]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix outbound DTMF for inband mode (tell asterisk core to generate DTMF
authorAlexandr Anikin <may@telecom-service.ru>
Thu, 26 Jan 2012 20:14:50 +0000 (20:14 +0000)
committerAlexandr Anikin <may@telecom-service.ru>
Thu, 26 Jan 2012 20:14:50 +0000 (20:14 +0000)
sounds).

(Closes issue ASTERISK-19233)
Reported by: Matt Behrens
Patches:
        chan_ooh323.c.patch uploaded by Matt Behrens (License #6346)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@352807 65c4cc65-6c06-0410-ace0-fbb531ad65f3

addons/chan_ooh323.c

index b4456c5703d542105e139a258b46f57364f87bcb..f72498bb4cb1aed38770c208bed09948624e9fe6 100644 (file)
@@ -854,6 +854,7 @@ static int ooh323_digit_begin(struct ast_channel *chan, char digit)
 {
        char dtmf[2];
        struct ooh323_pvt *p = (struct ooh323_pvt *) chan->tech_pvt;
+       int res = 0;
        
        if (gH323Debug)
                ast_verbose("---   ooh323_digit_begin\n");
@@ -882,17 +883,21 @@ static int ooh323_digit_begin(struct ast_channel *chan, char digit)
                dtmf[0] = digit;
                dtmf[1] = '\0';
                ooSendDTMFDigit(p->callToken, dtmf);
+       } else if (p->dtmfmode & H323_DTMF_INBAND) {
+               res = -1; // tell Asterisk to generate inband indications
        }
        ast_mutex_unlock(&p->lock);
-       if (gH323Debug)
-               ast_verbose("+++   ooh323_digit_begin\n");
+       if (gH323Debug) {
+               ast_verbose("+++   ooh323_digit_begin %d\n", res);
+       }
 
-       return 0;
+       return res;
 }
 
 static int ooh323_digit_end(struct ast_channel *chan, char digit, unsigned int duration)
 {
        struct ooh323_pvt *p = (struct ooh323_pvt *) chan->tech_pvt;
+       int res = 0;
 
        if (gH323Debug)
                ast_verbose("---   ooh323_digit_end\n");
@@ -902,14 +907,18 @@ static int ooh323_digit_end(struct ast_channel *chan, char digit, unsigned int d
                return -1;
        }
        ast_mutex_lock(&p->lock);
-       if (p->rtp && ((p->dtmfmode & H323_DTMF_RFC2833) || (p->dtmfmode & H323_DTMF_CISCO)) ) 
+       if (p->rtp && ((p->dtmfmode & H323_DTMF_RFC2833) || (p->dtmfmode & H323_DTMF_CISCO)) ) {
                ast_rtp_instance_dtmf_end(p->rtp, digit);
+       } else if(p->dtmfmode & H323_DTMF_INBAND) {
+               res = -1; // tell Asterisk to stop inband indications
+       }
 
        ast_mutex_unlock(&p->lock);
-       if (gH323Debug)
-               ast_verbose("+++   ooh323_digit_end\n");
+       if (gH323Debug) {
+               ast_verbose("+++   ooh323_digit_end, res = %d\n", res);
+       }
 
-       return 0;
+       return res;
 }