Ignore:
Timestamp:
Dec 8, 2011 8:18:02 AM (12 years ago)
Author:
nanang
Message:

Re #1419: updated call transfer to allow both the transferee and the transfer destination to update the current call setting:

  • for transferee (attended & unattended): via new PJSUA-LIB callback on_call_transfer_request2()
  • for transfer destination (attended only): via new PJSUA-LIB callback on_call_replace_request2()
File:
1 edited

Legend:

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

    r3901 r3903  
    965965     * if it wants to. 
    966966     */ 
    967     if (replaced_dlg != NULL && pjsua_var.ua_cfg.cb.on_call_replace_request) { 
     967    if (replaced_dlg != NULL && 
     968        (pjsua_var.ua_cfg.cb.on_call_replace_request || 
     969         pjsua_var.ua_cfg.cb.on_call_replace_request2)) 
     970    { 
    968971        pjsua_call *replaced_call; 
    969972        int st_code = 200; 
     
    973976        replaced_call = (pjsua_call*) replaced_dlg->mod_data[pjsua_var.mod.id]; 
    974977 
     978        /* Copy call setting from the replaced call */ 
     979        call->opt = replaced_call->opt; 
     980 
    975981        /* Notify application */ 
    976         pjsua_var.ua_cfg.cb.on_call_replace_request(replaced_call->index, 
    977                                                     rdata, &st_code, &st_text); 
     982        if (pjsua_var.ua_cfg.cb.on_call_replace_request) { 
     983            pjsua_var.ua_cfg.cb.on_call_replace_request(replaced_call->index, 
     984                                                        rdata, 
     985                                                        &st_code, &st_text); 
     986        } 
     987 
     988        if (pjsua_var.ua_cfg.cb.on_call_replace_request2) { 
     989            pjsua_var.ua_cfg.cb.on_call_replace_request2(replaced_call->index, 
     990                                                         rdata, 
     991                                                         &st_code, &st_text, 
     992                                                         &call->opt); 
     993        } 
    978994 
    979995        /* Must specify final response */ 
     
    38753891    pjsip_status_code code; 
    38763892    pjsip_evsub *sub; 
     3893    pjsua_call_setting call_opt; 
    38773894 
    38783895    pj_log_push_indent(); 
     
    39113928    /* Notify callback */ 
    39123929    code = PJSIP_SC_ACCEPTED; 
    3913     if (pjsua_var.ua_cfg.cb.on_call_transfer_request) 
     3930    if (pjsua_var.ua_cfg.cb.on_call_transfer_request) { 
    39143931        (*pjsua_var.ua_cfg.cb.on_call_transfer_request)(existing_call->index, 
    39153932                                                        &refer_to->hvalue,  
    39163933                                                        &code); 
     3934    } 
     3935 
     3936    call_opt = existing_call->opt; 
     3937    if (pjsua_var.ua_cfg.cb.on_call_transfer_request2) { 
     3938        (*pjsua_var.ua_cfg.cb.on_call_transfer_request2)(existing_call->index, 
     3939                                                         &refer_to->hvalue,  
     3940                                                         &code, 
     3941                                                         &call_opt); 
     3942    } 
    39173943 
    39183944    if (code < 200) 
     
    40414067    /* Now make the outgoing call. */ 
    40424068    tmp = pj_str(uri); 
    4043     status = pjsua_call_make_call(existing_call->acc_id, &tmp, 0, 
     4069    status = pjsua_call_make_call(existing_call->acc_id, &tmp, &call_opt, 
    40444070                                  existing_call->user_data, &msg_data,  
    40454071                                  &new_call); 
Note: See TracChangeset for help on using the changeset viewer.