Skip to main content

Inbound route to second Asterisk box

Posted by cbbs70a on Mon, 06/02/2008

All;
I have 2 asterisk boxes setup that speak to each other via a SIP trunk. One box has an incoming DID, the other has some extensions. What I would like to do with the incoming DID is pass it to an extension on the other server. I'm not quite sure how to do that. For example, when defining the inbound route, if I select tl-goto-userextension, only the extensions LOCAL to that machine are selectable. If I select tl-dialout-1-trunk, which seems a logical choice, I'm not sure how to define the extension I want to use. Has anyone ever done this before?
Thanks Much;
FSD


Submitted by eeman on Tue, 06/03/2008 Permalink

yes, but first .. do you know how to do this sort of thing without a manager interface? IE editing iax.conf and extensions.conf ? If so I can explain it in a way that you should be able to create trunks and write scripts inside pbx manager quite easily.

Submitted by cbbs70a on Tue, 06/03/2008 Permalink

Erik;

You really amaze me. Yes, I can pretty easily set up most of this manually, but maybe not all of it. I can easily get an extension on machine 1 to dial an extension on machine 2 by manual editing and by using Thirdlane. I can get an extension on machine 1 to dial a 10-digit number and have it dial out on the outbound trunk of machine 2. I am not certain of the last part of this and thats getting the inbound DID of machine 2 to dial an extension on machine 1. I think that if you explain it, I will probably be able to follow it. I've worked with the dialplan for a while now.

Thanks

FSD

Submitted by cbbs70a on Tue, 06/03/2008 Permalink

Ok, machine 1 has an extension 100, and machine 2 has an extension 200 along with a VoIP line 555-1212. When calling 555-1212, it connects to ext 100.

(1) first setup sip trunk between the 2 machines in sip.conf (setup on both machines)

(2) on machine 1, setup outbound dialing

exten => _NXXNXXXXXX,1,Dial(SIP/machine2/${exten})

(3) on machine 2, setup the dialplan like so:

exten => 5551212,1,Dial(SIP/machine1/200)

I think that would do it. That should be it I think.

Submitted by cbbs70a on Tue, 06/03/2008 Permalink

Ok, I have it working now, even though the solution may not be very elegant. When defining an inbound route when dialing the DID, I use the script tl-dialout-1-trunk. I use the SIP trunk that exists between the two machines. I then strip off the entire 10 digit number and prepend the extension that is configured on the other machine. It works, but there may be a better more elegant way of doing this.

Regards;

FSD

Submitted by eeman on Tue, 06/03/2008 Permalink

do you already have 3 digit dialing working between the boxes?

box A has 1XX pattern...

box B has 2XX pattern...

use Feature Codes to set the _1XX or _2XX pattern to dial the other box. You will need to write a custom script so it doesnt re-write caller-id, it should be fairly simple. Mine is a 1 liner with 5 arguements.

for an inbound route you should just be able to tell it to Go to Feature Extension 100. That would send it to extension 100 on box A. I suspect that using tl-dialout-trunk scripts will overwrite the callerid before it reaches box A.

if you want to get more complex you could create a second trunk that arrives in from-outside on box A and use a custom script that sends it to that trunk with all 10 digit DNIS. You would still have to write an inbound route on box A to handle the call. This would be a way to do it in order to make box A appear more 'independent' using box B as a sip provider.

consider IAX2 connections if these boxes arent local to eachother. IAX2 offers trunking to save on bandwidth. Even g726+trunking can amount to quite a savings.

Submitted by dozment on Wed, 06/04/2008 Permalink

Erik, this may seem like a stupid question, but could you post your sip.conf entries for the trunks? Will this also work for tenant-to-tenant dialing in MTE?

Submitted by cbbs70a on Wed, 06/04/2008 Permalink

Yes, thats a really good point about the callerid. Yes, I already had the exten-to-exten dialing working. Unless I had that working, there was no sense in trying to get everything else to work right. Using the method above, I stripped off all 10 digits and prepended the destination extension, and yes, to my shock and amazement, the callerid *IS* preserved. I will test out your method also. I'll text out IAX2 also.

Coolness;

Frank

Submitted by eeman on Wed, 06/04/2008 Permalink

dozment, tenant to tenant dialing wont be possible within a MTE installation. However, there are still other ways to make sure your client-to-client traffic stays internal. Your biggest challenge is how to handle when someone dials 7 digits or 10 digits yet ensure they both arrive at the same place.

I use some scripts to turn 7 digits into 10 digits based on the NXX dialed from the rate-center the customer belongs to. All 10 digit numbers are turned into E.164 format (+1NXXNXXXXXX) before leaving the MTE box. I route all calls through a primary gateway asterisk box. If the destination is on my network it will route to the client instead of delivering to the PSTN.

Submitted by rrossie@wanc.com on Thu, 11/04/2010 Permalink

when I select Dial Out or Dial Out in outbound Route
Anyone has any suggestion?