[asterisk-users] What is my syntax error here?

James B. Byrne byrnejb at harte-lyne.ca
Wed Jul 24 13:14:40 CDT 2013


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:ByrneJB at 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




More information about the asterisk-users mailing list