<div dir="ltr"><div>Hi all,</div><div>I want to extract the channel ID from a line in SDP (a=channel:d87c363c1b5b4f13@speechrecog)</div><div>I can extract this line, but I don't know how can I have only the ID (d87c363c1b5b4f13)</div><div><br></div><div>Do you have a way for me please ?</div><div><br></div><div>thanks in advance</div><div><br></div><div>SDP example:</div><div><div>***********<br><span style="font-family:monospace">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>*************</div></div><div><br></div><div>My conf:</div><div><br></div><div>My result: "line in the SDP body is a=channel:d87c363c1b5b4f13@speechrecog"</div><div>I want only: d87c363c1b5b4f13 in specific avp<br></div><div><div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-family:"Droid Sans Mono","monospace",monospace,"Droid Sans Fallback";font-weight:normal;font-size:14px;line-height:19px;white-space:pre"><div><span style="color:rgb(78,201,176)">onreply_route</span><span style="color:rgb(220,220,170)">[reply_mrcp]</span></div><div><span style="color:rgb(212,212,212)">{</span></div><div><span style="color:rgb(212,212,212)">  xlog(</span><span style="color:rgb(206,145,120)">"L_INFO"</span><span style="color:rgb(212,212,212)">,</span><span style="color:rgb(206,145,120)">"$avp(startlog) In REPLY ROUTE MRCP - fu : $fu , si : $si , rs: $rs</span><span style="color:rgb(215,186,125)">\n</span><span style="color:rgb(206,145,120)">"</span><span style="color:rgb(212,212,212)">);</span></div><div><span style="color:rgb(212,212,212)">  </span><span style="color:rgb(197,134,192)">if</span><span style="color:rgb(212,212,212)">(has_body_part(</span><span style="color:rgb(206,145,120)">"application/sdp"</span><span style="color:rgb(212,212,212)">))</span></div><div><span style="color:rgb(212,212,212)">  {</span></div><div><span style="color:rgb(212,212,212)">    </span><span style="color:rgb(197,134,192)">if</span><span style="color:rgb(212,212,212)"> (search_body(</span><span style="color:rgb(206,145,120)">"m=application.*TCP</span><span style="color:rgb(215,186,125)">\/</span><span style="color:rgb(206,145,120)">MRCPv2"</span><span style="color:rgb(212,212,212)">)) { </span></div><div><span style="color:rgb(212,212,212)">      </span><span style="color:rgb(197,134,192)">if</span><span style="color:rgb(212,212,212)">(search_body(</span><span style="color:rgb(206,145,120)">"a=channel:.*"</span><span style="color:rgb(212,212,212)">)) {</span></div><div><span style="color:rgb(212,212,212)">        </span><span style="color:rgb(156,220,254)">$var(i)</span><span style="color:rgb(212,212,212)"> </span><span style="color:rgb(212,212,212)">=</span><span style="color:rgb(212,212,212)"> </span><span style="color:rgb(181,206,168)">0</span><span style="color:rgb(212,212,212)">;</span></div><div><span style="color:rgb(212,212,212)">        </span><span style="color:rgb(156,220,254)">$var(whileflag)</span><span style="color:rgb(212,212,212)"> </span><span style="color:rgb(212,212,212)">=</span><span style="color:rgb(212,212,212)"> </span><span style="color:rgb(181,206,168)">0</span><span style="color:rgb(212,212,212)">;</span></div><div><span style="color:rgb(212,212,212)">        </span><span style="color:rgb(197,134,192)">while</span><span style="color:rgb(212,212,212)"> (</span><span style="color:rgb(156,220,254)">$var(i)</span><span style="color:rgb(212,212,212)"> </span><span style="color:rgb(212,212,212)"><</span><span style="color:rgb(212,212,212)"> </span><span style="color:rgb(181,206,168)">10</span><span style="color:rgb(212,212,212)"> </span><span style="color:rgb(212,212,212)">&&</span><span style="color:rgb(212,212,212)"> </span><span style="color:rgb(156,220,254)">$var(whileflag)</span><span style="color:rgb(212,212,212)"> </span><span style="color:rgb(212,212,212)">!=</span><span style="color:rgb(212,212,212)"> </span><span style="color:rgb(181,206,168)">1</span><span style="color:rgb(212,212,212)">)</span></div><div><span style="color:rgb(212,212,212)">        {</span></div><div><span style="color:rgb(212,212,212)">          </span><span style="color:rgb(156,220,254)">$avp(aline)</span><span style="color:rgb(212,212,212)"> </span><span style="color:rgb(212,212,212)">=</span><span style="color:rgb(212,212,212)"> $(rb{sdp.line,a,</span><span style="color:rgb(156,220,254)">$var(i)</span><span style="color:rgb(212,212,212)">});</span></div><div><span style="color:rgb(212,212,212)">          </span><span style="color:rgb(197,134,192)">if</span><span style="color:rgb(212,212,212)">(</span><span style="color:rgb(156,220,254)">$avp(aline)</span><span style="color:rgb(212,212,212)">=~</span><span style="color:rgb(206,145,120)">"a=channel"</span><span style="color:rgb(212,212,212)">)</span></div><div><span style="color:rgb(212,212,212)">          {</span></div><div><span style="color:rgb(212,212,212)">            xlog(</span><span style="color:rgb(206,145,120)">"line in the SDP body is $avp(aline)</span><span style="color:rgb(215,186,125)">\n</span><span style="color:rgb(206,145,120)">"</span><span style="color:rgb(212,212,212)">);</span></div><div><span style="color:rgb(212,212,212)">            </span><span style="color:rgb(156,220,254)">$var(whileflag)</span><span style="color:rgb(212,212,212)"> </span><span style="color:rgb(212,212,212)">=</span><span style="color:rgb(212,212,212)"> </span><span style="color:rgb(181,206,168)">1</span><span style="color:rgb(212,212,212)">;</span></div><div><span style="color:rgb(212,212,212)">          }</span></div><div><span style="color:rgb(212,212,212)">          </span><span style="color:rgb(156,220,254)">$var(i)</span><span style="color:rgb(212,212,212)"> </span><span style="color:rgb(212,212,212)">=</span><span style="color:rgb(212,212,212)"> </span><span style="color:rgb(156,220,254)">$var(i)</span><span style="color:rgb(212,212,212)"> </span><span style="color:rgb(212,212,212)">+</span><span style="color:rgb(212,212,212)"> </span><span style="color:rgb(181,206,168)">1</span><span style="color:rgb(212,212,212)">;</span></div><div><span style="color:rgb(212,212,212)">        }</span></div><div><span style="color:rgb(212,212,212)">        xlog(</span><span style="color:rgb(206,145,120)">"var i = $var(i)</span><span style="color:rgb(215,186,125)">\n</span><span style="color:rgb(206,145,120)">"</span><span style="color:rgb(212,212,212)">);</span></div><div><span style="color:rgb(212,212,212)">      }</span></div><div><span style="color:rgb(212,212,212)">    }</span></div><div><span style="color:rgb(212,212,212)">  }</span></div><div><span style="color:rgb(212,212,212)">}</span></div></div></div></div>