Ignore:
Timestamp:
Mar 10, 2010 1:33:25 PM (14 years ago)
Author:
bennylp
Message:

More #1032 (new SIP TCP/TLS transport callback):

  • PJSUA-LIB transport callback, if installed, will call the previously registered callback, to allow multiple transport callbacks to be installed
  • there seem to be a bug with the use of "pjsip_tp_state_callback" everywhere (the "pjsip_tp_state_callback" type is pointer, but most variables of this type are declared to pointer too)
File:
1 edited

Legend:

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

    r3106 r3119  
    15261526} 
    15271527 
     1528/* Callback to receive transport state notifications */ 
     1529static void on_tp_state_callback(pjsip_transport *tp, 
     1530                                 pjsip_transport_state state, 
     1531                                 const pjsip_transport_state_info *info) 
     1532{ 
     1533    if (pjsua_var.ua_cfg.cb.on_transport_state) { 
     1534        (*pjsua_var.ua_cfg.cb.on_transport_state)(tp, state, info); 
     1535    } 
     1536    if (pjsua_var.old_tp_cb) { 
     1537        (*pjsua_var.old_tp_cb)(tp, state, info); 
     1538    } 
     1539} 
     1540 
    15281541/* 
    15291542 * Create and initialize SIP socket (and possibly resolve public 
     
    18671880    /* Set transport state callback */ 
    18681881    if (pjsua_var.ua_cfg.cb.on_transport_state) { 
    1869         pjsip_tpmgr_set_status_cb(pjsip_endpt_get_tpmgr(pjsua_var.endpt), 
    1870                                   &pjsua_var.ua_cfg.cb.on_transport_state); 
     1882        pjsip_tp_state_callback tpcb; 
     1883        pjsip_tpmgr *tpmgr; 
     1884 
     1885        tpmgr = pjsip_endpt_get_tpmgr(pjsua_var.endpt); 
     1886        tpcb = pjsip_tpmgr_get_status_cb(tpmgr); 
     1887 
     1888        if (tpcb != &on_tp_state_callback) { 
     1889            pjsua_var.old_tp_cb = tpcb; 
     1890            pjsip_tpmgr_set_status_cb(tpmgr, &on_tp_state_callback); 
     1891        } 
    18711892    } 
    18721893 
Note: See TracChangeset for help on using the changeset viewer.