Changeset 3908


Ignore:
Timestamp:
Dec 13, 2011 4:59:15 AM (13 years ago)
Author:
nanang
Message:

Close #1424: Added new pjsua callback: on_call_rx_offer().

Location:
pjproject/trunk/pjsip
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h

    r3903 r3908  
    810810                             pjsua_call_id new_call_id); 
    811811 
     812 
     813    /** 
     814     * Notify application when call has received new offer from remote 
     815     * (i.e. re-INVITE/UPDATE with SDP is received). Application can 
     816     * decide to accept/reject the offer by setting the code (default 
     817     * is 200). If the offer is accepted, application can update the  
     818     * call setting to be applied in the answer. When this callback is 
     819     * not defined, the default behavior is to accept the offer using 
     820     * current call setting. 
     821     * 
     822     * @param call_id   The call index. 
     823     * @param offer     The new offer received. 
     824     * @param reserved  Reserved param, currently not used. 
     825     * @param code      Status code to be returned for answering the 
     826     *                  offer. On input, it contains status code 200. 
     827     *                  Currently, valid values are only 200 and 488. 
     828     * @param opt       The current call setting, application can update 
     829     *                  this setting for answering the offer. 
     830     */ 
     831    void (*on_call_rx_offer)(pjsua_call_id call_id, 
     832                             const pjmedia_sdp_session *offer, 
     833                             void *reserved, 
     834                             pjsip_status_code *code, 
     835                             pjsua_call_setting *opt); 
    812836 
    813837    /** 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c

    r3903 r3908  
    35563556    pj_log_push_indent(); 
    35573557 
     3558    if (pjsua_var.ua_cfg.cb.on_call_rx_offer) { 
     3559        pjsip_status_code code = PJSIP_SC_OK; 
     3560        pjsua_call_setting opt = call->opt; 
     3561         
     3562        (*pjsua_var.ua_cfg.cb.on_call_rx_offer)(call->index, offer, NULL, 
     3563                                                &code, &opt); 
     3564 
     3565        if (code != PJSIP_SC_OK) { 
     3566            PJ_LOG(4,(THIS_FILE, "Rejecting updated media offer on call %d", 
     3567                      call->index)); 
     3568            goto on_return; 
     3569        } 
     3570 
     3571        call->opt = opt; 
     3572    } 
     3573 
    35583574    /* Re-init media for the new remote offer before creating SDP */ 
    35593575    status = pjsua_media_channel_init(call->index, PJSIP_ROLE_UAS, 
Note: See TracChangeset for help on using the changeset viewer.