On reflection, that probably should have been:
exten = _!,n,Set(CALLERID(all)="${
Main Topics
Browse All TopicsI have a macro in asterisk 1.6 for setting the incoming caller id. This is what is looks like:
[macro-SetIncomingCallerID
exten = _!,1,NoOp(Call received in SetIncomingCallerID macro)
exten = _!,n,SetCallerPres(allowed
exten = _!,n,Set(CID=${ODBC_SPGetC
exten = _!,n,Set(CALLERID(name)=${
exten = _!,n,Set(CALLERID(number)=
This makes the name appear, but for the number it shows the extension being called.
I can't seem to change the number.
So then I tried changing the From sip header like so:
exten = _!,n,SipAddHeader(From: "${CID}" <sip:${CALLERID(num)}@phon
This line worked and showed the proper name and number, but then I got no audio.
Any ideas? Thanks
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I actually have tried that:
exten = _!,n,Set(CALLERID(all)="${
I also tried the same line with the number in email format.
As for printing the number to screen.
I am saving all the caller id values to a database like so:
exten = _!,n,Set(CL=${ODBC_SPInser
name, num, all, and ani are all initially set to the incoming caller ID number.
When I print ${CALLERID(num)} to screen, it has the correct caller id.
The odbc look up is an internal caller id database. That too is retrieving the name as expected and it does come up on the phone. The phones are linksys spa942. If I do not set the caller ID, I get the caller ID number with the called extension underneath. If I set the name, I get the name with the called extension underneath. I have tried using the "o" option when transfering to the correct extension:
exten => s,n,Dial(SIP/${ARG1},20,o)
When I make calls to an SPA941 from Asterisk, the LCD display always shows this:
From: <name>
<number>
Where <name> is the caller ID name and <number> is the caller ID number. The only difference I can think of is that I have never used the SetCallerPres command in the dial plan or the usecallingpres parameter in the peer definition. So perhaps you need to remove those lines from your peer definition and dial plan macro.
Other possibilities include: An obscure setting on the SPA942, but I tried several that I thought might make a difference and none did; Another line in the Asterisk dial plan that is not contained in the macro, but I assume you would know if that was the case; A setting in sip.conf or users.conf that is over-riding the caller ID, but I think all the settings available are there to set the caller ID for calls made from the peer, not for calls made to it; an additional SIP header (specifically the P-Asserted-Identity header) has got in there somehow and is being used in preference to the From header.
Can you capture the entire SIP INVITE packet sent to the Linksys phone at the start of the call? I normally use the Asterisk CLI command "sip set debug" (or "sip set debug on" if using v1.6) to capture SIP packets.
hmm. I just noticed that the "fromuser" parameter in sip.conf will override the CALLERID(number) for all calls sent *TO* the sip peer. If you had that parameter in sip.conf (or users.conf perhaps) then it would have the effect that you are seeing.
http://www.voip-info.org/w
Business Accounts
Answer for Membership
by: feptiasPosted on 2009-05-24 at 10:10:47ID: 24462222
Please try this (instead of adding a From Header) and report back the results: CID} <${CALLERID(num)}>")
exten = _!,n,Set(CALLERID(all)="${
I'm not sure I fully understand what you are trying to do because you say "I can't seem to change the number" and yet your macro only appears to be looking up a name using an ODBC lookup, ${CID}, while using the number as already received, ${CALLERID(num)} without modification. Would it help in debugging to write the value of ${CALLERID(num)} to the console by modifying your NoOp something like this:
exten = _!,1,NoOp(Call received in macro SetIncomingCallerID - CLI is ${CALLERID(num)})