Discussion:
[Linphone-developers] Implement iOS Background Mode for incoming call
Xaree
2014-10-01 08:05:44 UTC
Permalink
Dear all,


I use Linphone C API to write an iOS VoIP app. After I did add some code
for background mode, it still can't receive incoming call in background.
I'm not sure what the problem is. Hope someone can provide hints for me.

I did the following jobs from the official docs
(http://www.linphone.org/docs/liblinphone/group__IOS.html) for the
background mode in iOS:

1. add `voip` and `audio` value in the .plist for background mode.
2. refresh register and call `-setKeepAliveTimeout:handler:` in
UIApplicationDelegate method `-applicationDidEnterBackground:`.

Did I miss something?

Is there any minimal example to implement the background incoming call
(not the big linphone-iphone project)?

I don't understand how the official linphone-iphone project implements
the background incoming call. After removing the
`-setKeepAliveTimeout:handler:` implementation, the official
linphone-iphone app still can receive the background incoming call.


Best regards,
Xaree
Luis Soltero
2014-10-01 08:17:35 UTC
Permalink
Note that receive calls in background mode on iOS you must use TCP and not UDP.

--luis
Post by Xaree
Dear all,
I use Linphone C API to write an iOS VoIP app. After I did add some code for background mode, it still can't receive
incoming call in background. I'm not sure what the problem is. Hope someone can provide hints for me.
I did the following jobs from the official docs (http://www.linphone.org/docs/liblinphone/group__IOS.html) for the
1. add `voip` and `audio` value in the .plist for background mode.
2. refresh register and call `-setKeepAliveTimeout:handler:` in UIApplicationDelegate method
`-applicationDidEnterBackground:`.
Did I miss something?
Is there any minimal example to implement the background incoming call (not the big linphone-iphone project)?
I don't understand how the official linphone-iphone project implements the background incoming call. After removing
the `-setKeepAliveTimeout:handler:` implementation, the official linphone-iphone app still can receive the background
incoming call.
Best regards,
Xaree
_______________________________________________
Linphone-developers mailing list
https://lists.nongnu.org/mailman/listinfo/linphone-developers
--
Luis Soltero, Ph.D., MCS
Director of Software Development, CTO
Global Marine Networks, LLC
StarPilot, LLC
Tel: +1.865.379.8723
Fax: +1.865.681.5017
E-Mail: ***@globalmarinenet.net
Web: http://www.globalmarinenet.net
Web: http://www.redportglobal.com
Web: http://www.starpilotllc.com
Xaree
2014-10-01 08:52:14 UTC
Permalink
Thanks for Luis' reply.

But I did not get the 10 sec execution time after entering background
mode, the thread was blocked and the linphone core wasn't iterated. I
only got the registration state change callback for the
`LinphoneRegistrationProgress` state.

Is iterating linphone core necessary for receiving incoming call in the
background mode? I think my problem is the linphone core was iterated
when entering background and receiving incoming calls.


Xaree
Post by Luis Soltero
Note that receive calls in background mode on iOS you must use TCP and not UDP.
Xaree
2014-10-01 09:56:32 UTC
Permalink
According to the official documents for iOS development
(http://www.linphone.org/docs/liblinphone/group__IOS.html): "liblinphone
automatically configures SIP socket for voip".

I don't know how to check whether the linphone uses TCP socket. Any idea?


Xaree
Post by Luis Soltero
Note that receive calls in background mode on iOS you must use TCP and not UDP.
--luis
Post by Xaree
Dear all,
I use Linphone C API to write an iOS VoIP app. After I did add some code for background mode, it still can't receive
incoming call in background. I'm not sure what the problem is. Hope someone can provide hints for me.
I did the following jobs from the official docs (http://www.linphone.org/docs/liblinphone/group__IOS.html) for the
1. add `voip` and `audio` value in the .plist for background mode.
2. refresh register and call `-setKeepAliveTimeout:handler:` in UIApplicationDelegate method
`-applicationDidEnterBackground:`.
Did I miss something?
Is there any minimal example to implement the background incoming call (not the big linphone-iphone project)?
I don't understand how the official linphone-iphone project implements the background incoming call. After removing
the `-setKeepAliveTimeout:handler:` implementation, the official linphone-iphone app still can receive the background
incoming call.
Best regards,
Xaree
_______________________________________________
Linphone-developers mailing list
https://lists.nongnu.org/mailman/listinfo/linphone-developers
Luis Soltero
2014-10-01 10:42:45 UTC
Permalink
you need to set transport to TCP in settings. You need to make sure your pbx is configured to accept TCP connections.
Astersik by default only accepts udp so you need to add

tcpenable=yes ; Enable server for incoming TCP connections (default is no)
transport=tcp,udp ; support both tcp and udp connections from peer


to your sip.conf

--luis
"liblinphone automatically configures SIP socket for voip".
I don't know how to check whether the linphone uses TCP socket. Any idea?
Xaree
Post by Luis Soltero
Note that receive calls in background mode on iOS you must use TCP and not UDP.
--luis
Post by Xaree
Dear all,
I use Linphone C API to write an iOS VoIP app. After I did add some code for background mode, it still can't receive
incoming call in background. I'm not sure what the problem is. Hope someone can provide hints for me.
I did the following jobs from the official docs (http://www.linphone.org/docs/liblinphone/group__IOS.html) for the
1. add `voip` and `audio` value in the .plist for background mode.
2. refresh register and call `-setKeepAliveTimeout:handler:` in UIApplicationDelegate method
`-applicationDidEnterBackground:`.
Did I miss something?
Is there any minimal example to implement the background incoming call (not the big linphone-iphone project)?
I don't understand how the official linphone-iphone project implements the background incoming call. After removing
the `-setKeepAliveTimeout:handler:` implementation, the official linphone-iphone app still can receive the background
incoming call.
Best regards,
Xaree
_______________________________________________
Linphone-developers mailing list
https://lists.nongnu.org/mailman/listinfo/linphone-developers
--
Luis Soltero, Ph.D., MCS
Director of Software Development, CTO
Global Marine Networks, LLC
StarPilot, LLC
Tel: +1.865.379.8723
Fax: +1.865.681.5017
E-Mail: ***@globalmarinenet.net
Web: http://www.globalmarinenet.net
Web: http://www.redportglobal.com
Web: http://www.starpilotllc.com
Continue reading on narkive:
Search results for '[Linphone-developers] Implement iOS Background Mode for incoming call' (Questions and Answers)
14
replies
Creating a "Why we should switch to Mac" Speech. Help Please?
started 2007-10-26 15:44:14 UTC
desktops
Loading...