Modification in sip header


Is there any way to chage the sip header field. I want to chage the from field in sip header.

Is that possible ?


Check the CallerID() dialplan function :wink:.

SIPAddHeader() Add a SIP header to the outbound call.

He is trying to change a core header. You can’t use SIPAddHeader for that; you need to decide exactly what you want to do and then do the specific configuration for that. Set(CALLERID will work in some cases, but one needs to know what is trying to be achieved, as there may be easier ways, and setting the caller ID will also set some other headers, if enabled.


i need to set the callerid as my pstn number but even though i set it takes only the trunk callerid.
How to set my pstn number as callerID.


If i make a outbond trunk call the callerid to the endpoint is trunk DID not my pstn number set during the outbound trunk call.

exten => _X.,1,Set(CALLERID=6578342312)
exten => _X.,2,Dial(SIP/trunk1/${EXTEN})
exten => _X.,3,hangup()


Are you trying to set a caller ID that is not the one known to your ITSP? If so, any respectable ITSP will ignore it. Some will allow you to use other caller IDs once you have proved them that you have control of the lines with those caller IDs. Talk to your ITSP.

The other thing is that some ITSPs require you to fix the From: header as the account name, using fromuser. If you do that they may or may not allow the user of Remote-Party-ID or P-Asserted-Identity headers to pass a different caller ID. If this is the case, you will need to set an appropriate value for sendrpid.

Thanks david,

But the issue is when i set the pstn number in callerid field for the user it takes that pstn number. But when i give it in the dialplan its not taken. 


Do Verbose(${CALLERID})

before and after the Set, to make sure the Set is working. If it is, I don’t understand why you are getting the problem. However, if you are not use RPI or PAI, setting fromuser on the trunk may handle yoru requirement.

Hi ,

set operation is working whatever i set i’m getting that. But at the end point i’m having the trunk DID.

Thanks …,

Please provide SIP traces for the case where you successfully set the caller ID and when you fail to set it.