OBiTALK Community

General Support => Installation and Set-Up (Devices) => Topic started by: justin on February 22, 2011, 12:22:00 PM

Title: Asterisk setup with OBi110
Post by: justin on February 22, 2011, 12:22:00 PM
Is there anyone who can help me setup my asterisk with OBi110?

I have tried using:http://michigantelephone.wordpress.com/2011/02/06/how-to-use-the-obihai-obi100-or-obi110-voip-device-as-a-gateway-between-asteriskfreepbx-and-google-voice-andor-the-obitalk-network/ (http://michigantelephone.wordpress.com/2011/02/06/how-to-use-the-obihai-obi100-or-obi110-voip-device-as-a-gateway-between-asteriskfreepbx-and-google-voice-andor-the-obitalk-network/)

I can't get the Asterisk server to use the OBi110 as an outbound route trunk.

Incoming line calls are routed without issue. But GV does not. GV does work with the phone port but only outgoing incoming GV are not picked up.

What I want to have happen is have my POTS and GV calls coming in go to my asterisk server AND have asterisk use GV first for outbound (if available) then use POTS. (Emergency calls use only POTS)

It's very frustrating as I know I must be missing something but I can not get it to work. I have tried doing it from scratch many times but I haven't had any luck.

My Asterisk is AsteriskNow 2.8 with FreePBX
My Obi110 is using the Feb 19 2011 firmware
both are on the same network and subnet.

Can someone please help me? (BTW sorry if this is the wrong section)
Title: Re: Asterisk setup with OBi110
Post by: justin on February 22, 2011, 07:43:06 PM
This is driving me mad! I don't understand how I can make this work.
Title: Re: Asterisk setup with OBi110
Post by: MichiganTelephone on February 23, 2011, 05:21:24 AM
justin, I'm having a little trouble understanding your issue (maybe it's too early!)  ;)

So let's deal with one thing at a time. You say your incoming GV calls are not being routed to the Asterisk server but your calls from the Line port are.  My first question is, do you know for a fact that the GV account is working and properly registering?  What happens when you call the GV number?  Do any of the lights on the OBi device start flashing quickly (after about one ring or so)?

Is your Google Voice account on SP1 and your Asterisk trunk on SP2?

Did you go to Voice Services, SP1 Service and modify the X_InboundCallRoute string to SP2 and then in parenthesis the 10 digit number of your Google Voice line, as the instructions say?

And then in FreePBX did you add an Inbound Route with the 10-digit Google Voice number as the DID?

Can you watch the Asterisk CLI and see if it gives any indication that it sees the incoming Google Voice call?

I just would like to know beyond the shadow of a doubt that you have your Google Voice account set up correctly in the device before trying to tackle your outgoing routing.
Title: Re: Asterisk setup with OBi110
Post by: justin on February 23, 2011, 09:11:04 PM
OK, Im not sure what has changed but I now have it set that GV will come into Asterisk BUT the linein port is not connecting to asterisk now. :(

GV is on SP1
Asterisk trunk is SP2

I have modified the x_inboundcallroute. it is set as "SP2('mygvnumberhere')"

I have 2 inbound call routes 1 set as my POTS line and 2nd set as my GV line.

How can I use the CLI for debugging?
Title: Re: Asterisk setup with OBi110
Post by: justin on February 23, 2011, 09:17:59 PM
My SP2 Service Status is set as

Register Failed: 403

I have confirmed the password set on my trunk matches my sip credentials. AND I set the AuthUserName as my GV number and URI to GV10digit@proxyseverip
Title: Re: Asterisk setup with OBi110
Post by: justin on February 23, 2011, 09:41:37 PM
alright Ive gotten the 403 error to go away but now I have lost my GV into asterisk and POTS still is not working into asterisk
Title: Re: Asterisk setup with OBi110
Post by: MichiganTelephone on February 23, 2011, 10:41:11 PM
"How can I use the CLI for debugging?" :o Seriously, you're running FreePBX and you're asking that?  ::)

