Hello Daniel<br><br><div class="gmail_quote">2012/9/11 Daniel-Constantin Mierla <span dir="ltr">&lt;<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">


  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    I think that it would be better to have a generic function in the
    configuration file like:<br>
    <br>
    sdp_get_attr(line, attr, result)<br>
    <br>
    Where line can be: m, c, o, etc ...<br>
    <br></div></blockquote><div>I&#39;m agree with that<br> <br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000">


    The attr can be: ip, port, ...<br>
    <br>
    For the moment, this function will be a wrapper around the two
    functions, so it supports:<br>
    - sdp_get_attr(&quot;m&quot;, &quot;port&quot;, result)<br>
    - sdp_get_attr(&quot;c&quot;, &quot;ip&quot;, result)<br>
    <br></div></blockquote><div><br>But how to specify a line if a multiple &#39;a&#39; or &#39;m&#39; will be in sdp body ?<br>For example this one:<br> -------<br>a=recvonly<br>m=audio 49170 RTP/AVP 0<br>m=video 51372 RTP/AVP 31<br>

m=application 32416 udp wb<br>a=orient:portrait<br> -------<br>or:<br> -------<br>m=audio 19000 RTP/AVP 0 101<br>a=recvonly<br>a=rtpmap:0 pcmu/8000<br>a=rtpmap:101 telephone-event/8000<br> -------<br><br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

<div bgcolor="#FFFFFF" text="#000000">
    There are many attributes that can be returned, thus it can results
    in dozens of the configuration file functions if we go for one per
    attribute.<br>
    <br>
    What do you think?<br>
    <br>
    Also, at some point I should add a PV class for sdp access (if
    nobody will do it meanwhile).<br>
    <br>
    Cheers,<br>
    Daniel<div><div class="h5"><br>
    <br>
    <br>
    <div>On 9/11/12 11:51 AM, Vicente Hernando
      wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div>Hello Konstantin,<br>
        <br>
        attached patch provides a function that gets ports and stores
        them in an AVP variable.<br>
        <br>
        <br>
        However, there are other approaches to create these functions:<br>
        <br>
        - A function to return each parameter (sdp_get_ip_c,
        sdp_get_port, etc)<br>
        <br>
        - An only function sdp_get_address which return two AVP
        variables, IP and port for each stream.<br>
        <br>
        - A generic function sdp_get_stream_info which receives an enum
        indicating what variable do you like and return it.<br>
        <br>
        - Two functions: sdp_get_stream_count,
        sdp_get_stream_info(stream_num, enum_variable, pseudo_variable)<br>
        First would get total number of streams (asuming one session in
        offer/answer way), and second function would return that
        variable value for a stream.<br>
        <br>
        <br>
        Daniel, as sdpops maintainer which approach would you rather?<br>
        <br>
        <br>
        Kind regards,<br>
        Vicente. <br>
        <br>
        On 09/07/2012 04:37 PM, Konstantin M. wrote:<br>
      </div>
      <blockquote type="cite">Hi Vicente,<br>
        <br>
        It&#39;s my personal but I think would be good to also have another
        one function to extract a port of media stream.<br>
        Because of no &#39;sdp_get_ip_c&#39; and no something like
        &#39;sdp_get_port_c&#39; - I have to parse sdb body by python script
        just to fetch IP/PORT of media stream...<br>
        <br>
        <br>
        <div class="gmail_quote">2012/9/7 Vicente Hernando <span dir="ltr">&lt;<a href="mailto:vhernando@systemonenoc.com" target="_blank">vhernando@systemonenoc.com</a>&gt;</span><br>
          <blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> Hello,<br>
            <br>
            attached patch shows a new function in sdpops module:
            sdp_get_ip_c<br>
            <br>
            It receives as parameter an avp variable, and stores there
            every connection IP for each stream. If a stream has not c
            IP, then it returns session default one.<br>
            <br>
            <br>
            Any opinion or criticism?<br>
            <br>
            <br>
            Kind regards,<br>
            Vicente.<br>
            <br>
            _______________________________________________<br>
            sr-dev mailing list<br>
            <a href="mailto:sr-dev@lists.sip-router.org" target="_blank">sr-dev@lists.sip-router.org</a><br>
            <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a><br>
            <br>
          </blockquote>
        </div>
        <br>
        <br>
        <fieldset></fieldset>
        <br>
        <pre>_______________________________________________
sr-dev mailing list
<a href="mailto:sr-dev@lists.sip-router.org" target="_blank">sr-dev@lists.sip-router.org</a>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a>
</pre>
      </blockquote>
      <br>
      <br>
      <fieldset></fieldset>
      <br>
      <pre>_______________________________________________
sr-dev mailing list
<a href="mailto:sr-dev@lists.sip-router.org" target="_blank">sr-dev@lists.sip-router.org</a>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a>
</pre>
    </blockquote>
    <br>
    </div></div><span class="HOEnZb"><font color="#888888"><pre cols="72">-- 
Daniel-Constantin Mierla - <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a>
<a href="http://twitter.com/#%21/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a>
Kamailio Advanced Training, Berlin, Nov 5-8, 2012 - <a href="http://asipto.com/u/kat" target="_blank">http://asipto.com/u/kat</a>
Kamailio Advanced Training, Miami, USA, Nov 12-14, 2012 - <a href="http://asipto.com/u/katu" target="_blank">http://asipto.com/u/katu</a></pre>
  </font></span></div>

<br>_______________________________________________<br>
sr-dev mailing list<br>
<a href="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a><br>
<br></blockquote></div><br>