News:

On Tuesday September 6th the forum will be down for maintenance from 9:30 PM to 11:59 PM PDT

Main Menu

OBiBT as a trunk on asterisk

Started by gelcom, December 10, 2014, 03:14:20 PM

Previous topic - Next topic

gelcom

Guys, Is it possible to use a Obi202 + ObiBT as an asterisk trunk? My idea is to have the Obi as a gateway to my cellphone via Bluetooth so when I'm near the device all calls ring the asterisk server and all calls dialed by asterisk phones go out via my cellphone line. Is it possible to do that without any other online service involved?

There is a how-to on Nerd Vittels ( http://nerdvittles.com/?p=4945 ) but this option relies on Voip.ms but I dont want this service to be internet dependent.

Is it possible to do that? How?

King regards

azrobert

#1
I use Freepbx.

Asterisk

Setup an outbound trunk without registration for the OBi202:
type=peer
username=gelcom
host=192.168.1.102 (OBi202 IP address)
port=5063  (OBi202 SP4)

Setup an inbound route for 9999 (See OBi202 BT inbound route)

OBi202

SP4 must be defined as an SIP trunk to send/receive to/from Asterisk.
If SP4 is not defined, setup a dummy SIP definition like this:

Service Providers -> ITSP Profile D -> SIP -> ProxyServer: 127.0.0.1
Voice Services -> SP4 Service -> AuthUserName: (any userid)
Voice Services -> SP4 Service -> X_RegisterEnable: (unchecked)
Voice Services -> SP4 Service -> X_ServProvProfile: D

Route outbound calls from Asterisk to BT
Voice Services -> SP4 Service -> X_InboundCallRoute: bt

Route inbound calls to Asterisk
Voice Services -> OBiBluetooth -> InboundCallRoute:
sp4(9999@192.168.1.100:5060)  (Asterisk IP address)

Edit:
I fixed a typo on the last line of my post.

gelcom

#2
Thanks for the reply.

Is call quality good with this setup? I heard I could hear some echo on this kind of connection...

I already have a router and I wont use the device's FXS port so I wonder if I could get this working with Obi200+ObiBT instead of Obi202+ObiBT. Is there any difference from these devices apart the routing stuff and additional FXS?


Quote from: azrobert on December 10, 2014, 04:11:11 PM
Voice Services -> OBiBluetooth -> InboundCallRoute:
sp4(9999@192.168.1.100:5060)  (Asterisk IP address)
Here I should use port 5060 or 5063 as you mentioned before?

Is there a way to have a password protected register to have a more secure approach to your sugestion?


kind regards
Gustavo

azrobert

#3
QuoteIs call quality good with this setup? I heard I could hear some echo on this kind of connection...
I have never read that the OBiBT causes an echo, but I'm not sure. Some people have reported an echo with the OBiline adapter. Maybe someone else can answer this.

QuoteI already have a router and I wont use the device's FXS port so I wonder if I could get this working with Obi200+ObiBT instead of Obi202+ObiBT. Is there any difference from these devices apart the routing stuff and additional FXS?
I believe they are the same except for the differences you noted and the size of the box. The OBi200 is much smaller.

QuoteHere I should use port 5060 or 5063 as you mentioned before?
192.168.1.100:5060 should be changed to the IP Address and port of Asterisk.

QuoteIs there a way to have a password protected register to have a more secure approach to your sugestion?
Yes. Add the following to the SP4 definition:
Voice Services -> SP4 Service -> AuthPassword: (any password)
Voice Services -> SP4 Service -> X-Proxy: (checked)

The above setting is only available on the OBi2xx models.

gelcom

#4
Thanks for the reply!

If I pair the OBiBT with 2 cellphones at the same time is it possible to choose which cellphone will be used to send out a call via SIP?

In the same config is it possible to know which cellphone line is ringing on asterisk?

Sorry for the noob questions. As I need to use 2 cellphones at once Í'm not sure if I can do that with just 1 Obi200 or I need 2 Obis...


kind regards
Gustavo

azrobert

#5
QuoteSorry for the noob questions. As I need to use 2 cellphones at once Í'm not sure if I can do that with just 1 Obi200 or I need 2 Obis...
I wanted to make sure I got this correct. I have an OBi200 and an OBiBT. When I try to pair a 2nd device the OBiBT drops connection to the 1st device.

The OBi200 has definitions for 2 OBiBT dongles, so you would need a second OBiBT dongle. The OBi200 only has one USB port, but I assume it will work with a USB hub. How else would you get 2 OBiBT dongles connected?

Your choice:
1 OBi200 w/USB hub
2 OBi200s

I was wrong in my last post on the differences between the OBi202 and the OBi200. The OBi202 also has 1 USB port. I corrected the post.

QuoteIf I pair the OBiBT with 2 cellphones at the same time is it possible to choose which cellphone will be used to send out a call via SIP?
The OBi2xx has definitions for 2 BT trunks.
You would need a prefix to route calls out the second.
The default prefix for the OBi Phone Port to route calls to BT2 is "**82", but you can use any prefix.
In this example I'm using a prefix "2".
The prefix is replaced by "1".
I also added extra security. I'm checking for userid "gelcom" (the userid on the Asterisk trunk)

Route outbound calls from Asterisk to BT1 or BT2
Voice Services -> SP4 Service -> X_InboundCallRoute:
{gelcom>(1xxxxxxxxxx):bt1},{gelcom>(<2:1>xxxxxxxxxx:bt2}

QuoteIn the same config is it possible to know which cellphone line is ringing on asterisk?
There is an inbound route for each bt trunk. Route the calls to 2 separate numbers.

Route inbound calls to Asterisk
Voice Services -> OBiBluetooth 1 -> InboundCallRoute:
sp4(1000@192.168.1.100:5060)  (Asterisk IP address and port)

Voice Services -> OBiBluetooth 2 -> InboundCallRoute:
sp4(2000@192.168.1.100:5060)  (Asterisk IP address and port)

azrobert

Route inbound calls to Asterisk
Voice Services -> OBiBluetooth 1 -> InboundCallRoute:
sp4(1000@192.168.1.100:5060)  (Asterisk IP address and port)

Voice Services -> OBiBluetooth 2 -> InboundCallRoute:
sp4(2000@192.168.1.100:5060)  (Asterisk IP address and port)

There might some confusion with the above.
The OBi is NOT routing calls to Asterisk via the Trunk you defined in Asterisk.
It's using SP4 to route calls to Asterisk via SIP URI.
I believe the default for Asterisk is to reject these calls, but since you defined a trunk with the OBi's IP address Asterisk will accept the calls.


azrobert

I thought of 2 ways to route outbound calls without using a prefix.

You can route certain area codes to BT1 and everything else to BT2.
OR
You can setup 2 trunks on Asterisk pointing to the OBi200.
One with a username of "gelcom1" and the other "gelcom2".
In the OBi200 route call from "gelcom1" out BT1 and "gelcom2" out BT2.