Ignore:
Timestamp:
Jul 23, 2018 7:32:54 AM (6 years ago)
Author:
riza
Message:

Close #2036: Support DTMF via SIP INFO.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_aud.c

    r5825 r5834  
    557557    pj_log_push_indent(); 
    558558 
    559     /* For discussions about call mutex protection related to this 
    560      * callback, please see ticket #460: 
    561      *  http://trac.pjsip.org/repos/ticket/460#comment:4 
    562      */ 
    563     if (pjsua_var.ua_cfg.cb.on_dtmf_digit) { 
     559    if (pjsua_var.ua_cfg.cb.on_dtmf_digit2) { 
    564560        pjsua_call_id call_id; 
     561        pjsua_dtmf_info info; 
    565562 
    566563        call_id = (pjsua_call_id)(pj_ssize_t)user_data; 
    567         pjsua_var.ua_cfg.cb.on_dtmf_digit(call_id, digit); 
     564        info.method = PJSUA_DTMF_METHOD_RFC2833; 
     565        info.digit = digit; 
     566        (*pjsua_var.ua_cfg.cb.on_dtmf_digit2)(call_id, &info); 
     567    } else if (pjsua_var.ua_cfg.cb.on_dtmf_digit) { 
     568        /* For discussions about call mutex protection related to this 
     569         * callback, please see ticket #460: 
     570         *      http://trac.pjsip.org/repos/ticket/460#comment:4 
     571         */     
     572        pjsua_call_id call_id; 
     573 
     574        call_id = (pjsua_call_id)(pj_ssize_t)user_data; 
     575        (*pjsua_var.ua_cfg.cb.on_dtmf_digit)(call_id, digit); 
    568576    } 
    569577 
     
    645653         * callback to the session. 
    646654         */ 
    647         if (pjsua_var.ua_cfg.cb.on_dtmf_digit) { 
     655        if (pjsua_var.ua_cfg.cb.on_dtmf_digit ||  
     656            pjsua_var.ua_cfg.cb.on_dtmf_digit2)  
     657        { 
    648658            pjmedia_stream_set_dtmf_callback(call_med->strm.a.stream, 
    649659                                             &dtmf_callback, 
Note: See TracChangeset for help on using the changeset viewer.