How to use the Obihai OBi100, OBi110, or OBi202 VoIP device as a gateway between Asterisk/F—PBX and Google Voice and/or the OBiTALK network (UPDATED)

This article has been moved. Please click here to read it.

23 Comments

  1. Leo said

    Nice article.. I follow each steps and it worked on my first try. Newbie here on asterisk. I especially like “How to divert incoming Google Voice calls from an Obihai VoIP device to an Asterisk server for additional processing (such as Caller ID lookup).”

    I do have two questions maybe I’m newbie here and asterisk so I haven’t figure it out yet.
    1. Q. When the incoming calls from GV to asterisk and forward to SP2 after caller id lookup, I do see name and number on the phone. However, in asterisk Reports call logs I see Person/city name and but not the number? Not sure if that way it suppose to be? Is there way in Reports calllogs to show the name & number?

    2. With above setup I’m not sure if it is even possible to dial out from another asterisk extension configured via gateway on Obi110 so call goto asterisk and back to obi110 to gv? This way the call get record in call log for out going in the Report.( Maybe my questions is silly )
    I like to see how many incoming and outgoing calls the family makes. I did try with another extension via softphone and it worked. But via Gateway on obi110 it failed and got 503 error.

  2. Leo, in answer to your first question, that’s not how it works for me — here I see the name supplied by Caller ID Superfecta in my CDR (the “Reports” page). I have no idea why you are not seeing the same.

    Regarding your second question, it makes no sense to me, so I can’t answer it. Don’t know if it’s that your question is poorly worded, or if I’m just particularly dense tonight. Sorry.

  3. Leo said

    Thanks for replying back so fast.
    I might have to look into my setting again to see if I made some typo error.

    My second question is poorly worded. Sorry about it.
    After looking at what I asked it not even possible and I’m make it too complicated.

    This is what I was testing.

    I configure gateway 5 on obi110 as follows:
    Name: GVOutViaAsterisk
    Access Number: SP2(IP for my asterisk)
    DigitiMap: (1xxxxxxxxxx|xx.)
    AuthUserID: extension id from my asterisk server (e.g 9999)
    AuthPassword: password

    With this gateway setup I assumed when I pick the phone connect on obi110 and dial **5 and number the the call number will go to asterisk (SP2) –> asterisk outbound route –> (SP2) back to obi110 –> (SP1) GV.
    However after I looked it my own flow if I’m already using SP2 to connect to asterisk to make outbound call, asterisk can’t come back to obi110 (SP2)to call out via gv.

  4. Leo, that’s a bit clearer but now I don’t understand why it wouldn’t work for you. By default you have two channels per service provider so there is no technical reason the call couldn’t go to Asterisk and then come back via the same SP, as long as you have the inbound routing (X_InboundCallRoute) set correctly (to redirect the calls to Google Voice).

    I actually suggest increasing the “MaxSessions” value for any SP that is an extension off an Asterisk server – go into “OBi Expert Configuration” (or your device’s web interface if you don’t use the OBiTALK portal, but the following assumes you are using the portal), and then navigate to Voice Service | SPn Service where SPn is the one you have set up to be an Asterisk extension (SP2 in your case). Then scroll down to the “Calling Features” section and UNcheck the boxes next to the “MaxSessions” option. Go to the bottom of the page and click “Submit”, then come back to the “MaxSessions” option and change the value to something higher than the default of 2 (I used 10 just to be safe). Go to the bottom of the page and click “Submit” again. Now you will be able to have 10 simultaneous connections (or as many as the device allows, up to 10) so you should not run into an issue of calls being blocked because no more channels are available.

    If it still doesn’t work, I’d check your X_InboundCallRoute setting to make sure it’s redirecting the incoming calls to Google Voice properly.

  5. My apologies to anyone who tried to use the instructions in this thread between about April 4 and April 7 – I had added a change suggested by a user in the OBiTALK forum and I later discovered it didn’t work quite as expected so I’ve changed it again. The changes are to the X_InboundCallRoute setting mentioned in the article, and also to the Dialed Number Manipulation rules of the F—PBX trunk. If you got the “bad” settings you may not be able to use the device as a gateway to Google Voice from other extensions on your server. Again, I apologize for the error.

  6. Just a quick note for anyone who followed these instructions on or before the evening of April 8 (Easter Sunday) — in the companion article that I referred you to at the top of this article (to assist you in setting up inbound calling) you were instructed to create a [custom-from-Obihai] context in extensions_custom.conf. In that context, right after the line:
    exten => _X!,1,Set(CALLERID(num)=${CUT(EXTEN,/,2)})
    add this line:
    exten => _X!,n,Set(CALLERID(ani)=${CALLERID(num)})
    If you don’t (and you are running Asterisk 1.8 or later) you’ll see the trunk name in the CDR rather than the calling number.

  7. Leo said

    michigan, thanks for the updated on extension.conf
    exten => _X!,n,Set(CALLERID(ani)=${CALLERID(num)})

    This is what I was talking on my first question on my first comment post I made. After I made the change above, now I see the name and number. ;o)

    I’m still have issue when place call after I increase the max connection to 10.
    Maybe I’m doing some wrong on Obi setting or Asterisk.

    Do you think I might need to create a custom extension instead of SIP extension?

  8. Leo, I honestly don’t understand the problem you are still having. What I understood that you wanted to do was route both incoming and outgoing calls through Asterisk. To do that you’d set up one service provider account as an Asterisk extension (as explained in First look at the Obihai OBi202 VoIP device: Setting up a Google Voice and/or a SIP account (Part 2)) and make that line the PRIMARY line (and that would be a regular SIP extension, not a “custom” one). You’d then use the instructions in this article to set up a pair of trunks that would use your Obi device as a gateway to and from Google voice. Where you may be getting confused is that the trunk used for outbound calling is a custom TRUNK (not custom EXTENSION — they are two very different things).

    The reason we use separate trunks for incoming and outgoing calls is that in this method we’re trying to avoid using one of our Service Provider accounts on the Obihai device for the Asterisk trunk. This is particularly desirable on an Obihai OBi100 or OBi110 because there are only two available Service Provider accounts available and we need to use one for our Asterisk extension. On an OBi202 you might prefer to use a Service Provider account and a single SIP trunk that handles both incoming and outgoing calls, but I don’t cover that method in this article because I figure that no matter how may Service Provider accounts you have available, sooner or later you’re probably going to wish you had another. So with this method we “split” incoming and outgoing calls (to and from Google Voice) and use separate trunks for each, and only the one that handles outgoing calls TO Google Voice is a custom trunk.

    Increasing the max connections won’t help if you can’t even get one connection to work! I’m just wondering if you made your Asterisk extension account your PRIMARY line rather than your Google Voice account. But if that’s not the issue you’re having now, then I honestly don’t understand your explanation of your issue. Sorry.

  9. Leo said

    This is my setup on Obi110:
    SP1 GV and SP2 SIP Extension 1234 to Asterisk
    VG1
    Access Number: SP2(IP for my asterisk)
    DigitiMap: (xx.)
    AuthUserID: Obi110
    AuthPassword: password

    ITSP Profile B->X_AccessList->IP for my asterisk
    Voice Services->SP1 Service->X_InboundCallRoute->vg1(GV#here/$1)
    Voice Services->SP2 Service->{>(1xxxxxxxxxx):sp1},{ph}

    Asterisk Setting:
    SIP Trunk Obi110 got to SP2 SIP extension.

    Custom Trunk Name OutviaObi
    Custom Dial String: sip/$OUTNUM$@obi110ipadress:X_UserAgentPort

    Outbound route->Named it OutviaGV->Trunk used OutviaObi

    Made SP2 primary line for out call.

    Did test call for incoming call to my GV and it worked I see caller id number and name.

    I pick phone connected to phone port on obi110 and dial any number and I get call can not be completed as dial check number and dial again follow by 503 service message.

    However, if I connect a softphone to my asterisk via different extension and place a call it is success. I don’t get call not be completed as dial or 503 service message.

    I’m think maybe some setting on Asterisk at this point is missing but can figure which setting I might be missing.

  10. Leo, it sounds like the issue is either that extension 1234 is not registering with Asterisk, or it’s not sending the number you’re calling to Asterisk in a format that matches the pattern in your Outbound Route (may your outbound route only expects 10 digit numbers but the OBi110 is sending 11 digits or something like that). Since the softphone works as expected and incoming calls work as expected (if I’m reading correctly) then it is only outbound calls from the phone connected to the OBi110 that are an issue.

    The thing I would wonder is if Extension 1234 is registering with Asterisk properly. You DID configure your SIP extension as shown in First look at the Obihai OBi202 VoIP device: Setting up a Google Voice and/or a SIP account (Part 2), right? Can you call from extension 1234 to another extension? Can you call extension 1234 from another extension (such as your soft phone)? If you do sip show peers from the Asterisk CLI, does it show extension 1234 as registered (Status: OK) and show the correct host (OBi110) IP address?

    If you are satisfied that it’s registering, try dialing an outgoing call using all 11 digits and watch the Asterisk CLI as you do that. When you have finished dialing, does Asterisk react to the call in any way? Does it give you any kind of error message?

    If it’s NOT registering then make sure you have created a SIP extension on your Asterisk server and then make sure you have set up SP2 properly on your Obihai. You may be able to discover the issue by looking at your Asterisk log file. For example, if it’s trying to register but you entered the password incorrectly, the log file should show you that Asterisk is refusing the registration. Another way to look at that would be to to do sip set debug ip 192.168.0.123 (replace 192.168.0.123 with the actual IP address of the OBi110) from the Asterisk CLI (use sip set debug off to turn it off). You should see each sip packet coming in from the OBi110 and what you want to try and find is a registration attempt for extension 1234 and then see what Asterisk’s response is. Very often it’s a simple matter of a typo someplace (particularly in the password, since you can’t see what you are typing).

    I hope you get it figured out — it sounds like you are most of the way there!

  11. Leo said

    Problem resolved.
    culprit “Dial Patterns that will use this Route” for outbound
    I had this (1)+ | NXXNXXXXXX in my outbound route. When I changed it to 1NXXNXXXXXX without prepend (1) the phone was able to dial out via SP2 to GV.

    Thanks for your help and appreciate your time trying guide me fix the issue I was having.

  12. Rick said

    I am not seeing all outbound calls recorded in the Asterisk call report.

    SP1 GV
    SP2 SIP extension to Asterisk

    Using this setup, any call made from the phone attached to the ph port on the obi110 is not logged in Asterisk. All other extensions (SIP) registered to Asterisk is being logged.

    Any other settings we might have missed?

    Rick

  13. Rick, if you have SP1 selected as your primary line then your outgoing calls will bypass Asterisk and go directly to Google Voice. What happens if you dial **2 before dialing the number – do you see the call in the CDR then? If so, then perhaps you want to make SP2 your primary line for outgoing calls, so they will be diverted to Asterisk and recorded there before going back to the OBi110 and out to Google Voice. Please read my April 3 comment to Leo (above) about increasing the “MaxSessions” option (on SP2 in your case) if you do this.

  14. Rick said

    Trying to dial with **2 gives me “your call cannot be completed as dialed” and nothing new shows up in the log. Max sessions are set at 10. Found the Primary setting for (PHONE) and changed to SP2. Do I need something in the outbound call route to point to sp2?

  15. denon said

    Hello there I need help to configure my 2 obi110 so that I can call from obi number 1 to obi number 2 and get AA to call INTERNATIONAL numbers in the form of 00……………. where 00 is the international access then i woul enter countrry code city code and numbers typically some 12 numbers or more. the 2 units have already been set up with google voice which I have no need for.OBI NUMBER 2 has a telco cable box connected to the line port. THANKS in advance for your help and regards

  16. denon, more than likely it’s not working because the DigitMap for the service provider you are using for the outgoing calls has the rule 011xx. in it but you need 00xx. instead. So, look under Service Providers, ITSP Profile A or B (depending on which is used for the outgoing calls), General, and then find the DigitMap setting and change the string as menioned above. Note that ITSP Profile A is associated with Service Provider 1 and ITSP Profile B is associated with Service Provider 2. If you normally use the OBiTALK portal to configure your device then you can make this change from the Expert Configuration mode.

    If that doesn’t fix the problem then you may have to look under Voice Services, Auto Attendant, Auto Attendant 1 section and modify the DigitMap and/or OutboundCallRoute settings there, but try the above first — I suspect that will be sufficient to fix the problem (though I might be wrong; I’m not that up on Obihai dial plan configuration).

  17. denon said

    Thanks a mill for your help guys;i will try and report here

  18. denon said

    Hello again;can you possibly care to share the AutoAttendant proper digitmap settings?I know it sounds stupid but I have no idea whatsoever as to what the formula there means so if i could have the settings so that i can COPY PASTE in the proper area that would be most helpfull;the same for Outbound call route:I DO USE the obitalk portal to configure. thanks

  19. By default, it appears that the Auto Attendant DigitMap is:

    ([1-9]x?*(Mpli)|[1-9]|[1-9][0-9]||0|**1(Msp1)|**2(Msp2)|**8(Mli)|**9(Mpp)|(Mpli))

    And the OutboundCallRoute is:

    {([1-9]x?*(Mpli)):pp},{0:ph},{((Msp1)):sp1},{((Msp2)):sp2},{((Mli)):li},{((Mpp)):pp},{(Mpli):pli}

    Not you see the references to Msp1 and Msp2 – my understanding is that those incorporate by reference the DigitMaps you have assigned to those service providers, SO, it should not be necessary to change any of these settings as long as you modify the Service Provider DigitMap. That would be the correct place to do it because each Service Provider may have different expectations (if you have one based in the USA or Canada they would likely expect an 011 prefix, whereas in many other parts of the world the want to see 00 as the prefix. So if you had two different service providers, each might use a different international prefix).

    Again, Obihai device dial plans are not exactly my area of expertise, and I don’t personally use the Auto Attendant. If I’m not giving you enough information, or if what I’m suggesting isn’t working, then I suggest you try the OBiTALK forum. I’d try posting in the Installation and Set-Up (Devices) section.

  20. Modul8 said

    I’m looking to host audio conference calls for up to 10 participants on a home-based asterisk pbx and GV. Can I do this with this OBIHAI hardware in between?

  21. Modul8, the only problem with that is that last I heard, Google Voice only allows two simultaneous calls per account, and to be honest I wouldn’t depend on getting more than one to go through, at least not without testing first. So you might need several Google Voice accounts, and each participant would need to call a different GV number. With an OBi202, you could have three or four Google Voice accounts coming in on the device (depending on whether you need to reserve a service provider slot for the connection to your Asterisk server) so at a minimum you’d need three of them, and then you are depending on Google Voice which is not always reliable.

    If you are going to set up an Asterisk server anyway, a better approach might be to buy an OBi100 or OBi110 for each participant (or at least each one that has broadband) and let them directly connect to your server and to your conference bridge, thereby skipping Google Voice and its associated hassles. Some participants might elect to use a SIP-based softphone on their computer or wireless phone, and many of those are free (for example, the free version of Zoiper will let you have one SIP account and one IAX account per Zoiper user connected to your server, and Asterisk is happy to use either, though IAX works better in some challenging firewall situations).

    Of course you could always get a DID number from a commercial VoIP service provider (NOT usually free, although there still may be one or two free DID providers out there) but even with them the thing you need to watch out for is a limit on the number of simultaneous channels. Some, like Google, will limit you to two, while others may have a much higher limit. And, some will charge you a per-minute usage charge, while others will let you just pay so much per month for the DID. If you want advice on that, see this page on the voip-info.org wiki (but beware of out-of-date information), or you could search for previous posts or post your own questions on the BroadbandReports VoIP forum.

    If it’s for a one-time or very occasional use, you might be able to get a Tropo developer Account and get one or more DID’s routed to your Asterisk server. Be aware, though, that they will disable your account if they think you are abusing it, so don’t go hog wild on the usage if you go this route, and I have absolutely no idea if they have a maximum number of simultaneous connections per DID or account. On the other hand, if that option works well for you, you may want to consider switching to a full paid account.

    I’m not trying to discourage you from using an Obihai device for this application — they are great devices, but when used with Google Voice you need to be aware of the limitations of that service, since there is nothing that Obihai can do to increase the number of simultaneous calls that Google Voice will allow on each account. And note that I’ve never personally tried to put more than two simultaneous calls through on the same Google Voice account, so that limit may or may not still be in effect.

  22. Modul8 said

    Wow Thanks for the immediate feedback!
    OK. If they are unreliable, Forget the Obi and Google voice- Lets assume I am a private homeowner that said goodbye to Ma Bell (PSTN) years ago in favor of a voip offering from an ISP over broadband – Cable or ADSL.
    I want to host a conference 4-5 times a week for a couple hours at a time for up to 10 persons as a free service to persons who can’t attend a meeting in person. Since they are often elderly/infirm, the participants are not tech-savvy, nor are they always the same persons, but I want them to sign in via a simple PIN (obtained form me prior to the event). All of the inbound calls will be local, so a 1-800 # is not necessary.
    I have a reliable linux-capable box kicking around in the basement, dreaming of PBX stardom.
    What do I need to add to the mix hardware-wise to make its dream come true, at truly minimal monthly cost? Talk slowly, please, I’m new to asterisk, but I’m determined to learn :) Thanks a pile for your help and advice.

  23. First, just to be clear, I am NOT saying that Obihai devices are unreliable. Rather, it’s the Google Voice service itself that is SOMETIMES unreliable for SOME users (and often this can be corrected by creating a new Google Voice account tied to a brand new Google Mail account that’s not used for everyday e-mail). There are many users that never seem to have a problem but then there are others that have more frequent issues with making or receiving calls.

    Regarding your question, again you’d need to experiment (or ask in a forum where people might know about such things) to see who can provide you a DID with unlimited channels. You did not say where you are located (it might make a difference in your situation) but it sounds like you want a local inbound number so your callers don’t incur toll charges.

    Why don’t you do this – send me an e-mail at the address in the right-hand column (way down near the bottom of the column) and give me some idea of where you are located, what PBX software you are planning on using, and how experienced you are with Linux and how much you enjoy troubleshooting minor issues that may arise. The reason I ask that is because if you have not yet picked a distribution, you may find that the Asterisk-based ones are easier to set up and configure, but the FreeSWITCH-based ones (and I am particularly thinking of FusionPBX) may offer better conferencing capabilities, but the latter is not nearly as easy to set up and get running if you are not a Linux geek or don’t enjoy the “good learning experience” of getting some obstinate thing to work. If you are up for the challenges, though, I think that FusionPBX would give you a bit more control over your conferences (then again, I don’t know what they may have done to add capabilities to conferences in Asterisk 11, so there is that). Anyway, I may or may not have useful suggestions for you — no guarantees but I won’t know until I have some idea where “local” is for you and your callers.

RSS feed for comments on this post

Comments are closed.

Follow

Get every new post delivered to your Inbox.

Join 136 other followers

%d bloggers like this: