cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4006
Views
10
Helpful
3
Replies

Normalization Script

shane.orr
Level 4
Level 4

I have vitually the same problem as posted below.

https://supportforums.cisco.com/message/3797939#3797939

After talking to TAC, the 3rd Party PBX is sending the SIP Contact Header and forcing Call Manager 8.6 to reject the call with a "SIP/2.0 400 Bad Request - 'Malformed/Missing Contact field'"

In my case calls all inbound calls are failing when marked as anonymous/private

PSTN <PRI> Nortel CS1k <SIP> Avaya Session Manager <SIP> Call Manager 8.6

I do not have CUBE, simply SIP Trunk directly from AvayaSM to UCM.

So I was wondering if anyone has any Normalization script advice.  I've been referring to the URL below but not much luck.

http://www.cisco.com/en/US/docs/voice_ip_comm/cucm/sip_tn/9_0_1/sip_t_n.html

Current Incoming Private SIP Contact Header:

e.g.

Contact: <sip:anonymous.invalid;phone-context=+1@company.com:5060;maddr=1.1.1.1;transport=udp;user=phone>

Wanting to replace “anonymous.invalid;phone-context=+1” with “00000”:

e.g.

Contact: <sip:00000@company.com:5060;maddr=1.1.1.1;transport=udp;user=phone>

...or any other advice welcome.

Thanks in advance!           

1 Accepted Solution

Accepted Solutions

shane.orr
Level 4
Level 4

For anyone intersted I fixed my problem with the following script.  The script is two-fold;

1. Lights Nortel MWI by replacing the word "voicemail" from the SIP "From" message to an arbitrary "1000" numerical value because Nortel will only recognize a number in the MWI SIP Notify outbound.

2. Modifies the SIP "Contact" message replacing the word "anonymous.invalid" to an arbitrary "12345" numerical value for Call Manager to accept private calls inbound.

Nortel = {}

Nortel.allowHeaders = {"History-Info"}

local contact_number = scriptParameters.getValue("contact-number")
local mwi_number = scriptParameters.getValue("mwi-number")

if not contact_number
then
    contact_number = "12345"
end

if not mwi_number
then
    mwi_number = "1000"
end

function Nortel.inbound_INVITE(msg)
    local from = msg:getHeader("Contact")
    if from
    then
        from = from:gsub("anonymous.invalid", contact_number)
        msg:modifyHeader("Contact", from)
    end
end

function Nortel.outbound_ANY(msg)
    msg:removeHeaderValue("Allow", "OPTIONS")
    end

function Nortel.outbound_ANY_ANY(msg)
    msg:removeHeaderValue("Allow", "OPTIONS")
    end

function Nortel.outbound_NOTIFY(msg)
    msg:removeHeaderValue("Allow", "OPTIONS")

    local from = msg:getHeader("From")
    if from
    then
        from = from:gsub("voicemail", mwi_number)
        msg:modifyHeader("From", from)
        msg:addHeaderUriParameter("From", "user", "phone")
    end
end

return Nortel

View solution in original post

3 Replies 3

shane.orr
Level 4
Level 4

For anyone intersted I fixed my problem with the following script.  The script is two-fold;

1. Lights Nortel MWI by replacing the word "voicemail" from the SIP "From" message to an arbitrary "1000" numerical value because Nortel will only recognize a number in the MWI SIP Notify outbound.

2. Modifies the SIP "Contact" message replacing the word "anonymous.invalid" to an arbitrary "12345" numerical value for Call Manager to accept private calls inbound.

Nortel = {}

Nortel.allowHeaders = {"History-Info"}

local contact_number = scriptParameters.getValue("contact-number")
local mwi_number = scriptParameters.getValue("mwi-number")

if not contact_number
then
    contact_number = "12345"
end

if not mwi_number
then
    mwi_number = "1000"
end

function Nortel.inbound_INVITE(msg)
    local from = msg:getHeader("Contact")
    if from
    then
        from = from:gsub("anonymous.invalid", contact_number)
        msg:modifyHeader("Contact", from)
    end
end

function Nortel.outbound_ANY(msg)
    msg:removeHeaderValue("Allow", "OPTIONS")
    end

function Nortel.outbound_ANY_ANY(msg)
    msg:removeHeaderValue("Allow", "OPTIONS")
    end

function Nortel.outbound_NOTIFY(msg)
    msg:removeHeaderValue("Allow", "OPTIONS")

    local from = msg:getHeader("From")
    if from
    then
        from = from:gsub("voicemail", mwi_number)
        msg:modifyHeader("From", from)
        msg:addHeaderUriParameter("From", "user", "phone")
    end
end

return Nortel

One thing I've noticed about great postings, is that often they go unnoticed. Let's hope that is not the case here.

Thanks Paolo!