Asterisk 1.6 (realtime) – Overwritten CallerID(num) Problem

Home » Asterisk Users » Asterisk 1.6 (realtime) – Overwritten CallerID(num) Problem
Asterisk Users 7 Comments

Hello,

I am running Asterisk 1.6 with Realtime enabled for my SIP users and peers. The backend is a MySQL database running through the ODBC backend in Asterisk. At this point everything works in terms of phones registering, placing calls between them, etc. However, I am having a problem setting the Caller ID number whenever I am using the Realtime database for the SIP users/peers. If I use a static sip.conf configuration instead of the database, everything works fine. Unfortunately a static sip.conf file won’t work in my application.

In this example:
exten => 412,1,Set(CALLERID(all)=”TEST”<22222>)
exten => 412,n,NoOp(CallerID(num) is: ${CALLERID(num)}) ;;;PS: This shows the correct number of “22222” on the CLI console…
exten => 412,n,Dial(SIP/412)

Whenever another phone calls extension 412, the call is forwarded to SIP/412 and should have “TEST” as the CallerID name and “22222” as the CallerID number. But, whenever I am using the realtime backend, the caller ID number always displays on the destination phone as that phone’s username. Meaning, if phone SIP/412 receives the call from the example above, the caller ID name displayed is “TEST” but the caller ID number is always “412”.

What could be causing this?

Brett Woollum
href=”mailto:Brett@Woollum.com”>Brett@Woollum.com

7 thoughts on - Asterisk 1.6 (realtime) – Overwritten CallerID(num) Problem

  • Good idea Paul.

    My debug output:
    [Nov 9 17:33:39] VERBOSE[2923] netsock.c: == Using SIP RTP CoS mark 5
    [Nov 9 17:33:39] VERBOSE[4175] pbx.c: — Executing [412@sipphones:1] Set(“SIP/413-00000005”, “CALLERID(num)=22222”) in new stack
    [Nov 9 17:33:39] VERBOSE[4175] pbx.c: — Executing [412@sipphones:2] NoOp(“SIP/413-00000005”, “CallerID(num) is: 22222” ) in new stack
    [Nov 9 17:33:39] VERBOSE[4175] pbx.c: — Executing [412@sipphones:3] Dial(“SIP/413-00000005”, “SIP/412”) in new stack
    [Nov 9 17:33:39] VERBOSE[4175] netsock.c: == Using SIP RTP CoS mark 5
    [Nov 9 17:33:39] VERBOSE[4175] app_dial.c: — Called 412
    [Nov 9 17:33:40] VERBOSE[4175] app_dial.c: — SIP/412-00000006 is ringing
    [Nov 9 17:33:44] VERBOSE[4175] pbx.c: == Spawn extension (sipphones, 412, 3) exited non-zero on ‘SIP/413-00000005’
    [Nov 9 17:33:44] VERBOSE[4175] pbx.c: — Executing [h@sipphones:1] Hangup(“SIP/413-00000005”, “”) in new stack
    [Nov 9 17:33:44] VERBOSE[4175] pbx.c: == Spawn extension (sipphones, h, 1) exited non-zero on ‘SIP/413-00000005’

    As you can see on line 3, CallerID(num) was successfully set to “22222”. SIP/412 is dialed next. It receives the call, but with “412” as the Caller ID number – even though the real source of the call was extension 413. The name I set in CallerID(name) works fine.

    My Extensions.conf for that context:
    [sipphones]
    exten => 412,1,Set(CALLERID(num)=22222)
    exten => 412,1,Set(CALLERID(all)=”TEST”<22222>)
    exten => 412,n,NoOp(CallerID(num) is: ${CALLERID(num)})
    exten => 412,n,Dial(SIP/412)
    exten => 412,n,NoOp(${CALLERID(num)})

    If I disable sippusers and sippeers in extconfig.conf and put 412 and 413 into sip.conf directly, this code works (ie: the CallerID(num) I set makes it out to the destination phone properly).

    Brett Woollum


    href=”mailto:Brett@Woollum.com”>Brett@Woollum.com

  • 10 nov 2010 kl. 02.38 skrev Brett Woollum:

    Have you set the fromuser= field in the realtime database?

    /O

  • That was it! I had a value (412 and 413) set for each phone. This overwrote the caller ID that I was setting in the dialplan. Removing the contents of the fromuser field cleared this issue.

    Thanks Olle!

    Brett Woollum

    href=”mailto:Brett@Woollum.com”>Brett@Woollum.com

  • Are you using the fromuser field in the realtime table? I had this
    problem once when from user was set and user kept receiving that as the
    callerid.

  • Hi Carlos.

    Yes I did have fromuser set, which was the problem. I removed this for each extension and that solved the issue.

    Thanks!

    Brett Woollum

    href=”mailto:Brett@Woollum.com”>Brett@Woollum.com