[cisco-voip] SIP profile to modify Diversion Header

Roger Wiklund roger.wiklund at gmail.com
Wed Apr 18 15:20:26 EDT 2012


On Wed, Apr 18, 2012 at 5:38 PM, Nick <csvoip at googlemail.com> wrote:
> Hi All
>
> I've got some sip-profiles configured within CUBE to modify the Diversion
> header that fixes Call Foward issues, i was having with Verizon SIP trunks
> in the UK, now we have had Ireland added to the same SIP trunks, however
> they are not UK and in Europe so i have to use the Irish number to modity
> the diversion header to get the call working. My issue is i'm not sure how
> to write the sip-profiles to accommadate both countries, the following is
> what I have configured, however I also need to add 35312560800 at 10.62.254.5
> into the diversion header for the Irish calls.
>
> voice class sip-profiles 1
> no request INVITE sip-header Diversion modify "<sip:(.*)@(.*)>"
> "<sip:442036150000 at 10.62.254.5>"
> no request INVITE sip-header Remote-Party-ID modify "<sip:anonymous@(.*)>"
> "<sip:442036150000 at 10.62.254.5>"
> anyone got any ideas?

If you are on 8.6.2 you have a Transformation CSS for Diversion header
on the SIP trunk.
If you are on 8.5 you can use SIP normalization script for Diversion header.

Sample script:

M = {}
local mask = scriptParameters.getValue(“Diversion-Mask”)
 function mask_diversion(msg)
    if mask
    then
      msg:applyNumberMask(“Diversion”, mask)
    end
end
function M.outbound_INVITE(msg)
mask_diversion(msg)
end
return M

It defines a “variable” called Diversion-Mask.

Under the SIP trunk config, select your script, and enter
Diversion-Mask in the Parameter Name
In the Parameter Value enter your mask, for example if 4685661XXXX.

I prefer to normalize digits/headers on the SIP-trunk in outbound
direction. If that's not possible, do it in the CUBE like Bill
suggested.
I'm in the process of writing what I think is optimal Verizon
SIP-trunk design with multi countries with CUBE, extension mobility,
TEHO etc.



More information about the cisco-voip mailing list