<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>23 jan 2013 kl. 05:48 skrev Austin Einter &lt;<a href="mailto:austin.einter@gmail.com">austin.einter@gmail.com</a>&gt;:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div><div><div>Dear Ole<br></div>I am not finding any example how to do it (changing a fqdn with ipaddress in sdp).<br></div>Using sdp_get i can get the sdp.<br></div>But how i can use transformation function pls let me know.<br></div></blockquote>Check the transformations cookbok!</div><div><a href="http://www.kamailio.org/wiki/cookbooks/devel/transformations#line_transformations">http://www.kamailio.org/wiki/cookbooks/devel/transformations#line_transformations</a></div><div><br><blockquote type="cite"><div dir="ltr"><div>
<br></div>The sdpops link does not give much info how to modify any line.<br></div></blockquote>You asked for changing the IP and you do that easiest with the function created to do just that in mangler.</div><div><br></div><div>In SDPops you get the attachment, the SDP, into the AVP. Then change it using string operations and transformations and add it back to the message - request or response.</div><div><br></div><div>It's pretty normal scripting. Use the transformation to get the number of lines in the avp, use a while loop and pick out each line, do the changes if needed. When you are done, use the set_body() function in the textops module to add the new SDP to the message. In the textops you also have a function named replace_body_stonce() that can do the trick for you. In short, there are many ways to do it, but you will have to read documentation :-)</div><div><br></div><div><a href="http://kamailio.org/docs/modules/3.3.x/modules_k/textops.html#id2498509">http://kamailio.org/docs/modules/3.3.x/modules_k/textops.html#id2498509</a></div><div><br></div><div>/O</div><div><br></div><div>----</div><div>Get updated! Attend the SIP Update class in Stockholm, March 2013!&nbsp;</div><div><a href="http://edvina.net/blog/2013/01/sip-update/">http://edvina.net/blog/2013/01/sip-update/</a></div><div><br></div><div><blockquote type="cite"><div dir="ltr"><div><div><br></div>Best regards<br></div>austin<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jan 22, 2013 at 6:41 PM, Olle E Johanson <span dir="ltr">&lt;<a href="mailto:olle@ozone.webway.se" target="_blank">olle@ozone.webway.se</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im HOEnZb"><br>
22 jan 2013 kl. 14:07 skrev Austin Einter &lt;<a href="mailto:austin.einter@gmail.com">austin.einter@gmail.com</a>&gt;:<br>
<br>
</div><div class="HOEnZb"><div class="h5">&gt; Dear All<br>
&gt; When 200 OK to INVITE passes through Kamailio proxy , I want to change the IP address in SDP to a specific IP address.<br>
&gt;<br>
&gt; Can this be done by just modifying configuration files or do I need to modify in source code.<br>
&gt;<br>
&gt; In case I need to modify source code, which files I need to look at.<br>
&gt;<br>
&gt; Kindly provide pointers for said problem.<br>
<br>
</div></div><div class="HOEnZb"><div class="h5">You can modify ANYTHING in a text based attachment like an SDP in the configuration script.<br>
To make it a bit simple for you, we have two modules that work with specific parts:<br>
<br>
- SDPops <a href="http://kamailio.org/docs/modules/devel/modules/sdpops.html" target="_blank">http://kamailio.org/docs/modules/devel/modules/sdpops.html</a><br>
- MANGLER <a href="http://kamailio.org/docs/modules/devel/modules/mangler.html" target="_blank">http://kamailio.org/docs/modules/devel/modules/mangler.html</a><br>
<br>
In the Mangler module there's a function called "sdp_mangle_ip()" that will make you happy.<br>
<br>
You can always copy the whole SDP into an AVP with SDP_GET, use the transformations to read one line at a time and modify it.<br>
<br>
/O<br>
<br>
----<br>
Update yourself to Kamailio 4 and new things in SIP - <a href="http://edvina.net/training/sip-update-2013/" target="_blank">http://edvina.net/training/sip-update-2013/</a><br>
New training class - three days in Stockholm - march 6-8! Register today!<br>
_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</div></div></blockquote></div><br></div>
</blockquote></div><br></body></html>