Iphone Voip 应用程序 - 后台处理并保持 nat 针孔存活
我正在测试由 iphone 应用程序开发人员编写的使用 PJSip 的 Voip sip 客户端。我个人也曾尝试过一些 SIP 开发,但并不是专家。
使用我们的 VOIP 软交换机(Acme packet / Broadsoft),它通过动态确定最佳重新注册时间来处理所有 Nat 处理,以保持 Nat 设备上的 Nat 针孔处于活动状态。通常,当 iphone 位于 NAT 之后时,该时间在 60-90 秒之间。
Iphone 应用程序使用 TCP,并且可以很好地与后台配合使用。显然,后台是节省电池寿命的理想选择。来电唤醒手机,您可以接听电话。
问题是,当应用程序进入后台模式时,它无法保持 Nat Pinhole 打开。这意味着一旦针孔关闭,防火墙将始终拒绝新的来电到达 Iphone 应用程序。这会导致应用程序的来电工作几分钟,然后一段时间不工作,然后当应用程序退出后台并再次注册时,来电再次工作。
根据苹果文档: <一href="http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/ManagingYourApplicationsFlow/ManagingYourApplicationsFlow.html#//apple_ref/doc/uid/TP40007072-CH4-SW3 ">http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/ManagingYourApplicationsFlow/ManagingYourApplicationsFlow.html#//apple_ref/doc/uid/TP40007072-CH4-SW3
他们为 VoIP 应用程序内置了特殊例外,以便我们可以: 1. 配置应用程序套接字,使其仍然可以处理传入消息。这没有帮助,因为如果 nat 针孔关闭,消息将永远不会到达应用程序。 2. 使用保活,但最短时间为 600 秒。这也意味着针孔将关闭。
应用程序是否有某种巧妙的方法可以发送 Voip Sip 注册消息,例如每 60 秒左右发送一次,同时保持在后台。或者应用程序可以每 60 秒唤醒一次,执行一些工作,然后关闭。
我真的很困惑市场上是否有其他 sip 应用程序可以解决这个问题。
I am testing a Voip sip client written by an iphone app developer that uses PJSip. I personally have toyed around with some SIP development myself but am no expert.
With our VOIP softswitch (Acme packet / Broadsoft), it takes care of all the Nat Handling by dynamically determining the best Re-register time to keep the Nat pinhole alive on the nat device. Typically when the iphone is behind a NAT this time is between 60-90 seconds.
The Iphone App is using TCP and happily works with Backgrounding. Obviously backgrounding is ideal to save on the battery life. The call wakes up the phone and you can listen to the call.
The problem is that when the App goes into Background mode, it has no way of keeping the Nat Pinhole open. This means the firewall will always reject new incoming calls from reaching the Iphone App once the pinhole is closed. This has the affect of incoming calls working to the app for a few minutes, then not working for a period, and then when the app comes out of background and registers again, the inbound calls work again.
According to the apple documentation:
http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/ManagingYourApplicationsFlow/ManagingYourApplicationsFlow.html#//apple_ref/doc/uid/TP40007072-CH4-SW3
They have inbuilt special exceptions for voip applications for backgrounding we can:
1. Configure the Apps sockets such that they can still handle incoming messaging. This doesn't help as the messaging will never reach the app if the nat pinhole is closed.
2. Use a Keep alive, however the minimum time is 600 seconds. This also means the pinhole will close.
Is there some clever way an App can send a Voip Sip registration message, say every 60 seconds or so whilst remaining in the background. Or can the app wake up every 60 seconds do some work and then close.
Im really perplexed as to whether or not there are other sip apps on the market that have got around this problem.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
解决此问题的方法是让 Acme 向注册到它的设备发送 TCP keepalive,并将过期时间设置为至少 600 秒。您可能希望它更高,因为手机需要一些时间来重新注册,因此 720 之类的东西会更好。
如果您将 keepailve 间隔设置得足够低(大约 30 秒左右),这应该会保持 NAT 针孔打开。 NAT 应允许更高的间隔,但这可能需要一些测试。
我知道 ACME SBC 可以处理这个问题。
To solution to this is to have the Acme send TCP keepalives to the devices registered to it and set the expires to at least 600s. You might want it higher because the phone will take some time to re-REGISTER so something like 720s would work better.
This should keep the NAT pinhole open if you set the keepailve interval low enough, around 30 seconds or so. NAT should allow a higher interval but that might require some testing.
I know that ACME SBCs can handle this.
如果间隔不太短,则允许 TCP 保持活动,我认为这应该保持 NAT 会话打开。你能告诉我们这是否有帮助吗?
TCP keep alives are allowed if the interval is not too short, i think this should maintain the NAT session opened. Can you tell us if it helps or not ?