diff options
author | jeremy <jeremy@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-09-15 03:26:02 +0000 |
---|---|---|
committer | jeremy <jeremy@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-09-15 03:26:02 +0000 |
commit | 0f012309c72dccf02c3db21894456ce45762c567 (patch) | |
tree | ae308264525a4b6d511def032ef268dfb4d9179c /channels/chan_h323.c | |
parent | 83c73627b868faab28ab6caea5296068abcc1480 (diff) |
Lets try this - an attempt to properly deal with DTMF
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6615 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_h323.c')
-rwxr-xr-x | channels/chan_h323.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/channels/chan_h323.c b/channels/chan_h323.c index c2f957136..302540da8 100755 --- a/channels/chan_h323.c +++ b/channels/chan_h323.c @@ -347,22 +347,30 @@ static int oh323_digit(struct ast_channel *c, char digit) { struct oh323_pvt *pvt = (struct oh323_pvt *) c->tech_pvt; char *token; - if (h323debug) - ast_log(LOG_DEBUG, "Sending digit %c on %s\n", digit, c->name); - if (!pvt) + + if (!pvt) { + ast_log(LOG_ERROR, "No private structure?! This is bad\n"; return -1; + } ast_mutex_lock(&pvt->lock); if (pvt->rtp && (pvt->options.dtmfmode & H323_DTMF_RFC2833)) { + /* out-of-band DTMF */ + if (h323debug) { + ast_log(LOG_DEBUG, "Sending out-of-band digit %c on %s\n", digit, c->name); + } ast_rtp_senddigit(pvt->rtp, digit); + } else { + /* in-band DTMF */ + if (h323debug) { + ast_log(LOG_DEBUG, "Sending inband digit %c on %s\n", digit, c->name); + } + token = pvt->cd.call_token ? strdup(pvt->cd.call_token) : NULL; + h323_send_tone(token, digit); + if (token) { + free(token); + } } - /* If in-band DTMF is desired, send that */ - if (h323debug) - ast_log(LOG_DEBUG, "Sending digit %c on %s\n", digit, c->name); - token = pvt->cd.call_token ? strdup(pvt->cd.call_token) : NULL; ast_mutex_unlock(&pvt->lock); - h323_send_tone(token, digit); - if (token) - free(token); oh323_update_info(c); return 0; } |