Diversion Header problem: change <tel:> to <sip:> (solved)

dear community,

i have a problem:
i have activated the diversion header generation in the advanced settings tab.

all is good, but my diversion header must show like: <sip:+49XXXXXXXXXXX>.
but asterisk create the diversion header like this: <tel:+49XXXXXXXXXXX>.

how i can change the tel to sip? any possibilities?

thank you very much

have now tried to change this file:

/etc/asterisk/extensions_additional.conf:
changed the line:
exten => s,n,SIPAddHeader(Diversion: <tel:FROM_DID};reason=${DIVERSION_REASON};screen=no;privacy=off)
to
exten => s,n,SIPAddHeader(Diversion: <sip:FROM_DID;reason=${DIVERSION_REASON};screen=no;privacy=off)

it worked for me, but if i change anything in freepbx and apply config,
the changes are the old one.

how i can fix this that freepbx always keep my changes?

thanks!

/etc/asterisk/extensions_additional.conf is owned by FreePBX (as it says in the file) and not for manual edits.
To add your own custom dial plan, use /etc/asterisk/extensions_custom.conf

hello community,

if i activate the diversion headers, the file extensions_additional.conf will be auto filled with:
[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,GotoIf($["${CHANNEL(channeltype)}"=“PJSIP”]?pjsip)
exten => s,n,SIPAddHeader(Diversion: tel:${FROM_DID};reason=${DIVERSION_REASON};screen=no;privacy=off)
exten => s,n,Return()
exten => s,n(pjsip),Set(PJSIP_HEADER(add,Diversion)=;privacy=off;screen=no;reason=${DIVERSION_REASON}))
exten => s,n,Return()

but if i change this (from tel: to sip:) then it works. but on each configuration load from freepbx,
the file will be changed to the old tel:

have tried to add the whole:
[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,GotoIf($["${CHANNEL(channeltype)}"=“PJSIP”]?pjsip)
exten => s,n,SIPAddHeader(Diversion: sip:${FROM_DID};reason=${DIVERSION_REASON};screen=no;privacy=off)
exten => s,n,Return()
exten => s,n(pjsip),Set(PJSIP_HEADER(add,Diversion)=;privacy=off;screen=no;reason=${DIVERSION_REASON}))
exten => s,n,Return()

to the extensions_custom.conf and to a reload, but asterisk always use the diversion header with tel:

can anybody helps me? where i can change this tel to sip in the freepbx configuration?

thanks

There is a config file called “extension_freepbx_override.conf” (IIRC - look for ‘override’).

In this file, you can specify local changes to the “standard” dial plans.

Copy your code into that file (with the context name and all of the lines) and it will get defined first, which disables the code from the system’s update.

If you do this, you will need to double-check the original context hasn’t changed. If it’s the same, you’re good. If it’s different, then you may need to analyze the differences and see if they apply to your custom code.

Thank you very much Dave Burgess,

that has solved my problem :slight_smile:

Thank you!

many greets