Re-setting Caller ID on asterisk channel

I am creating the asterisk calling files (.call) and setting the caller id in the .call files. Its making call after moving it to the /var/spool/asterisk/outgoing
and I am getting the correct caller id but what I am looking it to change this caller id once the call is answered in the context. I want to change this caller id as its going to make a call to another phone.

or in simple words I want to override the channel caller id.

I have used the following code
[color=#008000]exten => s,1,SET(${Callerid(num)}="1234567") exten => same, n, Dial(SIP/${Callerid(num)}@sometrunk) [/color]
but I am getting the caller id of the channel and not new caller id after setting.

Please suggest.

As far as I know, this is only supported on SIP channels (might also be on some rarely used VoIP ones) and only in the context of transfers. I don’t think there is any way for dialplan to force connected line ID changes.

contact your service provide(TELCO)
In ISDN PRI CASE they usually dont allow to set callerid but in ss7 signaling you can set it explicitly.