I have my server runs FreePBX version 16 with Asterisk version 18.20.2
I need to add sip Diversion header when an extension call forward is turned on. I have set the “Generate Diversion Headers” under Advanced Settings but I still don’t see the PBX include the diversion header in the sip invite. I have checked the “extensions_additional.conf” config file and confirmed that the below settings exist for the diversion header, but still the server doesn’t add diversion header. I read all the related topics for adding diversion headers but none of them help in my case, would you please direct me how to do this? Thanks.
[sub-diversion-header]
include =>; sub-diversion-header-custom
exten =>; s,1,Set(DIVERSION_REASON=${IF($[${LEN(${DIVERSION_REASON})}=0]?no-answer:${DIVERSION_REASON})})
exten =>; s,n,Gosub(func-set-sipheader,s,1(Diversion,<tel:${FROM_DID}>;;reason=${DIVERSION_REASON};screen=no;privacy=off))
exten =>; s,n,Return()
exten =>; s,n,Set(DIVERSION_REASON=${IF($[${LEN(${DIVERSION_REASON})}=0]?no-answer:${DIVERSION_REASON})})
exten =>; s,n,Gosub(func-set-sipheader,s,1(Diversion,<tel:${FROM_DID}>;;reason=${DIVERSION_REASON};screen=no;privacy=off))
exten =>; s,n,Return()
;–== end of [sub-diversion-header] ==–;
Thanks,
Robert