title: Asterisk - To reduce extension repitition in extensions.conf in a context
body: <p>I have a very basic extensions.conf with the following <code>context</code>:</p>
  
  <pre><code>[LocalPhones]
  
  exten =&gt; 1001,1,noop(Dialing ${PEX_ONE})
          same =&gt; n,Macro(DialStartMonitor,${PEX_ONE})
          same =&gt; n,Dial(SIP/${PEX_ONE},30,mTt)
          same =&gt; n,Playback(vm-nobodyavail)      ; Play "no one's available"
          same =&gt; n,Hangup()
  
  exten =&gt; 1002,1,noop(Dialing ${PEX_TWO})
          same =&gt; n,Macro(DialStartMonitor,${PEX_TWO})
          same =&gt; n,Dial(SIP/${PEX_TWO},30,mTt)
          same =&gt; n,Playback(vm-nobodyavail)      ; Play "no one's available"
          same =&gt; n,Hangup()
  
  exten =&gt; 1003,1,noop(Dialing ${PEX_THREE})
          same =&gt; n,Macro(DialStartMonitor,${PEX_THREE})
          same =&gt; n,Dial(SIP/${PEX_THREE},30,mTt)
          same =&gt; n,Playback(vm-nobodyavail)      ; Play "no one's available"
          same =&gt; n,Hangup()
  
  exten =&gt; 1004,1,Dial(Dialing ${PEX_FOUR})
          same =&gt; n,Macro(DialStartMonitor,${PEX_FOUR})
          same =&gt; n,Dial(SIP/${PEX_FOUR},10,m)
          same =&gt; n,Playback(vm-nobodyavail)      ; Play "no one's available"
          same =&gt; n,Hangup()
  
  exten =&gt; 1005,1,Dial(Dialing ${PEX_FIVE})
          same =&gt; n,Macro(DialStartMonitor,${PEX_FIVE})
          same =&gt; n,Dial(SIP/${PEX_FIVE},10,m)
          same =&gt; n,Playback(vm-nobodyavail)      ; Play "no one's available"
          same =&gt; n,Hangup()
  </code></pre>
  
  <p>Is there a way I can combine all these into a single block (instead of 5 blocks like it is now) so that the extensions can dial each other (the extensions are from 1001 to 1010)?</p>