<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<tt>Hi Jeff,<br>
<br>
Maybe the version of MDB2 or MDB2::mysql </tt><tt>php pear ? <br>
<br>
The CP versions are correlated with the OpenSIPS versions. The len
field was moved to a flag field (in dialplan table) in opensips
1.11, corresponding to CP 6.0 (6.1 matches opensips 2.1 and CP
trunk matches the 2.2)<br>
<br>
Regards,<br>
</tt>
<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 26.08.2016 08:33, Jeff Wilkie wrote:<br>
</div>
<blockquote
cite="mid:CANFkrT1MRTcx4xzGFEo24sZ+_czuhVGJtRAob-b2809tUZbWZQ@mail.gmail.com"
type="cite">
<div dir="ltr">I just loaded all the web directory content from
git to test but the results are the same. The config dir for
dialplan are the same other than the toggle for 1 on text
attributes. Are there other files/dirs that would affect the
dial plan section of CP? Also, the git download does not
include the changes from expression string length to expression
flags (5.0 cp)
<div class="gmail_extra"><br clear="all">
<div>
<div class="gmail_signature"
data-smartmail="gmail_signature">
<div dir="ltr">
<div>
<div>Jeff </div>
</div>
<div><br>
</div>
<div><br>
</div>
</div>
</div>
</div>
<div class="gmail_quote">On Thu, Aug 25, 2016 at 5:11 PM,
Bogdan-Andrei Iancu <span dir="ltr"><<a
moz-do-not-send="true" href="mailto:bogdan@opensips.org"
target="_blank">bogdan@opensips.org</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"> <tt>Hi Jeff,<br>
<br>
I run some test with the exact code on GITHUB (branch
5.0) and the edit actually worked well (without any
further changes).<br>
<br>
The $link is a variable that is initialized in the
included file lib/db_connect.php, so it valid (anyhow,
it is used later for the actual query, which works ;)
).<br>
<br>
Could you check if the return of
mysql_real_escape_string() is actually something valid
or is it FALSE ? <br>
<a moz-do-not-send="true"
href="http://stackoverflow.com/questions/3005135/mysql-real-escape-string-just-makes-an-empty-string"
target="_blank">http://stackoverflow.com/<wbr>questions/3005135/mysql-real-<wbr>escape-string-just-makes-an-<wbr>empty-string</a><br>
<br>
Regards,<br>
</tt><span class="">
<pre cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a moz-do-not-send="true" href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.<wbr>com</a></pre>
</span><div><div class="h5"><div>On 25.08.2016 05:33, Jeff Wilkie wrote:
</div>
<blockquote type="cite">
<div dir="ltr">If I modify the file <span style="font-family:Menlo;font-size:11px">/var/www/opensips_cp/web/<wbr>tools/system/dialplan/<wbr>dialplan.php
and comment out the following:</span>
<div><span style="font-family:Menlo;font-size:11px">
</span></div>
<div>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span> //
if(get_magic_quotes_gpc()==0){</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><span></span>
</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
// $match_exp =
mysql_real_escape_string($<wbr>match_exp, <b>$link</b>);</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span> // }</span></p>
</div>
<div><span>
</span></div>
<div>The updates work fine. I think noticed that the ref to <b>$link</b>
sits below this line in the "modify" section so I decided to
remove the $link ref in the above lines and then uncommented
the lines leaving the modify section like this</div>
<div>
</div>
<div>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span> if ($errors=="") {</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span>
if(get_magic_quotes_gpc()==0){</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><span></span>
</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span> $match_exp =
mysql_real_escape_string($<wbr>match_exp);</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span> }</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><span></span>
</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span> $sql = "SELECT * FROM
".$table.</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span> " WHERE dpid=" .$dpid. "
AND match_exp='" .$match_exp. "'".</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span> " AND id!=".$id;</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
$resultset = <b>$link</b>->queryAll($sql);
</p>
</div>
<div><span>
</span></div>
<div><span>
</span></div>
<div><span>Let me know if I've broken something as a
result but this appears to have corrected the problem I was
having. Unknown of any side effects currently :) Take a
look and let me know your thoughts.</span></div>
<div class="gmail_extra">
<div>
<div data-smartmail="gmail_signature">
<div dir="ltr">
<div>
<div>Jeff </div>
</div>
<div>
</div>
<div>
</div>
</div>
</div>
</div>
<div class="gmail_quote">On Wed, Aug 24, 2016 at 6:22 PM, Jeff
Wilkie <span dir="ltr"><<a moz-do-not-send="true" href="mailto:jwilkie@usipcom.com" target="_blank">jwilkie@usipcom.com</a>></span>
wrote:
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Here is what it looks like to my db when I
create a DialPlan
<div>
</div>
<div>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="white-space:pre-wrap">                </span>
20 Query<span style="white-space:pre-wrap">        </span>SELECT
* FROM dialplan WHERE dpid=36 AND match_exp='877'</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="white-space:pre-wrap">                </span>
20 Query<span style="white-space:pre-wrap">        </span>PREPARE
MDB2_STATEMENT_mysql_a9e5e113b<wbr>009b855c4d690637965bc74
FROM 'INSERT INTO dialplan\n<span style="white-space:pre-wrap">                        </span>(dpid,
pr, match_op, match_exp, match_flags, subst_exp, \n<span style="white-space:pre-wrap">                                </span>repl_exp,
attrs) VALUES \n<span style="white-space:pre-wrap">                                </span>(36,
0,1, \'877\',0,\'\',\'\',\'.30\')'</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="white-space:pre-wrap">                </span>
20 Prepare<span style="white-space:pre-wrap">        </span>INSERT
INTO dialplan</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="white-space:pre-wrap">                                </span>(dpid,
pr, match_op, match_exp, match_flags, subst_exp, </p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="white-space:pre-wrap">                                </span>repl_exp,
attrs) VALUES </p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="white-space:pre-wrap">                                </span>(36,
0,1, '877',0,'','','.30')</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="white-space:pre-wrap">                </span>
20 Query<span style="white-space:pre-wrap">        </span>EXECUTE
MDB2_STATEMENT_mysql_a9e5e113b<wbr>009b855c4d690637965bc74</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="white-space:pre-wrap">                </span>
20 Execute<span style="white-space:pre-wrap">        </span>INSERT
INTO dialplan</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="white-space:pre-wrap">                                </span>(dpid,
pr, match_op, match_exp, match_flags, subst_exp, </p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="white-space:pre-wrap">                                </span>repl_exp,
attrs) VALUES </p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="white-space:pre-wrap">                                </span>(36,
0,1, '877',0,'','','.30')</p>
</div>
<div>
</div>
<div>This is what happens when I edit that same DialPlan</div>
<div>
</div>
<div>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="white-space:pre-wrap">                </span>
23 Query<span style="white-space:pre-wrap">        </span>select
* from dialplan where id='9030'</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="white-space:pre-wrap">                </span>
23 Quit<span style="white-space:pre-wrap">        </span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="white-space:pre-wrap">                </span>
24 Query<span style="white-space:pre-wrap">        </span>SELECT
* FROM dialplan WHERE dpid=36 AND match_exp='' AND
id!=9030</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="white-space:pre-wrap">                </span>
24 Query<span style="white-space:pre-wrap">        </span>PREPARE
MDB2_STATEMENT_mysql_880efa45d<wbr>78ebff7cbf5f617428df4d2
FROM 'UPDATE dialplan SET dpid=36, pr = 0, match_op=
1, match_exp =\'\', match_flags=0, subst_exp = \'\',
repl_exp=\'\', attrs= \'.30\' WHERE id=9030'</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="white-space:pre-wrap">                </span>
24 Prepare<span style="white-space:pre-wrap">        </span>UPDATE
dialplan SET dpid=36, pr = 0, match_op= 1, match_exp
='', match_flags=0, subst_exp = '', repl_exp='',
attrs= '.30' WHERE id=9030</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="white-space:pre-wrap">                </span>
24 Query<span style="white-space:pre-wrap">        </span>EXECUTE
MDB2_STATEMENT_mysql_880efa45d<wbr>78ebff7cbf5f617428df4d2</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="white-space:pre-wrap">                </span>
24 Execute<span style="white-space:pre-wrap">        </span>UPDATE
dialplan SET dpid=36, pr = 0, match_op= 1, match_exp
='', match_flags=0, subst_exp = '', repl_exp='',
attrs= '.30' WHERE id=9030</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="white-space:pre-wrap">                </span>
24 Query<span style="white-space:pre-wrap">        </span>DEALLOCATE
PREPARE MDB2_STATEMENT_mysql_880efa45d<wbr>78ebff7cbf5f617428df4d2</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="white-space:pre-wrap">                </span>
24 Quit<span style="white-space:pre-wrap">        </span></p>
</div>
<div>
</div>
<div>
</div>
<div>You can see that the container for match_ex is not
getting passed to the '24' SELECT statement which ends
in a 0 results query apparently.</div>
<div class="gmail_extra">
</div>
<div class="gmail_extra">
</div>
<div class="gmail_extra">Thanks</div>
<div class="gmail_extra"><span><font color="#888888">
<div>
<div data-smartmail="gmail_signature">
<div dir="ltr">
<div>
<div>Jeff </div>
</div>
</div>
</div>
</div>
</font></span>
<div>
<div>
<div class="gmail_quote">On Wed, Aug 24, 2016 at
5:30 PM, Jeff Wilkie <span dir="ltr"><<a moz-do-not-send="true" href="mailto:jwilkie@usipcom.com" target="_blank">jwilkie@usipcom.com</a>></span>
wrote:
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><span><span style="font-size:13px">Yes. After any
edits followed by a save with the
attribute field active as text causes
"Matching Regular Expression" to be
deleted.</span>
<div class="gmail_extra">
</div>
</span>
<div class="gmail_extra">Thanks</div>
<div class="gmail_extra"><span><font color="#888888">
<div>
<div data-smartmail="gmail_signature">
<div dir="ltr">
<div>
<div>Jeff </div>
</div>
</div>
</div>
</div>
</font></span>
<div class="gmail_quote"><span>On Wed, Aug
24, 2016 at 5:15 PM, Bogdan-Andrei
Iancu <span dir="ltr"><<a moz-do-not-send="true" href="mailto:bogdan@opensips.org" target="_blank">bogdan@opensips.org</a>></span>
wrote:
</span>
<div>
<div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"> <tt>Jeff,
You mean "Matching Regular
Expression", right ? upon
performing an edit + save
where you only changed the
attrs, the </tt><tt>"Matching
Regular Expression" gets to
empty ?
Regards,
</tt><span>
<pre cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a moz-do-not-send="true" href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.<wbr>com</a></pre>
</span><div><div><div>On 24.08.2016 23:25, Jeff Wilkie wrote:
</div>
<blockquote type="cite">
<div dir="ltr">Ok. The value now displays but if you modify the
value and hit save, it kills the regex value upon saving. Also,
you cannot add the regex value back into the row. All other
values appear to be kept.
<div>
</div>
<div>Thanks</div>
<div class="gmail_extra">
<div>
<div data-smartmail="gmail_signature">
<div dir="ltr">
<div>
<div>Jeff</div>
</div>
<div>
</div>
</div>
</div>
</div>
<div class="gmail_quote">On Wed, Aug 24, 2016 at 11:35 AM,
Bogdan-Andrei Iancu <span dir="ltr"><<a moz-do-not-send="true" href="mailto:bogdan@opensips.org" target="_blank">bogdan@opensips.org</a>></span>
wrote:
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"> <tt>Hi Jeff,
I spotted the issue and fixed it on GIT repo. Please
give it a try and let me know if it works for you too.
Thanks and regards,
</tt><span>
<pre cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a moz-do-not-send="true" href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.<wbr>com</a></pre>
</span><div><div><div>On 24.08.2016 17:46, Jeff Wilkie wrote:
</div>
<blockquote type="cite">
<div dir="ltr">Yes, The text box is there but when you place a
value in a preexisting dial plan, the result in the DB is just
the value in the text attribute field with no dial plan
information. By editing or adding an attribute it kills the
rest of the dial plan that you were editing and you cannot add
the dial plan information back in via the CP as long as an
attribute in text form is added. The same does not happen if
using check box. I can provide pics if you'd like. The only
var changed is the
<div class="gmail_extra">
<blockquote type="cite">
<div>
<div dir="ltr">
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">$dialplan_attributes_mode
= 1</p>
</div>
</div>
</blockquote>
<div>
<div data-smartmail="gmail_signature">
<div dir="ltr">
<div>
<div>Jeff Wilkie
</div>
Chief Technology Officer
</div>
US IP Communications
<a moz-do-not-send="true" href="tel:919.297.1057" value="+19192971057" target="_blank">919.297.1057</a>
<i>"This e-mail communication and any attachments may
contain confidential and privileged information and is
for use by the designated addressee(s) named above
only. Any files transmitted with it are confidential
and intended solely for the use of the individual to
whom it is addressed. Any views or opinions presented
are solely those of the author and do not necessarily
represent those of USIPCOM, LLC. If you are not the
intended addressee, you are hereby notified that you
have received this communication in error and that any
use or reproduction of this email or its contents is
strictly prohibited and may be unlawful. If you have
received this communication in error, please notify us
immediately by replying to this message and deleting
it from your computer. Thank you". </i>
</div>
</div>
</div>
<div class="gmail_quote">On Wed, Aug 24, 2016 at 5:20 AM,
Bogdan-Andrei Iancu <span dir="ltr"><<a moz-do-not-send="true" href="mailto:bogdan@opensips.org" target="_blank">bogdan@opensips.org</a>></span>
wrote:
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"> <tt>Hi Jeff,
You mean you do not get the Attributes text area at
all in the Edit section ?
Regards,
</tt>
<pre cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a moz-do-not-send="true" href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.<wbr>com</a></pre><div><div>
<div>On 23.08.2016 00:56, Jeff Wilkie wrote:
</div>
</div></div><blockquote type="cite"><div><div>
<div dir="ltr">
<div>New small issue with DIALPLAN in the CP. Running OSIPS
1.10 with CP 5.0</div>
<div>
</div>
<div>It appears that when modifying the CP for Dialplan
attributes as text, they do not appear in the edit section
once applied. The attributes do show up in the view list of
dial plans but if you go back to edit the attrs again, they
are not there. I dot not have the same problem when using
attrs as checkboxes. Is there more code in the local files
that require editing to display these values? Also, if an
entry in the Dialplan was once a checkbox value but I've not
converted the mode to text, the value does not show up in the
text box to be edited.</div>
<div>
</div>
<div>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">#
Attention : advanced options !!</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px">
</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px">
</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"> //database
tables</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"> $config->table_dialplan
= "dialplan";</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"> $config->results_per_page
= 20;</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"> $config->results_page_range
= 5;</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px">
</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"> $config->attrs_cb=array(</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
// name , description</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
array("a","Descr a"),</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
array("b","Descr b"),</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
array("c","Descr c"),</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
array("d","Descr d"),</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
array("e","Descr e"),</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
array("f","Descr f"),</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">
);</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"> $config->cb_per_row
= 3;</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"> $talk_to_this_assoc_id
= 1 ;</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px">
</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">//
Dialplan - Add/Edit new Translation Rule - Attributes input
type</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">//
0 - checkboxes</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">//
1 - text</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">$dialplan_attributes_mode
= 1 ;</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px">
</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">?></p>
</div>
<div>
</div>
<div>
</div>
<div>
<div data-smartmail="gmail_signature">
<div dir="ltr">
<div>
<div>Jeff
</div>
</div>
</div>
</div>
</div>
</div>
<fieldset></fieldset>
</div></div><pre>______________________________<wbr>_________________
Users mailing list
<a moz-do-not-send="true" href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a moz-do-not-send="true" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a>
</pre>
</blockquote>
</div>
</blockquote></div>
</div></div>
</blockquote>
</div></div></div></blockquote></div>
</div></div>
</blockquote>
</div></div></div></blockquote></div></div></div>
</div></div>
</blockquote></div>
</div></div></div></div>
</blockquote></div>
</div></div>
</blockquote>
</div></div></div></blockquote></div>
</div></div>
</blockquote>
</body></html>