{CALLERIDNUM} error

I am trying to detect an inbound call.
[globals]
CELLNUMBER=1234567890

With:
exten => 1,1,GotoIf($[${CALLERIDNUM} = ${CELLNUMBER}]?IVR,1)

I get:
warning[17456]: ast_expr.y: 483 ast_yyerror(): syntax error; Input:
= 1234567890
^^^^^^^^^^^^^^
^
(the arrow is under the 9)

[IVR]
(ivr menu)

if I put in the number directly in quotes or without quotes it just does nothing. Is there a way to view the debug to see what specifically it is doing?

Thanks

i see the problem. CALLERIDNUM is null, so there is no left operand. try something like this instead:

exten => 1,1,GotoIf($[X${CALLERIDNUM} = X${CELLNUMBER}]?IVR,1)

well, my Sipura phone shows the entry when it rings through. So, is it not being set before the ringing starts?

dunno, but the error text showing nothing before the ‘=’ is a giveaway, i’d think. have you tried my fix?

For some reason, now it is not pulling callerid for any callers - will se why and continue - thanks

Asterisk 1.2.X

exten => 1,1,GotoIf($["${CALLERID(num)}" = "${CELLNUMBER}"]?IVR,1)
Lonnie

I put in the entry and I get the following on the CLI:
error[17965]: pbx.c:1163 ast_func_read: Function Callerid not registered

so, it leads me to ask:

CALLERID(num) looks like a function call - is it a built in?

that is to set the outbound caller id - i believe.

I am attempting to do inbound.

Now, the SIP Phone (Sipura 841) shows the callerid, but it isn’t catching it with the X$ entries

[quote=“dmuller”]I put in the entry and I get the following on the CLI:
error[17965]: pbx.c:1163 ast_func_read: Function Callerid not registered

so, it leads me to ask:

CALLERID(num) looks like a function call - is it a built in?[/quote]
Yes, it is built-in, it BOTH sets and gets, depending on how you use it. (Did you specify all UPPERCASE, function?)

[code]voipCLI> show function CALLERID
voip
CLI>
-= Info about function ‘CALLERID’ =-

[Syntax]
CALLERID(datatype)

[Synopsis]
Gets or sets Caller*ID data on the channel.

[Description]
Gets or sets Caller*ID data on the channel. The allowable datatypes
are “all”, “name”, “num”, “ANI”, “DNID”, “RDNIS”.[/code]
Maybe there is something wrong with your Asterisk system?

Lonnie

i’m starting to wonder…

This is how I doit on 1.09 I am just checking the arecode and routing by it. Once it jumps to the dish270 or dish 731 then I check the NXX and route accordingly. you could easily do arecode nxx and number in 1 context but I am routing to three store based on the area code and nxx so this was the only way I coukld figure out to make it work.
I would suggest making another conext with a dial dunction and your cell number and jump to it

exten => s,1,NoOP(${CALLERID})
exten => s,2,GotoIf($["${CALLERIDNUM:0:3}" = “270”]?dish270,s,1:3)
exten => s,3,GotoIf($["${CALLERIDNUM:0:3}" = “731”]?dish731,s,1:4)
exten => s,4,Goto(ucdish,s,1)

Maybe it is a way that BE differs from other versions?