Android sipdemo 拨打电话超时

发布于 2025-01-06 19:35:51 字数 128 浏览 3 评论 0原文

android sipdemo 拨打电话时出现超时问题。手机上的本机 sip 客户端呼叫没有任何问题,运行完美。当我在 sipdemo 中发起呼叫时,我在 logcat 中遇到超时。超时设置为 30 秒的标准。它连接的是本地星号框。注册良好。

Having a problem with the android sipdemo timing out when making calls. The native sip client on the phone has no issues calling, works perfect. Its When i initiate the call within the sipdemo i get a timeout in the logcat. timeout is set to standard of 30 seconds.. a local asterisk box is what its connecting to. Registers fine.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

岛徒 2025-01-13 19:35:51

我也有同样的问题。
我在wireshark中跟踪了包,以下是我发现的内容:

  1. 我在SipDemo中注册到SIP服务器
  2. 我在桌面上注册到SIP服务器(使用Ekiga)
  3. 我在SipDemo中向Ekiga发出呼叫。
  4. INVITE 消息发送到 Ekiga
  5. 尝试从 Ekiga 发送到服务器
  6. 振铃从 Ekiga 发送到 SipDemo
  7. 我在 Ekiga 客户端上应答呼叫
  8. OK(带有会话描述)从 Ekiga 发送到 SipDemo。在 Ekiga 放弃并结束呼叫之前,这种情况会发生 11 次
  9. BYE 从 Ekiga 客户端发送到 SipDemo

请注意,在 Ekiga 放弃并结束呼叫之前,OK 会被发送 11 次。这就是为什么通话只持续 30 秒。

如果您查看此处的 RFC:
http://www.ietf.org/rfc/rfc3261.txt 第 13.3.1.4 节

您可以看到,Ekiga 放弃 SipDemo 客户端的原因是它永远不会从 SipDemo 收到 ACK。

我相信这是 Android 错误,但我无法想象他们可能在 SIP 实现中错过了如此基本的东西。

在接下来的几天里,我将尝试在 android 源代码中挖掘一些答案...

我将尝试看看在 2 个 SipDemo 应用程序之间建立调用时会发生什么。如果它有效,这意味着 android 会完全忽略 ACK。

编辑:
我刚刚尝试了 2 个 SipDemo 客户端之间的通话。它发送 OK 5 次并放弃 OK,但不会结束呼叫。有趣的行为:)

编辑2:
我挖掘了 androids SIP 实现,发现应该发送 ACK...即使 logcat 记录了这一点,但我在 Wireshark 中仍然看不到任何内容。我想可能它被阻止了或者其他什么原因,所以我在设备上运行 Shark(比如 Android 版的 Wireshark),将转储拉到我的笔记本电脑上,在 Wireshark 中打开它,但我在任何地方都看不到 ACK。我什至查看了所有数据包...没有过滤器,以防万一我可能将其过滤掉。无论如何...这是我在 android 代码中发现的内容:
http://hi-android.info/src/com /android/server/sip/SipSessionGroup.java.html
类:SipSessionImpl
方法:私有布尔outgoingCall(EventObject evt)
如果响应.OK:
你可以看到这个调用:
mSipHelper.sendInviteAck(事件, mDialog);

在SipHelper中,方法sendInviteAck,可以看到:
if (DEBUG) Log.d(TAG, "发送 ACK: " + ack);
对话框.sendAck(ack);

Dialog 是 nist javax.sip,所以我认为没有必要进一步......
运行应用程序 EDIT3 时,我在 logcat 中看到此消息“发送 ACK”


我注意到此问题仅发生在某些 SIP 服务器上。我现在尝试了opensips,效果很好。我想我遇到的问题与服务器响应 androids keep-alive OPTIONS 消息和 404 Not Found 有关。然后,android尝试尽快不使用服务器。因此,一旦 android 获得其对等客户端的地址,它就会尝试发送直接消息,但失败了

I'm having the same problem.
I traced packages in wireshark and here's what I found:

  1. I register to SIP server in SipDemo
  2. I register to SIP server on Desktop (using Ekiga)
  3. I place a call in SipDemo to Ekiga.
  4. INVITE message gets sent to Ekiga
  5. Trying is sent from Ekiga to the server
  6. Ringing is sent from Ekiga to SipDemo
  7. I answer the call on Ekiga client
  8. OK (with session description) is sent from Ekiga to SipDemo. This happens 11 times before Ekiga just gives up
  9. BYE is sent from Ekiga client to SipDemo

Please note that OK is being sent 11 times before Ekiga just gives up and ends the call. This is why the call lasts just 30 seconds.

If you take a look at the RFC here:
http://www.ietf.org/rfc/rfc3261.txt section 13.3.1.4

you can see that the reason Ekiga is giving up on SipDemo client is because it never gets ACK back from SipDemo.

I believe this is android bug, but I can't imagine they could have missed something this basic in their SIP implementation.

In the next few days, I'll try to dig up some answers in android source code...

I'll try see what happens when establishing calls between 2 SipDemo applications. If it works, that means android just ignores ACK all together.

EDIT:
I just tried a call between 2 SipDemo clients. It sends OK 5 times and gives up on the OK, but does not end the call. Interesting behavior :)

EDIT2:
I dug up androids SIP implementation, and I found that ACK should get sent... Even logcat logs this, but I still see nothing in Wireshark. I thought maybe it gets blocked or something, so I ran Shark (like Wireshark for android) on the device, pulled the dump to my laptop, opened it up in Wireshark, and I don't see ACK anywhere. I even looked trough all packets... No filters, just in case I might be filtering it out. Anyways... Here's what I found in android code:
http://hi-android.info/src/com/android/server/sip/SipSessionGroup.java.html
class: SipSessionImpl
method: private boolean outgoingCall(EventObject evt)
in case Response.OK:
you can see this call:
mSipHelper.sendInviteAck(event, mDialog);

In SipHelper, method sendInviteAck, you can see:
if (DEBUG) Log.d(TAG, "send ACK: " + ack);
dialog.sendAck(ack);

Dialog is nist javax.sip, so I don't think there's a need to go further...
I see this message "send ACK" in my logcat when running the application

EDIT3:
I noticed that this issue occurs only with some SIP servers. I now tried opensips, and it works fine. I guess the problem I was having had to do with the server responding to androids keep-alive OPTIONS messages with 404 Not Found. Then, android tried to not use the server as soon as possible. Because of that, as soon as android got the address of its peer client, it tried to send a direct message, and failed

风月客 2025-01-13 19:35:51

就这样很难说清楚。尝试使用 wireshark 捕获数据包,过滤 SIP 协议并查看通过网络发送的内容。也用本机客户端尝试一下,并与 sipdemo 进行比较。

另一个起点是星号实例的日志(系统日志)

如果您自己无法弄清楚,请将结果发布到此处。

Hard to tell just like that. Try capturing the packages with wireshark, filter for the SIP protocol and have a look at what is sent over the network. Also try it with the native client and compare it to the sipdemo.

Another starting point is the log of your asterisk instance (systemlog)

If you can't figure it out yourself, post the results here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文