Pass along callerid info SOLVED

Hi - I’ve been attempting to get this to work for some time yet the solution still eludes me.

When a call comes into my Asterisk 1.8 server from my SIP DiD provider, I have it set ring my cell phone as well as my home phones. This all works, however when my cell rings, the call appears to come from my house. Instead I’d like to see the caller ID of whoever is actually calling.

extensions.conf:

[inbound]
exten => s,1,Set(CallerIDString=${CALLERID(num)})
exten => s,n,NoOp(${CallerIDString})
exten => s,n,Set(CALLERID(num)=$CallerIDString)
exten => s,n,Dial(SIP/sip_ata&SIP/5555551212@provider-outbound,25,t)
exten => s,n,Voicemail(111,b)
exten => s,n,Hangup

Say I call my house from the number 555-444-3333 and say my cell is 555-555-1212. The command line output reads

    -- Executing [2223334444@default:1] Answer("SIP/username", "") in new stack
    -- Executing [2223334444@default:2] Goto("SIP/username", "inbound,s,1") in new stack
    -- Goto (inbound,s,1)
    -- Executing [s@inbound:1] Set("SIP/username", "CallerIDString=5554443333") in new stack
    -- Executing [s@inbound:2] NoOp("SIP/username", "5554443333") in new stack
    -- Executing [s@inbound:3] Set("SIP/username", "CALLERID(num)=$CallerIDString") in new stack
    -- Executing [s@inbound:4] Dial("SIP/username", "SIP/sip_ata&SIP/5555551212@vitel-outbound,25,t") in new stack

It seems that the incoming caller’s ID is recognized, but is not being set for some reason. Can anyone help me spot the error?

You are missing the {} from around the variable name.

Also, it is quite likely that the network will not allow you to present a callerid for a number they haven’t supplied to you. Alternatively they may forward it with the “unscreened” flag, and a later hop may ignore it.

I actually noticed that too after reading my own post. Funny how often I find my own answer shortly after I post a question. It seems to happen almost every time. Anyway it now works as I wanted so thanks!