Ok,

there was a ; missing in the partition modparam, which is getting a step further

dialplanis loading:
Mar 22 17:11:40 gl-sip-01 /usr/sbin/opensips[3866]: INFO:dialplan:mod_init: initializing module...
Mar 22 17:11:40 gl-sip-01 /usr/sbin/opensips[3866]: DBG:dialplan:dp_print_list: Partition default url mysql://root:opensips@192.168.36.85:3306/opensips table dialplan
Mar 22 17:11:40 gl-sip-01 /usr/sbin/opensips[3866]: DBG:dialplan:dp_print_list: Partition greenlight url mysql://root:opensips@192.168.36.85:3306/opensips table dialplan
Mar 22 17:11:40 gl-sip-01 /usr/sbin/opensips[3866]: DBG:dialplan:init_data: Adding partition with name [default]
Mar 22 17:11:40 gl-sip-01 /usr/sbin/opensips[3866]: DBG:dialplan:dp_add_connection: Added dialplan partition [default] table [dialplan].
Mar 22 17:11:40 gl-sip-01 /usr/sbin/opensips[3866]: DBG:dialplan:init_data: Adding partition with name [greenlight]
Mar 22 17:11:40 gl-sip-01 /usr/sbin/opensips[3866]: DBG:dialplan:dp_add_connection: Added dialplan partition [greenlight] table [dialplan].
Mar 22 17:11:40 gl-sip-01 /usr/sbin/opensips[3866]: DBG:core:init_mod: register MI for dialplan
Mar 22 17:11:40 gl-sip-01 /usr/sbin/opensips[3867]: DBG:core:init_mod_child: type=PROC_MODULE, rank=-2, module=dialplan
Mar 22 17:11:40 gl-sip-01 /usr/sbin/opensips[3868]: DBG:core:init_mod_child: type=PROC_MODULE, rank=-2, module=dialplan
Mar 22 17:11:40 gl-sip-01 /usr/sbin/opensips[3872]: DBG:core:init_mod_child: type=CHILD, rank=2, module=dialplan
Mar 22 17:11:40 gl-sip-01 /usr/sbin/opensips[3866]: DBG:core:init_mod_child: type=PROC_MAIN, rank=0, module=dialplan
Mar 22 17:11:40 gl-sip-01 /usr/sbin/opensips[3874]: DBG:core:init_mod_child: type=CHILD, rank=4, module=dialplan
Mar 22 17:11:40 gl-sip-01 /usr/sbin/opensips[3873]: DBG:core:init_mod_child: type=CHILD, rank=3, module=dialplan


the problem now is the MI commands are failing

dp_translate default:10 01382843843 gives the following:


 ERROR:dialplan:mi_translate: Wrong id parameter - should be an integer

Also the documentation implies that this should work without the partition and the partition is an optional parameter.


without the partition
 dp_translate 10 01382843843   you get
400 Wrong db connection para

/usr/sbin/opensips[3905]: ERROR:dialplan:mi_translate: Unable to get connection



although the MI is not working (could be incorrect syntax)

the route script seems to be despite the regex not matching

