News:

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

Main Menu

Asterisk setup with OBi110

Started by justin, February 22, 2011, 12:22:00 PM

Previous topic - Next topic

justin

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/

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)

justin

This is driving me mad! I don't understand how I can make this work.

MichiganTelephone

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.
Inactive, no longer posting or responding to messages.  Goodbye and good luck.  Some of my old Obihai-related blog posts have been moved to http://tech.iprock.com - note this in NOT my blog; I have simply given the owner permission to repost some of my old stuff.

justin

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?

justin

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

justin

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

MichiganTelephone

"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.
Inactive, no longer posting or responding to messages.  Goodbye and good luck.  Some of my old Obihai-related blog posts have been moved to http://tech.iprock.com - note this in NOT my blog; I have simply given the owner permission to repost some of my old stuff.

justin

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  ??? )

MichiganTelephone

#8
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; 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.
Inactive, no longer posting or responding to messages.  Goodbye and good luck.  Some of my old Obihai-related blog posts have been moved to http://tech.iprock.com - note this in NOT my blog; I have simply given the owner permission to repost some of my old stuff.

justin

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.

justin

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?

MichiganTelephone

#11
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!
Inactive, no longer posting or responding to messages.  Goodbye and good luck.  Some of my old Obihai-related blog posts have been moved to http://tech.iprock.com - note this in NOT my blog; I have simply given the owner permission to repost some of my old stuff.

justin

POTS > Asterisk
I have all 3 locations set but I still seem to be getting a 404 error with sip debug.  :'(

MichiganTelephone

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).
Inactive, no longer posting or responding to messages.  Goodbye and good luck.  Some of my old Obihai-related blog posts have been moved to http://tech.iprock.com - note this in NOT my blog; I have simply given the owner permission to repost some of my old stuff.

justin

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?

MichiganTelephone

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.  ???
Inactive, no longer posting or responding to messages.  Goodbye and good luck.  Some of my old Obihai-related blog posts have been moved to http://tech.iprock.com - note this in NOT my blog; I have simply given the owner permission to repost some of my old stuff.

MichiganTelephone

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?
Inactive, no longer posting or responding to messages.  Goodbye and good luck.  Some of my old Obihai-related blog posts have been moved to http://tech.iprock.com - note this in NOT my blog; I have simply given the owner permission to repost some of my old stuff.

justin

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

MichiganTelephone

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
Inactive, no longer posting or responding to messages.  Goodbye and good luck.  Some of my old Obihai-related blog posts have been moved to http://tech.iprock.com - note this in NOT my blog; I have simply given the owner permission to repost some of my old stuff.

justin

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?