Change caller ID for outgoing calls

Hi all.

I need to change the caller ID for some of my clients that are using my trunks (SIP provider) to show their own numbers. I found this command on internet:

exten => s,1,Set(CALLERID(name)=Asterisk PBX)

but I don’t where to put it. I tried in the context of lines but it doesn’t work. In the 3CX sotfware it’s possible to change it at the “From” field resulting that I can show the number I need.

The SIP frame is something like this:

From: “[color=#FF4000]Field_I_Want_To_Change[/color]” sip:My_Provider_User@My_Provider_IP

I need to change the red coloured field.

Thans a lot.

1 Like

That’s exactly what happens.

If my dialplan reads like:

exten => 200,1,NoOp()
exten => 200,n,Set(CALLERID(name)=Frankie)
exten => 200,n,Dial(SIP/malcolm)

Then, I’ll get:

INVITE sip:sdtqfugk@ SIP/2.0
Via: SIP/2.0/UDP;branch=z9hG4bK31b96d91
Max-Forwards: 70
From: "Frankie" <sip:david@>;tag=as320a34b7
To: <sip:sdtqfugk@>
Contact: <sip:david@>
Call-ID: 47612d0b1d07a5be6b371cc327410e78@
CSeq: 102 INVITE
User-Agent: Asterisk PBX
Date: Fri, 27 May 2011 13:10:33 GMT
Supported: replaces, timer
Remote-Party-ID: "Frankie" <sip:david@>;party=calling;privacy=off;screen=no
Content-Type: application/sdp
Content-Length: 260

But note that many networks do not pass the name field, and even for the number field, if you are not yourself a recognized network operator the network will either ignore the caller-ID or limit it to a number which they know belongs to you.

Try this:


I tried with “Name” at the “Outbound CID” field of the configuration page of the extension and:

  • If I put any number into the number part the capture of the sip debug is:

From: Name


  • If the number is of ANY of the number provided of my provider (from my account or not my numbers) I can call, if not, I can not.
  • Nothing nof I wrote as name is showed on the screen of my mobile when I call me.

I’m thinking to connect the 3CX PBX with my Asterisk to test what happens and where to change it. The provider has Asterisk and I can show all I want with that software.

I’ll comment my advances.

[quote=“dejanst”]Try this:

CALLERID(all)="Field_I_Want_To_Change"<My_Provider_User> [/quote]

¿Where do I have to write it?

You have to run it before you call the Dial() app. For example:

exten => 1,1,CALLERID(all)="Field_I_Want_To_Change"<My_Provider_User>
exten => 1,n,Dial(SIP/1)

He’s trapped by a GUI (Trixbox). He doesn’t know how to configure Asterisk itself.

The problem with trixbox and similar is that finally you can make the same that with “pure Asterisk” but in different files.

So did you do it?

Not exactly.

If I change the CID for one of the numbers that I know from my provider (and are not on my account) I can call with that numbers but if I put an satardard public tellephone number the call is rejected.

I think they changed their security configuration after I tested sussecfully this with 3CX. I believe they saw a call from their trunks with an ID that were not from they.

So clear this up with your provider. Asterisk configuration can not solve the things that your provider is blocking …

Yes, I’m thinking that when I tested the CID with 3CX thy saw calls with numbers that aren’t from they and they block it becaus now I can not do it.