 |
|
 |
| |
Using SIP instead of IAX to Link Servers
Posted on Saturday, November 25 @ 14:13:44 EST by master |
|
 |
|
 |
| |
I like to have links with my client’s machines, but I found no real information on how to do this by SIP. There are a lot of scraps everywhere, but Asterisk to Asterisk is constantly referenced and described using an IAX link. If you think about various suppliers like Stanaphone (one of my favorites) linking to their server with yours is documented. This is a SIP server to SIP server, but where on VOIPinfo is the configuration for both sides?
If such a configuration is documented, I missed it. So I decided to rediscover the wheel again and document it. I supply Asterisk systems based on the AMP and now FreePBX control programs so my configurations are based on these modules.
Lets continue onto the meat...
Why link with SIP?
IAX, IAX, IAX is what I hear is the way to go and indeed I do have IAX links between servers. It is interesting to note that I have had voice quality problems with IAX regardless of any changes I made in the configuration files (TOS, codec, kill heartbeat, kill debug…). But voice quality is not what led me to SIP interconnectivity. I wanted to be able to define an extension on my client’s machine, using SIP as their phones do, which would be just like any other extension in their company. It would be able to be dialed from their internal users, be shown on their FOP display and use port 5060 just like an ordinary, non customized p hone or ATA. Lastly, my extension pattern does not have to conform to their servers extension pattern (They can dial xxx to reach yyyy on my system) If you look at some of the devices in the marketplace you may notice a VOIP / Gaming accelerator. These units do packet inspection and inject priority flags (QOS). They are sold by Dlink and Linksys to name two I have tried. These seem to work well with SIP port 5060 but do nothing extra (that I have not done in iaxprov.conf) for the default IAX port 4569. Yes, I can buy a QOS switch or router and give the highest priority to the port for the Asterisk server, but for around $50 the small unit is a nice addition to an already existing system. So wanting to be on the FOP (Flash Operator Panel) as a SIP extension and looking at a cheap little SIP QOS boost I decided it was time to dig in. Testing Setup:
This setup was over a VPN so NAT was not a concern. It was completed with static routes already in place so it was as if two servers were on the same switch. I choose to get this working first rather than worrying about NAT and proxies. The two servers are running different versions of Asterisk and AMP / FreePBX. My client is of course on the most stable release I can give them, but I like to try new software. The client version of AMP is 1.10.010 with all the patches as well as my own fixes. My current production system is freePBX 2.1.3. Configuring the Servers:
On my clients machine I set up an extension as I would normally do in AMP. Do not set up voice mail, since that will be on the destination server. The only change to the defaults was to change the qualify control to 500. On my server, I set up a trunk, outbound route and an inbound route in freePBX. First let me point out that an inbound route is used so I can direct any client’s calls to specific extension(s) rather than to the IVR system. They are treated as a priority call, giving the illusion that they dialed an extension not another server. It is also important to understand the register string a little. Looking at this string: register=extension:password@server.address/optional-returned-DID I register the extension using the DID parameter so when a call comes in from the SIP channel (due to my registration), I can route it using an inbound route based on the DID I set when I register. Now here is all you need to create that trunk:
Peer Details:
allow=ulaw&gsm canreinvite=no host=192.10.1.253&dynamic insecure=very qualify=500 secret=password for extension on other server type=peer username=extension on other server User Details: allow=ulaw&gsm canreinvite=no dtmfmode=rfc2833 insecure=very qualify=500 secret= password for extension on other server type=user username= extension on other server Register String:
220:12345@192.10.1.253/254368 220 is the extension on the other server set up using AMP 12345 is the password for the extension on other server 192.10.1.253 is the other servers address 254368 is the DID sent to my server on incoming calls Although there are many more options available this will get you linked. As an example, I did not list above, disallow all nor did I specify dtmfmode in both peer and user. I adjusted my ‘sip.conf’ file to send all inbound SIP calls to my from-pstn context (context=from-pstn). I created an inbound route for DID 254368 and I will leave that to you to figure out. I created an outbound route so that I can dial any of my clients’ extensions. Just create this route like you would create any outbound route using this new SIP trunk. This outbound route also allows me to use their phone lines to make a call since I’m an extension on their system and I’m in their ‘from-internal’ context. Now on to another way to connect via SIP:
If you do not need to place any calls to your client’s machine (or out it) but want to allow them to reach you by dialing an extension, we can dispense with creating a trunk and an outbound route on our server. We still need to create an extension on their machine, an inbound route on ours and add a single line to our sip_custom.conf file as follows: register=220:12345@192.10.1.253/254368 220 is the extension on the other server set up using AMP 12345 is the password for the extension on other server 192.10.1.253 is the other servers address 254368 is the DID sent to my server on incoming calls Create an inbound route to process the DID (254368) on your server. Why create both types of Sip interconnections?
You probably have a special code or extension on your system for pages. As an example, I have a Cisco phone which has multiple extensions defined. One such extension is set to auto answer the call. It is this extension (set to peer) that I use to receive intercoms and pages from other Cisco phones. To allow my client to page me I must give them access to this extension. Since I forced any incoming calls from the SIP trunk (in my previous example) to specific extensions, they can not reach my intercom number. I therefore created a second SIP link which is one way directed to my intercom extension. Now my client has two extensions to dial, one which will ring my phone and take a message while the other intercoms me. If any of my users (yes you) have downloaded my intercom / paging software off Sourceforge you will notice that I like to use a suffix to each extension as the paging extension. That is, extension 100 would have a page / intercom extension of say 10012345. This would stop outside callers from reaching the intercom extensions (100 is matched before they can dial the full number). The last thing you would want is a user calling and listening to the office workings. Also in my routines I remap an extension prefixed with a 0 to the intercom so that when a user dials 0100 to intercom user at extension 100 they actually reach 10012345. That little summary describes a secure way to intercom and page away from outside users, which is why I must use the second SIP link. My clients could never reach my intercom extension even if they had access to my IVR menu. Wrap Up:
I don’t know if this is documented anywhere. My searching only uncovered piecemeal. This is common knowledge to a service provider since they are selling you time on their server and you have dozens of examples on how to connect to their service using an ATA, phone and Asterisk server. I wanted to put both sides (provider & user / SIP server to server) in one spot. This could also allow you to resell your unused phone time as the big boys do. Have a few VOIP lines underused? In the future, I will be moving my free speed dial / paging routines for AMP from Sourceforge as well as the speed dial module and paging routines for freePBX to the download area. I would also like to cover automatic configuration of freePBX from the client side (when a web user signs up for an account). So stay tuned.
|
|
 |
 |
 |
| |
 |
 |
 |
| |
Article Rating
Average Score: 4.85 Votes: 14

|
|
 |
 |
 |
|