Changes between Version 10 and Version 11 of IPAddressChange
- Timestamp:
- Aug 15, 2014 7:11:31 AM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
IPAddressChange
v10 v11 125 125 126 126 0. You need to implement reachability API (sample is provided in the patch). With this API we can monitor the access point connection status and perform re-registration when necessary. 127 1. We need to keep track of which transport is being used by the registration, by implementing the {{{on_reg_state2()}}} callback. Add reference counter to it to prevent other from deleting the transport while we're referencing it (it shouldn't happen while the registration is active, but just in case). Sample code:127 1. We need to keep track of which transport is being used by the registration, by implementing the {{{on_reg_state2()}}} and {{{on_transport_state()}}} callbacks. Add reference counter to it to prevent other from deleting the transport while we're referencing it (it shouldn't happen while the registration is active, but just in case). Sample code: 128 128 {{{ 129 129 static pjsua_acc_id the_acc_id; … … 161 161 ... 162 162 } 163 164 /* Also release the transport when it is disconnected (see ticket #1482) */ 165 static void on_transport_state(pjsip_transport *tp, 166 pjsip_transport_state state, 167 const pjsip_transport_state_info *info) 168 { 169 ... 170 if (state == PJSIP_TP_STATE_DISCONNECTED && the_transport == tp) { 171 PJ_LOG(3,(THIS_FILE, "xxx: Releasing transport..")); 172 pjsip_transport_dec_ref(the_transport); 173 the_transport = NULL; 174 } 175 ... 176 } 163 177 }}} 164 178