hello friends, is there any way to simplify that extensions.conf file? [miprimerejemplo] exten => 20000,1,Dial(SIP/20000,30,Ttm) exten => 20000,2,Hangup exten => 20000,102,Voicemail(20000) exten => 20000,103,Hangup exten => 20100,1,Dial(SIP/20100,30,Ttm) exten => 20100,2,Hangup exten => 20100,102,Voicemail(20100) exten => 20100,103,Hangup exten => 20200,1,Dial(SIP/20200,30,Ttm) exten => 20200,2,Hangup exten => 202000,102,Voicemail(20200) exten => 20200,103,Hangup exten => 20300,1,Dial(SIP/20300,30,Ttm) exten => 20300,2,Hangup exten => 203000,102,Voicemail(20300) exten => 20300,103,Hangup exten => 20400,1,Dial(SIP/20400,30,Ttm) exten => 20400,2,Hangup exten => 204000,102,Voicemail(20400) exten => 20400,103,Hangup thanks to all -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20070402/fb1e4dda/attachment.htm
Use a macro [macro-stdexten] exten => s,1,Dial(${ARG1},30,Ttm) exten => s,2,Hangup exten => s-NOANSWER,1,Voicemail(${ARG2}) exten => s-NOANSWER,n,Hangup then call it like exten => 20000,1,Macro(stdexten,SIP/20000,20000) Josu Lazkano Lete wrote:> hello friends, > > is there any way to simplify that extensions.conf file? > > [miprimerejemplo] > exten => 20000,1,Dial(SIP/20000,30,Ttm) > exten => 20000,2,Hangup > exten => 20000,102,Voicemail(20000) > exten => 20000,103,Hangup > > exten => 20100,1,Dial(SIP/20100,30,Ttm) > exten => 20100,2,Hangup > exten => 20100,102,Voicemail(20100) > exten => 20100,103,Hangup > > exten => 20200,1,Dial(SIP/20200,30,Ttm) > exten => 20200,2,Hangup > exten => 202000,102,Voicemail(20200) > exten => 20200,103,Hangup > > exten => 20300,1,Dial(SIP/20300,30,Ttm) > exten => 20300,2,Hangup > exten => 203000,102,Voicemail(20300) > exten => 20300,103,Hangup > > exten => 20400,1,Dial(SIP/20400,30,Ttm) > exten => 20400,2,Hangup > exten => 204000,102,Voicemail(20400) > exten => 20400,103,Hangup > > > thanks to all > > ------------------------------------------------------------------------ > > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20070402/71ec2783/attachment.htm
[miprimerejemplo] exten => _X.,1,Dial(SIP/${exten},30,Ttm) ... exten => s,1,Dial(SIP/${exten},30,Ttm) ... Josu Lazkano Lete wrote:> hello friends, > > is there any way to simplify that extensions.conf file? > > [miprimerejemplo] > exten => 20000,1,Dial(SIP/20000,30,Ttm) > exten => 20000,2,Hangup > exten => 20000,102,Voicemail(20000) > exten => 20000,103,Hangup > > exten => 20100,1,Dial(SIP/20100,30,Ttm) > exten => 20100,2,Hangup > exten => 20100,102,Voicemail(20100) > exten => 20100,103,Hangup > > exten => 20200,1,Dial(SIP/20200,30,Ttm) > exten => 20200,2,Hangup > exten => 202000,102,Voicemail(20200) > exten => 20200,103,Hangup > > exten => 20300,1,Dial(SIP/20300,30,Ttm) > exten => 20300,2,Hangup > exten => 203000,102,Voicemail(20300) > exten => 20300,103,Hangup > > exten => 20400,1,Dial(SIP/20400,30,Ttm) > exten => 20400,2,Hangup > exten => 204000,102,Voicemail(20400) > exten => 20400,103,Hangup > > > thanks to all > ------------------------------------------------------------------------ > > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20070402/46c36684/attachment.htm
Hi Josu, [miprimerejemplo] exten => 2XXXX,1,Dial(SIP/${EXTEN},3-,Ttm) exten => 2XXXX,2,Hangup exten => 2XXXX,102,Voicemail(${EXTEN}) exten => 2XXXX,103,Hangup ... is all you need in that context. Asterisk will match any called number that starts with a 2 and is 5 digits long. ${EXTEN} carries the value of the dialed number. Alex On 4/2/07, Josu Lazkano Lete <jlazkano@somesi.com> wrote:> > hello friends, > > is there any way to simplify that extensions.conf file? > > [miprimerejemplo] > exten => 20000,1,Dial(SIP/20000,30,Ttm) > exten => 20000,2,Hangup > exten => 20000,102,Voicemail(20000) > exten => 20000,103,Hangup > > exten => 20100,1,Dial(SIP/20100,30,Ttm) > exten => 20100,2,Hangup > exten => 20100,102,Voicemail(20100) > exten => 20100,103,Hangup > > exten => 20200,1,Dial(SIP/20200,30,Ttm) > exten => 20200,2,Hangup > exten => 202000,102,Voicemail(20200) > exten => 20200,103,Hangup > > exten => 20300,1,Dial(SIP/20300,30,Ttm) > exten => 20300,2,Hangup > exten => 203000,102,Voicemail(20300) > exten => 20300,103,Hangup > > exten => 20400,1,Dial(SIP/20400,30,Ttm) > exten => 20400,2,Hangup > exten => 204000,102,Voicemail(20400) > exten => 20400,103,Hangup > > > thanks to all > > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users > >-- Alex Robar alex.robar@gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20070402/3c130b10/attachment.htm
On 4/2/07, Josu Lazkano Lete <jlazkano@somesi.com> wrote:> > hello friends, > > is there any way to simplify that extensions.conf file? > > [miprimerejemplo] > exten => 20000,1,Dial(SIP/20000,30,Ttm) > exten => 20000,2,Hangup > exten => 20000,102,Voicemail(20000) > exten => 20000,103,Hangup > > exten => 20100,1,Dial(SIP/20100,30,Ttm) > exten => 20100,2,Hangup > exten => 20100,102,Voicemail(20100) > exten => 20100,103,Hangup > > exten => 20200,1,Dial(SIP/20200,30,Ttm) > exten => 20200,2,Hangup > exten => 202000,102,Voicemail(20200) > exten => 20200,103,Hangup > > exten => 20300,1,Dial(SIP/20300,30,Ttm) > exten => 20300,2,Hangup > exten => 203000,102,Voicemail(20300) > exten => 20300,103,Hangup > > exten => 20400,1,Dial(SIP/20400,30,Ttm) > exten => 20400,2,Hangup > exten => 204000,102,Voicemail(20400) > exten => 20400,103,Hangup >Yes, 2 ways: 1. Use a macro: [macro-whatever] exten => s,1,Dial(SIP/${ARG1},30,Ttm) exten => s,2,Hangup exten => s,102, Voicemail(b${ARG1}) exten => s,103,Hangup 2. Use pattern matching exten => _20[0-4]00,1,Macro(whatever,${EXTEN}) Is that simpler? 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? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20070402/646053f4/attachment-0001.htm
On Mon, 2 Apr 2007, Josu Lazkano Lete wrote:> hello friends, > > is there any way to simplify that extensions.conf file?Write a macro to do your 4-lines of 'dial'. This is in the book - get the book & read it. (Asterisk, The future of Telephony - it's free in PDF form - pages 110 onwards) Gordon