[asterisk-commits] russell: branch group/vldtmf_fixup r51267 - in
/team/group/vldtmf_fixup: chan...
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Thu Jan 18 16:03:00 MST 2007
Author: russell
Date: Thu Jan 18 17:02:59 2007
New Revision: 51267
URL: http://svn.digium.com/view/asterisk?view=rev&rev=51267
Log:
Read the duration on a SIP INFO message and put it in the DTMF frame. Also,
ensure that the len field of the frame is always copied in ast_frdup().
Modified:
team/group/vldtmf_fixup/channels/chan_sip.c
team/group/vldtmf_fixup/main/frame.c
Modified: team/group/vldtmf_fixup/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/group/vldtmf_fixup/channels/chan_sip.c?view=diff&rev=51267&r1=51266&r2=51267
==============================================================================
--- team/group/vldtmf_fixup/channels/chan_sip.c (original)
+++ team/group/vldtmf_fixup/channels/chan_sip.c Thu Jan 18 17:02:59 2007
@@ -10683,6 +10683,7 @@
/* Need to check the media/type */
if (!strcasecmp(c, "application/dtmf-relay") ||
!strcasecmp(c, "application/vnd.nortelnetworks.digits")) {
+ unsigned int duration = 0;
/* Try getting the "signal=" part */
if (ast_strlen_zero(c = get_body(req, "Signal")) && ast_strlen_zero(c = get_body(req, "d"))) {
@@ -10692,7 +10693,12 @@
} else {
ast_copy_string(buf, c, sizeof(buf));
}
-
+
+ if (!ast_strlen_zero((c = get_body(req, "Duration"))))
+ duration = atoi(c);
+ if (!duration)
+ duration = 100; /* 100 ms */
+
if (!p->owner) { /* not a PBX call */
transmit_response(p, "481 Call leg/transaction does not exist", req);
sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
@@ -10730,6 +10736,7 @@
} else if (event < 16) {
f.subclass = 'A' + (event - 12);
}
+ f.len = duration;
ast_queue_frame(p->owner, &f);
if (sipdebug)
ast_verbose("* DTMF-relay event received: %c\n", f.subclass);
Modified: team/group/vldtmf_fixup/main/frame.c
URL: http://svn.digium.com/view/asterisk/team/group/vldtmf_fixup/main/frame.c?view=diff&rev=51267&r1=51266&r2=51267
==============================================================================
--- team/group/vldtmf_fixup/main/frame.c (original)
+++ team/group/vldtmf_fixup/main/frame.c Thu Jan 18 17:02:59 2007
@@ -496,11 +496,9 @@
strcpy((char *)out->src, f->src);
}
out->has_timing_info = f->has_timing_info;
- if (f->has_timing_info) {
- out->ts = f->ts;
- out->len = f->len;
- out->seqno = f->seqno;
- }
+ out->ts = f->ts;
+ out->len = f->len;
+ out->seqno = f->seqno;
return out;
}
More information about the asterisk-commits
mailing list