[Asterisk-Users] ast_yyerror - 'space' in Caller-ID - string comparison

Mark Elkins mje at posix.co.za
Thu May 12 05:48:36 MST 2005


I've some code to manipulate incoming Caller-ID - so its suitable for
replying to...

[sipdef]
exten => s,1,NoOp(FWD SIP: "${CALLERIDNAME}" <${CALLERIDNUM}>)
; Alter incoming calles from pulver - add a '87'
exten => s,2,Gotoif($[${CALLERIDNAME} = ${CALLERIDNUM}]?3:4)
exten => s,3,SetCIDName(87${CALLERIDNUM})
exten => s,4,SetCIDNum(87${CALLERIDNUM})
exten => s,5,Goto(default,s,1)

When Executing the above - and I presume incoming Caller Info looks like
the name is "Mark Elkins" and the Number is "638936"...

The purpose is to prefix the number (only the number) with "87".
Sometimes, incoming CallerID data looks like --> "638936" <638936>
therefore the checking of both "Name" and <number>.

    -- Executing NoOp("SIP/292951-b11f", "FWD SIP: "Mark Elkins"
<638936>") in new stack
May 12 14:36:59 WARNING[28824]: ast_expr.y:486 ast_yyerror:
ast_yyerror(): syntax error: parse error; Input:
Mark Elkins = 638936
^^^^
            ^
    -- Executing GotoIf("SIP/292951-b11f", "Mark?3:4") in new stack
    -- Goto (sipdef,s,4)
    -- Executing SetCIDNum("SIP/292951-b11f", "87638936") in new stack
    -- Executing Goto("SIP/292951-b11f", "default|s|1") in new stack
    -- Goto (default,s,1)

What solutions are there to getting rid of the "yyerror"??
-- 
  .  .     ___. .__      Posix Systems - Sth Africa.  e.164 VOIP ready
 /| /|       / /__       mje at posix.co.za  -  Mark J Elkins, Cisco CCIE
/ |/ |ARK \_/ /__ LKINS  Tel: +27 12 807 0590  Cell: +27 82 601 0496




More information about the asterisk-users mailing list