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

Close #2036: Support DTMF via SIP INFO.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsua2/endpoint.cpp

    r5828 r5834  
    11481148    char buf[10]; 
    11491149    pj_ansi_sprintf(buf, "%c", digit); 
    1150     job->prm.digit = (string)buf; 
     1150    job->prm.digit = string(buf); 
     1151     
     1152    Endpoint::instance().utilAddPendingJob(job); 
     1153} 
     1154 
     1155void Endpoint::on_dtmf_digit2(pjsua_call_id call_id,  
     1156                              const pjsua_dtmf_info *info) 
     1157{ 
     1158    Call *call = Call::lookup(call_id); 
     1159    if (!call) { 
     1160        return; 
     1161    } 
     1162     
     1163    PendingOnDtmfDigitCallback *job = new PendingOnDtmfDigitCallback; 
     1164    job->call_id = call_id; 
     1165    char buf[10]; 
     1166    pj_ansi_sprintf(buf, "%c", info->digit); 
     1167    job->prm.digit = string(buf); 
     1168    job->prm.method = info->method; 
     1169    job->prm.duration = info->duration; 
    11511170     
    11521171    Endpoint::instance().utilAddPendingJob(job); 
     
    16011620    ua_cfg.cb.on_stream_created2        = &Endpoint::on_stream_created2; 
    16021621    ua_cfg.cb.on_stream_destroyed       = &Endpoint::on_stream_destroyed; 
    1603     ua_cfg.cb.on_dtmf_digit             = &Endpoint::on_dtmf_digit; 
     1622    //ua_cfg.cb.on_dtmf_digit             = &Endpoint::on_dtmf_digit; 
     1623    ua_cfg.cb.on_dtmf_digit2            = &Endpoint::on_dtmf_digit2; 
    16041624    ua_cfg.cb.on_call_transfer_request2 = &Endpoint::on_call_transfer_request2; 
    16051625    ua_cfg.cb.on_call_transfer_status   = &Endpoint::on_call_transfer_status; 
Note: See TracChangeset for help on using the changeset viewer.