I want to handle ip change form wifi to 4g and back during an ongoing call using pjsip on ios.
I have followed all the steps form pjsip website: https://trac.pjsip.org/repos/wiki/IPAddressChange and here I have found that the call is disconnected after the pjsua_acc_set_registration(the_acc_id, PJ_FALSE);
is sent.
Also I don't figure it out how to send the re registration at point 4.
"And finally, once unregistration in 2b) above is complete, re-register (with TCP)."
Any advice, suggestion, link to any resource that will hell me solve the issue is well come.
The most simple and reliable way is described in your reference:
The most straightforward solution is of course to restart everything, which means in pjsua terms to call
pjsua_destroy()
and followed bypjsua_create()
,pjsua_init()
, and so on.
To detect 4G/WiFi changes, you should use Apple Reachability
API, great wrappers are AFNetworkReachabilityManager
and Reachability
by Tony Million. I used this approach in my own project and it worked flawlessly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With