aboutsummaryrefslogtreecommitdiff
path: root/net/asterisk/files/dtmf_debug.diff
diff options
context:
space:
mode:
Diffstat (limited to 'net/asterisk/files/dtmf_debug.diff')
-rw-r--r--net/asterisk/files/dtmf_debug.diff137
1 files changed, 69 insertions, 68 deletions
diff --git a/net/asterisk/files/dtmf_debug.diff b/net/asterisk/files/dtmf_debug.diff
index 5179d42225fd..968554880ac3 100644
--- a/net/asterisk/files/dtmf_debug.diff
+++ b/net/asterisk/files/dtmf_debug.diff
@@ -1,6 +1,45 @@
---- include/asterisk/rtp.h.orig 2008-03-18 13:35:42.000000000 +0200
-+++ include/asterisk/rtp.h 2008-03-18 13:35:58.000000000 +0200
-@@ -251,6 +251,9 @@
+--- channels/chan_sip.c.orig 2009-05-12 21:18:44.000000000 +0300
++++ channels/chan_sip.c 2009-05-26 12:50:22.000000000 +0300
+@@ -3891,6 +3891,7 @@
+ ast_log(LOG_WARNING, "old channel wasn't %p but was %p\n", oldchan, p->owner);
+ else {
+ p->owner = newchan;
++ ast_rtp_set_chan_name(p->rtp, newchan->name);
+ /* Re-invite RTP back to Asterisk. Needed if channel is masqueraded out of a native
+ RTP bridge (i.e., RTP not going through Asterisk): RTP bridge code might not be
+ able to do this if the masquerade happens before the bridge breaks (e.g., AMI
+@@ -4168,6 +4169,7 @@
+ if (i->rtp) {
+ tmp->fds[0] = ast_rtp_fd(i->rtp);
+ tmp->fds[1] = ast_rtcp_fd(i->rtp);
++ ast_rtp_set_chan_id(i->rtp, i->callid);
+ }
+ if (needvideo && i->vrtp) {
+ tmp->fds[2] = ast_rtp_fd(i->vrtp);
+@@ -4195,6 +4197,8 @@
+ if (!ast_strlen_zero(i->language))
+ ast_string_field_set(tmp, language, i->language);
+ i->owner = tmp;
++ ast_rtp_set_chan_name(i->rtp, tmp->name);
++
+ ast_module_ref(ast_module_info->self);
+ ast_copy_string(tmp->context, i->context, sizeof(tmp->context));
+ /*Since it is valid to have extensions in the dialplan that have unescaped characters in them
+@@ -4621,8 +4625,10 @@
+ build_via(p);
+ if (!callid)
+ build_callid_pvt(p);
+- else
++ else {
+ ast_string_field_set(p, callid, callid);
++ ast_rtp_set_chan_id(p->rtp, p->callid);
++ }
+ /* Assign default music on hold class */
+ ast_string_field_set(p, mohinterpret, default_mohinterpret);
+ ast_string_field_set(p, mohsuggest, default_mohsuggest);
+--- include/asterisk/rtp.h.orig 2008-03-04 20:05:28.000000000 +0200
++++ include/asterisk/rtp.h 2009-05-26 12:50:22.000000000 +0300
+@@ -243,6 +243,9 @@
int ast_rtp_codec_getformat(int pt);
@@ -10,9 +49,9 @@
/*! \brief Set rtp timeout */
void ast_rtp_set_rtptimeout(struct ast_rtp *rtp, int timeout);
/*! \brief Set rtp hold timeout */
---- main/rtp.c.orig 2008-04-08 14:53:18.000000000 +0300
-+++ main/rtp.c 2008-04-08 14:54:14.000000000 +0300
-@@ -81,6 +81,7 @@
+--- main/rtp.c.orig 2009-05-13 16:38:01.000000000 +0300
++++ main/rtp.c 2009-05-26 12:52:30.000000000 +0300
+@@ -80,6 +80,7 @@
static int rtpstart; /*!< First port for RTP sessions (set in rtp.conf) */
static int rtpend; /*!< Last port for RTP sessions (set in rtp.conf) */
static int rtpdebug; /*!< Are we debugging? */
@@ -20,7 +59,7 @@
static int rtcpdebug; /*!< Are we debugging RTCP? */
static int rtcpstats; /*!< Are we debugging RTCP? */
static int rtcpinterval = RTCP_DEFAULT_INTERVALMS; /*!< Time between rtcp reports in millisecs */
-@@ -168,6 +169,8 @@
+@@ -173,6 +174,8 @@
struct ast_codec_pref pref;
struct ast_rtp *bridged; /*!< Who we are Packet bridged to */
int set_marker_bit:1; /*!< Whether to set the marker bit or not */
@@ -29,7 +68,7 @@
};
/* Forward declarations */
-@@ -669,8 +672,8 @@
+@@ -673,8 +676,8 @@
struct ast_frame *f = NULL;
event = ntohl(*((unsigned int *)(data)));
event &= 0x001F;
@@ -40,32 +79,33 @@
if (event < 10) {
resp = '0' + event;
} else if (event < 11) {
-@@ -684,12 +687,24 @@
+@@ -688,12 +691,25 @@
}
if (rtp->resp && (rtp->resp != resp)) {
f = send_dtmf(rtp, AST_FRAME_DTMF_END);
-+ ast_log(LOG_DEBUG, "Channel: %s %s Cisco DTMF event: %c\n", rtp->chan_name, rtp->chan_id, rtp->resp);
++ ast_log(LOG_DEBUG, "Channel: %s %s Cisco DTMF event: %c\n", rtp->chan_name, rtp->chan_id, rtp->resp);
}
rtp->resp = resp;
- rtp->dtmfcount = dtmftimeout;
+ rtp->dtmf_timeout = 0;
return f;
}
+void ast_rtp_set_chan_id(struct ast_rtp *rtp, const char *chan_id) {
-+ if (rtp == NULL || chan_id == NULL)
-+ return;
-+ snprintf(rtp->chan_id, sizeof(rtp->chan_id), "%s", chan_id);
++ if (rtp == NULL || chan_id == NULL)
++ return;
++ snprintf(rtp->chan_id, sizeof(rtp->chan_id), "%s", chan_id);
+}
+
+void ast_rtp_set_chan_name(struct ast_rtp *rtp, const char *chan_name) {
-+ if (rtp == NULL || chan_name == NULL)
-+ return;
-+ snprintf(rtp->chan_name, sizeof(rtp->chan_name), "%s", chan_name);
++ if (rtp == NULL || chan_name == NULL)
++ return;
++ snprintf(rtp->chan_name, sizeof(rtp->chan_name), "%s", chan_name);
+}
++
/*!
* \brief Process RTP DTMF and events according to RFC 2833.
*
-@@ -1051,6 +1066,10 @@
+@@ -1090,6 +1106,10 @@
struct rtpPayloadType rtpPT;
int reconstruct = ntohl(rtpheader[0]);
@@ -76,9 +116,9 @@
/* Get fields from packet */
payload = (reconstruct & 0x7f0000) >> 16;
mark = (((reconstruct & 0x800000) >> 23) != 0);
-@@ -1062,10 +1081,6 @@
- if (!bridged->current_RTP_PT[payload].code)
- return -1;
+@@ -1097,10 +1117,6 @@
+ /* Check what the payload value should be */
+ rtpPT = ast_rtp_lookup_pt(rtp, payload);
- /* If the payload is DTMF, and we are listening for DTMF - then feed it into the core */
- if (ast_test_flag(rtp, FLAG_P2P_NEED_DTMF) && !rtpPT.isAstFormat && rtpPT.code == AST_RTP_DTMF)
@@ -87,7 +127,7 @@
/* Otherwise adjust bridged payload to match */
bridged_payload = ast_rtp_lookup_code(bridged, rtpPT.isAstFormat, rtpPT.code);
-@@ -1254,11 +1269,12 @@
+@@ -1293,11 +1309,12 @@
/* This is special in-band data that's not one of our codecs */
if (rtpPT.code == AST_RTP_DTMF) {
/* It's special -- rfc2833 process it */
@@ -101,7 +141,7 @@
data = rtp->rawdata + AST_FRIENDLY_OFFSET + hdrlen;
event = ntohl(*((unsigned int *)(data)));
event >>= 24;
-@@ -1267,9 +1283,12 @@
+@@ -1306,9 +1323,12 @@
event_end >>= 24;
duration = ntohl(*((unsigned int *)(data)));
duration &= 0xFFFF;
@@ -115,7 +155,7 @@
} else if (rtpPT.code == AST_RTP_CISCO_DTMF) {
/* It's really special -- process it the Cisco way */
if (rtp->lastevent <= seqno || (rtp->lastevent >= 65530 && seqno <= 6)) {
-@@ -2198,8 +2217,9 @@
+@@ -2272,8 +2292,9 @@
ast_log(LOG_ERROR, "RTP Transmission error to %s:%u: %s\n",
ast_inet_ntoa(rtp->them.sin_addr),
ntohs(rtp->them.sin_port), strerror(errno));
@@ -127,7 +167,7 @@
ast_inet_ntoa(rtp->them.sin_addr),
ntohs(rtp->them.sin_port), payload, rtp->seqno, rtp->lastdigitts, res - hdrlen);
/* Increment sequence number */
-@@ -2242,8 +2262,9 @@
+@@ -2316,8 +2337,9 @@
ast_log(LOG_ERROR, "RTP Transmission error to %s:%d: %s\n",
ast_inet_ntoa(rtp->them.sin_addr),
ntohs(rtp->them.sin_port), strerror(errno));
@@ -139,7 +179,7 @@
ast_inet_ntoa(rtp->them.sin_addr),
ntohs(rtp->them.sin_port), rtp->send_payload, rtp->seqno, rtp->lastdigitts, res - hdrlen);
-@@ -3481,6 +3502,16 @@
+@@ -3609,6 +3631,16 @@
return RESULT_SUCCESS;
}
@@ -156,7 +196,7 @@
static int rtp_do_debug(int fd, int argc, char *argv[])
{
if (argc != 2) {
-@@ -3541,6 +3572,7 @@
+@@ -3669,6 +3701,7 @@
if (argc != 3)
return RESULT_SHOWUSAGE;
rtpdebug = 0;
@@ -164,7 +204,7 @@
ast_cli(fd,"RTP Debugging Disabled\n");
return RESULT_SUCCESS;
}
-@@ -3601,7 +3633,7 @@
+@@ -3729,7 +3762,7 @@
}
static char debug_usage[] =
@@ -173,7 +213,7 @@
" Enable dumping of all RTP packets to and from host.\n";
static char no_debug_usage[] =
-@@ -3676,6 +3708,10 @@
+@@ -3804,6 +3837,10 @@
rtp_do_debug, "Enable RTP debugging",
debug_usage },
@@ -184,42 +224,3 @@
{ { "rtp", "debug", "off", NULL },
rtp_no_debug, "Disable RTP debugging",
no_debug_usage, NULL, &cli_rtp_no_debug_deprecated },
---- channels/chan_sip.c.orig 2008-06-10 00:29:41.000000000 -0700
-+++ channels/chan_sip.c 2008-06-10 00:42:00.000000000 -0700
-@@ -3813,6 +3813,7 @@
- ast_log(LOG_WARNING, "old channel wasn't %p but was %p\n", oldchan, p->owner);
- else {
- p->owner = newchan;
-+ ast_rtp_set_chan_name(p->rtp, newchan->name);
- /* Re-invite RTP back to Asterisk. Needed if channel is masqueraded out of a native
- RTP bridge (i.e., RTP not going through Asterisk): RTP bridge code might not be
- able to do this if the masquerade happens before the bridge breaks (e.g., AMI
-@@ -4085,6 +4086,7 @@
- if (i->rtp) {
- tmp->fds[0] = ast_rtp_fd(i->rtp);
- tmp->fds[1] = ast_rtcp_fd(i->rtp);
-+ ast_rtp_set_chan_id(i->rtp, i->callid);
- }
- if (needvideo && i->vrtp) {
- tmp->fds[2] = ast_rtp_fd(i->vrtp);
-@@ -4112,6 +4114,8 @@
- if (!ast_strlen_zero(i->language))
- ast_string_field_set(tmp, language, i->language);
- i->owner = tmp;
-+ ast_rtp_set_chan_name(i->rtp, tmp->name);
-+
- ast_module_ref(ast_module_info->self);
- ast_copy_string(tmp->context, i->context, sizeof(tmp->context));
- /*Since it is valid to have extensions in the dialplan that have unescaped characters in them
-@@ -4531,8 +4535,10 @@
- build_via(p);
- if (!callid)
- build_callid_pvt(p);
-- else
-+ else {
- ast_string_field_set(p, callid, callid);
-+ ast_rtp_set_chan_id(p->rtp, p->callid);
-+ }
- /* Assign default music on hold class */
- ast_string_field_set(p, mohinterpret, default_mohinterpret);
- ast_string_field_set(p, mohsuggest, default_mohsuggest);