Forum Discussion

Al_Walter_10251's avatar
Al_Walter_10251
Icon for Nimbostratus rankNimbostratus
Mar 16, 2007

SDP::media conn media-index “new value”

Can anyone tell how to use the following syntax in an iRule:

 

 

SDP::media conn media-index “new value”

 

Rewrite SDP media connection info of media media-index

 

 

Here's what I'm trying (without success):

 

 

when SIP_RESPONSE {

 

SDP::media conn media-index "IN IP4 xx.xx.xx.xx"

 

}

 

 

(Be gentle, I'm new to iRule coding)

3 Replies

  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    When you say this isn't working, what do you mean exactly? Are you getting a syntax error when trying to load the config into memory, or are you just not seeing the results you're expecting when this code is being executed?

     

     

    Do you have the EA license required to get the SDP functionality working?

     

     

    Colin
  • i am a F5, iRules newbie and I am trying to do the same. Can someone tell me how I can change the IP address to the F5's VIP in the SDP body?

     

     

    We are using 9.4.3 version.
  • Deb_Allen_18's avatar
    Deb_Allen_18
    Historic F5 Account
    It looks like the is supposed to be the value of an index at which new data would be written. I've updated the wiki page to indicate media-index is a parameter value, not a literal part of the command.

    From the (updated) wiki page (Click here)

    SDP::media conn “new value”

    * Rewrite SDP media connection info of media media-index

    From RFC4566:

    5.7. Connection Data ("c=")

    c=

    The "c=" field contains connection data.

    A session description MUST contain either at least one "c=" field in each media description or a single "c=" field at the session level. It MAY contain a single session-level "c=" field and additional "c=" field(s) per media description, in which case the per-media values override the session-level settings for the respective media.

    ...

    5.14. Media Descriptions ("m=")

    m= ...

    A session description may contain a number of media descriptions.

    ...

    If multiple addresses are specified in the "c=" field and multiple ports are specified in the "m=" field, a one-to-one mapping from port to the corresponding address is implied. For example:

    c=IN IP4 224.2.1.1/127/2

    m=video 49170/2 RTP/AVP 31

    would imply that address 224.2.1.1 is used with ports 49170 and 49171, and address 224.2.1.2 is used with ports 49172 and 49173.

    Considering that one-to-one correspondence, I'd assume you could easily determine the value for which you'd want to replace the connection info.

    So if there were only a single media index, I'm guessing you'd invoke the command like this:

    
    when SIP_RESPONSE {
    SDP::media conn 0 "IN IP4 xx.xx.xx.xx"
    }

    (Only guessing because I quite literally know nothing else other than what I've deduced above. Postback would be appreciated if it works so I can further update the wiki page.)

    HTH

    /deb