Hi,
My trunk-provider requires P-Asserted-Identity to be set on outgoing calls to one of the numbers that we have with them to bill the correct number regardless of outgoing caller-id.
I set this up with PJSIP and have “Send RPID/PAI” set to “Send P-Asserted-Identity header”. This works when a call has one of the called ids from this provider as it gets set to the same value as the outgoing caller id.
We have another number that we wish to set as the caller id, but since the number is not with this provider, we need to set the PAI to another value than the caller id and this I’m unsuccessful with.
This is the extensions_custom.conf that I tried using.
[set-pai-user1]
exten => s,1,Noop(entering user defined context custom-sip-header in extensions_custom.conf)
exten => s,n,Set(CALLERID(all)="Main Office" <XXXX>))
exten => s,n,GoSub(func-set-sipheader,s,1(P-Asserted-Identity,<sip:${FROMEXTEN}@YYYY.siptrunk.provider.net\;user=phone>))
exten => s,n,DumpChan()
exten => s,n,Return
The caller id gets set correct, however, it seems that the PAI header is overwritten by the Send PAI setting for the trunk and the PAI that is set is based on the caller id rathern than what I set in the custom extension. This results in the call being dropped by the provider.
DumpChan()
Info:
Name= PJSIP/provider-00000050
Type= PJSIP
UniqueID= 1615896806.80
LinkedID= 1615896806.80
CallerIDNum= XXXX
CallerIDName= Main Office
ConnectedLineIDNum= (N/A)
ConnectedLineIDName=(N/A)
DNIDDigits= ZZZZ
RDNIS= (N/A)
Parkinglot=
Language= en
State= Ring (4)
Rings= 1
NativeFormat= (alaw)
WriteFormat= alaw
ReadFormat= alaw
RawWriteFormat= alaw
RawReadFormat= alaw
WriteTranscode= No
ReadTranscode= No
1stFileDescriptor= -1
Framesin= 0
Framesout= 0
TimetoHangup= 0
ElapsedTime= 0h0m0s
BridgeID= (Not bridged)
Context= set-pai-user1
Extension= s
Priority= 6
CallGroup=
PickupGroup=
Application= DumpChan
Data= (Empty)
Blocking_in= (Not Blocking)
Variables:
GOSUB_RETVAL=
~HASH~SIPHEADERS~P-Asserted-Identity~=<sip:[email protected];user=phone>
ARGC=0
CALLINGNUMPRES_SV=allowed_not_screened
CALLINGNAMEPRES_SV=allowed_not_screened
REVERSAL_REJECT=FALSE
MOHCLASS=oder18
CALLED_BLACKLIST=1
returnhere=1
FROMEXTEN=BBBB
REC_POLICY_MODE_SAVE=
MON_FMT=wav
TIMESTR=20210316-131326
YEAR=2021
MONTH=03
DAY=16
NOW=1615896806
REC_STATUS=INITIALIZED
FROM_DID=ZZZZ
DIRECTION=INBOUND
SIP-invite
INVITE sip:[email protected];user=phone SIP/2.0
Via: SIP/2.0/UDP 2.2.2.2:5060;rport;branch=z9hG4bKPj48859a4d-135b-47f1-943b-c7df2325dc54
From: "Main Office" <sip:[email protected];user=phone>;tag=518e0300-0e4e-4524-9b40-c96981dbcb53
To: <sip:[email protected];user=phone>
Contact: <sip:[email protected]:5060>
Call-ID: 6e5e392a-c8ec-4fd1-b226-94035049120c
CSeq: 9409 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub, histinfo
Session-Expires: 1800
Min-SE: 90
P-Asserted-Identity: "Main Office" <sip:[email protected];user=phone>
Max-Forwards: 70
User-Agent: FPBX-15.0.17.24(16.15.1)
Content-Type: application/sdp
Content-Length: 313
I also tried adding a “[macro-dialout-trunk-predial-hook]” to the extensions_custom with the PAI rewrite, even though I had read that macros no longer exist, but as excpeted this didn’t work either.
Does anyone have a suggestion on how I could solve this?
Thanks!