Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pjsip iOS handling ip change during call

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.

like image 651
Alex Terente Avatar asked Oct 18 '22 08:10

Alex Terente


1 Answers

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 by pjsua_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.

like image 151
Maxim Pavlov Avatar answered Oct 21 '22 04:10

Maxim Pavlov