<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Have you tried using the substitution transformation?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><a href="https://www.opensips.org/Documentation/Script-Tran-2-4#toc82">https://www.opensips.org/Documentation/Script-Tran-2-4#toc82</a><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="color:black">Ben Newlin </span><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:12.0pt;color:black">From: </span></b><span style="font-size:12.0pt;color:black">Users <users-bounces@lists.opensips.org> on behalf of Mickael Hubert <mickael@winlux.fr><br>
<b>Reply-To: </b>OpenSIPS users mailling list <users@lists.opensips.org><br>
<b>Date: </b>Wednesday, November 27, 2019 at 11:11 AM<br>
<b>To: </b>OpenSIPS users mailling list <users@lists.opensips.org><br>
<b>Subject: </b>[OpenSIPS-Users] Extract data from AVP<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">Hi all,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">I want to extract the channel ID from a line in SDP (a=channel:d87c363c1b5b4f13@speechrecog)<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">I can extract this line, but I don't know how can I have only the ID (d87c363c1b5b4f13)<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Do you have a way for me please ?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">thanks in advance<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">SDP example:<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">***********<br>
<span style="font-family:"Courier New"">m=application 1544 TCP/MRCPv2 1<br>
a=setup:passive<br>
a=connection:new<br>
a=channel:d87c363c1b5b4f13@speechrecog<br>
a=cmid:1<br>
m=audio 5002 RTP/AVP 8 101</span><br>
*************<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">My conf:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">My result: "line in the SDP body is a=channel:d87c363c1b5b4f13@speechrecog"<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">I want only: d87c363c1b5b4f13 in specific avp<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#4EC9B0">onreply_route</span><span style="font-size:10.5pt;font-family:"Courier New";color:#DCDCAA">[reply_mrcp]</span><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4"><o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4">{<o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4">xlog(</span><span style="font-size:10.5pt;font-family:"Courier New";color:#CE9178">"L_INFO"</span><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4">,</span><span style="font-size:10.5pt;font-family:"Courier New";color:#CE9178">"$avp(startlog)
In REPLY ROUTE MRCP - fu : $fu , si : $si , rs: $rs</span><span style="font-size:10.5pt;font-family:"Courier New";color:#D7BA7D">\n</span><span style="font-size:10.5pt;font-family:"Courier New";color:#CE9178">"</span><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4">);<o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#C586C0">if</span><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4">(has_body_part(</span><span style="font-size:10.5pt;font-family:"Courier New";color:#CE9178">"application/sdp"</span><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4">))<o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4">{<o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#C586C0">if</span><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4"> (search_body(</span><span style="font-size:10.5pt;font-family:"Courier New";color:#CE9178">"m=application.*TCP</span><span style="font-size:10.5pt;font-family:"Courier New";color:#D7BA7D">\/</span><span style="font-size:10.5pt;font-family:"Courier New";color:#CE9178">MRCPv2"</span><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4">))<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4">{
<o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#C586C0">if</span><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4">(search_body(</span><span style="font-size:10.5pt;font-family:"Courier New";color:#CE9178">"a=channel:.*"</span><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4">))
{<o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#9CDCFE">$var(i)</span><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4">=<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#B5CEA8">0</span><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4">;<o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#9CDCFE">$var(whileflag)</span><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4">=<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#B5CEA8">0</span><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4">;<o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#C586C0">while</span><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4"> (</span><span style="font-size:10.5pt;font-family:"Courier New";color:#9CDCFE">$var(i)</span><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4"><<o:p> </o:p></span></p>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#B5CEA8">10</span><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4">&&<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#9CDCFE">$var(whileflag)</span><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4">!=<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#B5CEA8">1</span><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4">)<o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4">{<o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#9CDCFE">$avp(aline)</span><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4">= $(rb{sdp.line,a,</span><span style="font-size:10.5pt;font-family:"Courier New";color:#9CDCFE">$var(i)</span><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4">});<o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#C586C0">if</span><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4">(</span><span style="font-size:10.5pt;font-family:"Courier New";color:#9CDCFE">$avp(aline)</span><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4">=~</span><span style="font-size:10.5pt;font-family:"Courier New";color:#CE9178">"a=channel"</span><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4">)<o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4">{<o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4">xlog(</span><span style="font-size:10.5pt;font-family:"Courier New";color:#CE9178">"line in the SDP body is $avp(aline)</span><span style="font-size:10.5pt;font-family:"Courier New";color:#D7BA7D">\n</span><span style="font-size:10.5pt;font-family:"Courier New";color:#CE9178">"</span><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4">);<o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#9CDCFE">$var(whileflag)</span><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4">=<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#B5CEA8">1</span><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4">;<o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4">}<o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#9CDCFE">$var(i)</span><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4">=<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#9CDCFE">$var(i)</span><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4">+<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#B5CEA8">1</span><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4">;<o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4">}<o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4">xlog(</span><span style="font-size:10.5pt;font-family:"Courier New";color:#CE9178">"var i = $var(i)</span><span style="font-size:10.5pt;font-family:"Courier New";color:#D7BA7D">\n</span><span style="font-size:10.5pt;font-family:"Courier New";color:#CE9178">"</span><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4">);<o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4">}<o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4">}<o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4">}<o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4">}<o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier New";color:#D4D4D4"><o:p> </o:p></span></p>
</div>
</div>
</div>
</div>
</body>
</html>