<br><div><span class="gmail_quote">On 4/2/07, <b class="gmail_sendername">Josu Lazkano Lete</b> <<a href="mailto:jlazkano@somesi.com">jlazkano@somesi.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff">
<div><font face="Arial" size="2">hello friends,</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">is there any way to simplify that extensions.conf
file?</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">[miprimerejemplo]<br>exten =>
20000,1,Dial(SIP/20000,30,Ttm)<br>exten => 20000,2,Hangup<br>exten =>
20000,102,Voicemail(20000)<br>exten => 20000,103,Hangup</font></div>
<div> </div>
<div><font face="Arial" size="2">exten => 20100,1,Dial(SIP/20100,30,Ttm)<br>exten
=> 20100,2,Hangup<br>exten => 20100,102,Voicemail(20100)<br>exten =>
20100,103,Hangup</font></div>
<div> </div>
<div><font face="Arial" size="2">exten => 20200,1,Dial(SIP/20200,30,Ttm)<br>exten
=> 20200,2,Hangup<br>exten => 202000,102,Voicemail(20200)<br>exten =>
20200,103,Hangup</font></div>
<div> </div>
<div><font face="Arial" size="2">exten => 20300,1,Dial(SIP/20300,30,Ttm)<br>exten
=> 20300,2,Hangup<br>exten => 203000,102,Voicemail(20300)<br>exten =>
20300,103,Hangup</font></div>
<div> </div>
<div><font face="Arial" size="2">exten => 20400,1,Dial(SIP/20400,30,Ttm)<br>exten
=> 20400,2,Hangup<br>exten => 204000,102,Voicemail(20400)<br>exten =>
20400,103,Hangup</font></div></div></blockquote><div><br>Yes, 2 ways:<br><br>1. Use a macro:<br><br>[macro-whatever]<br>exten => s,1,Dial(SIP/${ARG1},30,Ttm)<br>exten => s,2,Hangup<br>exten => s,102, Voicemail(b${ARG1})
<br>exten => s,103,Hangup<br><br>2. Use pattern matching<br>exten => _20[0-4]00,1,Macro(whatever,${EXTEN})<br><br>Is that simpler?<br>By the way, I took the liberty of adding b for busy to the macro. But you may want to consider using the standard extension macro provided with Asterisk instead. It allows people to press * to check their voicemail, and a few other handy features. Why reinvent the wheel?
<br></div><br></div><br>