PJSIP how do I add a Prefix only to INVITE and not to the "To" header

Oure current provider vant that we send a INVITE with a prefix but that prefix should not be part of the To: header

provider request that we add a prefix “03” to INVITE, but I cant find any options to set INVITE to something else

like this PREFIX=03

INVITE sip:034588888888@;user=phone SIP/2.0
From: <sip:+4511111111@tdc-sbg-2.uni-tel.dk;user=phone>;tag=f364b7c9-8ac7-4886-a737-1e0f0d037340
To: <sip:+4588888888@;user=phone>

have tried to use these, with no luck

Dial(PJSIP/accout1/sip: ${PREFIX}{NUMBER}@${REMOTE_IP})




My understanding is that chan_pjsip only supports the standards recommended method of setting To: and the request URI to the same value, when originating a call.

As you can see, from rfc3261 your ITSP is requiring you to violate a SHOULD level requirement of the SIP RFC, so they cannot expect their service to work with an arbitrary SIP client.


Indeed, there is no ability that I can think of currently to set them differently.

Thanks for the quick answer
I will contact our TSP and tell the to provide documentation to where in the RFC that state INVITE and To is allowed to differ
as according to rfc3261 it violate a SHOULD level requirement

"The initial Request-URI of the message SHOULD be set to the value of the URI in the To field. "

“The URI in the To field of the request MUST be set to the remote URI from the dialog state.”