Asterisk syntax errors

Hi,
I’m using asterisk 13 for a standalone voicemail. It’s currently producing the following errors:
Checking voicemailmain:

WARNING[12549][C-00000067]: ast_expr2.fl:470 ast_yyerror: ast_yyerror(): syntax error: syntax error, unexpected ‘’, expecting $end; Input:
"“44745XXXXXXX"sip:447458XXXXXX@192.168.0.2:5060;user=phone” != “”
^
[Jun 23 21:12:14] WARNING[12549][C-00000067]: ast_expr2.fl:474 ast_yyerror: If you have questions, please refer to wiki.asterisk.org/wiki/display/ … +Variables

and
receiving voicemail which has been redirected:

WARNING[13094][C-00000069]: ast_expr2.fl:470 ast_yyerror: ast_yyerror(): syntax error: syntax error, unexpected ‘’, expecting $end; Input:
sip:447458XXXXXX@172.31.23.20;reason=“unconditional”;privacy=“full”” != “”
^
[Jun 23 21:22:36] WARNING[13094][C-00000069]: ast_expr2.fl:474 ast_yyerror: If you have questions, please refer to wiki.asterisk.org/wiki/display/ … +Variables

My dialplan:

exten => 44745XXXXXXX,1,NoOp(Checking for Diversion Headers)
exten => 44745XXXXXXX,n(diversioncheck),GotoIf($["${SIP_HEADER(Diversion)}" != “”]?diversion:paicheck)
exten => 44745XXXXXXX,n(diversion),Set(DIVERSION=${SIP_HEADER(Diversion)})
exten => 44745XXXXXXX,n,Set(temp=${CUT(DIVERSION,:,2)})
exten => 44745XXXXXXX,n,Set(CID=${CUT(temp,@,1)})
exten => 44745XXXXXXX,n,GotoIf($[${VM_INFO(${CID},exists)} = 0]?paicheck)
exten => 44745XXXXXXX,n,VoiceMail(${CID},u)
exten => 44745XXXXXXX,n,Hangup()
exten => 44745XXXXXXX,n,NoOp(Checking for PAI Headers)
exten => 44745XXXXXXX,n(paicheck),GotoIf($["${SIP_HEADER(P-Asserted-Identity)}" != “”]?pai:usecid)
exten => 44745XXXXXXX,n(pai),Set(PAI=${SIP_HEADER(P-Asserted-Identity)})
exten => 44745XXXXXXX,n,Set(temp=${CUT(PAI,:,2)})
exten => 44745XXXXXXX,n,Set(CID=${CUT(temp,@,1)})
exten => 44745XXXXXXX,n,GotoIf($[${VM_INFO(${CID},exists)} = 0]?usecid)
exten => 44745XXXXXXX,n,VoiceMailMain(${CID},s)
exten => 44745XXXXXXX,n,Hangup()
exten => 447458800176,n(usecid),NoOp(Using CallerID to see if the callerid matches a mailbox)
exten => 447458800176,n,ExecIf($[${VM_INFO(${CID},exists)} = 1]?VoiceMailMain(${CID},s}))
exten => 447458800176,n,NoOp(all else fails just prompt for a mailbox number and pin)
exten => 447458800176,n,VoiceMailMain()
exten => 447458800176,n,Hangup()

When calls are directed to voicemail, there are no errors.
The errors are only created when calls are directed to voicemailmain.

The dialplan appears to be working, but I’d like to identify the cause of the errors and clearly avoid them.

TIA for any help.

Is there a reason you are directly accessing things (and trying to parse it) instead of using the functionality provided by Asterisk? [1] [2]

[1] wiki.asterisk.org/wiki/display/ … EDIRECTING
[2] wiki.asterisk.org/wiki/display/ … n_CALLERID

Hi Joshua, thanks for responding and apologies for the delay in responding, I’ve been away.

The dial plan is required to identify the redirected CLI when calls are diverted to voicemail, even if withheld and also allow the subscriber to access their own voicemail. Like I said, the errors only arise when accessing voicemailmain though the dialplan seems to work.

If you can advise on a better way of constructing the dialplan, that would be great, bear in mind I’m new to this though :smile:

The links I provided at the bottom of my post are for the Asterisk functionality which is used to get the information. If things are properly configured they should be fine, and pushes the URI parsing into Asterisk.