将 OBi (OBi202) 连接到 Twilio SIP? [英] Connecting an OBi (OBi202) to Twilio SIP?

查看:33
本文介绍了将 OBi (OBi202) 连接到 Twilio SIP?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望将 Twilio SIP 连接到 OBi202 端点.考虑到 Twilio SIP 支持和 OBi 是一个 SIP 端点,这似乎很容易......

我找到了 RTP 端口范围、服务器和凭据信息的设置,但除此之外我卡住了,无法连接.谁能提供一些将 OBi 连接到 Twilio 的指导?

我确实设法找出入站路由,尽管正如德文所说,它需要第三方.我在 iptel.org 上设置了一个免费帐户.他们提供注册并允许我将我的 OBi 连接到他们的纯 SIP 服务.使用动词,我可以将 Twilio 号码的来电直接拨给我的 Obi!我仍在测试,但目前看来效果很好.

我已经使用 iptel 服务进行传出.我可以成功地将 SIP 呼叫从我的 OBi 传递到 Twilio,但后来我有点卡住了.我似乎对 Twilio 的传入 SIP 呼叫收取了双重费用,然后传出重定向似乎不起作用.我会在进一步调试后发布更多详细信息...

解决方案

Twilio 在 2016 年 10 月添加了 SIP 注册功能.

请注意,您可以使用 mysipdomain.sip.us1.twilio.commysipdomain.sip.twilio.com.Obitalk 默认为前者,但 twilio UI 显示后者.两者都暂时有效.

登录 obitalk 仪表板并在 Obihai 盒上配置可用的 SP 之一以使用 Twilio.

  • 输入您的 twilio sip 域(例如 mysipdomain)
  • 提供您在 twilio 中配置的 sip 用户名和密码作为 sip 域的一部分.
  • 保存

obitalk 仪表板应该显示您配置的 SP 的 sip 注册成功,您应该能够拨打您的 Twilio 号码并让您的 SIP 电话响铃.

拨出电话

为了处理来自 SIP 注册电话的拨出呼叫,您需要在 Twilio 的 SIP 域下的语音配置"下提供 URL.当您的 SIP 注册设备尝试拨出电话时,Twilio 将询问此 URL 以获取有关如何操作的说明.

这是更难的部分,因为您需要在某个地方托管一个小型 Web 应用程序,以便 twilio 与之对话(截至今天还没有可用的 twimlet).如果我们想要做的只是解析请求并告诉 twilio 请求的号码,那么 Web 应用程序本身可以非常简单.如果您进行任何国际拨号,则应确保在您的帐户中启用了这些国家/地区.

这是一个可以用于此目的的开源应用程序.https://github.com/timbeyers/sip2pstn-simpledial

我有一个我更喜欢的快速而肮脏的 php 实现(因为几乎所有廉价的共享托管计划都可以轻松托管).

https://gist.github.com/mattpr/9ed8f97f0a7a184c17d4a96aI am looking to connect Twilio SIP to an OBi202 endpoint. It seems like it would be easy considering the Twilio SIP support and the OBi is a SIP endpoint...

I found the settings for the RTP port range, server, and credential information, but beyond that I am stuck and cannot connect. Can anyone provide some guidance for connecting an OBi to Twilio?

Edit: I did manage to figure out the inbound routing, although as Devin said, it requires a third party. I setup a free account with iptel.org. They provide registration and allowed me to connect my OBi to their pure SIP service. Using the verbs I can dial incoming calls to my Twilio numbers directly to my Obi! I am still testing, but appears to work great so far.

Edit: I have played around with the iptel service for outgoing. I can successfully pass a SIP call from my OBi to Twilio, but then I get a bit stuck. I seem to get double charged for the incoming SIP call to Twilio, then the for the outgoing redirect does not seem to work. I will post more details once I debug further...

解决方案

Twilio added SIP Registration as a feature in October 2016.

https://www.twilio.com/blog/2016/10/introducing-sip-registration.html

Incoming Calls

SIP Registration allows you to connect a SIP device in order to receive INCOMING calls to your number. Basically your device is "registered" with twilio so that twilio knows your device exists and can ring it when there is an incoming call.

To get incoming calls working, you should login to twilio, have a phone number and configure a SIP domain under "Programmable Voice":

  • Add a SIP Domain (e.g. mysipdomain.sip.twilio.com).
  • Add a user/credential to that sip domain

Note that you can use either mysipdomain.sip.us1.twilio.com or mysipdomain.sip.twilio.com. Obitalk defaults to the former but the twilio UI shows the latter. Both work for now.

Login to the obitalk dashboard and configure one of the available SP on your Obihai box to use Twilio.

  • Enter your twilio sip domain (e.g. mysipdomain)
  • Provide the sip username and password that you configured in twilio as part of the sip domain.
  • save

The obitalk dashboard should show successful sip registration for the SP you configured and you should be able to dial your Twilio number and have your SIP phone ring.

Outgoing Calls

In order to handle outgoing calls from your SIP registered phone, you need to provide a URL under "Voice Configuration" under the SIP Domain in Twilio. When your SIP registered device tries to make an outgoing call, Twilio will ask this URL for instructions on what to do.

This is the harder part because you need to host a small web application somewhere for twilio to talk to (no twimlet available as of today). The web application itself can be quite simple if all we want to do is parse the request and tell twilio to <Dial> the requested number. If you are doing any international dialing you should make sure you have enabled these countries in your account.

Here is one opensource application you can use for this purpose. https://github.com/timbeyers/sip2pstn-simpledial

I have a quick and dirty php implementation that I prefer (due to the ease of hosting on almost any cheap shared hosting plans).

https://gist.github.com/mattpr/9ed8f97f0a7a184c17da99a3d2463e7a

这篇关于将 OBi (OBi202) 连接到 Twilio SIP?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