<div dir="ltr">Hi,<div>I am trying to append new field in SDP and I need to append new line but I don't know how. I tried to google for solution but I didn't find anything.</div><div><br></div><div>I want to route my RTP and RTCP packet to port 5060 (this is for development of my school project, I know that in the context of correct SIP this has no sense but this is only experimental).</div>
<div><br></div><div>My sample kamailio.cfg code:</div><div><br></div><div><div>                                if (is_method("INVITE"))<br></div><div>                                {</div><div>                                        # route RTP packets to 5060</div>
<div>                                        if (search_body('m=audio [0-9]+'))</div><div>                                        {</div><div>                                                subst_body('/^m=audio [0-9]+/m=audio 5060/g');</div>
<div>                                        }</div><div><br></div><div>                                        # route RTCP packets to 5060</div><div>                                        if (search_body('a=rtcp:[0-9]+ IN IP4 [0-9]+.[0-9]+.[0-9]+.[0-9]+'))</div>
<div>                                        {</div><div>                                                subst_body('/^a=rtcp:[0-9]+ IN IP4 [0-9]+.[0-9]+.[0-9]+.[0-9]+/a=rtcp:5060 IN IP4 <a href="http://192.168.11.129/g'">192.168.11.129/g'</a>);</div>
<div>                                        }</div><div>                                        else</div><div>                                        {</div><div>                                                search_append_body('m=audio [0-9]+ RTP/AVP [0-9]+ [0-9]+ [0-9]+ [0-9]+ [0-9]+ [0-9]+ [0-9]+', '<b>{NEW_LINE_NEEDED_HERE}</b>a=rtcp:5060 IN IP4 192.168.11.129');</div>
<div>                                        }</div><div>                                }</div><div>                        }</div><div><br></div></div><div><br></div><div>Could someone please help me resolve what should I replace the {NEW_LINE_NEEDED_HERE} with to add new line after 'm=audio' field? Also If you have some idea how should I optimize my regexp for finding 'm=audio'/'a=rtcp' fields I would appreciate your help.</div>
<div><br></div><div><br></div></div>