Restrick numbers to dial


I am trying to restrict phone numbers when dialing from asterisk. I am doing this but it doesnt work

exten => 0[2378]XXXXXXXX, 1, dial…

what i want to do is to only allow numbers 03,02,07,08 numbers to dial out and the rest restricted.

Is the above right or what else i have to do.

I installed asterisk from scratch and using slackware.

if you have a pattern you need a _ to signify its a pattern


exten => [color=red]_[/color]0[2378]XXXXXXXX,1,Dial(blah blah blah)

also don’t use spaces between the commas

exten => whatever,1,Dial(SIP/peer/extension)

exten => whatever, 1, dial, SIP/peer/extension

asterisk may accept it but it may cause you other problems…

thanks for that. I already have that but still I cant dial But I got new problem now

app_dial.c:1049 dial_exec_full: Unable to create channel of type ‘IAX2’ (cause 3 - No route to destination)
Everyone is congested or busy at the moment.

what to do?

no route to destination is probably a network error- whatever the IP or host of your SIP peer is, can’t be routed to or resolved.

First make sure * box has non-broken DNS, then ensure that you can ping the IAX host…