Use trunk endpoint callerid


i have an endpoint configured as trunk ‘mytrunk’ to outgoing calls. Also there are two endpoints configured for phones 1001 and 1002. when ever i make outgoing call Dial(PJSIP/${EXTEN}@mytrunk) i want the callerid of the ‘mytrunk’ endpoint to be used instead of the caller 1001/1002.

is it possible other than setting through dialplan like Set(CALLERID(num)=1000)


You have to do something explicitly that conflicts with this behaviour, or the other end of the trunk has to not trust the caller ID, for this not to happen automatically.

An example of the first would be using fromuser on chan_sip; I assume chan_pjsip has something similar. If the trunk accepts P-Asserted-ID or Remote-Party-ID, it should be possible to enable one of these.

If the other end of the trunk is not trusting the caller ID, you may need to use a less reputable service provider, or transform the number into a valid PSTN number and confirm your ownership of the number to the service provider.