# Dial Plan

**URL:** <https://community.asterisk.org/t/dial-plan/18802>\
**Category:** Asterisk Support\
**Created:** [January 24, 2008, 11:33pm UTC](https://community.asterisk.org/t/dial-plan/18802 "2008-01-24T23:33:40Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![isgur513](https://avatars.discourse-cdn.com/v4/letter/i/a88e57/32.png) [@isgur513](https://community.asterisk.org/u/isgur513)\
**Post date:** [January 24, 2008, 11:33pm UTC](https://community.asterisk.org/t/dial-plan/18802/1 "2008-01-24T23:33:40Z")

</div>

Hello all,

I’ve run into a dial plan issue. I have a working asterisk server that can make internal phone calls, outgoing phone calls, and receive incoming phone calls. Problem is that I have it set up so that you must dial ‘9’ before an outbound call. The problem occurs when I have a missed call from a PSTN phone, I click ok to call the person back and it won’t go because it’s calling 555-555-5555 instead of (9)555-555-5555. I would also like to setup 5-digit dialing for internal calls. What’s your suggestion (if you have one) of the best way to

extensions.conf:

```auto
[sip]
include => parkedcalls

;----------internal extensions-----------
;extension 0001=phone1
exten => 0001,1,Dial(SIP/phone1,20,tr)
exten => 0001,2,VoiceMail,u0001

;extension 0002=phone2
exten => 0002,1,Dial(SIP/phone2,20,tr)
exten => 0002,3,VoiceMail,u0002
;------------end-------------------------

;-------------Voicemail-------------------
;extension 1001: to receive voicemail
exten => 1001,1,Ringing
exten => 1001,2,Wait(2)
exten => 1001,3,VoicemailMain
;------------------end--------------------

;----------------intercom-----------------
;extension 2400: intercom PAGING over loudspeaker for phones 1-2
exten => 2400,1,Set(VXML_URL=intercom=true)
exten => 2400,2,SIPAddHeader(Call-Info: sip: ****.mit.edu.de\;answer-after=0)
exten => 2400,3,Page(SIP/phone1&SIP/phone2&SIP/phone3)

exten => _240Z,1,Set(VXML_URL=intercom=true)
exten => _240Z,n,SIPAddHeader(Call-Info:sip: ****.mit.edu.de\;answer-after=0)
exten => _240Z,n,Page(SIP/phone${EXTEN:4})
;-------------------end---------------------

-----------------Outbound----------------
;Outbound Calls (Must Dial '9')
exten => _9.,1,Dial(SIP/SWITCH/${EXTEN},,tr)
;-------------------end-------------------

;----------------PARKED CALLS----------------
exten => 701,1,ParkedCall(701)
;exten => 701,hint,Local/701@parkedcalls
exten => 701,hint,park:701@parkedcalls

exten => 702,1,ParkedCall(702)
;exten => 702,hint,Local/702@parkedcalls
exten => 702,hint,park:702@parkedcalls
;--------------------------------------------

```

---

<div class="post-metadata">

**Author:** ![ianplain](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/ianplain/32/1776_2.png) [@ianplain](https://community.asterisk.org/u/ianplain)\
**Post date:** [January 25, 2008, 12:20am UTC](https://community.asterisk.org/t/dial-plan/18802/2 "2008-01-25T00:20:28Z")

</div>

Set the callerID(num) of incoming calls to prefix a 9.

That way you will be able to call them straight back

Ian

---

<div class="post-metadata">

**Author:** ![mbruni](https://avatars.discourse-cdn.com/v4/letter/m/ecccb3/32.png) [@mbruni](https://community.asterisk.org/u/mbruni)\
**Post date:** [January 25, 2008, 1:23pm UTC](https://community.asterisk.org/t/dial-plan/18802/3 "2008-01-25T13:23:31Z")

</div>

> [@](#):
>
> Set the callerID(num) of incoming calls to prefix a 9.
> 
> That way you will be able to call them straight back

Cool, never thought about, just updated the dialplan of our Asterisk box 😄

Cheers.

Marco Bruni

---

<div class="post-metadata">

**Author:** ![vincefrancesi](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/vincefrancesi/32/944_2.png) [@vincefrancesi](https://community.asterisk.org/u/vincefrancesi)\
**Post date:** [January 25, 2008, 2:19pm UTC](https://community.asterisk.org/t/dial-plan/18802/4 "2008-01-25T14:19:52Z")

</div>

Here is the link to the Asterisk commands on voipinfo

[http://www.voip-info.org/wiki/view/Setting+Callerid](http://www.voip-info.org/wiki/view/Setting+Callerid)

Vince  
[http://www.illuminiconsulting.com](http://www.illuminiconsulting.com)

---

<div class="post-metadata">

**Author:** ![isgur513](https://avatars.discourse-cdn.com/v4/letter/i/a88e57/32.png) [@isgur513](https://community.asterisk.org/u/isgur513)\
**Post date:** [January 25, 2008, 6:40pm UTC](https://community.asterisk.org/t/dial-plan/18802/5 "2008-01-25T18:40:39Z")

</div>

I see you can use the CALLERID(num)=5555 to show a certain callerID number; however, how would I create the syntax to just set a prefix for all numbers? Not sure how the syntax would be set up

---

<div class="post-metadata">

**Author:** ![ianplain](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/ianplain/32/1776_2.png) [@ianplain](https://community.asterisk.org/u/ianplain)\
**Post date:** [January 25, 2008, 7:37pm UTC](https://community.asterisk.org/t/dial-plan/18802/6 "2008-01-25T19:37:29Z")

</div>

Hi  
Set(CALLERID(num)=9${CALLERID(num)})  
Without checking …

Ian

---

<div class="post-metadata">

**Author:** ![isgur513](https://avatars.discourse-cdn.com/v4/letter/i/a88e57/32.png) [@isgur513](https://community.asterisk.org/u/isgur513)\
**Post date:** [January 25, 2008, 9:02pm UTC](https://community.asterisk.org/t/dial-plan/18802/7 "2008-01-25T21:02:13Z")

</div>

nope, doesn’t work. Already tried that 😉

---

<div class="post-metadata">

**Author:** ![ianplain](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/ianplain/32/1776_2.png) [@ianplain](https://community.asterisk.org/u/ianplain)\
**Post date:** [January 25, 2008, 9:29pm UTC](https://community.asterisk.org/t/dial-plan/18802/8 "2008-01-25T21:29:46Z")

</div>

Ok I have checked on a system

and the following is whats used there

exten =\> 701967,1,set(CALLERID(num)=9${CALLERID(num)})

Well its the end of a VERY long week.

iF it dosesnt work then stick some Noops in to see whats happening

Ian
