Description of My Environment
- CLIENT is an extension using sipml5.
- FREEPBX is FreePBX 15 with Asterisk 16.30.
- TRUNK is the telecom provider’s trunk.
I am making outbound calls from CLIENT through FREEPBX to TRUNK. Now, I want FREEPBX to include its unique call ID in the SIP header when responding to CLIENT during the call. The information should be related only to FREEPBX and should have nothing to do with TRUNK.
I have added the following configuration in extensions_custom.conf:
[from-internal-custom]
exten => _X.,1,NoOp(=== FreePBX Custom UniqueID Injection ===)
exten => _X.,n,ExecIf($["${UNIQUE_CALL_ID}" = ""]?Set(UNIQUE_CALL_ID=${CHANNEL(uniqueid)}))
exten => _X.,n,ExecIf($["${PJSIP_HEADER(read,X-UniqueID)}" = ""]?Set(PJSIP_HEADER(add,X-UniqueID)=${UNIQUE_CALL_ID}))
exten => _X.,n,NoOp(=== X-UniqueID: ${UNIQUE_CALL_ID} ===)
exten => _X.,n,NoOp(=== CALLERID: ${CALLERID(num)} ===)
I have also confirmed from the logs that this script is executing.
However, when checking CLIENT, I do not see the X-UniqueID in the received headers, and it is also missing from the SIP logs on FREEPBX (but log shows dialplan executed).
Is there anything I did wrong?
Thank you!