<HTML>
<HEAD>
<TITLE>Re: [OpenSIPS-Users] Opensips-cp Dialplan Problem</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Yes Alex, most CP modules except for dialplan work. <BR>
Well, I haven't tested <B>all</B> of them, but at least drouting, monit, permissions, domains, mi commands and user management all work. Do I know db connection seems fine with those.<BR>
<BR>
All 3 of my test machines give the same results. They are all centos 5.4 with mysql 5.0.77, php 5.1.6<BR>
<BR>
<BR>
On 6/14/10 4:28 AM, &quot;Alex Ionescu&quot; &lt;<a href="alex@opensips.org">alex@opensips.org</a>&gt; wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Hi Sven,<BR>
<BR>
I think I have a clue about your problem.<BR>
In the code we call mysql_real_escape string like this : <FONT COLOR="#FF0000">&quot;mysql_real_escape_string($match_exp,$link)&quot;</FONT> ... you get the following error (on our test platform it runs free of warnings) : <BR>
<FONT COLOR="#FF0000">PHP Warning: &nbsp;mysql_real_escape_string() expects parameter 2 to be resource<BR>
</FONT><BR>
If you check this <a href="http://php.net/manual/en/function.mysql-real-escape-string.php">http://php.net/manual/en/function.mysql-real-escape-string.php</a> you will see that the warning message that you are getting is caused by the lack of connection to the db. As it is said in the php online manual :<BR>
<BR>
<FONT COLOR="#FF0000">If the link identifier is not specified, the last link opened by mysql_connect() &lt;<a href="http://www.php.net/manual/en/function.mysql-connect.php">http://www.php.net/manual/en/function.mysql-connect.php</a>&gt; &nbsp;is assumed. If no such link is found, it will try to create one as if mysql_connect() &lt;<a href="http://www.php.net/manual/en/function.mysql-connect.php">http://www.php.net/manual/en/function.mysql-connect.php</a>&gt; &nbsp;was called with no arguments. If no connection is found or established, an </FONT></SPAN></FONT><FONT COLOR="#FF0000"><FONT SIZE="2"><FONT FACE="Consolas, Courier New, Courier"><SPAN STYLE='font-size:10pt'><B>E_WARNING</B></SPAN></FONT></FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'> level error is generated. <BR>
<BR>
</SPAN></FONT></FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>So, my guess is that there is something wrong with your db connection, since on our platform works ... <BR>
You could try to see if the rest of the modules run error free and let me know, maybe we can narrow down the possible causes of this issue.<BR>
<BR>
Regards,<BR>
Alex<BR>
<BR>
<BR>
On 6/11/2010 21:07, Sven Schulz wrote: <BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'> Re: [OpenSIPS-Users] Opensips-cp Dialplan Problem Alex,<BR>
&nbsp;<BR>
I just took the latest from svn trunk and still getting the same results.<BR>
I did see these php warnings in the log, not sure igf its helpful or not:<BR>
&nbsp;<BR>
[11-Jun-2010 14:00:39] PHP Notice: &nbsp;Undefined variable: dpid in /var/www/opensips-cp/web/tools/system/dialplan/template/dialplan.add.php on line 91<BR>
[11-Jun-2010 14:00:39] PHP Notice: &nbsp;Undefined variable: pr in /var/www/opensips-cp/web/tools/system/dialplan/template/dialplan.add.php on line 97<BR>
[11-Jun-2010 14:00:39] PHP Notice: &nbsp;Undefined variable: match_exp in /var/www/opensips-cp/web/tools/system/dialplan/template/dialplan.add.php on line 109<BR>
[11-Jun-2010 14:00:39] PHP Notice: &nbsp;Undefined variable: match_len in /var/www/opensips-cp/web/tools/system/dialplan/template/dialplan.add.php on line 115<BR>
[11-Jun-2010 14:00:39] PHP Notice: &nbsp;Undefined variable: subst_exp in /var/www/opensips-cp/web/tools/system/dialplan/template/dialplan.add.php on line 121<BR>
[11-Jun-2010 14:00:39] PHP Notice: &nbsp;Undefined variable: repl_exp in /var/www/opensips-cp/web/tools/system/dialplan/template/dialplan.add.php on line 127<BR>
[11-Jun-2010 14:00:57] PHP Warning: &nbsp;mysql_real_escape_string() expects parameter 2 to be resource, object given in /var/www/opensips-cp/web/tools/system/dialplan/dialplan.php on line 119<BR>
[11-Jun-2010 14:00:57] PHP Warning: &nbsp;mysql_real_escape_string() expects parameter 2 to be resource, object given in /var/www/opensips-cp/web/tools/system/dialplan/dialplan.php on line 139<BR>
[11-Jun-2010 14:00:57] PHP Warning: &nbsp;mysql_real_escape_string() expects parameter 2 to be resource, object given in /var/www/opensips-cp/web/tools/system/dialplan/dialplan.php on line 141<BR>
[11-Jun-2010 14:00:57] PHP Notice: &nbsp;Undefined index: &nbsp;dialplan_id in /var/www/opensips-cp/web/tools/system/dialplan/template/dialplan.main.php on line 28<BR>
&nbsp;<BR>
&nbsp;<BR>
&nbsp;<BR>
On 6/10/10 11:18 AM, &quot;Alex Ionescu&quot; &lt;<a href="alex@opensips.org">alex@opensips.org</a>&gt; wrote:<BR>
&nbsp;<BR>
&nbsp;&nbsp;<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Hi Sven,<BR>
&nbsp;<BR>
I've tried exactly your example. It worked for me.<BR>
Please take the last version of opensips-cp from svn trunk. Maybe that will work for you.<BR>
&nbsp;<BR>
Regards,<BR>
Alex<BR>
On 6/4/2010 16:12, Sven Schulz wrote: <BR>
&nbsp;&nbsp;<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'> Re: [OpenSIPS-Users] Opensips-cp Dialplan Problem For example, if I use control panel cp to add a new rule:<BR>
&nbsp;<BR>
DialplanID = 0<BR>
Rule Priority = 1<BR>
Matching Operator=1<BR>
Matching reg exp= ^(2|3|5|7)[0-9]{4}<BR>
Matching str len=0<BR>
Subst Reg Exp= (^(2|3|5|7)[0-9]{4})<BR>
Repl Reg Exp=181486\1<BR>
Attr= I leave this blank unchecked<BR>
&nbsp;<BR>
Then the webpage doesn&#8217;t give any errors and creates the rule like this:<BR>
&nbsp;<BR>
DialplanID = 0<BR>
Rule Priority = 1<BR>
Matching Operator=1<BR>
Matching reg exp=<BR>
Matching str len=0<BR>
Subst Reg Exp= <BR>
Repl Reg Exp=<BR>
Attr= <BR>
&nbsp;<BR>
Then I hit apply changes to do a dp_reload and the box segfaults.<BR>
&nbsp;<BR>
Im running Centos5.4 64 bit and using cp version 4.0<BR>
&nbsp;<BR>
&nbsp;<BR>
&nbsp;<BR>
&nbsp;<BR>
On 6/4/10 5:53 AM, &quot;Alex Ionescu&quot; &lt;<a href="alex@opensips.org">alex@opensips.org</a>&gt; wrote:<BR>
&nbsp;<BR>
&nbsp;&nbsp;<BR>
&nbsp;&nbsp;<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Hi Sven,<BR>
&nbsp;<BR>
I have tested the latest version of CP (taken from SVN). <BR>
I've inserted a few rules, and it worked just fine. All the fields were populated. <BR>
Can you be more specific please ? <BR>
&nbsp;<BR>
Regards,<BR>
Alex<BR>
On 6/3/2010 16:55, Sven Schulz wrote: <BR>
&nbsp;&nbsp;<BR>
&nbsp;&nbsp;<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'> Opensips-cp Dialplan Problem Using opensips-cp latest version from SVN.<BR>
&nbsp;<BR>
Whenever I use CP to insert a new rule, some of the fields arnt populated. &nbsp;<BR>
&nbsp;<BR>
&nbsp;<BR>
_______________________________________________<BR>
Users mailing list<BR>
&nbsp;<a href="Users@lists.opensips.org">Users@lists.opensips.org</a><BR>
&nbsp;<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><BR>
&nbsp;&nbsp;<BR>
&nbsp;<BR>
&nbsp;<BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'> &nbsp;<BR>
&nbsp;<BR>
&nbsp;<BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'> &nbsp;<BR>
&nbsp;<BR>
&nbsp;<BR>
_______________________________________________<BR>
Users mailing list<BR>
&nbsp;<a href="Users@lists.opensips.org">Users@lists.opensips.org</a><BR>
&nbsp;<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><BR>
&nbsp;&nbsp;<BR>
&nbsp;<BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'> <BR>
&nbsp;<BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'> <BR>
<BR>
<BR>
_______________________________________________<BR>
Users mailing list<BR>
<a href="Users@lists.opensips.org">Users@lists.opensips.org</a><BR>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><BR>
&nbsp;&nbsp;<BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT></BLOCKQUOTE>
</BODY>
</HTML>