<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Try $var(reg) =
"/gml:Coordinates>(.*)<\/gml:Coordinates/\1/";<br>
<br>
<pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
<div class="moz-cite-prefix">On 05.01.2017 13:38, xaled wrote:<br>
</div>
<blockquote cite="mid:01b601d26748$2bebb6e0$83c324a0$@web.de"
type="cite">
<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;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
color:black;
mso-fareast-language:EN-US;}
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;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";
color:black;}
tt
{mso-style-priority:99;
font-family:"Courier New";}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;
color:black;}
span.EmailStyle20
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle21
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.EmailStyle22
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.EmailStyle23
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
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]-->
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">Hi
Bogdan,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">Well
- almost enough ;)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-indent:35.4pt"><span
style="color:#1F497D" lang="EN-US">$var(reg) =
"/gml:Coordinates>(.*)<//gml:Coordinates/\1/";<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:35.4pt"><span
style="color:#1F497D" lang="EN-US">xlog("Position is
$(rb[1]{re.subst,$var(reg)})\n");<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">2017-01-05T12:28:34.923153+01:00
ivr01 /usr/local/sbin/opensips[32257]:
ERROR:core:subst_parser: unknown flag m in
/gml:Coordinates>(.*)<//gml:Coordinates/\1/<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">2017-01-05T12:28:34.923507+01:00
ivr01 /usr/local/sbin/opensips[32257]:
ERROR:core:tr_eval_re: Can't compile regexp<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">Thanks<o:p></o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1
1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span
style="color:windowtext;mso-fareast-language:DE"
lang="EN-US">From:</span></b><span
style="color:windowtext;mso-fareast-language:DE"
lang="EN-US"> Users
[<a class="moz-txt-link-freetext" href="mailto:users-bounces@lists.opensips.org">mailto:users-bounces@lists.opensips.org</a>] <b>On Behalf
Of </b>xaled<br>
<b>Sent:</b> Donnerstag, 5. Januar 2017 12:22<br>
<b>To:</b> 'OpenSIPS users mailling list'
<a class="moz-txt-link-rfc2396E" href="mailto:users@lists.opensips.org"><users@lists.opensips.org></a><br>
<b>Subject:</b> Re: [OpenSIPS-Users] How to parse XML
Body?<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">Hi Bogdan,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">that
is enough for me!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Thanks.</span><span
style="color:#1F497D" lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1
1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span
style="color:windowtext;mso-fareast-language:DE"
lang="EN-US">From:</span></b><span
style="color:windowtext;mso-fareast-language:DE"
lang="EN-US"> Bogdan-Andrei Iancu [<a
moz-do-not-send="true"
href="mailto:bogdan@opensips.org">mailto:bogdan@opensips.org</a>]
<br>
<b>Sent:</b> Donnerstag, 5. Januar 2017 12:19<br>
<b>To:</b> OpenSIPS users mailling list <<a
moz-do-not-send="true"
href="mailto:users@lists.opensips.org">users@lists.opensips.org</a>>;
xaled <<a moz-do-not-send="true"
href="mailto:xaled@web.de">xaled@web.de</a>><br>
<b>Subject:</b> Re: [OpenSIPS-Users] How to parse XML
Body?<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><tt><span
style="font-size:10.0pt">You can use the $(rb[n]) to
access a specific body part. see:</span></tt><span
style="font-size:10.0pt;font-family:"Courier New""><br>
<tt> <a moz-do-not-send="true"
href="http://www.opensips.org/Documentation/Script-CoreVar-2-2#toc65">http://www.opensips.org/Documentation/Script-CoreVar-2-2#toc65</a></tt><br>
<br>
<tt>Once you get the XML body, you can use some regexp in
order to extract the needed info from the the XML
(unfortunately thers is no way to parse XML at script
level). See the "re" transformation :</tt></span><br>
<tt><span style="font-size:10.0pt"> <a
moz-do-not-send="true"
href="http://www.opensips.org/Documentation/Script-Tran-2-2#toc82">http://www.opensips.org/Documentation/Script-Tran-2-2#toc82</a></span></tt><br>
<br>
$var(reg) = "/gml:pos>(.*)<<span lang="EN-US">//gml:pos</span>/\1/";<br>
xlog("Position is $(rb[0]{re.subst,$var(reg)})\n");<br>
<br>
<tt><span style="font-size:10.0pt">Regards,</span></tt><span
style="font-size:12.0pt;mso-fareast-language:DE"><o:p></o:p></span></p>
<pre>Bogdan-Andrei Iancu<o:p></o:p></pre>
<pre>OpenSIPS Founder and Developer<o:p></o:p></pre>
<pre><a moz-do-not-send="true" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a><o:p></o:p></pre>
<div>
<p class="MsoNormal">On 05.01.2017 12:57, xaled wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span style="color:#1F497D">Hi Bogdan;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">opensips-2.2.2</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">Thanks.</span><o:p></o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1
1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span
style="color:windowtext;mso-fareast-language:DE"
lang="EN-US">From:</span></b><span
style="color:windowtext;mso-fareast-language:DE"
lang="EN-US"> Bogdan-Andrei Iancu [<a
moz-do-not-send="true"
href="mailto:bogdan@opensips.org">mailto:bogdan@opensips.org</a>]
<br>
<b>Sent:</b> Donnerstag, 5. Januar 2017 11:39<br>
<b>To:</b> OpenSIPS users mailling list <a
moz-do-not-send="true"
href="mailto:users@lists.opensips.org"><users@lists.opensips.org></a>;
xaled <a moz-do-not-send="true"
href="mailto:xaled@web.de"><xaled@web.de></a><br>
<b>Subject:</b> Re: [OpenSIPS-Users] How to parse XML
Body?</span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><tt><span
style="font-size:10.0pt">Hi,</span></tt><span
style="font-size:10.0pt;font-family:"Courier
New""><br>
<br>
<tt>What version of OpenSIPS are you using ?</tt><br>
<br>
<tt>Regards,</tt><br>
<br>
</span><o:p></o:p></p>
<pre>Bogdan-Andrei Iancu<o:p></o:p></pre>
<pre>OpenSIPS Founder and Developer<o:p></o:p></pre>
<pre><a moz-do-not-send="true" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a><o:p></o:p></pre>
<div>
<p class="MsoNormal">On 04.01.2017 21:19, xaled wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span lang="EN-US">Hi,</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">What is the best way
to parse xml body in an INVITE request? </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">I want to access
geographic location information gml:Coordinates or
gml:pos from xml body and do some routing. I’ve seen the
emergency module, but it is too specific to be useful in
my basic scenario.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Content-Type:
multipart/mixed;boundary=ssboundary-1_</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Content-Type:
application/pidf+xml</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">…</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">
<gml:Coordinates>XYZ</gml:Coordinates></span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">
<gml:pos>XYZ</gml:pos></span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">…</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span
style="font-size:12.0pt"><br>
<br>
<br>
</span><o:p></o:p></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>Users mailing list<o:p></o:p></pre>
<pre><a moz-do-not-send="true" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><o:p></o:p></pre>
<pre><a moz-do-not-send="true" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><o:p></o:p></pre>
</blockquote>
<p class="MsoNormal"><span style="font-size:12.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span
style="font-size:12.0pt;font-family:"Times New
Roman",serif;mso-fareast-language:DE"><br>
<br>
<o:p></o:p></span></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>Users mailing list<o:p></o:p></pre>
<pre><a moz-do-not-send="true" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><o:p></o:p></pre>
<pre><a moz-do-not-send="true" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><o:p></o:p></pre>
</blockquote>
<p class="MsoNormal"><span
style="font-size:12.0pt;font-family:"Times New
Roman",serif;mso-fareast-language:DE"><o:p> </o:p></span></p>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</body>
</html>