<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, "Alex Ionescu" <<a href="alex@opensips.org">alex@opensips.org</a>> 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">"mysql_real_escape_string($match_exp,$link)"</FONT> ... you get the following error (on our test platform it runs free of warnings) : <BR>
<FONT COLOR="#FF0000">PHP Warning: 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() <<a href="http://www.php.net/manual/en/function.mysql-connect.php">http://www.php.net/manual/en/function.mysql-connect.php</a>> is assumed. If no such link is found, it will try to create one as if mysql_connect() <<a href="http://www.php.net/manual/en/function.mysql-connect.php">http://www.php.net/manual/en/function.mysql-connect.php</a>> 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>
<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>
<BR>
[11-Jun-2010 14:00:39] PHP Notice: 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: 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: 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: 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: 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: 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: 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: 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: 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: Undefined index: dialplan_id in /var/www/opensips-cp/web/tools/system/dialplan/template/dialplan.main.php on line 28<BR>
<BR>
<BR>
<BR>
On 6/10/10 11:18 AM, "Alex Ionescu" <<a href="alex@opensips.org">alex@opensips.org</a>> wrote:<BR>
<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Hi Sven,<BR>
<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>
<BR>
Regards,<BR>
Alex<BR>
On 6/4/2010 16:12, Sven Schulz wrote: <BR>
<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>
<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>
<BR>
Then the webpage doesn’t give any errors and creates the rule like this:<BR>
<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>
<BR>
Then I hit apply changes to do a dp_reload and the box segfaults.<BR>
<BR>
Im running Centos5.4 64 bit and using cp version 4.0<BR>
<BR>
<BR>
<BR>
<BR>
On 6/4/10 5:53 AM, "Alex Ionescu" <<a href="alex@opensips.org">alex@opensips.org</a>> wrote:<BR>
<BR>
<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Hi Sven,<BR>
<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>
<BR>
Regards,<BR>
Alex<BR>
On 6/3/2010 16:55, Sven Schulz wrote: <BR>
<BR>
<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>
<BR>
Whenever I use CP to insert a new rule, some of the fields arnt populated. <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>
<BR>
<BR>
<BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'> <BR>
<BR>
<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>
<BR>
<BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'> <BR>
<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>
<BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT></BLOCKQUOTE>
</BODY>
</HTML>