0
votes

I have an app based on pjsip for doing some Sip calls.

The app works fine with other SIP Switches/servers but with freeSwitch the app is not receiving calls in the background mode.

With freeSwitch everything is fine when the app is active but when in background mode the app is not notified about the call. It has, probably, something to do with how freeSwitch notify the app about the new call (for iOS pjsip the notification should come on the TCP wrapped socket).

Dose anybody know how i can configure the fresSwitch to send the notification on a specific port?

2
Does your app register to FreeSWITCH? It may be the fact that the registration has timed out and FreeSWITCH doesn't know where your app endpoint is. What does debug 7 show in FreeSWITCH? Can you explain more about the functionality you are after?Gavin Henry
the app is registered,because if i'm opening the app (from the background) I get the call notification.alinoz

2 Answers

0
votes

I mange to solve this problem by adding:

<variable name="sip-force-contact" value="NDLB-connectile-dysfunction"/>

into freeswitch_install_folder/conf/directory/default/XYZ.xml (where XYZ is the user you are configuring) under variables.

0
votes

You don't want to use ndlb-connectile-dysfunction (ndlb) for iOS with Freeswitch. Doing so will guarantee you can't hold a registration open long enough to be useful in the background, because Freeswitch appends "expires=30" to all registrations when that option is set. After that you'll just get a "USER_NOT_REGISTERED" error when trying to call that user, unless it happens to be within 30 seconds after a registration call.

What you need to do is follow the steps here: http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/AdvancedAppTricks/AdvancedAppTricks.html#//apple_ref/doc/uid/TP40007072-CH7-SW12

Specifically:

1) make sure you have an iOS keep-alive timer running (setKeepAliveTimeout:handler:), with the handler block doing a re-register at the minimum value (600 seconds).

2) make sure your app is configured for VOIP and audio playback background modes in its Info.plist

3) make sure your client is registering the network stream interface for VOIP usage as noted in those Apple guidelines. That way the OS can put the app to sleep, but wake you up if incoming traffic occurs on that network stream.

If you do all three of those, you should be able to run voip just fine in the background on iOS 5, even with the screen locked.