Summary:ASTERISK-09362: Under 1.4.4 the callerid(num) variable outputs the sip uri not the callerid num
Reporter:Brandon Price (bprice20)Labels:
Date Opened:2007-05-01 14:42:43Date Closed:2011-06-07 14:03:22
Versions:Frequency of
Environment:Attachments:( 0) calleridvar_sample
( 1) openser-nodata.sql
( 2) sip_debug
( 3) sip_debug2
( 4) sip.conf
( 5) sipview.sql
Description:This behavior only occurs when res_config_mysql.so from the asterisk addons package is installed.


samples attached. I can provide access to testing server.
Comments:By: Brandon Price (bprice20) 2007-05-01 15:26:31

I know that it must be rewriting the variable as it breaks when using ${CALLERID(num)} yet works when I use ${SIPCHANINFO(peername)}

By: Joshua C. Colp (jcolp) 2007-05-03 12:36:39

sip.conf (minus passwords) and sip debug is needed for this issue, thanks!

By: Brandon Price (bprice20) 2007-05-03 13:32:30

Added sip debug output, and sip.conf

By: Joshua C. Colp (jcolp) 2007-05-03 13:34:07

A full sip debug including INVITE, not just a portion is needed.

By: Brandon Price (bprice20) 2007-05-03 13:36:17

Added a second better formatted sip debug.

By: Brandon Kruse (bkruse) 2007-05-03 16:52:24

you say if you unload that mysql resource module the problem goes away?


By: Brandon Price (bprice20) 2007-05-03 17:23:14

Yes if I unload res_config_mysql.so it goes away.

By: Brandon Price (bprice20) 2007-05-08 22:44:50


By: Joshua C. Colp (jcolp) 2007-06-19 09:12:45

I've tried reproducing this using res_config_mysql and res_config_odbc. Both work fine in my case. What does the database entry look like for the device you are calling from?

By: Brandon Price (bprice20) 2007-06-19 09:33:59

mysql> select * from sip where username = 'username' \G
*************************** 1. row ***************************
      name: username
  username: username
      type: friend
    secret: NULL
  callerid: "Brandon Price" <sip:username@eastern.domain.net> <username>
   context: default
   mailbox: username
       nat: yes
   qualify: no
  fromuser: NULL
  authuser: NULL
fromdomain: NULL
  insecure: NULL
canreinvite: no
  disallow: NULL
     allow: NULL
restrictcid: NULL
    ipaddr: NULL
      port: NULL
regseconds: NULL
1 row in set (0.00 sec)

Edited to protect the innocent.

By: Joshua C. Colp (jcolp) 2007-06-19 09:37:58

Uh... the URI is in the database callerid field... specifically the part that gets parsed as the number.

By: Brandon Price (bprice20) 2007-06-19 09:44:21

I should note that the sip table is actually a mysql view of another table, I have attached the create view syntax for review - sipview.sql-

By: Brandon Price (bprice20) 2007-06-19 09:45:12

I have also attached the openser.sql with no data to allow duplication of the db structure if needed.

By: Joshua C. Colp (jcolp) 2007-06-19 09:47:00

Your view must not be working as you expect then since your own select clearly shows a SIP URI.

By: Joshua C. Colp (jcolp) 2007-06-19 09:51:00

I'm suspending this until you can show it's really Asterisk at fault... it really seems as though it's your view.