Hi, I have been looking though all the other posts around this and it seems a few people have had similar issues. I am using Asterisk 16.28.0 running on Debian.
the documentation from my sip provider seems to only cover older version of asterisk and states to set the outbound CID to add the header with the following on the dialplan
SIPAddHeader(P-Preferred-Identity: <sip:[4420300000000@sipconnect.sipgate.co.uk])
but after doing a lot of research I have discovered this will not work for PJSIP registrations and I should be using PJSIP_HEADER instead I have attempted this in a number of ways.
exten => _0X.,1,NoOp(Dialing external number)
same => n,Set(PJSIP_HEADER(add,P-Preferred-Identity)="<sip:445603011069@sipconnect.sipgate.co.uk>")
same => n,Dial(PJSIP/+44${EXTEN:1}@SipgateTrunk)
I then seen people saying it needs to be done with option b so attempted this on my dial plan
exten => _0X.,1,NoOp(Dialing external number)
same => n,Dial(PJSIP/+44${EXTEN:1}@SipgateTrunk,,b(SetOutLine^Line^1))
[SetOutLine]
exten => Line,1,NoOp(** Pre dial settings **)
same => n,Set(PJSIP_HEADER(add,P-Preferred-Identity)="<sip:445603011069@sipconnect.sipgate.co.uk>")
same => n,Return()
I have also seen some comments with users using the same SIP provider in a different country saying not to use the < > around the sip:445603011069@sipconnect.sipgate.co.uk but ever time I attempt to dial out the number used is the trunk default number.
I have also attempted to set “send_pai=no/yes” option in the endpoint section of the SIP providers config in PJSIP.conf without any affect. is there any other settings that I should consider. I am not creating complex dialplans currently as I want to ensure all features are working as expected before I add complexity. hence the statistic assigned header.
Any help with this would be greatly appreciated.
thanks
Vip32