I'm really sorry, but I don't think I can help you, at least not here.  You need to learn the basics on how to use your system before you attempt a project like this, and this forum is certainly not the place to teach you how to maintain and modify your FreePBX system.  Your problems are not related to the OBi110, and it would have been more appropriate for you to post your question as a comment on the blog.  But even if you did that, I don't think I could help you.  I already feel like I'd be trying to hit a moving target, because each time you post it seems that things have changed, and even what you originally had working doesn't work now.
Title: Re: Asterisk setup with OBi110
Post by: justin on February 24, 2011, 06:13:34 AM
I am sorry my post has frustrated you so much. I feel as if I have a moving target also as I keep changing settings trying to find a solution to a task without a clear understanding of what each setting does. (Previous to my posting on the forum I placed a reply to your blog post. It was never accepted.)

MichiganTelephone: I never expected you to fix all my errors with asterisk and OBi110. I did hope though the community would suggest reasons why my system might not be working. Viewing status and debug windows are paramount to that.

For anyone else looking for the debug command. The command is:

CLI> sip set debug on

to turn it off

sip set debug off

to get to the CLI you can type

asterisk -r

in a bash shell window.

To wrap up I have an OBi110 that will send GV traffic to asterisk but POTS are not coming in. (when I get one working the other stops  ??? )
Title: Re: Asterisk setup with OBi110
Post by: MichiganTelephone on February 24, 2011, 09:09:01 AM
Quote from: justin on February 24, 2011, 06:13:34 AM
I am sorry my post has frustrated you so much. I feel as if I have a moving target also as I keep changing settings trying to find a solution to a task without a clear understanding of what each setting does. (Previous to my posting on the forum I placed a reply to your blog post. It was never accepted.)

