I'd like to create a dial rule that when someone tries to dial a particular number, the same number is dialed, except that prefixed with some additional digit(s). How can this be specified on extensions.conf? Thanks, Daniel
On Monday 25 April 2005 3:05 pm, Daniel Salama wrote:> I'd like to create a dial rule that when someone tries to dial a > particular number, the same number is dialed, except that prefixed with > some additional digit(s). How can this be specified on extensions.conf?exten => 1234,1,Dial(Zap/g1/555${EXTEN}) Just put the extra digits before the extension to dial on the device. -josiah
Franco Bellagamba
2005-Apr-25 12:53 UTC
[Asterisk-Users] Dial Plan - How to prepend a digit
Daniel, try
_X.,1,Dial(123${EXTEN})
That will prefix "123" to the dialed number.
Franco
----- Original Message -----
From: "Daniel Salama" <dsalama@user.net>
To: "Asterisk Users Mailing List - Non-Commercial Discussion"
<asterisk-users@lists.digium.com>
Sent: Monday, April 25, 2005 4:05 PM
Subject: [Asterisk-Users] Dial Plan - How to prepend a digit
> I'd like to create a dial rule that when someone tries to dial a
> particular number, the same number is dialed, except that prefixed with
> some additional digit(s). How can this be specified on extensions.conf?
>
> Thanks,
> Daniel
>
> _______________________________________________
> Asterisk-Users mailing list
> Asterisk-Users@lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-users
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
Tony Mountifield
2005-Apr-25 13:03 UTC
[Asterisk-Users] Re: Dial Plan - How to prepend a digit
In article <5ca26b971fb804b2dbbfbcfa8893180b@user.net>, Daniel Salama <dsalama@user.net> wrote:> I'd like to create a dial rule that when someone tries to dial a > particular number, the same number is dialed, except that prefixed with > some additional digit(s). How can this be specified on extensions.conf?Easy. Say you want to prepend 90 onto any number beginning with 7, and 91 onto a particular number, and dial anything else normally: [specials] exten => _7.,1,Dial(Zap/g1/90${EXTEN}) exten => 1234567890,1,Dial(Zap/g1/91${EXTEN}) [outgoing] include => specials exten => _X.,1,Dial(Zap/g1/${EXTEN}) You need to put the exceptions into an included context, because that's the only way to guarantee they are considered before the default case. See http://www.voip-info.org/wiki-Asterisk+config+extensions.conf+sorting for more discussion of this issue. Cheers Tony -- Tony Mountifield Work: tony@softins.co.uk - http://www.softins.co.uk Play: tony@mountifield.org - http://tony.mountifield.org
Do you mean like this?
This is an example
Here I have 3 trunks (2 SIP and 1 IAX)
To dial out in rix, i'll have to dial a 0 before areaprefix, which
here always begins with another 0 (040xxxxxx)
I.e to dial that area on trunk "rix" I'll have to dial
0040xxxxxxx = (00Z.)
EXTEN:1 will remove one (1) leading digit, the first 0 and I'm out on
that trunk.
Same with the digisip-trunk, instead I'll have to dial 9 to reach out
on that trunk
Same with the FWD-trunk, I'll have to dial 393 to reach the FWD network.
EXTEN:3 will remove the leading three digits (393)
To be able to dial another country I'll have to be able to dial 00 (000Z.)
Aka 0 00xxxxxxxxx or 9 00xxxxxxxxx
?
I'm using Asterisk@Home ver 0.9 with asterisk 1.0.7
;[outrt-001-rixroute]
;include => outrt-001-rixroute-custom
;exten => _000Z.,1,Macro(dialout-trunk,2,${EXTEN:1})
;exten => _000Z.,2,Macro(outisbusy) ; No available circuits
;exten => _00Z.,1,Macro(dialout-trunk,2,${EXTEN:1})
;exten => _00Z.,2,Macro(outisbusy) ; No available circuits
;
;[outrt-002-digisiproute]
;include => outrt-002-digisiproute-custom
;exten => _900Z.,1,Macro(dialout-trunk,1,${EXTEN:1})
;exten => _900Z.,2,Macro(outisbusy) ; No available circuits
;exten => _90Z.,1,Macro(dialout-trunk,1,${EXTEN:1})
;exten => _90Z.,2,Macro(outisbusy) ; No available circuits
;
;[outrt-003-fwdroute]
;include => outrt-003-fwdroute-custom
;exten => _393.,1,Macro(dialout-trunk,3,${EXTEN:3})
;exten => _393.,2,Macro(outisbusy) ; No available circuits
Rgds
Stefan (Sweden)
On 4/25/05, Daniel Salama <dsalama@user.net>
wrote:> I'd like to create a dial rule that when someone tries to dial a
> particular number, the same number is dialed, except that prefixed with
> some additional digit(s). How can this be specified on extensions.conf?
>
> Thanks,
> Daniel
>
> _______________________________________________
> Asterisk-Users mailing list
> Asterisk-Users@lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-users
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
>