Dial() and setting CallerID


I have an extension where the user will call his local access number. This number will connect to Asterisk and Asterisk will call another long distance number to finally connect the two parties.

I am using Dial(SIP/mytrunk/LD) to call the long distance number. But I would like to dynamically override the CallerID on that SIP/mytrunk/LD call.

Can I do that with Dial() or do I need to do this somewhere else? I was thinking, passing a variable from the dialplan to sip.conf as the CallerID? I doubt this will work as the sip.conf is parsed only when forced.

Thanks for your input,

If you are using a responsible ITSP, you will need to register your intended caller ID with them first. (I think you were asking about dialing through based on incoming caller ID. ITSPs who will pass through any caller ID allow fraudulent use of such systems.

See the Set application and the CALLERID function, for how to change the caller ID sent to the ITSP (core show application/function).

Note, if you have to set fromuser, it is possible that there is no way to send callerID to your ITSP.