Automatic trunk selection

hi.
in my office we do have a lot of mobile calls in different providers.
on the asterisk i do have three gsm gateways (gsm1, gsm2, gsm3) and when you would like to place a call through gsm 1 you have to dial 1 and then the number, for gsm 2 it is 2 and the number, respectively for gsm 3.
there are some people that do not know which gsm to use and then the monthly bill reaches shy high.
note that there is no pattern to diffetentiate the different mobile providers due to the fact of portabilty of the numbers between the carriers.

i would like to build a table of numbers (max 20) that will be something:
69123456 use gsm 1
69234567 use gsm 2
69125677 use gsm 3
.
.
.

is there a way to have something like that so i could save thousands every month in mobile calls?

You definitly can do that, but you will have to do some advance scripting in the Asterisk DialPlan. For instance, you can save the table of GSM numbers in AstDB and reference the entrys on every outbound call.

hi.
could you be able to give an example of the dialplan?

It isn’t exactly advanced dialplan. For a small number or numbers, all you need is simple full matches on the dialled number. That is far too easy to require example dial plans.

could you be able to give me an example, please?

Like this:

exten => 1234567890,1,Dial(SIP/gsm1/${EXTEN})
exten => 1234567891,1,Dial(SIP/gsm2/${EXTEN})
exten => 1234567892,1,Dial(SIP/gsm3/${EXTEN})

Replace those numbers with the numbers you’re dialing, and check your Dial’s for options you might want, timeouts, and what to do if the Dial fails. For more information about Dialing with Asterisk, try the book:

www.asteriskdocs.org

Cheers

The example for dialing out via SIP Trunk with a change of CallerID would be (edit the CalledID (123456789)/CallerID parameters according to your needs):

exten => 123456789,1,Set(CALLERID(all)="New_CallerID"<New_CallerID>)
exten => 123456789,n,Dial(SIP/SIP_Trunk/${EXTEN})
exten => 123456789,n,Hangup()

And david55 is right, this is more or less very basic stuff, so please read some Asterisk documentation that is available on the web :wink: Things are not so complex as they look at the first glance :wink: