OBiTALK Community

General Support => Installation and Set-Up (Devices) => Topic started by: Ad_Hominem on July 11, 2011, 05:37:59 PM

Title: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: Ad_Hominem on July 11, 2011, 05:37:59 PM
UPDATED:  5/19/2012

Be sure to use the very latest firmware.  Earlier versions had a bug with the X_UseRefer option which have now been fixed!

Note that I've made a lot of changes to these instructions since I wrote them a few years ago, and so if you set-up your Obi 110 based upon these instructions before the date listed above, you should double check your settings now.  The updates include ensuring that the Obi 110 can transfer calls correctly (and allow you to continue making and receiving calls), process calls more quickly (by knowing when you're done dialing without waiting for 3-5 seconds), and I now include an option to allow you to choose whether your 911 calls should be routed to your PBX or direct to your FXO line (by default with the Obi, they are routed to your FXO line - even if you don't have one).

-----------------------------

Here's how to set up an Obi 110 to act as both an FXS and an FXO for any FreePBX -based PBX (including the FreePBX Distro, AsteriskNOW, PBX In A Flash, Elastix, and Trixbox):

1.  Set a static IP address for your Obi 110 device:

System Management:
   Network Settings:
      Internet Settings:
         Addressing Type:  Static
         IPAddress:  Pick an IP Address for your device
         SubnetMask: 255.255.255.0
         DefaultGateway:  192.168.1.1
         DNSServer1: 8.8.8.8
         DNSServer2: 8.8.4.4

2.  Set-up the Obi 110 to act as an FXS Port (i.e., to make the PHONE port work as an extension on your PBX):

     a.  First, set-up an extension on your FreePBX just like you'd set-up any other extension.  Make a note of the extension # and password, as you'll need them for step 2.b.

     b.  Once you've determined the IP Address of your FreePBX and your extension # and your extension password, you can configure the Obi 110 device as follows:

Service Providers:
   ITSP Profile A:
      General:
         General:
            DigitMap:  

(911S0|1xxxxxxxxxxS0|011xx.S2|xx.S2|xS2|xxS2|*X.S2|(Mipd)|[^*#]@@.)

Note:  The standard Obi 110 "DigitMap" will allow you to dial calls from your FXS Port that are 3 digits or longer, and will put the call through after three seconds.  It will also automatically add "1" to the beginning if you dial an area code and telephone number.

These behaviors may be undesirable.  Some people prefer to have calls go out after 2 seconds, or immediately.  In addition, PBX users often want to be able to dial one and two digit extension numbers, or feature codes that begin with an asterisk.  Finally, some telephone companies that require the dialing of area codes for local calls do not allow the calls to be prefixed with a "1".  

The Digit Map above eliminates the prefixing of calls with a 1, forces calls to 911 and to 1+Area Code+Number to go out immediately, sends all other calls out after 2 seconds of inactivity, and allows the dialing of feature codes starting with asterisk and one and two-digit extensions.

Note that the "S0" and "S2" in the digit map reflect how long the Obi will wait after receiving a matching pattern before putting the call through.  In the above-example, most calls will go through 2 seconds after dialing is completed, but a 1 + area code + number call will go through immediately without waiting for further digits.  You can change the numbers after the S to whatever delay suits your needs.  For example, if you change 011xx.S2 to 011xx.S5, then the device will wait 5 seconds before putting through a call that begins with 011.  Obi will always put a call through immediately if you dial # when you are finished dialing.

Service Providers:
   ITSP Profile A:
      SIP:
         SIP:
            Proxy Server:  IPAddressofYourPBX
            X_UseRefer:  Checked
            X_MWISubscribe: Checked

Voice Services:
   SP1 Service:
      SP1 Service:
         X_ServProvProfile:  A
      SIP Credentials:
         AuthUserName:  EXTENSION#  
         AuthPassword:   EXTENSIONPASSWORD
      Calling Features:
         MaxSessions:  10

Note:  You can change the above to something less than 10 if security is an issue.  The default of 2, however, will block you from making any calls if you transfer a call using the "flash" hook feature until the persons on those calls hang up.  Ten should be more than enough, but you can also increase it if you prefer.

         MWI Enable:  Checked
         X_VMWIEnable:  Checked
         MessageWaiting:  Unchecked, but undefaulted

Voice Services:
   SP2 Service:
      SP2 Service:
         X_ServProvProfile:  B

Note:  The above is necessary to prevent SP2 service from attempting to utilize ITSP A.  For some reason, even if SP2 is disabled, it will still attempt to subscribe to the MWI feature from Port 5061, causing error messages to show up in the Asterisk Logs.

Physical Interfaces:
   Phone Port
      Phone Port
         OutboundCallRoute:  

If you have a phone line plugged into the Line Port, then no changes are necessary.  By default, the Obi will route 911 calls to the phone line and NOT to your PBX.  If you want to change this behavior, then find the part of this entry that reads:

{(<#:>|911:li}

and change it to

{(<#:>|911:sp1}

or just delete {(<#:>|911:li} from the OutboundCallRoute altogether.

This will route 911 calls through the Asterisk PBX instead of routing it directly to the Line Port.

         Primary Line:  SP1 Service
      Calling Features:  
         StarCodeProfile:  None
User Settings:
   Speed Dials:

Note:  The information below, regarding speed dials, appears to no longer be necessary.  Obi probably fixed this in a firmware update.

By default, the OBI 110 uses all two digit #s between 1 and 99 as speed dials.  If you want to use two digit extension numbers and/or you want to use 70 as the transfer destination for parking lots and 71-79 as the way to pick-up parking lots, you'll need to create speed dial entries mapping each of these to themselves.  In other words, in the area for speed dial 70, type in 70.  In the area for speed dial 71, type in 71, and so on.

3.  Set-up the Obi 110 as an FXO Port (i.e., to allow you to connect a phone line to the LINE port and then make and receive calls on it using your PBX):

Service Providers
   ITSP Profile B
      SIP
         SIP
            Proxy Server:  YOURPBXIPADDRESS
            X_SpoofCallerID:  Checked

Note:  It is not clear to me that the X_SpoofCallerID setting is necessary, but the phone I currently use does not have Caller ID so I can't test it.

            X_AccessList:  YOURPBXIPADDRESS

Voice Services
   SP2 Service
      SP2 Service
         X-ServProvProfile:  B
         X_InboundCallRoute:  LI
      SIP Credentials:
         AuthUserName: OBITRUNK1
         AuthPassword:  FXOPASSWORD

Note:  the AuthUserName should NOT be your phone number.  It must match with the trunk name used when you set-up the trunk in FreePBX.
         
Physical Interfaces
   Line Port
      Line Port
         InboundCallRoute:  SP2(2125551212)

Note:  Change 2125551212 to the phone number of the line that will be attached to your LINE port.

         RingDelay:  3500

This is how long the Obi 110 will allow the phone to ring before giving up on waiting for Caller ID.  If the Obi 110 gets a Caller ID signal during this period, it immediately puts the call through.  If you do not have Caller ID, you may wish to set this to 0.

         DialDelay:  1000

Note:  My POTS line can sometimes take longer to pull a dial tone because I have an alarm on it.  You may not need to change this figure from the default.

         DialDigitOnTime:  50
         DialDigitOffTime:  50

Note:  You don't need to change the above two settings either, but your calls will go out faster if you do.

      PSTN Disconnect Detection:
         SilenceTimeThreshold:  600

Note:  The above increases the amount of time that the Obi will wait to disconnect a call if it hears silence.  600 equals ten minutes.  You may not want to change the default.

      Port Settings:
         ACImpedance: 600

Note:  You may need to change this to eliminate echo problems.  Good luck!

         ChannelTXGain:  0
         ChannelRXGain: 5

Note:  You don't need to change the above, but if you experience echo, you might want to reduce one or both of them.

4.  Set-up a Trunk in FreePBX:

   Now, you need to tell FreePBX how to make and receive calls from the Obi 110's connected line.  You start by creating a trunk:

Trunk Name:  Obitrunk1
Outbound Caller ID:  2125551212

Note:  Change 2125551212 to whatever your outbound Caller ID actually is.   This setting doesn't actually change your Caller ID, but it may be used in FreePBX's Call Detail Records.

Maximum Channels:  Blank

Dialed Number Manipulation Rules:
18005558355+411|

Note:  The Dialed Number Manipulation Rule above isn't necessary, but I use it to prevent users from dialing 411.

Trunk Name:  OBITRUNK1

Note:  The Trunk Name above (the second one in FreePBX) must match the AuthUserName that you entered when you set-up the FXO Port in the Obi 110.

Peer Details:

username=OBITRUNK1
secret=FXOPASSWORD
host=dynamic
type=friend
context=from-trunk
qualify=yes
dtmfmode=rfc2833
canreinvite=no
disallow=all
allow=ulaw

Note:  The "username" above must match the Trunk Name and the AuthUserName you entered when you set-up the FXO Port in the Obi 110.

Note:  The secret you enter above must match the AuthPassword you entered when you set-up the FXO Port in the Obi 110.  It does not need to be "FXOPASSWORD".  You can select any password you like.

5.  Set-up an inbound route in FreePBX

   The Inbound Route in FreePBX tells FreePBX how to route calls that ring in to the Obi 110.

Description:  Obi110
DID Number:  2125551212

NOTE:  This must match the number you put in the Obi 110 FXO setup (above) inside the parenthesis in the InboundCallRoute after you entered SP2(.  Normally, it should be the phone number of the line attached to the LINE port of the Obi 110.

CID name prefix:  L1-

NOTE:  You can put whatever you want in the above field.  I like to have L1- to indicate that this call came in on Line 1.

Set Destination:  Ring Group/Extension of Your Choice

6.  Set-up an Outbound Route in FreePBX

81DialsPOTS

Route Name:  81DialsPOTS

Dial Patterns:
81|
81|1NXXNXXXXXX
81|NXXNXXXXXX
81|NXXXXXX
81|X11

Trunk Sequence:  OBITRUNK1

Note:  You can obviously set-up any outbound route you want.  This route allows you to force calls to the Obi device by dialing 81.  The very first line will allow you to get a dial-tone if you dial 81 by itself.  If you don't want that ability, delete line that reads: 81|

If you want to make the dialing code something else, just change 81 wherever it appears to whatever you want it to be (i.e., 081).

Emergency

Route Name:  EMERGENCY
Dial Patterns:
911

Trunk Sequence:  OBITRUNK1

Note:  This route forces emergeny calls, i.e. 911 calls, to go out over the Obi 110.  
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: MichiganTelephone on July 11, 2011, 09:00:29 PM
Not sure why you started another thread on this (did you add something to your original post?), but I posted two articles showing how to do this several months ago:

How to use the Obihai OBi100 or OBi110 VoIP device as a gateway between Asterisk/FreePBX and Google Voice and/or 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/)

How to use the Obihai OBi100 or OBi110 VoIP device as a gateway between Asterisk/FreePBX and Google Voice and/or the OBiTALK network — Part 2: Using the Phone port as an Asterisk extension (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/)

EDIT: And a newer method that's arguably better than what's in the above two posts: 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) (http://michigantelephone.wordpress.com/2012/03/24/how-to-use-the-obihai-obi100-obi110-or-obi202-voip-device-as-a-gateway-between-asteriskf-pbx-and-google-voice-andor-the-obitalk-network-updated/)

Some people may prefer one set of instructions to the other, or may pick up some hints in one that are not in the other.  Thanks for posting yours.

I think the main difference is you suggest using dial prefixes and I'm kind of philosophically opposed to that, figuring that people should be able to dial calls as they always do, and the switch should be smart enough to route the call appropriately.  But, everyone has a different "right" way to do things!

Of course all this has been hashed and rehashed in this (sticky) thread:

Possible to use OBi110 to as an FXO port on an Asterisk server? (http://www.obitalk.com/forum/index.php?topic=57.0)

Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: Ad_Hominem on July 11, 2011, 11:20:09 PM
Michigan! Nice to see you again.  :)

I haven't been able to find a straightforward guide to use the Obi 110 as an FXO/FXS, similar to the way that people used to use the Cisco SPA3102.  So, after consulting with Obi Technical Support, I got mine working and wrote this one.  

My previous guide was for using the Obi 110 as an FXO and Google Voice.  This guide eliminates the routing issue that you didn't like because it simply doesn't use Google Voice at all.  As I explained at the link you provided, the old guide that I wrote gives users the option of just dialing, without using any kind of prefix.  However, it also gives users the option of forcing a call on a particular route using a prefix.  I'm a big believer in giving users and admins options, because they make troubleshooting much easier.

Your article talks about using the Obi as an FXS, but not with a simple extension configuration, which is what I wanted to do.  Also, in using the Obi 110 as an FXS with my cordless phones, I found that it was unable to dial two digit extensions and unable to dial *-feature codes, but I found the solution and included it in this guide.  I don't believe your guide addresses that issue.

Also, you may recall that I found a potential issue with your suggestion of using the LINE DID as the Trunk Name (incoming calls on other SIP trunks with a CID equal to the Obi Trunk name resulted in an Asterisk generated "not in service" type recording instead of being routed according to the inbound route for that DID), and so I continue to use the "OBITRUNK1" trunk designation.  

The Obi 110 is SOOOOOO good at dealing with echo that it just begs to have a guide to set it up the same way that the old SPA3102s were set-up (and we all know that they were AWWWFULLL with echo).  So, here it is.  :)

I'm glad to see that yo're still blogging as well.  Keep up the good work.
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: MichiganTelephone on July 12, 2011, 12:06:22 AM
Ahhh, I get it now (I'm a little slow sometimes)!  In that case this is a GREAT addition to the knowledge base on these devices, and I'm glad you posted it.  And yes, you are absolutely right about the Sipura/Linksys devices and their awful echoecho.  ;D

You're one of two people that have reported issues with using the DID as the Trunk Name (there may be others, of course, but I haven't heard from them) so I amended my article a bit to mention it and suggest using OBITALK1 as an alternative.  So I think we are both borrowing ideas from each other but that's okay, in the end it helps other users get their devices configured.

I'm not back to blogging the way I used to and perhaps never will be, but one thing I haven't mentioned (I don't think) is that I got hit with a pretty nasty skin infection a little over a month ago that among other things caused my feet to swell up like a couple balloons.  It's taken about a month to get it under control, and during most of that time I've felt like I've had about 1/50th my normal energy (a couple of days I actually thought I might be dying, it was that bad).  If you've ever had mono it was a bit like that, but without the jaundice.  So as you can possibly imagine, trying to blog was not only the last thing on my mind, but for a few days there I was actually thinking I might never have the strength or mental acuity to ever do it again.  The infection's mostly gone and my feet are back to normal size, and even the itching and burning has mostly gone away, but my energy levels still haven't come back up to where they were before. So that's one big reason I wasn't around much, for whatever it's worth.

Anyway thanks for the explanation, and sorry if I'm a little dense at times!
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: dirk101 on September 06, 2011, 11:59:05 AM
One thing that I've run into with this setup is it takes forever like 20 or 30 min. before the obi will successfully register with freepbx. This was driving me crazy. it took me a while to just be patient and let it work for a while.

I''m new to asterisk so it may be a setting that I have screwed up but I thought I'd throw this into the mix in case anyone else runs into this problem.

And thanks to Ad_Hominem and MichiganTelephone for doing the heavy lifting on this. When it does finally register it works perfectly.

Derek
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: QBZappy on September 06, 2011, 01:11:27 PM
dirk101,

It is not normal for it to this this long.
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: dirk101 on September 06, 2011, 01:28:31 PM
I should hope not  :)

Right after I read that I saw the post about SIP registration problems.
http://www.obitalk.com/forum/index.php?topic=33.0 (http://www.obitalk.com/forum/index.php?topic=33.0)

I have a Dlink router and I checked. It does have the SIP-ALG enabled. I don't know if that would cause problems for me locally though. I will say though that I gave up trying to register my voip.ms accounts as SIP. I ended up using IAX and they worked perfectly.  I probably have one of the 10,000 settings in freepbx screwed up but it's working great right now so until it breaks I'm not touching it!

Derek
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: dirk101 on September 12, 2011, 05:54:51 AM
I wanted to add this to the thread in case someone is searching this out. I hope it's appropriate.
I have Groundwire on my iPhone and I wanted to enable TCP for registration in order to save battery life. I went into  FreePBX, Asterisk SIP settings and added the following two items to "Other SIP Settings"
tcpenable=yes
transport=udp,tcp

This worked great until the OBI went to re-register and it threw out an error. I went into the OBI trunk and added:
transport=udp
to the peer section and all is well. Not sure if this is the right way to do it but it accomplished what I wanted to do.

Derek
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: ws2000 on November 12, 2011, 10:12:31 PM
Hello

I followed this process and had very good success with it.  Big THANKS!  My question is about voice mail notifications.  I have my PBX using Google Voice Mail to answer my missed calls.  I got tired of fighting it and decided to use it since it jumped in from time to time when I didn't want it.  What is the best way to get missed call voice mail notification with POTS phones?  I can not get the message light or the double dial tone ring to work on my Panasonic DECT 6.0 phones.  I would love to hear what others are doing. 
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: Ad_Hominem on March 14, 2012, 04:39:47 PM
I've made some updates to these instructions, including adding information about how to specify the dialing delay and how to decide whether 911 calls are routed directly to the FXO (bypassing your PBX) or to force 911 calls to go through the PBX.
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: MichiganTelephone on March 27, 2012, 09:22:26 AM
Quote from: Ad_Hominem on March 14, 2012, 04:39:47 PM
I've made some updates to these instructions, including adding information about how to specify the dialing delay and how to decide whether 911 calls are routed directly to the FXO (bypassing your PBX) or to force 911 calls to go through the PBX.

I was looking at your information again and realized there is one error that could prevent this from working if an inexperienced user doesn't know any better — you have no "context=from-trunk" or similar statement in your Peer Details.  Without a context statement, Asterisk has no idea what to do with the calls.  It might still work if you allow anonymous inbound SIP calls (I doubt it, but if it works for you, that's probably why) but I don't do that.

I've developed a new method (http://michigantelephone.wordpress.com/2012/03/24/how-to-use-the-obihai-obi100-obi110-or-obi202-voip-device-as-a-gateway-between-asteriskf-pbx-and-google-voice-andor-the-obitalk-network-updated/) that does not require using one of the Service Provider accounts to send calls to and from Asterisk (it uses a Voice Gateway rather than a Service Provider), and that (for Google Voice accounts, anyway) is easier to set up, at least in my opinion.  The downside is that you have to do a little extra work if you try to use it with something other than Google Voice and you want to get the Caller ID name from the device.  Since Google Voice doesn't send a Caller ID name anyway, that's not an issue for Google Voice users.

Anyway, my new approach still requires that at least one of your Service Providers be configured to use a SIP service (not Google Voice, else the Voice Gateway won't work in this application) but you can make it an extension off your Asterisk server and that qualifies, and that extension can be configured like a normal extension (no piggybacking on a trunk, as in one of my earlier approaches) which means that certain features such as Voicemail Message Indication still work.  The Voice Gateway won't pass a Caller ID name at this time (there's no exposed system variable that I can get it from) but by running a small AGI script you can scrape the device's web interface once when a call comes in and grab the caller name from there.  So it's possibly a bit simpler if you're only using it for Google Voice, and maybe about the same level of complexity if you are using it to get calls from the OBiTALK network or the LINE port on an OBi110.  When you get a chance you might want to take a look and see what you think.
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: Ad_Hominem on March 28, 2012, 11:54:49 PM
Michigan,

I have no idea why context=from-trunk did not appear in my original instructions, as I have that in my own trunk settings and in my "internal" documentation.  I've corrected it.  Thank you for bringing that to my attention.

Since I subscribe to your blog, I was notified when you posted the idea of using a voice gateway to handle FXO calls and creating a SIP URI trunk in FreePBX to handle outgoing calls, and I was intrigued.  I suspect that many users (myself included) only have an FXO for emergency calling and to keep my longstanding phone number tied to a provider that has no risk of going out of business.  In fact, I receive no incoming calls at all on my FXO because they all forward to VOIP provider instead.  I use the FXO for local outbound and 911 calls only, and so I'd simply ignore the Caller ID related issues.  Attempting to integrate your instructions into mine is on my list of things to do!  :)

Along those same lines, I urge you to take a close look at the modifications that I've made to the instructions recently, particularly regarding the digit map's handling of 911 calls, the dial plan, the use of X_UseRefer, and the means to enable message waiting, and to incorporate those into your instructions as well.

Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: Ad_Hominem on March 29, 2012, 12:04:02 AM
I'd like to add one other thing that most users may want to consider.  There's really NO reason to configure the FXO port on the Obi 110 to register with your PBX.  Registration is needed when you don't have a fixed IP address, and so the device needs to register with your PBX so that your PBX knows what that address is.  If you've followed my instructions, your Obi 110 device WILL have a fixed IP address.  Furthermore, when registration is ENABLED, there may be times that calls won't be able to get through (for example, if you reboot the PBX or your Obi, there will be a period of time where the Obi is not registered and is waiting for the retry period to elapse).  If you disable registration, all calls will be sent through immediately.  Registration is different than authentication.  As Michigan has noted in his instructions, the Obi NEVER authenticates, but you can limit any risk by using the X_AccessList field.

If you prefer NOT to use registration make the following changes to my instructions:

1.  In the FreePBX PEER Details for the trunk, change:

host=dynamic

to

host=192.168.1.50

(where 192.168.1.50 is the IP of your Obi 110)

and then add

port=5061

at the end of the PEER details.

The change to host is needed because without registration, the PBX needs to know where to find the Obi 110 device.  The port entry is needed so that the PBX knows which port to expect calls from and which port to send calls to.  Normally, that information would be sent during registration, but since we're not registering anymore, you need to tell FreePBX and Asterisk which port to use manually.  Note that if you have your FXO set up as SP1 (rather than SP2 as my instructions suggest), you would use port=5060.

2.  In the Obi Configuration screen

Voice Services
   SP2 Service
      SP2 Service
         X_Register Enable:  (Uncheck)

This change is needed to tell the Obi device not to attempt to register.

Once again, I'd like to thank Michigan, who gave me necessary ideas for this method to work in his latest articles (which avoid registering an FXO at all by using Voice Gateways and SIP dialing).
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: MichiganTelephone on April 01, 2012, 02:58:44 AM
Quote from: Ad_Hominem on March 28, 2012, 11:54:49 PM
Michigan,

I have no idea why context=from-trunk did not appear in my original instructions, as I have that in my own trunk settings and in my "internal" documentation.  I've corrected it.  Thank you for bringing that to my attention.

You're quite welcome.  Can't begin to tell you how many times I've done things like that.

Quote from: Ad_Hominem on March 28, 2012, 11:54:49 PMSince I subscribe to your blog, I was notified when you posted the idea of using a voice gateway to handle FXO calls and creating a SIP URI trunk in FreePBX to handle outgoing calls, and I was intrigued.  I suspect that many users (myself included) only have an FXO for emergency calling and to keep my longstanding phone number tied to a provider that has no risk of going out of business.  In fact, I receive no incoming calls at all on my FXO because they all forward to VOIP provider instead.  I use the FXO for local outbound and 911 calls only, and so I'd simply ignore the Caller ID related issues.  Attempting to integrate your instructions into mine is on my list of things to do!  :)

Well, just so you know, there actually IS a way to get the OBi to give up the Caller ID name, but you have to use a Perl AGI script (could be rewritten in PHP, I suppose, but I don't know PHP).  The script scrapes the web interface and pulls the name out of that.  I added the details as an addendum to the article.

Quote from: Ad_Hominem on March 28, 2012, 11:54:49 PMAlong those same lines, I urge you to take a close look at the modifications that I've made to the instructions recently, particularly regarding the digit map's handling of 911 calls, the dial plan, the use of X_UseRefer, and the means to enable message waiting, and to incorporate those into your instructions as well.

I don't really get much into dial plans; those aren't exactly my strong point.  But I did try your use of X_UseRefer, and unfortunately, at least on our system it didn't work well at all.  If I left it unchecked, it was as you said, you can use the OBi to transfer a call, but then you have no channels left to place another call — and this was on an OBi202.  And this apparently happens whether you use *98 to transfer, or simply flash, place a call to the desired extension, and hang up, or if you actually do a three way call and then drop out of the connection.  In any of those cases, until the other party stops talking, when you try to place another call, you get "There is no service available to complete this call"!  So you are correct about that.

However, when I tried using X_UseRefer, for whatever reason it just didn't work as it should have.  What would happen is that the original caller (the one I was trying to transfer) would go directly to voicemail.  If the other intended transferee was on the line (because I had done a three-way call), the act of hanging up would cause them to be disconnected, and the caller would go to voicemail.  If I tried to do *98 or flash, dial the other extension and hang up, the original caller got transferred to voicemail, got a busy signal, or got sent to a different extension in the same ring group.  Note that in all cases these tests were done using three extensions off the same Asterisk server.  There was simply no way I could successfully transfer a call to the intended extension with X_UseRefer checked.

I do not know if this is a problem with the OBi, with FreePBX, or with Asterisk (wouldn't surprise me at all if it's one of the latter two — the box I was testing it on has FreePBX 2.9 and Asterisk 1.8.7.1).  But since I couldn't get it to work after quite a few tests, I don't think I'm going to recommend it, at least until the problem is fixed.

Believe me, I wish it did work to solve the problem you mentioned.  Personally, I always use ## to transfer a call in Asterisk (which bypasses the VoIP device altogether) but still it seems like this should work better than it does.

EDIT:  What's even stranger is that I tried doing a transfer using the Zoiper softphone program, and it worked fine (and I could shut Zoiper down once the transfer button had been clicked, and the call continued, so it wasn't being bridged through Zoiper).  So maybe Obihai should try to figure out how Zoiper is doing a call transfer, and attempt to emulate that.  I have no idea what they are doing differently.

EDIT 2: I've also started a thread on this in the PBX in a Flash forum (http://pbxinaflash.com/community/index.php?threads/any-obihai-users-feel-like-trying-to-help-figure-out-call-transfer-issue.12771/) in the hope that perhaps someone there with more expertise than I can help nail down the exact source of the problem.  I don't want to say it's a problem with the OBi device if it's really Asterisk that's at fault or vise versa, and I'm personally at a loss to figure out why this wouldn't work in my testing.
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: Stewart on April 01, 2012, 07:58:18 PM
Turning off ReferAOR might help.

Though I know very little about Asterisk, you may find a clue by comparing the behavior of the Obi (using SIP Debug) with Zoiper (running Wireshark on the Zoiper PC).  Asterisk's log may also show an error or other useful info.

Linksys ATAs (with recent firmware) do handle call transfer properly with Asterisk-based providers such as Future-Nine and VoIP.ms.  If you have one, testing it on your FreePBX may help determine at which end the problem lies.  To be able to transfer after establishing a three-way call, set Xfer When Hangup Conf.
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: Ad_Hominem on April 01, 2012, 09:53:54 PM
UPDATE:  It seems that the way OBI handles X_UseRefer is a bug.  One of you beta testers should bring it to their attention.  I've sent an email to Obi support to alert them to the issue.

------------

Forget the UseRefer option.  Leave it unchecked.  Change the MaxSessions in the SP for the FXS to something higher.  I changed it to 99, and now the Obi will forward a call (just like any other endpoint) and still let me make and receive other calls.

If you want to use the UseRefer, you have to understand how it works.  

1.  Place or receive the first call.
2.  Hit Flash.
3.  Dial the second call.  The second person will receive a call from the ATA.
4.  Hang-up.  The call from the ATA to the second caller will end.
5.  The Obi will send a REFER message and the original call will be re-routed to the second caller.
6.  The second person will receive the referred call, i.e. a new call from the original caller.  
7.  Since this all happens very quickly, you may be occupying more than 1 channel on the second person's endpoint, and if they can only handle one, then the call in step #6 will reach voicemail.

Note that if, in step #4, you hit flash instead, you'll be in a conference.  If you then hang-up before the first party (i.e., the party you called in step 1) hangs-up, the REFER message will get sent and steps 5 and 6 will occur anyway.

Since these effects are a bit kludgy and unintended, I recommend that you use the new method of allowing the OBI to handle the transfer and increasing the maximum number of channels it can handle at once using the MaxSessions option in the Service Provider configuration.  I've updated my instructions, above, to change this setting to 10, which is an arbitrary number that should meet most people's needs.
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: MichiganTelephone on April 01, 2012, 10:04:53 PM
Quote from: Ad_Hominem on April 01, 2012, 09:53:54 PM
Forget the UseRefer option.  Leave it unchecked.  Change the MaxSessions in the SP for the FXS to something higher.  I changed it to 99, and now the Obi will forward a call (just like any other endpoint) and still let me make and receive other calls.

If you want to use the UseRefer, you have to understand how it works.  

1.  Place or receive the first call.
2.  Hit Flash.
3.  Dial the second call.  The second person will receive a call from the ATA.
4.  Hang-up.  The call from the ATA to the second caller will end.
5.  The Obi will send a REFER message and the original call will be re-routed to the second caller.
6.  The second person will receive the referred call, i.e. a new call from the original caller.  
7.  Since this all happens very quickly, you may be occupying more than 1 channel on the second person's endpoint, and if they can only handle one, then the call in step #6 will reach voicemail.

Note that if, in step #4, you hit flash instead, you'll be in a conference.  If you then hang-up before the first party (i.e., the party you called in step 1) hangs-up, the REFER message will get sent and steps 5 and 6 will occur anyway.

Since these effects are a bit kludgy and unintended, I recommend that you use the new method of allowing the OBI to handle the transfer and increasing the maximum number of channels it can handle at once using the MaxSessions option in the Service Provider configuration.  I've updated my instructions, above, to change this setting to 10, which is an arbitrary number that should meet most people's needs.

Okay, that's freaky, I was working on this at exactly the same time you were, testing some of your earlier messages (that you deleted JUST as I was about to reply). :P But I came to the same conclusion you did — X_UseRefer just isn't going to work the way you expect, but upping the MaxSessions to 10 (which is exactly the value I used also) at least makes it so that when you have a transferred call running through your device, you won't be prevented from making more calls.  This, of course, assumes that your PBX isn't limiting the number of simultaneous calls per account to some unreasonably low value.

EDIT:  This still means that transferred calls are going through the Obihai device, rather than being sent back to Asterisk.  What sort of complicates things is that the Obihai can do transfers that might be impossible using Asterisk alone - prime example, someone could call you via the OBiTALK network and you could then transfer them to a number that you can call via the Asterisk server.  But still, when a transfer takes place that would use two call legs to the same service provider, the Obihai should be able to do a proper transfer, as Zoiper does (and, I am told, certain other bands of VoIP adapter do).  It probably doesn't matter as much when the Obihai and the Asterisk server are on the same local network, but if the Obihai is at some remote location and the user has sub-optimal broadband service, then it could make a huge difference in call quality.
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: MichiganTelephone on April 01, 2012, 11:21:31 PM
Quote from: Stewart on April 01, 2012, 07:58:18 PMTurning off ReferAOR might help.

I tried that last night.  Doesn't help

Quote from: Stewart on April 01, 2012, 07:58:18 PMThough I know very little about Asterisk, you may find a clue by comparing the behavior of the Obi (using SIP Debug) with Zoiper (running Wireshark on the Zoiper PC).  Asterisk's log may also show an error or other useful info.

I know there are some people who can look at Asterisk log files and glean useful information out of them, but I've only rarely ever found them useful, mostly because looking for anything in them is like looking for the proverbial needle in the haystack.  Wireshark is another thing that's way too complicated to set up and use unless you do it frequently.  These are things that someone might be able to use to figure out what the difference is, but unfortunately I'm not one of those people.  I did try to look at the Asterisk CLI outputs to see if I could figure out anything from those, but it was hopeless.
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: Stewart on April 02, 2012, 01:38:35 AM
Though I've not tried on the OBi, my IP phones (Polycom and Aastra) have no problem with transfers on a free PBXes account.  The phones use SIP Refer to transfer; PBXes uses Asterisk.

Try your OBi on PBXes; if it fails, sending a comparison to the Obihai folks may help them fix the bug.  If it works, comparing the respective OBi SIP Debug and syslog outputs should show what your Asterisk is doing wrong.
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: DocM on April 03, 2012, 04:48:55 PM
Ad_Hominem, your digitmap rocks. I never knew about S functions.

My personal system is a combination of your tutorial and MichiganTelephones. Everything works except for the CDR :( and flash... :'(

One thing that has confused me for the longest time is how your setup would distinguish between calls from the trunk and calls made via the FXS port without customizing your context? I would think calls made from the FXS port needs to be routed to from-internal and instead of from-trunk.
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: Ad_Hominem on April 06, 2012, 09:55:40 PM
I think you may have missed step 2.a. in my instructions.  The FXS port isn't routed to the trunk.  It is routed to an extension in FreePBX.

In fairness to you, step 2.a. used to be just be the first sentence in Step 2.  I've broken down step 2 into a. and b. to clarify that you have to create an extension in your PBX before you set-up the Obi to act as an FXS on it.

I learned about the S# option from Obi support.  I really like being able to dial x11 or 1xxxxxxxxxx and have the call go out immediately, and it increases the wife acceptance factor as well...


Quote from: DocM on April 03, 2012, 04:48:55 PM
Ad_Hominem, your digitmap rocks. I never knew about S functions.

My personal system is a combination of your tutorial and MichiganTelephones. Everything works except for the CDR :( and flash... :'(

One thing that has confused me for the longest time is how your setup would distinguish between calls from the trunk and calls made via the FXS port without customizing your context? I would think calls made from the FXS port needs to be routed to from-internal and instead of from-trunk.
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: Ad_Hominem on April 06, 2012, 10:05:52 PM
It appears that the X_UseRefer option should solve the call transfer issue.  When enabled, the Obi should transfer Call #1 to Call #2.  However, instead, the Obi creates a Call #3 (to the identical destination as Call #2), refers call #1 to Call #3, and then drops call #2.  This is not how SIP Refer should work (at least, it isn't how my Aastra phones do it).

I've reported the bug to Obi.

Michigan- since you're an official beta tester, you might wish to do the same.
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: MichiganTelephone on April 09, 2012, 08:03:20 AM
Quote from: Ad_Hominem on April 01, 2012, 09:53:54 PMUPDATE:  It seems that the way OBI handles X_UseRefer is a bug.  One of you beta testers should bring it to their attention.  I've sent an email to Obi support to alert them to the issue.

I have also, but for some reason they can't duplicate the behavior on their setup.  That may mean that there is a bug in the way Asterisk handles REFER packets in some cases.  Unfortunately it is far too common for Asterisk to change its behavior in significant ways between versions.  I just got bit by this — I discovered that using my new method the correct caller number was not being shown in the CDR records (it was showing the trunk name instead), even though it was being delivered to the phone.  Turns out that in Asterisk 1.8 and later the number used in the CDR records is apparently CALLERID(ani) rather than CALLERID(num), which is a change from previous versions — and even though someone provided a patch to fix it (https://issues.asterisk.org/jira/browse/ASTERISK-18699), the Asterisk folks won't do that because, well, just because.  I had to update my instructions to take this into account.

Unfortunately I am not a SIP expert so I have no way to tell what's really causing the problem here.  As I noted, I do not have the issue when using the Zoiper softphone.  I'm not sure what they are doing differently.  I just wish developers would realize that sometimes you have to yield a bit and not be so pedantic about standards if you want your equipment to work in the real world.  It does no good to say "I'm following the standards properly" if something that you (or your customers) want to connect to is not.  But all that said, absent any evidence to the contrary, I'd be much more inclined to believe the problem is with Asterisk than with the Obihai, since Asterisk commonly breaks things from version to version (one of the reasons I keep hoping that one of the GUI's for FreeSWITCH will actually become usable at some point—I am soooo sick of Asterisk's quirks).

Quote from: Ad_Hominem on April 01, 2012, 09:53:54 PMSince these effects are a bit kludgy and unintended, I recommend that you use the new method of allowing the OBI to handle the transfer and increasing the maximum number of channels it can handle at once using the MaxSessions option in the Service Provider configuration.  I've updated my instructions, above, to change this setting to 10, which is an arbitrary number that should meet most people's needs.

Yep, that works, and it's an acceptable solution if your device is on a fast local network and your Asterisk server is on the same network.  It's not such a great solution if the device is at a remote location and they have limited or usage-capped bandwidth.  I only wish Obihai could duplicate this issue on their test server so they could see what you and I are seeing.  EDIT:  They've got the problem mostly resolved in beta firmware — see my second post after this one.
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: MichiganTelephone on April 09, 2012, 08:09:54 AM
Quote from: DocM on April 03, 2012, 04:48:55 PM
Ad_Hominem, your digitmap rocks. I never knew about S functions.

My personal system is a combination of your tutorial and MichiganTelephones. Everything works except for the CDR :( and flash... :'(

See my previous post — your CDR issue is likely the same one that bit me.  The solution is that in the [custom-from-Obihai] context, right after the first line, which should be...
exten => _X!,1,Set(CALLERID(num)=${CUT(EXTEN,/,2)})
...insert this line:
exten => _X!,n,Set(CALLERID(ani)=${CALLERID(num)})

Hopefully that will fix your CDR issue.  It took me THREE HOURS to figure this out, and all because Asterisk changed something in Asterisk 1.8 and refuses to fix it even though a user graciously provided a patch!  So this is really a workaround that should not be necessary, but it does appear to solve the problem.
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: MichiganTelephone on April 09, 2012, 10:53:02 AM
UPDATE:  Obihai support IS working on the X_UseRefer issue — they just pushed out a beta firmware for me to test on my OBi202, which appears to fix the problem as long as you don't use *98 to transfer.  In other words, if you flash, dial the number you want to transfer the call to, and when ringing commences you hang up, it works.  If you flash, dial the number you want to transfer the call to, wait for the called party to answer, maybe talk a bit to explain why you are transferring the call, and then hang up, it works.  If you flash, dial the number you want to transfer the call to, wait for the called party to answer, flash again to have a three-way call, and then hang up, the original caller gets transferred to the other party on the three way call but my OBi202 drops out of the conversation.  :)  :)  :)

The only way it does NOT work is if you flash, dial *98 and the number you want to transfer the call to. If you do that, the call disconnects.  My suspicion is that the OBi may be dropping out of the call before Asterisk has a chance to complete the transfer, based on what I've seen on the Asterisk CLI, but I might be wrong about that.  Anyway, I've let Obihai Support know that they have the problem mostly solved, and I suspect they might want to take a stab at fixing the *98 issue, but even if they don't, this is a huge improvement and hopefully it will make its way into the general firmware updates at some point in the near future.  Thanks to Obihai Support for looking into this, and with any luck this will be completely resolved by the time the OBi202's start shipping (which I am told should happen next week).  Of course, I would hope the fix will also be included with the next OBi1x0 firmware release as well.
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: Ad_Hominem on May 15, 2012, 05:47:46 PM
Note: Obi has released an updated firmware that corrects the X_UseRefer bug.  So, I've added a section encouraging users to update to the latest firmware and I've also added back the instruction to enable X_UseRefer.
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: loonsailor on September 21, 2012, 04:52:31 PM
Thanks very much for providing this guide.  I've followed it, but not with complete success.  My obi110 (firmware 1.3.0 build 2721) works fine as an asterisk trunk but only works partially as an extension.  I can call the extension, and it works fine, but I have limited dialing ability from the phone on the obi110 FXS port.  From it, I can dial out using the 1xxxxxxxxxx dial plan, but that's all I can do.  I can't call another asterisk extension (three digits on my system), or use *codes, or use different trunks that I've set up with an asterisk prefix.  Furthermore, when I do dial an outgoing call using 1..., it doesn't show up in my freepbx call log.

I've tried the digitmap suggested here, and the default, but neither allows me to dial another extension.  When I try, I get about a 5 second pause, one single ring, another long pause, then a voice message that the number I just dialed is invalid.  I'm not sure whether that message comes from the obi, or asterisk, or the trunk.

Any ideas?

Thanks, in advance, for any help.
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: zapattack on October 03, 2012, 04:08:40 PM
You have just described the exact same failure that my new 110 exhibits when dialing specific numbers
on the PSTN.
6043252011 is a 1000Hz test tone that answers and sends tone immediately in my local switch.
6043252091 is a 2-way test line that answers after about 1 second and sends a brief tone.
Neither line sends Ring Back Tone before connecting using #604325xxxx.

However, if I dial **86043252011 on the 110, I get a pause, 1 ring and then a PSTN time-out recording,
so the 110 has not successfuly connected.
But, if I dial **86043252091 I get a single Obi ring followed by connection to the test line.
Why is the 110 inserting a ring and why does it not connect immediately to either line?
Using updated software with no digit map modifications.
The only difference between the 2 numbers is speed of answer supervision.
****Answer. On the Line Port page there is a Detect Outbound Connect Method. If set to 'Assume connected after a short delay' it introduces the one ring. Detect Polarity Reversal, Detectect Speech, or None have no tone. Also note: on the ObiTalk Dashboard Expert configuration, the Assume option is missing.
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: greenhornet on March 05, 2013, 12:26:43 PM
Any Ideas on why my caller ID would not be working on this setup?  I can see caller ID on a phone connected to the phone port as well as on the obi call history portal.  I know it's being passed and OBI is seeing it.  I replaced a dead SPA3000 with the OBI and previously had caller ID working this way.  FreePBX had no problems showing it.  I have tried adjusting the ring delay.  Not that it matters, since i can see the ID on an attached phone.
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: greenhornet on March 19, 2013, 02:18:10 PM
No one has any caller ID suggestions?  OBI support referred me to the forums on this problem.  Their words, "Please post your question in our forum.  Other members who has done this can help you in there."
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: philc on March 27, 2013, 08:55:11 PM
Quote from: greenhornet on March 05, 2013, 12:26:43 PM
Any Ideas on why my caller ID would not be working on this setup?  I can see caller ID on a phone connected to the phone port as well as on the obi call history portal.  I know it's being passed and OBI is seeing it.  I replaced a dead SPA3000 with the OBI and previously had caller ID working this way.  FreePBX had no problems showing it.  I have tried adjusting the ring delay.  Not that it matters, since i can see the ID on an attached phone.

I'm assuming you followed the directions for setting this up using the OP's method?  I can say that using his setup I have personally successfully got my Cisco SPA525G phone up and running with full caller ID (name & number).

Have you looked at the FreePBX logs?  I can see Caller ID information for incoming calls clearly laid out in the logs.  You may need to increase the FreePBX verbosity if you don't see enough info.

The challenge with these setups is the number of moving parts; specifically the OBI device, FreePBX, and the phone.  Determining where the failure is occurring is very helpful.  You have at least somewhat ruled out the OBI device.  Next stop is getting your arms around FreePBX operation.

Good luck,

Phil
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: philc on March 27, 2013, 10:03:28 PM
As I mentioned in my previous post, I have had great success setting up a Cisco SPA525G phone with an OBI 110 and FreePBX.  I considered the various methods suggested by Michigan Telephone as well, but in the end decided to go with Ad Hominem's approach.  Although I liked the cleanliness of using the Custom Trunk in MT's prescription, my desire to preserve caller ID name information I am receiving from my POTS line was a key requirement.

Once you get the hang of configuring FreePBX the ease and control of using prefixed "codes" (Step 6) really shines.  I even went one step further and added a dial rule ("222" in my case) to allow for tapping into an active POTS line on the OBI device FXO.  This was accomplished by adding another prefix ("87" in my case) to the 222 causing 87222 to be issued to the OBI device.  I then added  "{>(<87222:>):li}" to the X_InboundCallRoute in the SP2 service parameter.  The FreePBX logs were very useful in showing how the numbers get added and stripped along the way.  This is with the added dimension of running FreePBX in VirtualBox on Windows 7 (I used that to great effect when "moving" FreePBX to a different machine.  I didn't even need to change the FreePBX network configuration since the MAC address came along with Virtual Box...same IP address, etc.).

Fwiw, I went one step further and hooked up 2 OBI 110's in this fashion which was simply a repeat of the basic configuration.  As a result, I have 2 POTS lines and 2 GV lines all accessible on my 5 line phone (yes, 1 line is empty).  Pretty sweet I would say.

So all in all a big thank you to Ad Hominem, Michigan Telephone, and others for allowing me to get this to work!  The collective insight provided really made this possible.

I do have one remaining issue that I have not been able to overcome yet.  I cannot get Call Waiting (much less CW ID) to function.  Specifically, I can hear the beep when someone is calling while I'm on the line (no surprise since that is Switch generated), but I can't seem to identify a method to send a hook flash signal through FreePBX to OBI.  There doesn't even appear to be a button the Cisco phone for this purpose.  Any ideas on how I might solve this would be appreciated.

Thanks,

Phil
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: zapattack on April 01, 2013, 10:54:54 PM
SPA525 will probably present a Soft Key to transfer to second call.
Check the screen.
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: Mattak on April 11, 2013, 06:57:49 AM
Thank you so much for this guide! It is exactly what I wanted to use the Obi 110 for!

I'm having a few other issues though. I wonder if you guys can help?

1: It seems like there is a small issue with the Obi hanging up a call through PSTN.

If I make a call into the Obi from my mobile it rings and I can answer through where ever I have routed the call through asterisk. If I then hang up the call locally the call goes silent on the mobile but it still shows as connected. If I then try to dial out locally I just get connected to the same call and I hear asterisk trying to dial numbers in my mobile.

The strange thing is that on the Obi110 web page, after hanging up locally, the line port status shows as "On Hook" and call status shows 0 active calls.

It seems like the Obi110 or asterisk is failing to tell the PSTN that the call has ended and I would be relying on the incoming caller to hangup to end the call.

Any ideas?


2: I am unsure which settings to fiddle with to change the timings. Currently it takes 3 rings on my mobile before anything shows up in asterisk and a local phone starts ringing. It also seems to take a long time (around 9 seconds) to actually dial out from an analogue phone connected to the Obi110 to asterisk then back out the Obi110 to the PSTN.


3: I am in London in the UK and was wondering if anyone knows if there is a page that shows all the local tone settings and other defaults that are specific for the UK.


Thanks in advance! Keep up the great work!

Mattak

Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: jaabello1 on March 06, 2014, 06:16:18 PM
Hi,

I have set up the OBI110 according to this explanation and it worked, but I want to know if i can use the OBI110 POTS to forward a call from an asterisk extension to an external number.

I mean, I route the inbound call from the PSTN line to asterisk, there, an IVR answers the phone, and if the extension doesn't answer, I want to forward the call to an external number, but using the OBI110 as the trunk.

Is it possible?

I'm getting this error "Dial failed for some reason with DIALSTATUS = CONGESTION and HANGUPCAUSE = 34"

thanks
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: drgeoff on March 08, 2014, 03:35:35 PM
1.  If you mean an incoming PSTN call (on the OBi110 LINE port) being forwarded to an external number going out on the same OBi110 LINE port, then no that isn't possible.  A PSTN line doesn't support that, nor does the OBi110.

2.  If you mean an incoming PSTN  call (on the OBi110 LINEport) being forwarded to an external number going out via the OBi110 to an ITSP or the OBiTALK network, then yes that should be possible in principle (but maybe not with the described configuration?).  But is there a good reason for not going out directly from Asterisk to the ITSP?
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: ptsnandgv on March 11, 2014, 04:54:03 PM
I'm having this issue from above:

2: I am unsure which settings to fiddle with to change the timings. Currently it takes 3 rings on my mobile before anything shows up in asterisk and a local phone starts ringing. It also seems to take a long time (around 9 seconds) to actually dial out from an analogue phone connected to the Obi110 to asterisk then back out the Obi110 to the PSTN.


I can see the Call 'connect' on the mobile, the timer starts, I still hear extra rings, these rings are now being routed to FreePBX.

If I navigate to OBI while I am calling from mole, I can see it register on the OBI..it seems like the OBI is waiting for CID information before it processes the call into the PBX (or putting it into the 'second' line)...
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: Ad_Hominem on August 15, 2014, 10:24:01 PM
Sorry it took me so long to reply to this message.  Obi is apparently not notifying me of updates to this thread.

Q1:  The behavior you describe is a normal feature of an analog telephone line when handling an incoming call.  If you receive an incoming telephone call on an analog phone line (from anywhere) and you then hang-up, it takes between 10 and 15 seconds before the phone company will disconnect the call.  If the caller hangs-up, the call will disconnect almost immediately.  This delay does NOT apply if you place a call from an analog line to someone else.  It only occurs on incoming calls.

This same problem would occur if you hooked up a standard telephone to your phone line, received a call, and then hung-up.  If you pick up 5-10 seconds later, the call will still be there.  That's just the way analog phone lines work.

Q2:  I suspect you don't have Caller ID on your phone line.  If that's the case, you need to modify the settings per the instructions to shorten the delay period where the system waits for CallerID.  Change RingDelay=3500 to RingDelay=0.  If that doesn't work, try 1, or 100..

Q3:  For the Obi, I don't.  For Asterisk, that's in indications.conf.  The tones you hear are generated in many different places, depending upon whether the call has answered. 

Quote from: Mattak on April 11, 2013, 06:57:49 AM
Thank you so much for this guide! It is exactly what I wanted to use the Obi 110 for!


I'm having a few other issues though. I wonder if you guys can help?

1: It seems like there is a small issue with the Obi hanging up a call through PSTN.

If I make a call into the Obi from my mobile it rings and I can answer through where ever I have routed the call through asterisk. If I then hang up the call locally the call goes silent on the mobile but it still shows as connected. If I then try to dial out locally I just get connected to the same call and I hear asterisk trying to dial numbers in my mobile.

The strange thing is that on the Obi110 web page, after hanging up locally, the line port status shows as "On Hook" and call status shows 0 active calls.

It seems like the Obi110 or asterisk is failing to tell the PSTN that the call has ended and I would be relying on the incoming caller to hangup to end the call.

Any ideas?


2: I am unsure which settings to fiddle with to change the timings. Currently it takes 3 rings on my mobile before anything shows up in asterisk and a local phone starts ringing. It also seems to take a long time (around 9 seconds) to actually dial out from an analogue phone connected to the Obi110 to asterisk then back out the Obi110 to the PSTN.


3: I am in London in the UK and was wondering if anyone knows if there is a page that shows all the local tone settings and other defaults that are specific for the UK.


Thanks in advance! Keep up the great work!

Mattak


Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: Ad_Hominem on August 15, 2014, 10:36:17 PM
Asterisk and FreePBX don't have any support for handling call waiting on analog phone lines.

Quote from: philc on March 27, 2013, 10:03:28 PM
I do have one remaining issue that I have not been able to overcome yet.  I cannot get Call Waiting (much less CW ID) to function.  Specifically, I can hear the beep when someone is calling while I'm on the line (no surprise since that is Switch generated), but I can't seem to identify a method to send a hook flash signal through FreePBX to OBI.  There doesn't even appear to be a button the Cisco phone for this purpose.  Any ideas on how I might solve this would be appreciated.

Thanks,

Phil
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: David_s5 on September 18, 2014, 12:41:01 PM
Quote from: Ad_Hominem on July 11, 2011, 05:37:59 PM
UPDATED:  5/19/2012

Be sure to use the very latest firmware.  Earlier versions had a bug with the X_UseRefer option which have now been fixed!

Note that I've made a lot of changes to these instructions since I wrote them a few years ago, and so if you set-up
...

I just wanted to thank you for this post! There are so many overly complicated setup descriptions out on the web. Some ones that I have found are labyrinths!  The author is referring the reader form on post to another instead of just listing the clear cut steps as you have done herein BRAVO!

THANK YOU AGAIN!
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: Ad_Hominem on September 18, 2014, 12:46:52 PM
You're very welcome!

Please let me know if you have any issues or suggestions!
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: David_s5 on September 18, 2014, 01:08:15 PM
Is there anyway you use OBiTALK Service or add what would be SP3 to facilitate google voice on the same device supporting a FXS and FXO? I read one there on the web, but it has an "out of band" way of fetching the the caller ID and routing.

Do you know if a feature request to do such a thing has been discussed?
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: Ad_Hominem on September 18, 2014, 01:12:55 PM
There definitely is a way to use the Obi to facilitate Google Voice, and there was a posting by Michigan Telephone Blog several years ago about a way to facilitate it while getting all the other benefits of FXO and FXS.  It, like Google Voice, was kludgy and had some issues.

However, Michigan took his blog down a few years ago because he was frustrated with how people on the internet were treating him..

I strongly recommend that you NOT use Google Voice.  There are lots of providers out there that have very reliable service for almost zero cost, including Callcentric, Flowroute, Vitelity, and voip.ms...
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: psyafter on March 21, 2018, 11:16:40 PM
Thank you for manual.
I connected obi pstn line to asterisk so I can dial and get calls on my ip phone.

There is a way to transfer current call from ip phone back to "phone" jack on obi110?
I have attached wireless phone to obi so sometimes I need transfer call to analog phone and continue talk on it.

I already use both SP services so can't add phone as extension.
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: MrMoxy on October 02, 2018, 03:00:42 PM
Quote from: greenhornet on March 19, 2013, 02:18:10 PM
No one has any caller ID suggestions?  OBI support referred me to the forums on this problem.  Their words, "Please post your question in our forum.  Other members who has done this can help you in there."

GreenHornet, did you ever get this to work? I've spent about 12 hours trying different settings on the OBi110 and I cannot get it to pass the caller ID. It rewrites caller ID as trunk name.

I am using OBi110 as FXO port only to get my Comcast PSTN line into PIAF. I am not using it as an extension. [I tried doing so but after 6 hours wrestling with the star code interference with PIAF I gave up.] My connection is on SP2. OBi is registering with PIAF. I can dial out from PIAF using the Comcast line, and incoming calls are passed to PIAF. However, OBi is not changing the caller ID to "OBiTrunk1" (the name of the trunk in PIAF and the username in my OBi Expert settings).

In OBi Expert config, my inbound call route is SP2(1303NxxXxxx) (my Comcast number).
Changing InboundCallRoute to SP2(1303NxxXxxx;ui=$1) or to SP2(1303NxxXxxx>$1) breaks the connection. Changing to SP2(1303NxxXxxx)>$1 or SP2(1303NxxXxxx)>$2 does not do anything.

In SP2 Service X_InboundCallRoute is LI. Changing X_InboundCallRoute from LI to LI;ui=$1 does not do anything.

In SP2 Service CallerIDName is default (OBiTalk settings). Changing to "Device default" does not do anything. Changing it to $1 passes "$1" (literally) as the caller ID.

Ring delay is 2000 ms. Increasing to 3000 causes PIAF to pick up slower. No caller ID. Increasing it above 3000 causes PIAF not to pick up and does not solve the problem. CallerIDDetectMethod is FSK(Bell 202). X_SpoofCallerID is unchecked, but checking it did not change anything.  Changing ring profile from A to B and back to A does not do anything.

ProxyServer is my PIAF IP address. ProxyServerPort is 5060 (UDP). OutboundProxy is my PIAF IP address.
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: zapattack on October 03, 2018, 12:07:21 AM
Interesting thing: if you check your call log you will see that
ui=$1 is shown as ui=xxxxxxxxxx (actual tel number)!
But that is as far as it goes?
Analog phone on phone port of course shows everything properly.
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: drgeoff on October 03, 2018, 04:27:46 AM
@MrMoxy
I followed what is in sections 3 and 4 of the first post in this thread http://www.obitalk.com/forum/index.php?topic=1157.msg7261#msg7261.  OBi110 (2886 firmware), FreePBX. CallerID works for me with unmodified sp2(my_number) as LINE Port InboundCallRoute.
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: zapattack on October 09, 2018, 11:57:35 PM
Unfortunately, trying to send it from the 110 to a 200
seems to loose some of the CID info.
Phone on 200 shows all calls as Private.
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: CALYTA on October 13, 2019, 10:58:25 AM
Quote from: ws2000 on November 12, 2011, 10:12:31 PM
Hello

I followed this proces jiofi.local.html (https://jfi.uno/jiofilocalhtml) tplinklogin (https://adminlogin.co/tplinklogin/) is it down (https://isitdown.top/) s and had very good success with it.  Big THANKS!  My question is about voice mail notifications.  I have my PBX using Google Voice Mail to answer my missed calls.  I got tired of fighting it and decided to use it since it jumped in from time to time when I didn't want it.  What is the best way to get missed call voice mail notification with POTS phones?  I can not get the message light or the double dial tone ring to work on my Panasonic DECT 6.0 phones.  I would love to hear what others are doing.  
Note that I've made a lot of changes to these instructions since I wrote them a few years ago, and so if you set-up your Obi 110 based upon these instructions before the date listed above,
Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: Albert12 on May 19, 2020, 05:46:36 AM
I''m new to asterisk so it may be a setting that I have screwed up but I thought I'd throw this into the mix in case anyone else runs into this problem.

And thanks to Ad_Hominem and MichiganTelephone for doing the heavy lifting on this. When it does finally register it works perfectly.

Title: Re: Using the Obi 110 as an FXO and FXS Port for FreePBX
Post by: Black1Star on May 19, 2020, 06:09:17 AM
One thing that I've run into with this setup is it takes forever like 20 or 30 min. before the obi will successfully register with freepbx. This was driving me crazy. it took me a while to just be patient and let it work for a while.

I''m new to asterisk so it may be a setting that I have screwed up but I thought I'd throw this into the mix in case anyone else runs into this problem.

And thanks to Ad_Hominem and MichiganTelephone for doing the heavy lifting on this. When it does finally register it works perfectly.

Derek