Ignore:
Timestamp:
Mar 30, 2010 11:13:59 AM (12 years ago)
Author:
nanang
Message:

Ticket #1044:

  • Added initial version of automatic re-registration after registration failure and automatic call disconnection after re-registration attempt fails.
  • Published auto re-registration setting to pjsua app.
  • Updated pjsip_regc_send() to retrieve the transport earlier (was only in tsx_callback()).
  • Fixed TCP and TLS transport to prevent transport deletion in transport disconnection callback.
  • Fixed wrong keep-alive settings used by TLS transport (was using TCP keep-alive settings).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip-ua/sip_reg.c

    r3105 r3128  
    204204    info->auto_reg = regc->auto_reg; 
    205205    info->interval = regc->expires; 
     206    info->transport = regc->last_transport; 
    206207     
    207208    if (regc->has_tsx) 
     
    12031204        regc->current_op = REGC_REGISTERING; 
    12041205 
     1206    /* Prevent deletion of tdata, e.g: when something wrong in sending, 
     1207     * we need tdata to retrieve the transport. 
     1208     */ 
     1209    pjsip_tx_data_add_ref(tdata); 
     1210 
    12051211    status = pjsip_endpt_send_request(regc->endpt, tdata, REGC_TSX_TIMEOUT, 
    12061212                                      regc, &tsx_callback); 
     
    12091215    } 
    12101216 
     1217    /* Get last transport used and add reference to it */ 
     1218    if (tdata->tp_info.transport != regc->last_transport) { 
     1219        if (regc->last_transport) { 
     1220            pjsip_transport_dec_ref(regc->last_transport); 
     1221            regc->last_transport = NULL; 
     1222        } 
     1223 
     1224        if (tdata->tp_info.transport) { 
     1225            regc->last_transport = tdata->tp_info.transport; 
     1226            pjsip_transport_add_ref(regc->last_transport); 
     1227        } 
     1228    } 
     1229 
     1230    /* Release tdata */ 
     1231    pjsip_tx_data_dec_ref(tdata); 
     1232 
    12111233    pj_lock_release(regc->lock); 
    12121234 
Note: See TracChangeset for help on using the changeset viewer.