[asterisk-users] Questions about extension.conf
Hello I have been reading the sample extension.conf ;### [outbound-freenum2] ; This is the handler which performs the dialing logic. It is called ; from the [outbound-freenum] context ; exten = _X!,1,Verbose(2,Performing ISN lookup for ${EXTEN}) same = n,Set(SUFFIX=${CUT(EXTEN,*,2-)}); make sure the suffix is all digits as well same = n,GotoIf($[${FILTER(0-9,${SUFFIX})} != ${SUFFIX}]?fn-CONGESTION,1) ; filter out bad characters per the README-SERIOUSLY.best-practices.txt document same = n,Set(TIMEOUT(absolute)=10800) same = n,Set(isnresult=${ENUMLOOKUP(${EXTEN},sip,,1,freenum.org)}) ; perform our lookup with freenum.org same = n,GotoIf($[${isnresult} != ]?from) same = n,Set(DIALSTATUS=CONGESTION) same = n,Goto(fn-CONGESTION,1) same = n(from),Set(__SIPFROMUSER=${CALLERID(num)}) same = n,GotoIf($[${GLOBAL(FREENUMDOMAIN)} = ]?dial) ; check if we set the FREENUMDOMAIN global variable in [global] same = n,Set(__SIPFROMDOMAIN=${GLOBAL(FREENUMDOMAIN)}) ;if we did set it, then we'll use it for our outbound dialing domain same = n(dial),Dial(SIP/${isnresult},40) same = n,Goto(fn-${DIALSTATUS},1) exten = fn-BUSY,1,Busy() exten = _f[n]-.,1,NoOp(ISN: ${DIALSTATUS}) same = n,Congestion() ;## According to http://www.voip-info.org/wiki/view/Asterisk+config+extensions.conf; Syntax for defining a context: keywords exten, include, ignorepat and switch. same is not mentioned in this wiki. There is a part of dial plan from sample extension.conf above. My Question is how same = key word works . Thanks -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Questions about extension.conf
As I understand it, same = is a way to shorthand your list of the other keywords. In the example you posted, you save 4 keystrokes for each line you enter; not a lot of savings for this short example, but put it in a 1000+ line dialplan and it's quite a time-saver. From: asterisk-users-boun...@lists.digium.com [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Shitian Long Sent: Thursday, November 29, 2012 10:40 AM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: [asterisk-users] Questions about extension.conf Hello I have been reading the sample extension.conf ;### [outbound-freenum2] ; This is the handler which performs the dialing logic. It is called ; from the [outbound-freenum] context ; exten = _X!,1,Verbose(2,Performing ISN lookup for ${EXTEN}) same = n,Set(SUFFIX=${CUT(EXTEN,*,2-)}); make sure the suffix is all digits as well same = n,GotoIf($[${FILTER(0-9,${SUFFIX})} != ${SUFFIX}]?fn-CONGESTION,1) ; filter out bad characters per the README-SERIOUSLY.best-practices.txt document same = n,Set(TIMEOUT(absolute)=10800) same = n,Set(isnresult=${ENUMLOOKUP(${EXTEN},sip,,1,freenum.org)}) ; perform our lookup with freenum.org same = n,GotoIf($[${isnresult} != ]?from) same = n,Set(DIALSTATUS=CONGESTION) same = n,Goto(fn-CONGESTION,1) same = n(from),Set(__SIPFROMUSER=${CALLERID(num)}) same = n,GotoIf($[${GLOBAL(FREENUMDOMAIN)} = ]?dial) ; check if we set the FREENUMDOMAIN global variable in [global] same = n,Set(__SIPFROMDOMAIN=${GLOBAL(FREENUMDOMAIN)}) ; if we did set it, then we'll use it for our outbound dialing domain same = n(dial),Dial(SIP/${isnresult},40) same = n,Goto(fn-${DIALSTATUS},1) exten = fn-BUSY,1,Busy() exten = _f[n]-.,1,NoOp(ISN: ${DIALSTATUS}) same = n,Congestion() ;## According to http://www.voip-info.org/wiki/view/Asterisk+config+extensions.conf; Syntax for defining a context: keywords exten, include, ignorepat and switch. same is not mentioned in this wiki. There is a part of dial plan from sample extension.conf above. My Question is how same = key word works . Thanks -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Questions about extension.conf
Shitian Long wrote 29.11.2012 18:40: There is a part of dial plan from sample extension.conf above. My Question is how same = key word works . Thanks same is used for complex templates, if you don't want to copy previous line or afraid you can make a typo. exten = _1XXNXXX,1,Answer same = n,HangUp is the substitution for: exten = _1XXNXXX,1,Answer exten = _1XXNXXX,n,HangUp Also, it makes grepping the particular exten in a file a lot easier, and if you want to change some template for exten which has 50 lines, you don't have to edit all 50 of them. -- With Best Regards Mikhail Lischuk -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Questions about extension.conf
On 29/11/2012 11:47 AM, Salman Zafar wrote: It is self explanatory, for example: exten = _X.,1, Noop(Let say we have allowed all numbers i.e. _X means and . specifies any range) same = n,NoOp(Here we have skipped mentioning dial-pattern again and thats it) Hope I have answered your question. Not for me. What part of those lines and comments discusses same? What is the syntax for a same line? what does it mean to use same rather than exten? On Thu, Nov 29, 2012 at 8:40 AM, Shitian Long longst...@gmail.com mailto:longst...@gmail.com wrote: Hello I have been reading the sample extension.conf ;### [outbound-freenum2] ; This is the handler which performs the dialing logic. It is called ; from the [outbound-freenum] context ; exten = _X!,1,Verbose(2,Performing ISN lookup for ${EXTEN}) same = n,Set(SUFFIX=${CUT(EXTEN,*,2-)}) ; make sure the suffix is all digits as well same = n,GotoIf($[${FILTER(0-9,${SUFFIX})} != ${SUFFIX}]?fn-CONGESTION,1) ; filter out bad characters per the README-SERIOUSLY.best-practices.txt document same = n,Set(TIMEOUT(absolute)=10800) same = n,Set(isnresult=${ENUMLOOKUP(${EXTEN},sip,,1,freenum.org http://freenum.org)}) ; perform our lookup with freenum.org http://freenum.org same = n,GotoIf($[${isnresult} != ]?from) same = n,Set(DIALSTATUS=CONGESTION) same = n,Goto(fn-CONGESTION,1) same = n(from),Set(__SIPFROMUSER=${CALLERID(num)}) same = n,GotoIf($[${GLOBAL(FREENUMDOMAIN)} = ]?dial) ; check if we set the FREENUMDOMAIN global variable in [global] same = n,Set(__SIPFROMDOMAIN=${GLOBAL(FREENUMDOMAIN)}) ; if we did set it, then we'll use it for our outbound dialing domain same = n(dial),Dial(SIP/${isnresult},40) same = n,Goto(fn-${DIALSTATUS},1) exten = fn-BUSY,1,Busy() exten = _f[n]-.,1,NoOp(ISN: ${DIALSTATUS}) same = n,Congestion() ;## According to http://www.voip-info.org/wiki/view/Asterisk+config+extensions.conf; Syntax for defining a context: keywords *exten*, *include*, *ignorepat* and *switch*. same is not mentioned in this wiki. There is a part of dial plan from sample extension.conf above. My Question is how same = key word works . Thanks -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users -- Regards ** Muhammad Salman *** -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users -- Ron Wheeler President Artifact Software Inc email: rwhee...@artifact-software.com skype: ronaldmwheeler phone: 866-970-2435, ext 102 -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Questions about extension.conf
That is a good answer. Thanks. Any reason why it is not documented? Ron On 29/11/2012 11:52 AM, Mikhail Lischuk wrote: Shitian Long wrote 29.11.2012 18:40: There is a part of dial plan from sample extension.conf above. My Question is how same = key word works . Thanks same is used for complex templates, if you don't want to copy previous line or afraid you can make a typo. exten = _1XXNXXX,1,Answer same = n,HangUp is the substitution for: exten = _1XXNXXX,1,Answer exten = _1XXNXXX,n,HangUp Also, it makes grepping the particular exten in a file a lot easier, and if you want to change some template for exten which has 50 lines, you don't have to edit all 50 of them. -- With Best Regards Mikhail Lischuk mailto:mlisc...@itx.com.ua -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users -- Ron Wheeler President Artifact Software Inc email: rwhee...@artifact-software.com skype: ronaldmwheeler phone: 866-970-2435, ext 102 -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Questions about extension.conf
The Wiki is (always) out of date. You might consider taking a look at http://www.asteriskdocs.org/en/3rd_Edition/asterisk-book-html/asterisk-book.html#DialplanBasics_id262049 which is likely less out of data. -Original Message- From: asterisk-users-boun...@lists.digium.com [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Ron Wheeler Sent: Thursday, November 29, 2012 12:17 PM To: asterisk-users@lists.digium.com Subject: Re: [asterisk-users] Questions about extension.conf On 29/11/2012 11:47 AM, Salman Zafar wrote: It is self explanatory, for example: exten = _X.,1, Noop(Let say we have allowed all numbers i.e. _X means and . specifies any range) same = n,NoOp(Here we have skipped mentioning dial-pattern again and thats it) Hope I have answered your question. Not for me. What part of those lines and comments discusses same? What is the syntax for a same line? what does it mean to use same rather than exten? On Thu, Nov 29, 2012 at 8:40 AM, Shitian Long longst...@gmail.com wrote: Hello I have been reading the sample extension.conf ;### [outbound-freenum2] ; This is the handler which performs the dialing logic. It is called ; from the [outbound-freenum] context ; exten = _X!,1,Verbose(2,Performing ISN lookup for ${EXTEN}) same = n,Set(SUFFIX=${CUT(EXTEN,*,2-)}) ; make sure the suffix is all digits as well same = n,GotoIf($[${FILTER(0-9,${SUFFIX})} != ${SUFFIX}]?fn-CONGESTION,1) ; filter out bad characters per the README-SERIOUSLY.best-practices.txt document same = n,Set(TIMEOUT(absolute)=10800) same = n,Set(isnresult=${ENUMLOOKUP(${EXTEN},sip,,1,freenum.org)}) ; perform our lookup with freenum.org same = n,GotoIf($[${isnresult} != ]?from) same = n,Set(DIALSTATUS=CONGESTION) same = n,Goto(fn-CONGESTION,1) same = n(from),Set(__SIPFROMUSER=${CALLERID(num)}) same = n,GotoIf($[${GLOBAL(FREENUMDOMAIN)} = ]?dial) ; check if we set the FREENUMDOMAIN global variable in [global] same = n,Set(__SIPFROMDOMAIN=${GLOBAL(FREENUMDOMAIN)}) ;if we did set it, then we'll use it for our outbound dialing domain same = n(dial),Dial(SIP/${isnresult},40) same = n,Goto(fn-${DIALSTATUS},1) exten = fn-BUSY,1,Busy() exten = _f[n]-.,1,NoOp(ISN: ${DIALSTATUS}) same = n,Congestion() ;## According to http://www.voip-info.org/wiki/view/Asterisk+config+extensions.conf; Syntax for defining a context: keywords exten, include, ignorepat and switch. same is not mentioned in this wiki. There is a part of dial plan from sample extension.conf above. My Question is how same = key word works . Thanks -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users -- Regards ** Muhammad Salman *** -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users -- Ron Wheeler President Artifact Software Inc email: rwhee...@artifact-software.com skype: ronaldmwheeler phone: 866-970-2435, ext 102 -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo
Re: [asterisk-users] Questions about extension.conf
On Nov 29, 2012, at 11:18 AM, Ron Wheeler wrote: That is a good answer. Thanks. Any reason why it is not documented? It's documented on the Asterisk wiki: https://wiki.asterisk.org/wiki/display/AST/Contexts,+Extensions,+and+Priorities Ron -- David M. Lee Digium, Inc. | Software Developer 445 Jan Davis Drive NW - Huntsville, AL 35806 - USA Check us out at: www.digium.com www.asterisk.org -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Questions about extension.conf
Excellent. It appears that Getting Started has a lot more stuff in it than the documentation for 1.8. Very helpful. Ron On 29/11/2012 12:31 PM, David M. Lee wrote: On Nov 29, 2012, at 11:18 AM, Ron Wheeler wrote: That is a good answer. Thanks. Any reason why it is not documented? It's documented on the Asterisk wiki: https://wiki.asterisk.org/wiki/display/AST/Contexts,+Extensions,+and+Priorities Ron -- David M. Lee Digium, Inc. | Software Developer 445 Jan Davis Drive NW - Huntsville, AL 35806 - USA Check us out at: www.digium.com http://www.digium.com/ www.asterisk.org http://www.asterisk.org/ -- Ron Wheeler President Artifact Software Inc email: rwhee...@artifact-software.com skype: ronaldmwheeler phone: 866-970-2435, ext 102 -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users