Doubt about trunks & Outbound routes

Hello good morning, I have a doubt:

I have a PRI(30 channels) for fixes and a PRI for mobiles(30 channels)
To do a call through PRI for mobiles I need to pass this sequence of digits “333” + number to call
To do a call though PRI for fixes I only need to pass the number to call.

I would like to know if it possible from the FreePBX GUI to do this:

  • At first instance I want that an external call is sent by the PRI-fixes
  • If the primary is full I want that the external call is sent by the PRI-mobile

If I didnt need to use the prepend “333” when I do a call through the PRI-mobile, all will be as simple as use two trunks on the same outbound route.

But in this case I need to use a prepend to make calls thorugh the PRI-mobiles. It is possible to use two different outbound routes so that if one of the outbound routes is congested the call can be go through the other outbound route?

With plain dialplan you can do that:
exten => _06XXXXXXXX,1,NoOp()
same => n,Dial(SIP/prim-fixed/${EXTEN},300,T)
same => n,DIal(SIP/prim-mobile/333${EXTEN},300,T)

But what could I do with FreePBX? In this case I need to create 2 trunks and 2 outbound routes. How can I jump from the first trunk to the second using different outbound routes?
I think that with FreePBX if the call go to the PRI for fixes and all the channels are BUSY it appears a CONGESTION audio and the call is finalishez instead of triying to go through the other trunk-outbound route

I’m not sure you and I understand the same way how this works.

You will need to set up two trunks. In the first trunk (Dahdi G0) route your fixed location calls. There’s a bunch of ways to identify this route - most use some kind of dial sequence to send the call to your fixed stations.

The second trunk (DAHDI G1) will route your cell calls. In the trunk dial manipulation rules, “prepend” the 333 to the start of the call.

So, if you do that, you should be able to use the single outbound route. If the first trunk fails and you have “continue to next trunk on failure” set, it should do what you’re looking for.

The problem is that your PRI provider may “accept” the call, which means it succeeded. If that happens, and then they subsequently deny the call, your call fails.

Ahhh, ok I think that I didnt understand how it worked that on FreePBX but I think that now I finally understand it.

Then I should define on both trunk the same posibilities with the difference on the PRI-mobile in which I need to prepend the 333.

For example:
Create Outbound route PRI-fixed and define:
9XXXXXXXX
6XXXXXXXX

Create Outbound route PRI-mobile and define:
333 9XXXXXXXX
333 6XXXXXXXX

Where I can select “continue to next trunk on failure” on FreePBX 12?

I have to tell you that this is about the strangest setup I’ve seen (and I’ve been doing this for a long time). I’ve never heard of a phone company that required you to “know” that the number you are calling is a cell phone and had you add a dial prefix to make that happen.

Regardless - Remember that there are two ways to modify a number on the way out of your system. If you set up the Fixed trunk with no prepend, and the Cell trunk with the 333 prepend, you can feed the same number to either trunk.

With this setup, you should be able to work with a single outbound route ASSUMING THE FIRST TRUNK FAILS when the number is dialed. To support this, I’d probably set it up so that cell phone trunk is first in the trunk list for your outbound routes.

So, important note: you can manipulate dialed numbers in Outbound Routes OR Trunk OR both.

Also, so we’re clear:

When you dial a number, the PBX matches what you dialed with the MATCH settings in your Outbound Route. If the number you dialed matches what that outbound route is set up for, that route will be chosen.

After the route is chosen, other “options” get set, including the Caller ID for this call, whether more stuff is prepended, and what needs to be removed from the number to make it work for the selected trunks.

The Outbound Route as a series of trunks. Each of these can modify the outbound dialed number again, with new appends or new removals.

The idea is that, from the Outbound Route, you should end up with a “predictable” number sequence (e164 removed, country codes, etc.) that your trunks will be able to process.

As an example, I allow my customers to enter country codes, area codes, prefixes, etc. We don’t allow International Calling, so I strip all of that off in the outbound route and add the area code if the number doesn’t have one. This way, coming out of my outbound routes, my numbers are always in the “format” NXXNXXXXXX. I then add ‘1’ for one of my outbound trunks, and don’t add ‘1’ for the other outbound trunk.

Yeah, thanks a lot by your explanation, I think that this is what I was needing.

I was seeing that just now:
http://issues.freepbx.org/browse/FREEPBX-7413

Best regards

Miguel Sanz