[cisco-voip] UCM 9.1 SIP Normalization Rules

Pavan K pav.ccie at gmail.com
Fri Mar 14 10:04:20 EDT 2014


Matt,

Here is a script i wrote to get this done a long time back.
This was to strip the 5060 from the request URI going towards an IMS core
on an ISC trunk but it should work for you.


==


-- Strip off the port information from the Request URI


local function stripPortFromRequestURI(msg)




    -- Get the URI from the SIP Request


    local method, uri, ver = msg:getRequestLine()




    if uri


    then


        -- Split the uri into SIP URI & URI Parameters


        local newuri, params = string.match(uri, "([^;]*)(;.*)")




        if not newuri


        then


            newuri = uri


        end




        -- Get the USER & the HOST part of the URI


        local lhs, rhs = string.match(newuri, "(.*)@(.*)")




        local _, numOfColons = string.gsub(rhs, ":", ":")




        -- If there are minimum of 2 ":", then the host part is an IPv6
Address


        if numOfColons >= 2


        then


            -- This is a n IPv6 Address




            -- URI with IPv6 address will be of the form -
sip:user:password@[1234::5678]:5060


            -- Check if the host part contains "]", if so, port number
might be present


            rhs = string.gsub(rhs, "(%[.*%]):.*", "%1")


        else


            -- This is an IPv4 address or a FQDN




            -- Strip off the characters after ":" (i.e) the port number


            rhs = string.gsub(rhs, "(.*):.*", "%1")


        end




        -- Generate the modified URI


        newuri = string.format("%s@%s%s", lhs, rhs, params or "")




        -- Set the new SIP URI


        msg:setRequestUri(newuri)


    end


end




M.outbound_200_INVITE  = stripPortFromRequestURI


M.outbound_INVITE      = stripPortFromRequestURI




return M


====


On Fri, Mar 14, 2014 at 8:37 AM, Matt Slaga (AM) <
matt.slaga at dimensiondata.com> wrote:

> The port number is actually something entirely different.  In this case, I
> have 70 SIP trunks between UCM and Lync for a global egress point access
> (CSS different for each SIP trunk).  The ports are actually in the
> 5020-5050 range.
>
>
>
> UCM puts this request in the SIP Start Line (Invite) with 5060 regardless
> of what the SIP trunk uses.
>
>
>
> Everything works fine if the user is part of the Lync pool that is
> associated with the Mediation server.  If they are on a different pool,
> this port of 5060 (not talking transport here, just SIP message adjustment)
> causes Lync to drop the invite.  When this port reads 5061 in the SIP
> invite, the calls flow properly.
>
>
>
>
>
>
>
> *From:* Florian Kroessbacher [mailto:florian.kroessbacher at gmail.com]
> *Sent:* Friday, March 14, 2014 9:24 AM
> *To:* Matt Slaga (AM)
> *Cc:* 'Cisco-Voip-Puck' (cisco-voip at puck.nether.net)
> *Subject:* Re: [cisco-voip] UCM 9.1 SIP Normalization Rules
>
>
>
>
>
> what about to change the destination port in the siptrunk config ??
>
> --
> Florian Kroessbacher
> gmail: florian.kroessbacher at gmail.com
>
>
>
> On Fri, Mar 14, 2014 at 2:20 PM, Matt Slaga (AM) <
> matt.slaga at dimensiondata.com> wrote:
>
> I'm attempting to apply a SIP Normalization rule to make a port adjustment
> on SIP calls between UCM and Lync 2013.
>
>
>
> In the header, UCM sends the port number as 5060.  Lync has problems
> digesting this when referring the call to another pool and wants to see the
> header at 5061.
>
>
>
> The script we are attempting to use is below.  It has been applied to the
> various SIP trunks between UCM and Lync.
>
>
>
> When reviewing traces, the port is not being adjusted.  Either the LUA
> script is wrong below, or for some reason it is not being applied.
>
>
>
> Any thoughts?
>
>
>
>
>
> M = {}
> function M.outbound_INVITE(msg)
> local method, ruri, ver = msg:getRequestLine()
> local uri = string.gsub(ruri, "5060", "5061")
> msg:setRequestUri(uri)
> end
> return M
>
>
>
>
>
> <image001.png>
>
>
>
> <image002.png>
>
>
>
>
>
>
>
> Matt Slaga
>
> Dimension Data
>
> Tel:+1-571-203-4132
>
> Matt.Slaga at DimensionData.com
>
>
>
>
>
>
> itevomcid
>
> _______________________________________________
> cisco-voip mailing list
> cisco-voip at puck.nether.net
> https://puck.nether.net/mailman/listinfo/cisco-voip
>
>


-- 
- Pavan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://puck.nether.net/pipermail/cisco-voip/attachments/20140314/b8059532/attachment.html>


More information about the cisco-voip mailing list