Mar 22 17:20:15 gl-sip-01 /usr/sbin/opensips[4033]: DBG:dialplan:dp_translate_f: dpid is 10 partition is default
Mar 22 17:20:15 gl-sip-01 /usr/sbin/opensips[4033]: DBG:dialplan:dp_get_svalue: searching 15
Mar 22 17:20:15 gl-sip-01 /usr/sbin/opensips[4033]: DBG:dialplan:dp_translate_f: input is 0800800150
Mar 22 17:20:15 gl-sip-01 /usr/sbin/opensips[4033]: DBG:dialplan:dp_translate_f: Checking with dpid 10
Mar 22 17:20:15 gl-sip-01 /usr/sbin/opensips[4033]: DBG:dialplan:translate: Regex operator testing. Got result: -1
Mar 22 17:20:15 gl-sip-01 /usr/sbin/opensips[4033]: DBG:dialplan:translate: No matching rule for input 0800800150
Mar 22 17:20:15 gl-sip-01 /usr/sbin/opensips[4033]: DBG:dialplan:dp_translate_f: could not translate 0800800150 with dpid 10
Mar 22 17:20:15 gl-sip-01 /usr/sbin/opensips[4033]: DBG:dialplan:dp_translate_f: dpid is 10 partition is default
Mar 22 17:20:15 gl-sip-01 /usr/sbin/opensips[4033]: DBG:dialplan:dp_get_svalue: searching 15
Mar 22 17:20:15 gl-sip-01 /usr/sbin/opensips[4033]: DBG:dialplan:dp_translate_f: input is 0800800150
Mar 22 17:20:15 gl-sip-01 /usr/sbin/opensips[4033]: DBG:dialplan:dp_translate_f: Checking with dpid 10
Mar 22 17:20:15 gl-sip-01 /usr/sbin/opensips[4033]: DBG:dialplan:translate: Regex operator testing. Got result: -1
Mar 22 17:20:15 gl-sip-01 /usr/sbin/opensips[4033]: DBG:dialplan:translate: No matching rule for input 0800800150
Mar 22 17:20:15 gl-sip-01 /usr/sbin/opensips[4033]: DBG:dialplan:dp_translate_f: could not translate 0800800150 with dpid 10
Mar 22 17:20:15 gl-sip-01 /usr/sbin/opensips[4033]: DBG:dialplan:dp_get_ivalue: searching 78
Mar 22 17:20:15 gl-sip-01 /usr/sbin/opensips[4033]: DBG:dialplan:dp_get_svalue: searching 78
Mar 22 17:20:15 gl-sip-01 /usr/sbin/opensips[4033]: DBG:dialplan:dp_translate_f: dpid is 10 partition is greenlight
Mar 22 17:20:15 gl-sip-01 /usr/sbin/opensips[4033]: DBG:dialplan:dp_get_svalue: searching 14
Mar 22 17:20:15 gl-sip-01 /usr/sbin/opensips[4033]: DBG:dialplan:dp_translate_f: input is sip:0800800150@192.168.36.85
Mar 22 17:20:15 gl-sip-01 /usr/sbin/opensips[4033]: DBG:dialplan:dp_translate_f: Checking with dpid 10
Mar 22 17:20:15 gl-sip-01 /usr/sbin/opensips[4033]: DBG:dialplan:translate: Regex operator testing. Got result: -1
Mar 22 17:20:15 gl-sip-01 /usr/sbin/opensips[4033]: DBG:dialplan:translate: No matching rule for input sip:0800800150@192.168.36.85
Mar 22 17:20:15 gl-sip-01 /usr/sbin/opensips[4033]: DBG:dialplan:dp_translate_f: could not translate sip:0800800150@192.168.36.85 with dpid 10




Regards,

Richard


On 22/03/2016 16:13, Bogdan-Andrei Iancu wrote:
Hi Richard,

Have you provided the partition name while firing the MI command ?

See http://www.opensips.org/html/docs/modules/2.1.x/dialplan.html#id294353 (1.8.2. dp_translate)

Regards,

Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com

On 22.03.2016 14:28, Richard Robson wrote:
Hi,

I'm trying to use the dialplan module, but every time I get a "400 Wrong
db connection para"

the connection is the same for all other modules, which are working fine
and I can connect via opensipsCP, mysql and phpmyadmin.

I'm using version 2.1

Mar 22 12:22:13 gl-sip-01 opensips: ERROR:dialplan:mi_translate: Unable
to get connection
Mar 22 12:22:13 gl-sip-01 opensips: DBG:mi_datagram:mi_datagram_server:
command process (dp_translate)succeded
Mar 22 12:22:13 gl-sip-01 opensips: DBG:mi_datagram:mi_datagram_server:
the response: 400 Wrong db connection para#012 has been sent in 29 octets

Dialplan table:

+----+------+------+----------+------------------+-------------+-----------+----------+---------+----------+-------+
| id | dpid | pr   | match_op | match_exp        | match_flags |
subst_exp | repl_exp | timerec | disabled | attrs |
+----+------+------+----------+------------------+-------------+-----------+----------+---------+----------+-------+
|  1 |   10 |    1 |        1 | "^0[1-9][0-9]+$" |           0 |
"^0(.*)$" | "44\0"   |         |        0 |       |
+----+------+------+----------+------------------+-------------+-----------+----------+---------+----------+-------+


#### Dialplan ####
loadmodule "dialplan.so"
modparam("dialplan", "db_url",
         "mysql://root:opensips@127.0.0.1:3306/opensips")

I also tried with the same results:
modparam("dialplan", "partition", "   default : table_name = dialplan ;
db_url = mysql://root:opensips@127.0.0.1:3306/opensips")

does anyone know why this is happening for this module only

Regards,




-- 
Richard Robson
Greenlight Support
01382 843843
supp...@greenlightcrm.com


_______________________________________________
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to