Setting Outbound Caller ID

Home » Asterisk Users » Setting Outbound Caller ID
Asterisk Users 15 Comments

I have found several places where it is explained how to do this, and I
have got the following setup, but it is not working (the provider claims they are not getting a proper caller ID setting from me).

I have a number of extensions that are shorthand, that I will use one of as an example (real number hidden):

exten => 2473,1,Macro(callout,##########)

Then this (actual number hidden again):

[macro-callout]
exten => s,1,Set(CALLERID(num)=##########)
exten => s,2,Set(CALLERID(name)=##########)
exten => s,3,Set(CALLERID(all)=”##########” <##########>)
exten => s,4,Dial(${PROVIDER}/”1${ARG1}”,30,tr)
exten => s,n,Hangup()

I have also tried setting only the number with the same results:

exten => s,1,Set(CALLERID(num)=##########)
exten => s,2,Dial …..

When I dial that extension, the call goes through, but the caller ID is not correct at the destination.

Does this look right?

My provider claims that I am somehow sending an old number that doesn’t appear anywhere in my /etc/asterisk directory where the config files are kept. I think they are screwed up somehow, but I wanted to see if anyone can see anything obviously wrong with what I am doing here, because unless I can find something wrong with my Asterisk configuration, I am probably going to have to change providers and port my number again (I just moved from a POTS provider Century Link to a VOIP provider).

Thank you,
–Greg

15 thoughts on - Setting Outbound Caller ID

  • CALLERID is a read only variable. Set the information in sip.conf in the extension.

    callerid=NAME <5555551212>

  • I’m using:

    exten => s,n,Set(CALLERID(number)&9XXXXXXX)

    Also check your sip.conf, you may have hard coded the old phone number there, I believe you can do that on SIP and IAX trunks.

    Doug

  • Set(CALLERID(number)=XXXXXXXXXX) works here.

    Also check with your VoIP provider what format they want for the number. (I
    believe) most accept a 10-digit number, but I seem to remember reading about the odd provider that wanted a leading “1”.

  • Set(CALLERID(number)=${var}) works fine for me.

    Perhaps some debugging on the channel could help? Set sip debug if it’s a sip trunk?

    You’ll at least get to see the callerid that Asterisk is putting on the trunk. That might even help your new VOIP provider do some digging if could provide the debugging output.

    Mark

  • Thanks very much for all the responses. I now have a few more things to try.

    I should have noted that I am using IAX2 rather than SIP to connect to my provider. I do have some internal phones that use SIP to connect to my asterisk box, as well as some corded phones connected through a Digium DAHDI-driven card.

    I am certain that the old number that is showing up as my caller ID is not present in any of my config files (that includes sip.conf and iax.conf, everything in the /etc/asterisk directory has been checked).

    A few things I will try tonight when I get home:

    1) Turning on iax debugging (don’t know why I didn’t think of that)
    2) Setting callerid= in the outbound dialing context in iax.conf
    3) Trying a leading “1” on the number I use in the Set(CALLERID(num) call.

    Since this is a thread that someone down the road is sure to stumble across, I will post results whether or not I am successful.

    –Greg

  • I believe you and everyone else that says so but…


    We should be able to set up our systems based on the documentation and not by “let’s try random things and see what works.

  • Did you buy the number from your carrier? Maybe it’s set on their side for the trunk.


    Cheers,

    Matt Riddell

  • That’s what I think too, but they are denying this. I think what’s happening is they have a customer service guy interpreting logs (probably incorrectly).

    When I had a Century Link POTS line, I had a second number through my VOIP
    provider that I only used rarely. The VOIP provider was used only as a backup to cover any POTS outages (there were few), and occasionally to make a second call when my wife was already on the line. The VOIP service was very inexpensive (only $5/month plus a small per-minute fee when I actually used it), plus they directly support asterisk use by supporting IAX
    connections. Then I decided I wanted to save some money, since Century Link was costing more than 8 times as much as the VOIP service, and while I was thinking about this, a problem developed with the internal wiring in the house (I did the demark test to confirm the CL line was OK). Since I didn’t want to pay to have the wiring repaired, I moved my main number over to the VOIP provider. Worked great for inbound calls.

    So now I have two numbers, and didn’t want to pay for the extra one, so I
    dropped the original VOIP number. That’s where the trouble started. I want my regular number that I ported over to be the one that shows in caller ID, but the old one that doesn’t even work any more was showing up instead. I
    don’t see any way that could be happening unless the provider is supplying it, but they deny it.

    At any rate, if I can figure out the right way to set the caller ID
    explicitly, and assuming they honor it if I do, then none of this will matter.

    –Greg

    –Greg

  • You may need to set this up with the web portal of your ITSP. My provider allows both caller ID to be passed in via SIP or alternatively to have a pre-provisioned caller ID to be applied to all calls.

    John

  • Did you try

    exten => s,1,Set(CALLERID(num-pres)=allowed)
    before your exten => s,n,Set(CALLERID(num)=##########)
    ?

    Also, note that some providers expect you to supply the full STD code including the leading zero; some providers expect you to omit the leading 0;
    while other providers expect you to use the 44 (or equivalent, inbound code for whatever country you live in; in which case you must always omit the leading 0 from the STD code, as though you were calling home from abroad).

    Begin by sending your ident in the same format that your telco use for incoming calls, but don’t be surprised for a moment if they expect something different …..