Changeset 1363


Ignore:
Timestamp:
Jun 11, 2007 6:22:54 PM (17 years ago)
Author:
bennylp
Message:

Ticket #334: Added on_pager_status2() callback to receive the full SIP message of IM delivery status (thanks Paul Levin)

Location:
pjproject/trunk/pjsip
Files:
2 edited

Legend:

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

    r1362 r1363  
    799799    /** 
    800800     * Notify application about the delivery status of outgoing pager 
    801      * request. 
     801     * request. See also on_pager_status2() callback for the version with 
     802     * \a pjsip_rx_data in the argument list. 
    802803     * 
    803804     * @param call_id       Containts the ID of the call where the IM was 
     
    830831                            pjsip_status_code status, 
    831832                            const pj_str_t *reason); 
     833 
     834    /** 
     835     * Notify application about the delivery status of outgoing pager 
     836     * request. 
     837     * 
     838     * @param call_id       Containts the ID of the call where the IM was 
     839     *                      sent, or PJSUA_INVALID_ID if the IM was sent 
     840     *                      outside call context. 
     841     * @param to            Destination URI. 
     842     * @param body          Message body. 
     843     * @param user_data     Arbitrary data that was specified when sending 
     844     *                      IM message. 
     845     * @param status        Delivery status. 
     846     * @param reason        Delivery status reason. 
     847     * @param rdata         The incoming MESSAGE response, or NULL if the 
     848     *                      message transaction fails because of time out  
     849     *                      or transport error. 
     850     */ 
     851    void (*on_pager_status2)(pjsua_call_id call_id, 
     852                             const pj_str_t *to, 
     853                             const pj_str_t *body, 
     854                             void *user_data, 
     855                             pjsip_status_code status, 
     856                             const pj_str_t *reason, 
     857                             pjsip_rx_data *rdata); 
    832858 
    833859    /** 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_im.c

    r1285 r1363  
    353353        } 
    354354 
    355         if (pjsua_var.ua_cfg.cb.on_pager_status) 
     355        if (pjsua_var.ua_cfg.cb.on_pager_status) { 
    356356            pjsua_var.ua_cfg.cb.on_pager_status(im_data->call_id,  
    357357                                                &im_data->to, 
     
    361361                                                    tsx->status_code, 
    362362                                                &tsx->status_text); 
     363        } 
     364 
     365        if (pjsua_var.ua_cfg.cb.on_pager_status2) { 
     366            pjsip_rx_data *rdata; 
     367 
     368            if (e->body.tsx_state.type == PJSIP_EVENT_RX_MSG) 
     369                rdata = e->body.tsx_state.src.rdata; 
     370            else 
     371                rdata = NULL; 
     372 
     373            pjsua_var.ua_cfg.cb.on_pager_status2(im_data->call_id,  
     374                                                 &im_data->to, 
     375                                                 &im_data->body, 
     376                                                 im_data->user_data, 
     377                                                 (pjsip_status_code)  
     378                                                    tsx->status_code, 
     379                                                 &tsx->status_text, 
     380                                                 rdata); 
     381        } 
    363382    } 
    364383} 
Note: See TracChangeset for help on using the changeset viewer.