Using TCP transport in siphone

531 views
Skip to first unread message

Fatemeh

unread,
Oct 29, 2011, 3:29:52 AM10/29/11
to Siphon
Hi,
I need to change default transport to TCP, so I set True for no_udp
then I called pjsua_transport_create method from My app with these
parameter:
PJSIP_TRANSPORT_TCP, &tcp_cfg, &transport_id
When I run app I got below messages from library:
Unsuitable transport selected (PJSIP_ETPNOTSUITABLE)
Service Unavailable (error 503)
I believe I don't change library and I don't know how fix this
problem. Please help me if you know how this error occur?

pasqui86

unread,
Apr 20, 2012, 6:20:49 AM4/20/12
to sip...@googlegroups.com
have you resolved this problem? Where is it possible set no_udp? I'd like to use che TCP transport protocol too, to enable background functionality on iphone 4.

Fatemeh Shapouri

unread,
Apr 22, 2012, 12:43:51 AM4/22/12
to sip...@googlegroups.com
Hi,
The iPhone (is better I say Apple) don't support TCP connection! And There is not any way to use it. But For Handling connection on background, you can use UDP and don't let app close port of connection. The PJSip 1.8.0 to up support background mode and you should only do two things :
1) On info.plist file add Voip on background (please look at this link: http://developer.apple.com/library/mac/#documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html)
2) Keep application alive: The RadioKit Sample code do that http://www.stormyprods.com/products/radiokit.php


--
You received this message because you are subscribed to the Google Groups "Siphon" group.
To view this discussion on the web visit https://groups.google.com/d/msg/siphon/-/zJgcGde92N4J.

To post to this group, send email to sip...@googlegroups.com.
To unsubscribe from this group, send email to siphon+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/siphon?hl=en.

Samuel Vinson

unread,
May 3, 2012, 5:48:37 PM5/3/12
to sip...@googlegroups.com
Hi,

I do not agree with your answer. For background, iOS supports TCP connection only. And pjsip 1.x includes natively this support.
I don't know the RadioKit solution, but I think it drains the battery.

However, the background iOS solution is not a very good solution for VoIP application, because:
  • if the user kills the application, the application doesn't restart. So it's impossible to receive incoming call. iOS tells the applications restart automatically in few cases like memory warning.
  • if the network connection changes (WiFi to 3G...), the application doesn't receive a notification, so there is no reregister. So it's impossible to receive incoming call. The notification will be received when the application goes in foreground.
In conclusion, I think the APN (Apple Push Notification) could be the solution. In this case, you need to temporize an incoming call and send the notification. If the user opens the application, you will need to redirect the incoming call to the device.
This solution works on iPhone and iPad 3G. It doesn't work on iPad Wifi and iPod, because it's not a push solution but a pull system.

Samuel


2012/4/22 Fatemeh Shapouri <fa.sh...@gmail.com>

Fatemeh Shapouri

unread,
May 4, 2012, 3:13:59 AM5/4/12
to sip...@googlegroups.com
Hi,
I know PJSIP 1.x has TCP for background on iOS but actually I was not able to use it! and with conversation with PJSIP support team, they sent a link to me from Apple that says the iOS don't support TCP connection at all!!!!!!!! Really it is not  True. But when I implement VoIP on background and checked VoIP packets on background all of them was UDP format! I cant explain it.

The Radio kit program is able to play radio stream on background.(it is sample project that works on background like VoIP apps, with live connection and play sound.)
 
The working on background mode  drains the battery and it's normal!
If user kills app, can't receive incoming call and it will not fix by APN( I guess). The SIP servers will send APN if user has incoming calls but app did not send Device token to servers before. you said I need to temporize an incoming call, where can I do that. Can you explain more about APN solution?

Samuel Vinson

unread,
May 5, 2012, 8:32:51 AM5/5/12
to sip...@googlegroups.com
Hi,

2012/5/4 Fatemeh Shapouri <fa.sh...@gmail.com>

Hi,
I know PJSIP 1.x has TCP for background on iOS but actually I was not able to use it! and with conversation with PJSIP support team, they sent a link to me from Apple that says the iOS don't support TCP connection at all!!!!!!!! Really it is not  True. But when I implement VoIP on background and checked VoIP packets on background all of them was UDP format! I cant explain it.

I'm surprise by the Apple's answer.
You can force the TCP connection with pjsip like that:
  • if you use proxy, you need to append the proxy with ";transport=tcp" (ex: sip:proxy;transport=tcp;lr )
  • if you don't use proxy, you need to define a proxy with the registrar name (ex: sip:registrar;transport=tcp;lr )
The Radio kit program is able to play radio stream on background.(it is sample project that works on background like VoIP apps, with live connection and play sound.)
 
The working on background mode  drains the battery and it's normal!
It drains the battery and it decreases (dramatically) your data package (in 3G)
 
If user kills app, can't receive incoming call and it will not fix by APN( I guess). The SIP servers will send APN if user has incoming calls but app did not send Device token to servers before. you said I need to temporize an incoming call, where can I do that. Can you explain more about APN solution?
The device is registered to the APN server.
When the SIP server receives an incoming call, it checks if the device is connected:
  • if yes, it send the message to the device
  • if no, it replies ringing and simultaneously it sends a notification to the device
    • if the device opens the SIP application, it registers to the SIP Server and server send the message to the device
    • If the device doesn't open the application, the SIP server replies unavailable or transfers to the voicemail box, and it cancels the previous notification, and send a new notification with "call missed".
I didn't test yet, but it should work.

Samuel

Fatemeh Shapouri

unread,
May 5, 2012, 10:45:25 AM5/5/12
to sip...@googlegroups.com
Hi,
The apple answer is really amazing. 
So thanks for your reply dear Samuel. I'm busy this month, When I test the apple solution, let other know detail of it.

pasqui86

unread,
Jun 28, 2012, 10:16:55 AM6/28/12
to sip...@googlegroups.com
Any news about this problem?
Hi,

2012/4/22 Fatemeh Shapouri <fa.sh...@gmail.com>
To unsubscribe from this group, send email to siphon+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/siphon?hl=en.

--
You received this message because you are subscribed to the Google Groups "Siphon" group.
To post to this group, send email to sip...@googlegroups.com.
To unsubscribe from this group, send email to siphon+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/siphon?hl=en.


--
You received this message because you are subscribed to the Google Groups "Siphon" group.
To post to this group, send email to sip...@googlegroups.com.
To unsubscribe from this group, send email to siphon+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/siphon?hl=en.

--
You received this message because you are subscribed to the Google Groups "Siphon" group.
To post to this group, send email to sip...@googlegroups.com.
To unsubscribe from this group, send email to siphon+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/siphon?hl=en.


--
You received this message because you are subscribed to the Google Groups "Siphon" group.
To post to this group, send email to sip...@googlegroups.com.
To unsubscribe from this group, send email to siphon+unsubscribe@googlegroups.com.

Fatemeh Shapouri

unread,
Jul 2, 2012, 2:56:52 PM7/2/12
to sip...@googlegroups.com
Noting, I'm very busy and don't have enough time to test this.
To view this discussion on the web visit https://groups.google.com/d/msg/siphon/-/4-i97ChJ_tkJ.

To post to this group, send email to sip...@googlegroups.com.
To unsubscribe from this group, send email to siphon+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages