# {CALLERIDNUM} error

**URL:** <https://community.asterisk.org/t/calleridnum-error/4819>\
**Category:** Asterisk Support\
**Created:** [March 3, 2006, 9:20pm UTC](https://community.asterisk.org/t/calleridnum-error/4819 "2006-03-03T21:20:24Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![dmitry.kuzmenko](https://avatars.discourse-cdn.com/v4/letter/d/46a35a/32.png) [@dmitry.kuzmenko](https://community.asterisk.org/u/dmitry.kuzmenko)\
**Post date:** [March 3, 2006, 9:20pm UTC](https://community.asterisk.org/t/calleridnum-error/4819/1 "2006-03-03T21:20:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dswartz](https://avatars.discourse-cdn.com/v4/letter/d/45deac/32.png) [@dswartz](https://community.asterisk.org/u/dswartz)\
**Post date:** [March 3, 2006, 9:36pm UTC](https://community.asterisk.org/t/calleridnum-error/4819/2 "2006-03-03T21:36:54Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![dmitry.kuzmenko](https://avatars.discourse-cdn.com/v4/letter/d/46a35a/32.png) [@dmitry.kuzmenko](https://community.asterisk.org/u/dmitry.kuzmenko)\
**Post date:** [March 3, 2006, 9:44pm UTC](https://community.asterisk.org/t/calleridnum-error/4819/3 "2006-03-03T21:44:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dswartz](https://avatars.discourse-cdn.com/v4/letter/d/45deac/32.png) [@dswartz](https://community.asterisk.org/u/dswartz)\
**Post date:** [March 3, 2006, 9:54pm UTC](https://community.asterisk.org/t/calleridnum-error/4819/4 "2006-03-03T21:54:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dmitry.kuzmenko](https://avatars.discourse-cdn.com/v4/letter/d/46a35a/32.png) [@dmitry.kuzmenko](https://community.asterisk.org/u/dmitry.kuzmenko)\
**Post date:** [March 3, 2006, 10:06pm UTC](https://community.asterisk.org/t/calleridnum-error/4819/5 "2006-03-03T22:06:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![lonnie](https://avatars.discourse-cdn.com/v4/letter/l/bc79bd/32.png) [@lonnie](https://community.asterisk.org/u/lonnie)\
**Post date:** [March 3, 2006, 10:22pm UTC](https://community.asterisk.org/t/calleridnum-error/4819/6 "2006-03-03T22:22:32Z")

</div>

Asterisk 1.2.X

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

---

<div class="post-metadata">

**Author:** ![dmitry.kuzmenko](https://avatars.discourse-cdn.com/v4/letter/d/46a35a/32.png) [@dmitry.kuzmenko](https://community.asterisk.org/u/dmitry.kuzmenko)\
**Post date:** [March 3, 2006, 10:34pm UTC](https://community.asterisk.org/t/calleridnum-error/4819/7 "2006-03-03T22:34:59Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![dmitry.kuzmenko](https://avatars.discourse-cdn.com/v4/letter/d/46a35a/32.png) [@dmitry.kuzmenko](https://community.asterisk.org/u/dmitry.kuzmenko)\
**Post date:** [March 3, 2006, 10:38pm UTC](https://community.asterisk.org/t/calleridnum-error/4819/8 "2006-03-03T22:38:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![lonnie](https://avatars.discourse-cdn.com/v4/letter/l/bc79bd/32.png) [@lonnie](https://community.asterisk.org/u/lonnie)\
**Post date:** [March 3, 2006, 11:46pm UTC](https://community.asterisk.org/t/calleridnum-error/4819/9 "2006-03-03T23:46:27Z")

</div>

[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]voip_CLI\> 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

---

<div class="post-metadata">

**Author:** ![dswartz](https://avatars.discourse-cdn.com/v4/letter/d/45deac/32.png) [@dswartz](https://community.asterisk.org/u/dswartz)\
**Post date:** [March 4, 2006, 12:18am UTC](https://community.asterisk.org/t/calleridnum-error/4819/10 "2006-03-04T00:18:50Z")

</div>

i’m starting to wonder…

---

<div class="post-metadata">

**Author:** ![rusty](https://avatars.discourse-cdn.com/v4/letter/r/f17d59/32.png) [@rusty](https://community.asterisk.org/u/rusty)\
**Post date:** [March 4, 2006, 5:11am UTC](https://community.asterisk.org/t/calleridnum-error/4819/11 "2006-03-04T05:11:09Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![dmitry.kuzmenko](https://avatars.discourse-cdn.com/v4/letter/d/46a35a/32.png) [@dmitry.kuzmenko](https://community.asterisk.org/u/dmitry.kuzmenko)\
**Post date:** [March 6, 2006, 6:33pm UTC](https://community.asterisk.org/t/calleridnum-error/4819/12 "2006-03-06T18:33:00Z")

</div>

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