justin - if you are Justin Herman and you posted a comment on February 16, then not only was your comment accepted but I gave you a much longer than usual response.  You left your comment under this article (http://michigantelephone.wordpress.com/2011/02/12/how-to-use-the-obihai-obi100-or-obi110-voip-device-as-a-gateway-between-asteriskfreepbx-and-google-voice-andor-the-obitalk-network-%E2%80%94-part-2-using-the-phone-port-as-an-asterisk-extension/); did you not ever see my reply?

If you are any other "Justin" then Wordpress has never notified me that you left a comment.

Quote from: justin on February 24, 2011, 06:13:34 AMMichiganTelephone: I never expected you to fix all my errors with asterisk and OBi110. I did hope though the community would suggest reasons why my system might not be working. Viewing status and debug windows are paramount to that.

For anyone else looking for the debug command. The command is:

CLI> sip set debug on

to turn it off

sip set debug off

to get to the CLI you can type

asterisk -r

in a bash shell window.

Actually you would get more information if you added a few v characters after that -r, to increase the verbosity level.  I personally use

asterisk -RvvvvvvvvvvT

to get to the CLI, although anything over about 4 "v"'s doesn't add much.

When turning on sip debugging, you might also want to look into the debug level x command when in the CLI - using "debug level 4" will often give you more output (whether that's always desirable is another matter entirely).

Quote from: justin on February 24, 2011, 06:13:34 AMTo wrap up I have an OBi110 that will send GV traffic to asterisk but POTS are not coming in. (when I get one working the other stops  ??? )

I suggest you go back and read the reply I posted to "Justin Herman" (whether that's you or not) - it may help you.  The symptom you describe could be caused by a mismatch between the number you put in parenthesis in your OBi configuration, for example SP2(8005551212) and the number in the DID in your inbound route (for example, if you used 18005551212 there it would not match). And if you are using the custom-from-obi context from the article that you (or the other Justin) left your (his) comment under, then there also has to be a match for the exact same number there.
Title: Re: Asterisk setup with OBi110
Post by: justin on February 24, 2011, 03:22:55 PM
Thank you very much. I thought I was subscribed to any posts on the blog, but apparently not. Im going to try those steps and see what I can get working. Ill let everyone know once I have that.
Title: Re: Asterisk setup with OBi110
Post by: justin on February 24, 2011, 04:38:41 PM
ok I have the Obi110 line port as an ext on the asterisk server. Tested and works

I have setup the line physical inbound call route as SP2(10digitPOTSnumber) with the ring delay set. and extended disconnect settings.

The obi110 History shows the call coming in and supposed to connect to my POTS number on SP2 but it never connects.

I have the SP2 X_InboundCallRoute as {>(202):ph}, {>(1xxx xxx xxxx):sp1}, {>( xxx xxx xxx):pp}

202 is the obi110 line ext number in asterisk.

I have 2 Inbound routes with GV DID and POTS DID

So to wrap up I currently have working...
Inbound GV. Pointed to Asterisk
The OBi110 phone port as an ext in Asterisk.

What I need to have working is:
Incoming POTS calls from line port to Asterisk
Outgoing Calls from asterisk to GV. with 911 going to POTS.

Any Idea where I could check?
Title: Re: Asterisk setup with OBi110
Post by: MichiganTelephone on February 24, 2011, 07:40:28 PM
Quote from: justin on February 24, 2011, 04:38:41 PMWhat I need to have working is:
Incoming POTS calls from line port to Asterisk

On your OBi110, check your settings under Physical Interface, Line Port.  For the InboundCallRoute put SP2 and then in parenthesis the 10 digit number of your PSTN line.  And make sure the RingDelay value is set it to 3500 (you may be able to cut that back to 3000 or even a bit less after you get it working, depending on how long it actually takes to reliably receive Caller ID).  Then, make sure you have an inbound route for the same 10 digit number, and also that in extensions_custom.conf, in the [custom-from-obi] context, you add a line at the top for the PSTN line - where in the article it shows you to do this:

[custom-from-obi]
exten => 9-DIGIT-OBiTALK-NUMBER,1,Goto(from-trunk,${EXTEN},1)
exten => 10-DIGIT-GV-NUMBER,1,Goto(from-trunk,${EXTEN},1)

Right under that, add a line like this:

exten => 10-DIGIT-PSTN-NUMBER,1,Goto(from-trunk,${EXTEN},1)

You need the exact same ten digit number in all three places (InboundCallRoute on the OBi110, the DID field of your Inbound Route in FreePBX, and the above context line) for it to work.

Quote from: justin on February 24, 2011, 04:38:41 PMOutgoing Calls from asterisk to GV. with 911 going to POTS.

This is where it gets a bit more complicated, because there are several things that all need to be right for it to work.  You need a proper Outbound Route, that selects the OBi110 SIP trunk you should have created.  If you have those two things, and your SP2 X_InboundCallRoute is as you show, then calls should go out the Google Voice trunk.  If you want to divert 911 calls to the LINE port, then you should be able to change your SP2 X_InboundCallRoute to this:

{>(911):li}, {>(202):ph}, {>(1xxx xxx xxxx):sp1}, {>( xxx xxx xxx):pp}

HOWEVER you will also have to make sure that you have an Outbound Route in FreePBX that actually sends your 911 calls to the OBi110 trunk.  From what you've shown me so far and what you've said works, I tend to think your trunk is okay and your OBi configuration may be okay, but you don't have your Outbound Route(s) set up correctly.  That's why it can be very helpful to watch the Asterisk CLI while actually trying to place a call - you can see the path the call is taking and you can see if it's ever reaching the trunk.  And remember, once Asterisk has seen a pattern match in any outbound route, it will never look any further, so you have to be careful how you have your Outbound Routes prioritized and that you don't have a pattern that could match the number called in a higher Outbound Route - if you do, the call will use that route and never get to the one you want it to use (even if the call ultimately fails on that route).

Hope that helps!
Title: Re: Asterisk setup with OBi110
Post by: justin on February 25, 2011, 06:42:00 AM
POTS > Asterisk
I have all 3 locations set but I still seem to be getting a 404 error with sip debug.  :'(
Title: Re: Asterisk setup with OBi110
Post by: MichiganTelephone on February 25, 2011, 07:09:16 AM
SIP debug is not going to tell you anything useful about your incoming calls.  If your trunk it working (and it IS working if you're receiving any calls from your OBi device), then the 404 is totally irrelevant.

The problem with SIP debug (which I rarely use) is that it mixes all kinds of input from various sources so unless you know how to use it, it can confuse you more than anything.  No, you should not see a 404 error BUT are you sure that packet has anything at all to do with the OBi110?  It could be right in the middle of a packet stream from the OBi but still be from another source entirely.  If it is from the OBi110 then you may have a mismatch between your Service Provider 2 SIP Credentials and your FreePBX trunk USER Context and USER Details (particularly your password/secret), although if that were the case I'd be surprised that the trunk works at all.

Concentrate on using the Asterisk CLI during your debugging — it will give you much more useful information than SIP debug (unless your unit were not connecting at all, which is clearly not the case here).
Title: Re: Asterisk setup with OBi110
Post by: justin on February 25, 2011, 08:33:04 AM
I used the CLI debug with verbosity set as 15 but when I call in using POTS all i see is


  == Using SIP RTP TOS bits 184
  == Using SIP RTP CoS mark 5

When Calling from GV I can see that it is preforming "Executing", and "GoTo".


Could this be an issue as I don't have CID on my POTS line?
Title: Re: Asterisk setup with OBi110
Post by: MichiganTelephone on February 25, 2011, 10:16:33 AM
justin, are you 1000% SURE that you are using the EXACT SAME 10 digit number under Physical Interface, Line Port, InboundCallRoute on the Obi, AND in the [custom-from-obi] context, AND in your Inbound Route as the DID?  If you are then I'm sorry but it's not making sense to me — if your trunk is working for other calls then it should handle the inbound PSTN calls as well.

If you don't have Caller ID on your PSTN line you could set the RingDelay to 0 to get calls into your Asterisk system faster, but that wouldn't impact the routing of incoming calls.  However that brings up another possibility — check your FreePBX Blacklist to make sure you're not blocking calls with no Caller ID (make sure that the checkbox for "Block Unknown/Blocked Caller ID" is NOT checked).

Other than that, I'm afraid you have me stumped.  ???
Title: Re: Asterisk setup with OBi110
Post by: MichiganTelephone on February 25, 2011, 10:41:41 AM
I'm going to give you some specific examples just so we are clear on what you need to do.  Let's say your PSTN phone number is 234-555-2345.

On the OBi, under Physical Interface, Line Port, the InboundCallRoute must be:
SP2(2345552345)

In your [custom-from-obi] context in /etc/asterisk/extensions_custom.conf you need a line like this:
exten => 2345552345,1,Goto(from-trunk,${EXTEN},1)

Note the above is an exact match, not a pattern, so there is no underscore in front of the first digit (just wanted to mention that in case maybe you thought there should be).

And then you have to create an Inbound route, and in the DID Number field you need to put 2345552345.  Do not fill in the Caller ID Number.

If those three things are correct, and it still doesn't work, and yet you can receive other calls (such as Google Voice call) over the trunk, then I simply have no idea what the problem is.  Are you sure you have a good physical connection to your PSTN Line?
Title: Re: Asterisk setup with OBi110
Post by: justin on February 25, 2011, 10:47:56 AM
POTS > ASterisk is now working
GV > Asterisk is working too.

The problem is I had GV number listed in the incoming settings for user context in the asterisk trunk.

Now to work on the outgoing calls to GV and POTS
Title: Re: Asterisk setup with OBi110
Post by: MichiganTelephone on February 25, 2011, 11:13:29 AM
Quote from: justin on February 25, 2011, 10:47:56 AM
POTS > ASterisk is now working
GV > Asterisk is working too.

The problem is I had GV number listed in the incoming settings for user context in the asterisk trunk.

That should not be a problem if you had also used that same number in the SP2 Service SIP Credentials.  The USER Context field is like your Login name - you could probably just as easily use something like obi-inbound if you also used that in your SP2 Service SIP Credentials, as both the AuthUserName and the first part of the URI (I have not actually tried that, so don't hold me to that).

What I can't understand is, if changing the USER Context field made it work, how was it working before?  Because that would indicate you weren't registering (which might explain that 404 you were seeing).  So I don't understand how the GV calls were getting through.  But then there are a lot of things about Asterisk that mystify me.

But hey, let's not look a gift horse in the mouth — I'm glad you got it working, no matter how you did it!

Quote from: justin on February 25, 2011, 10:47:56 AMNow to work on the outgoing calls to GV and POTS

Good luck, I sincerely hope that is easier for you!  ;D
Title: Re: Asterisk setup with OBi110
Post by: justin on February 25, 2011, 03:02:52 PM
Well It says the OBi110 is busy.

Got SIP response 486 "Busy Here" back from 192.168.1.140:5061
    -- SIP/OBi110-000001e3 is busy

Any Reason why it would say that?
Title: Re: Asterisk setup with OBi110
Post by: MichiganTelephone on February 25, 2011, 03:34:21 PM
Typically when you see that message it means that you're trying to send out more calls on a provider than it can handle (by the way, that's also not the correct SIP message that the OBi should be returning in that situation, since  FreePBX/Asterisk sees that as a "line busy" and that prevents it from falling through to another free trunk, if one is available — I'm told that will be fixed in an upcoming firmware update, and then it hopefully should send a more appropriate type of SIP message back to Asterisk in that situation).

I've seen that message when I've deliberately tried to do something like send a second call to the LINE port when it was already in use, or send a second call to Google Voice before the most recent firmware update that bumped the maximum simultaneous calls 2.  I think that it could also happen if, for example, you tried to send a call to the LINE port but the phone line wasn't connected, or if you tried to send a call to Google Voice or a SIP provider but the OBi wasn't registering with GV or the provider for whatever reason.
Title: Re: Asterisk setup with OBi110
Post by: justin on February 25, 2011, 03:40:42 PM
Could Obi110 have a feature code set that Im not aware of that would cause this?
Title: Re: Asterisk setup with OBi110
Post by: MichiganTelephone on February 25, 2011, 03:47:55 PM
If it does, I'm not aware of it either.
Title: Re: Asterisk setup with OBi110
Post by: justin on February 25, 2011, 04:08:42 PM
Is there a debug mode for the obi110 that I could run to see how it handles the request?
Title: Re: Asterisk setup with OBi110
Post by: RonR on February 25, 2011, 05:06:29 PM
There's not a lot of documentation on it, but the OBi Device Administration Guide (OBiDeviceAdminGuide.pdf) does indicate there is Syslog Server support and more than one area of debug information available.
Title: Re: Asterisk setup with OBi110
Post by: justin on February 25, 2011, 07:22:22 PM
How would I check to see if a feature code was set?

Looking in the device admin guide I see that this...

AnonymousCallBlockEnable

might get set via a feature code and respond with 486 (busy).

Title: Re: Asterisk setup with OBi110
Post by: justin on February 25, 2011, 08:30:25 PM
is anyone else have this working? Could there be a obi110 config file that I would import?
Title: Re: Asterisk setup with OBi110
Post by: justin on February 26, 2011, 01:58:10 PM
Is there any other fixes that might work? Like if I bought another Obi110 could I use it only for outgoing calls and get it work?

This is VERY frustrating as This is the reason I bought the OBi110 was to replace my SPA-3102 that stinks with DTMF. BTW no issues with DTMF or Echo with the OBI110. But I still cannot use it for out going calls.
Title: Re: Asterisk setup with OBi110
Post by: MichiganTelephone on February 26, 2011, 06:16:44 PM
For the benefit of anyone else who stumbles across this thread and is having a similar issue, I had a voice conversation with Justin tonight and we were able to determine that the problem with using the Line port for outgoing calls was in the X_InboundCallRoute setting for Service Provider 2 (the Asterisk trunk in this configuration).  I sent him a copy of the string in e-mail and it started working.  This is the relevant part of the string (note this does not include the part that handles the extension connected to the phone port, nor does it handle 911 calls, this is just for demonstration purposes:

{>(*x.|1xxx xxx xxxx):li}, {>(<ob> xxx xxx xxx):pp}

The first section sends any service code starting with a * character (the *x. pattern) OR (the | character represents OR in this context) an 11 digit PSTN number (the 1xxx xxx xxxx pattern) to the LINE port (:li).  The second section sends any 9 digit number (the xxx xxx xxx pattern) to the OBiTALK network (:pp), but only after prepending ob (the <ob> part of the string) to the number.  If you don't want to send the * service codes you could leave off the *x.| part.  If you wanted to send three digit numbers that end in 11 plus 11 digit numbers to the line port, you could replace that part of the pattern (the part between the parenthesis) with [2-9]xx|1xxx xxx xxxx (if you wanted to exclude 411 you could use [235-9]xx|1xxx xxx xxxx instead) and so on.

Naturally, all this assumes that Asterisk and FreePBX are set up to send calls that match those patterns to the OBi device in the first place.
Title: Re: Asterisk setup with OBi110
Post by: vtsnaab on July 04, 2018, 03:05:38 PM
This thread now has 1 1/2 pages of pure board spam !!!