Re: [asterisk-users] What is my syntax error here?
Have you tried without the double quotes ? as : exten = _417XX,n,GotoIf($[$[${CallerIDNum} 41799] | $[${CallerIDNum} 41700]]?notfromlocal:) From: James B. Byrne byrn...@harte-lyne.ca To: asterisk-users@lists.digium.com Sent: Wednesday, July 24, 2013 10:14 PM Subject: Re: [asterisk-users] What is my syntax error here? On Wed, July 24, 2013 10:33, James B. Byrne wrote: Additional data: Arch = x86_64 OS = CentOS-6.4 (freepbx) Asterisk = 11.4 FreePBX = 2.11.0.4 . . . So my question is simple. What error in syntax have I committed here? I expect that CallerIDNum == 41712 in the check: exten = _417XX,n,GotoIf( $[$[${CallerIDNum} 41799] | $[${CallerIDNum} 41700]]?notfromlocal:) But I am getting a message say there is no variable to check. So what I have done that is wrong? As suggested I made these additions to the dial plan: ; Line 8 exten = _417XX,n,NoOp($[${CallerIDNum} 41799]) ; Line 9 exten = _417XX,n,NoOp($[${CallerIDNum} 41700]) ; Line 10 exten = _417XX,n,NoOp($[${CallerIDNum} 41799] | $[${CallerIDNum} 41700]) ; Line 11 exten = _417XX,n,NoOp($[${CallerIDNum} 41799] | $[${CallerIDNum} 41700]) ; Line 12 exten = _417XX,n,NoOp($[$[${CallerIDNum} 41799] || $[${CallerIDNum} 41700]]) ; Line 13 exten = _417XX,n,NoOp($[$[${CallerIDNum} 41799] || $[${CallerIDNum} 41700]]) ; Line 14 - original exten = _417XX,n,GotoIf( $[$[${CallerIDNum} 41799] || $[${CallerIDNum} 41700]]?notfromlocal:) Which changed nothing but the results did provide a clue. Taking the earlier suggestion I ensured that my original line did not contain line breaks, which I cannot reproduce in this email because of its length. However, putting everything on one line caused the missing variable error to disappear. exten = _417XX,n,GotoIf($[$[${CallerIDNum} 41799] || $[${CallerIDNum} 41700]]?notfromlocal:) Thank you both for the help. I much appreciate it. -- *** E-Mail is NOT a SECURE channel *** James B. Byrne mailto:byrn...@harte-lyne.ca Harte Lyne Limited http://www.harte-lyne.ca 9 Brockley Drive vox: +1 905 561 1241 Hamilton, Ontario fax: +1 905 561 0757 Canada L8E 3C3 -- _ -- 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-- _ -- 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] What is my syntax error here?
In article e31f701f427b0d2f49c266511b01abca.squir...@webmail.harte-lyne.ca, James B. Byrne byrn...@harte-lyne.ca wrote: I have thsi code in a dial plan. The purpose of which is to set distinctive ring tones for internal and transferred calls. exten = _.,1,Noop(CALLERID_ALL=${CALLERID(all)}) exten = _.,n,Set(CallerIDNum=${CALLERID(num)}) I believe _. is frowned upon because it can potentially match h, i, and so on. Use _X. instead, or just the full pattern of _417XX exten = _417XX,n,GotoIf( $[$[${CallerIDNum} 41799] | $[${CallerIDNum} 41700]]?notfromlocal:) But I am getting a message say there is no variable to check. So what I have done that is wrong? Is that step split into three lines in your dialplan? I think you might need to put it all on a single line. Cheers Tony -- Tony Mountifield Work: t...@softins.co.uk - http://www.softins.co.uk Play: t...@mountifield.org - http://tony.mountifield.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] What is my syntax error here?
Additional data: Arch = x86_64 OS = CentOS-6.4 (freepbx) Asterisk = 11.4 FreePBX = 2.11.0.4 -- Original Message -- Subject: What is my syntax error here? From:James B. Byrne byrn...@harte-lyne.ca Date:Wed, July 24, 2013 10:08 To: asterisk-users@lists.digium.com -- I have thsi code in a dial plan. The purpose of which is to set distinctive ring tones for internal and transferred calls. exten = _.,1,Noop(CALLERID_ALL=${CALLERID(all)}) exten = _.,n,Set(CallerIDNum=${CALLERID(num)}) ; This just shows a list of interesting variables and their values ; Comment it out when finished debugging ;include = macro-dumpvars ;exten = _.,n,Macro(dumpvars) exten = _417XX,n,Set(AlertSnom=http://www.notused.com\;info=) ; alert-external, alert-group and alert-internal are ; Snom predefined values. exten = _417XX,n,Set(AlertExternalCall=alert-external) ; alert_internal_call and alert_internal_transfer are ; locally customised values exten = _417XX,n,Set(AlertInternalCall=alert_internal_call) exten = _417XX,n,Set(AlertInternalTransfer=alert_internal_transfer) exten = _417XX,n,Set(__ALERT_INFO=${AlertSnom}${AlertInternalTransfer}) exten = _417XX,n,GotoIf( $[$[${CallerIDNum} 41799] | $[${CallerIDNum} 41700]]?notfromlocal:) exten = _417XX,n,Set(__ALERT_INFO=${AlertSnom}${AlertInternalCall}) This works for internal calls but not transfers and it only works at all only because of the fall through structure. It contains this error that I do not understand: -- Executing [41720@from-internal:1] NoOp(SIP/41712-0548, CALLERID_ALL=James B Byrne 41712) in new stack -- Executing [41720@from-internal:2] Set(SIP/41712-0548, CallerIDNum=41712) in new stack -- Executing [41720@from-internal:3] Set(SIP/41712-0548, AlertSnom=http://www.notused.com;info=) in new stack -- Executing [41720@from-internal:4] Set(SIP/41712-0548, AlertExternalCall=alert-external) in new stack -- Executing [41720@from-internal:5] Set(SIP/41712-0548, AlertInternalCall=alert_internal_call) in new stack -- Executing [41720@from-internal:6] Set(SIP/41712-0548, AlertInternalTransfer=alert_internal_transfer) in new stack -- Executing [41720@from-internal:7] Set(SIP/41712-0548, __ALERT_INFO=http://www.notused.com;info=alert_internal_transfer) in new stack -- Executing [41720@from-internal:8] GotoIf(SIP/41712-0548, ) in new stack == Extension Changed 41712[ext-local] new state InUse for Notify User 41714 [2013-07-24 09:50:42] WARNING[10630][C-6b44]: pbx.c:11544 pbx_builtin_gotoif: Ignoring, since there is no variable to check [2013-07-24 09:50:42] WARNING[10630][C-6b44]: pbx.c:11544 pbx_builtin_gotoif: Ignoring, since there is no variable to check -- Executing [41720@from-internal:9] Set(SIP/41712-0548, __ALERT_INFO=http://www.notused.com;info=alert_internal_call) in new stack -- Executing [41720@from-internal:10] Goto(SIP/41712-0548, from-internal-original-override,41720,1) in new stack -- Goto (from-internal-original-override,41720,1) So my question is simple. What error in syntax have I committed here? I expect that CallerIDNum == 41712 in the check: exten = _417XX,n,GotoIf( $[$[${CallerIDNum} 41799] | $[${CallerIDNum} 41700]]?notfromlocal:) But I am getting a message say there is no variable to check. So what I have done that is wrong? -- *** E-Mail is NOT a SECURE channel *** James B. Byrnemailto:byrn...@harte-lyne.ca Harte Lyne Limited http://www.harte-lyne.ca 9 Brockley Drive vox: +1 905 561 1241 Hamilton, Ontario fax: +1 905 561 0757 Canada L8E 3C3 -- *** E-Mail is NOT a SECURE channel *** James B. Byrnemailto:byrn...@harte-lyne.ca Harte Lyne Limited http://www.harte-lyne.ca 9 Brockley Drive vox: +1 905 561 1241 Hamilton, Ontario fax: +1 905 561 0757 Canada L8E 3C3 -- _ -- 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] What is my syntax error here?
On Wednesday 24 July 2013, James B. Byrne wrote: Additional data: Arch = x86_64 OS = CentOS-6.4 (freepbx) Asterisk = 11.4 FreePBX = 2.11.0.4 -- Original Message -- Subject: What is my syntax error here? From:James B. Byrne byrn...@harte-lyne.ca Date:Wed, July 24, 2013 10:08 To: asterisk-users@lists.digium.com -- I have thsi code in a dial plan. The purpose of which is to set distinctive ring tones for internal and transferred calls. exten = _.,1,Noop(CALLERID_ALL=${CALLERID(all)}) exten = _.,n,Set(CallerIDNum=${CALLERID(num)}) ; This just shows a list of interesting variables and their values ; Comment it out when finished debugging ;include = macro-dumpvars ;exten = _.,n,Macro(dumpvars) exten = _417XX,n,Set(AlertSnom=http://www.notused.com\;info=) ; alert-external, alert-group and alert-internal are ; Snom predefined values. exten = _417XX,n,Set(AlertExternalCall=alert-external) ; alert_internal_call and alert_internal_transfer are ; locally customised values exten = _417XX,n,Set(AlertInternalCall=alert_internal_call) exten = _417XX,n,Set(AlertInternalTransfer=alert_internal_transfer) exten = _417XX,n,Set(__ALERT_INFO=${AlertSnom}${AlertInternalTransfer}) exten = _417XX,n,GotoIf( $[$[${CallerIDNum} 41799] | $[${CallerIDNum} 41700]]?notfromlocal:) exten = _417XX,n,Set(__ALERT_INFO=${AlertSnom}${AlertInternalCall}) This works for internal calls but not transfers and it only works at all only because of the fall through structure. It contains this error that I do not understand: -- Executing [41720@from-internal:1] NoOp(SIP/41712-0548, CALLERID_ALL=James B Byrne 41712) in new stack -- Executing [41720@from-internal:2] Set(SIP/41712-0548, CallerIDNum=41712) in new stack -- Executing [41720@from-internal:3] Set(SIP/41712-0548, AlertSnom=http://www.notused.com;info=) in new stack -- Executing [41720@from-internal:4] Set(SIP/41712-0548, AlertExternalCall=alert-external) in new stack -- Executing [41720@from-internal:5] Set(SIP/41712-0548, AlertInternalCall=alert_internal_call) in new stack -- Executing [41720@from-internal:6] Set(SIP/41712-0548, AlertInternalTransfer=alert_internal_transfer) in new stack -- Executing [41720@from-internal:7] Set(SIP/41712-0548, __ALERT_INFO=http://www.notused.com;info=alert_internal_transfer) in new stack -- Executing [41720@from-internal:8] GotoIf(SIP/41712-0548, ) in new stack == Extension Changed 41712[ext-local] new state InUse for Notify User 41714 [2013-07-24 09:50:42] WARNING[10630][C-6b44]: pbx.c:11544 pbx_builtin_gotoif: Ignoring, since there is no variable to check [2013-07-24 09:50:42] WARNING[10630][C-6b44]: pbx.c:11544 pbx_builtin_gotoif: Ignoring, since there is no variable to check -- Executing [41720@from-internal:9] Set(SIP/41712-0548, __ALERT_INFO=http://www.notused.com;info=alert_internal_call) in new stack -- Executing [41720@from-internal:10] Goto(SIP/41712-0548, from-internal-original-override,41720,1) in new stack -- Goto (from-internal-original-override,41720,1) So my question is simple. What error in syntax have I committed here? I expect that CallerIDNum == 41712 in the check: exten = _417XX,n,GotoIf( $[$[${CallerIDNum} 41799] | $[${CallerIDNum} 41700]]?notfromlocal:) I think that bitwise-or | should be a boolean-or ||. And you may have one too many $[] constructs there. The way to check would be with a few NoOp() lines just above that one: exten = _417XX,n,NoOp($[${CallerIDNum} 41799]) exten = _417XX,n,NoOp($[${CallerIDNum} 41700]) exten = _417XX,n,NoOp($[${CallerIDNum} 41799] | $[${CallerIDNum} 41700]) exten = _417XX,n,NoOp($[${CallerIDNum} 41799] | $[${CallerIDNum} 41700]) exten = _417XX,n,NoOp($[$[${CallerIDNum} 41799] || $[${CallerIDNum} 41700]]) exten = _417XX,n,NoOp($[$[${CallerIDNum} 41799] || $[${CallerIDNum} 41700]]) Note that 0 or an empty string is false; anything else is true. But why do you even need to set things based on ${CallerIDNum} anyway? What's wrong with just using separate contexts for internal and inbound external calls, and hard-coding the setting of the alert there? -- AJS Answers come *after* questions. -- _ -- 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] What is my syntax error here?
On Wed, July 24, 2013 10:33, James B. Byrne wrote: Additional data: Arch = x86_64 OS = CentOS-6.4 (freepbx) Asterisk = 11.4 FreePBX = 2.11.0.4 . . . So my question is simple. What error in syntax have I committed here? I expect that CallerIDNum == 41712 in the check: exten = _417XX,n,GotoIf( $[$[${CallerIDNum} 41799] | $[${CallerIDNum} 41700]]?notfromlocal:) But I am getting a message say there is no variable to check. So what I have done that is wrong? As suggested I made these additions to the dial plan: ; Line 8 exten = _417XX,n,NoOp($[${CallerIDNum} 41799]) ; Line 9 exten = _417XX,n,NoOp($[${CallerIDNum} 41700]) ; Line 10 exten = _417XX,n,NoOp($[${CallerIDNum} 41799] | $[${CallerIDNum} 41700]) ; Line 11 exten = _417XX,n,NoOp($[${CallerIDNum} 41799] | $[${CallerIDNum} 41700]) ; Line 12 exten = _417XX,n,NoOp($[$[${CallerIDNum} 41799] || $[${CallerIDNum} 41700]]) ; Line 13 exten = _417XX,n,NoOp($[$[${CallerIDNum} 41799] || $[${CallerIDNum} 41700]]) ; Line 14 - original exten = _417XX,n,GotoIf( $[$[${CallerIDNum} 41799] || $[${CallerIDNum} 41700]]?notfromlocal:) Which changed nothing but the results did provide a clue. Taking the earlier suggestion I ensured that my original line did not contain line breaks, which I cannot reproduce in this email because of its length. However, putting everything on one line caused the missing variable error to disappear. exten = _417XX,n,GotoIf($[$[${CallerIDNum} 41799] || $[${CallerIDNum} 41700]]?notfromlocal:) Thank you both for the help. I much appreciate it. -- *** E-Mail is NOT a SECURE channel *** James B. Byrnemailto:byrn...@harte-lyne.ca Harte Lyne Limited http://www.harte-lyne.ca 9 Brockley Drive vox: +1 905 561 1241 Hamilton, Ontario fax: +1 905 561 0757 Canada L8E 3C3 -- _ -- 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