Diversion Headers - Spectrum (TimeWarner)

I was wondering if anybody has luck getting diversion headers working with Spectrum (formerly TimeWarner) SIP trunking?

I did a search, and couldn’t find anything definitive. I turned on diversion headers and I can see in the console that the PBX is setting the diversion header with the DID called for forwarded calls, but Spectrum is still sending the lead DID on our trunk and not the forwarded external CID.

I made a quick call to support and was told that “as long as I send a diversion header” it should pass the external CID, but that obviously isn’t happening.

I was hoping that someone else had solved this with Spectrum before I have to push support for more details.

Chan-SIP, right? Please say yes.

We just had a big discussion here last week about Diversion Headers and Spectrum/TWC. It’s not something I’d be comfortable doing in PJ-SIP.

The trunk is Chan-SIP, and most endpoints are PJSIP.

I must have missed the discussion in my searches, just found things that were a couple years old.

It’s actually one of those discussions that starts, languishes for a while, then someone figured out part of it and a new flurry happens. The most recent posts were just last week or the week before IIRC. I’m pretty sure we were discussing these diversion header in the context of “how do you do them in PJ-SIP when they are so easy in Chan-SIP”.

I can’t remember exactly who was involved or the subject line, but I think @avayax might have been in there somewhere.

This one maybe?
https://community.freepbx.org/t/diversion-header-problem-change-tel-to-sip/41383

This one was about TWC/Spectrum:

1 Like

It’s not good enough to just ‘send a diversion header’, many (most?) providers mandate that the header be formatted to their format, or else they just ignore it.

Thanks @avayax & @cynjut! Found it. Looks like it was changing tel: to sip:. I had this working before, and I don’t remember doing that, but I must have.

For reference, just added the following to extensions_override_freepbx.conf:

[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}@X.X.X.X>\;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()

;--== end of [sub-diversion-header] ==--;

I changed the tel: to sip: and added @X.X.X.X (ip of PBX) after the ${FROM_DID} and it worked like a charm.

Looks like Spectrum is only passing 10 digits for the DID, and that’s all that’s being sent in the diversion header, but I guess that’s all they need. From reading around it seems that most require 11 digits.

@lgaetz, agreed that the response wasn’t good enough from support. There should be some formatting they’re expecting, and I guess this is it… But they should tell you that when asked.