cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
499
Views
0
Helpful
0
Replies

Cisco SIP Normalization Script Help

Jamin Horton
Level 4
Level 4

Hello Community,

 

Need some help with modifying an OUTBOUND SDP invite. Currently it's utilizing in-band DTMF payload in the invite no matter what I set the preference too. My requirement is that the CUCM and far end utilize out-of-band for DTMF. I've tried every possible configuration on the CUCM but I always start the conversation with a in-band DTMF. My initial thought was to create a SIP Normalization rule that would rewrite the a=fmtp and a=rtpmap attributes in the SDP. My problem (obviously) is I can't seem to get my head around the LUA script logic nor can I find any information on testing the script. Would be nice if I develop a script, upload it somewhere and run and INVITE against it and see if it changes anything. Kind of like the test translation rules on the GW's.

Any help is appreciated!

So currently my SDP contains the following.

a=rtpmap:101 telephone-event/8000

a=ftmp:101 0-15

I'm looking to change my invite to out-of-band for DTMF. As I understand it and I could be wrong I want to change it to the following,

a=rtpmap:100 telephone-event/8000

a=ftmp:100 0-15

 

So if I'm correct on my assumptions above I will then come up with a SIP Normalization Script that will rewrite those attributes.

I came across the following document --> http://www.cisco.com/c/en/us/td/docs/voice_ip_comm/cucm/sip_tn/8_5_1/sip_t_n/4-sdp_api.html#wp1063851

Based on my limited understanding I have come up with the following in order to change the SDP attributes. How far am I off?

 

M = {}
function M.outbound_INVITE(msg)
    local sdp = msg:getSdp()
    
    if sdp
    then
    local rtpmap_line = sdp:getLine("a=rtpmap", "101 telephone-event/8000")
       
    if rtpmap_line
    then

    rtpmap_line = rtpmap_line:gsub("101 telephone-event/8000", "100 telephone-event/8000")
        sdp = sdp:modifyLine("a=rtpmap",:"100 telephone-event/8000", rtpmap_line)
        msg:setSdp(sdp)
      
    if sdp
    then
    local fmtp_line = sdp:getLine("a=fmtp", "101 0-15")
       
    if fmtp_line
    then

    fmtp_line = fmtp_line:gsub("101 0-15", "100 0-15"
        sdp = sdp:modifyLine("a=fmtp",:"100 0-15", fmtp_line)
        msg:setSdp(sdp)
    end
end

 

 

 

 

0 Replies 0