Sip ! DialString to Pjsip

I decided to switch architecture chan_sip to pjsip.
So i started to testing Pjsip that is suitable for our system.

I couldn’t manage to use header manipulation with exclamation mark in Pjsip.
I tried to some configuration with outbound parameters.But i failed. Maybe , i couldn’t find way to change it.

I am using exclamation mark in chan_sip like this;

exten => _X.,n,Dial(SIP/$

{REDIRPREFIX}

$

{EXTEN}!${EXTEN}

@mytrunk)

My sip.conf

[general]
prematuremedia=no
allowsubscribe=yes
rtcachefriend=yes
rtupdate=yes
callcounter=yes
limitonpeers=yes
qualify=yes

[1001]
host=dynamic
type=friend
usename=1001
fromuser=1001
secret=1001

[mytrunk]
type= friend
context=pro
allow=ulaw,alaw
secret=password
host=host ip
fromuser=number
nat=force_rpport,comedia
insecure=port,invite

How can i solve this problem. Is there a way to change “to” header in pjsip.

Thanks for help.

There is currently no supporting for changing only the To header.

Is there a way to use “!” in pjsip ? Can i achive same goal without changing to header ?
I am using “!” in sip because my i am sending my invite uri with prefix and to header without prefix. Is there a way to manipulate invite uri without using “!” ?

Thanks for help.

The use of “!” is chan_sip specific. It doesn’t exist in PJSIP, and there’s no functionality to individually alter just the To URI. Any changes apply to both request URI and to URI.