MySQL Query in Dial Plan
Moderator: Brekeke Support Team
MySQL Query in Dial Plan
1. Brekeke Product Name and Version: SIP Proxy Server
2. Java version:
3. OS type and the version: Windows
4. UA (phone), gateway or other hardware/software involved:
5. Your problem:
im trying to execute a MySQL Cmmand thru the Dial Plan, but its failing
com.brekeke.net.sip.sv.rule.matching.plugins.db.query (null:-1)
sun.reflect.NativeMethodAccessorImpl.invoke0 (null:-2)
sun.reflect.NativeMethodAccessorImpl.invoke (null:-1)
sun.reflect.DelegatingMethodAccessorImpl.invoke (null:-1)
java.lang.reflect.Method.invoke (null:-1)
com.brekeke.net.sip.sv.rule.RuleTable.getSpecialValue (null:-1)
com.brekeke.net.sip.sv.rule.RuleTable.getValue (null:-1)
com.brekeke.net.sip.sv.rule.RuleTable.evalRule (null:-1)
com.brekeke.net.sip.sv.rule.RuleTable.getMatch (null:-1)
com.brekeke.net.sip.sv.Dispatcher.run (null:-1)
2. Java version:
3. OS type and the version: Windows
4. UA (phone), gateway or other hardware/software involved:
5. Your problem:
im trying to execute a MySQL Cmmand thru the Dial Plan, but its failing
com.brekeke.net.sip.sv.rule.matching.plugins.db.query (null:-1)
sun.reflect.NativeMethodAccessorImpl.invoke0 (null:-2)
sun.reflect.NativeMethodAccessorImpl.invoke (null:-1)
sun.reflect.DelegatingMethodAccessorImpl.invoke (null:-1)
java.lang.reflect.Method.invoke (null:-1)
com.brekeke.net.sip.sv.rule.RuleTable.getSpecialValue (null:-1)
com.brekeke.net.sip.sv.rule.RuleTable.getValue (null:-1)
com.brekeke.net.sip.sv.rule.RuleTable.evalRule (null:-1)
com.brekeke.net.sip.sv.rule.RuleTable.getMatch (null:-1)
com.brekeke.net.sip.sv.Dispatcher.run (null:-1)
What's the exception message?
Did you follow wiki?
http://wiki.brekeke.com/wiki/Execute-SQ ... m-Dialplan
Did you follow wiki?
http://wiki.brekeke.com/wiki/Execute-SQ ... m-Dialplan
Exception: 06/06/15 03:38:05.354
java.lang.NullPointerException
com.brekeke.net.sip.sv.rule.matching.plugins.db.newConnection (null:-1)
com.brekeke.net.sip.sv.rule.matching.plugins.db.getConnection (null:-1)
com.brekeke.net.sip.sv.rule.matching.plugins.db.query (null:-1)
sun.reflect.NativeMethodAccessorImpl.invoke0 (null:-2)
sun.reflect.NativeMethodAccessorImpl.invoke (null:-1)
sun.reflect.DelegatingMethodAccessorImpl.invoke (null:-1)
java.lang.reflect.Method.invoke (null:-1)
com.brekeke.net.sip.sv.rule.RuleTable.getSpecialValue (null:-1)
com.brekeke.net.sip.sv.rule.RuleTable.getValue (null:-1)
com.brekeke.net.sip.sv.rule.RuleTable.evalRule (null:-1)
com.brekeke.net.sip.sv.rule.RuleTable.getMatch (null:-1)
com.brekeke.net.sip.sv.Dispatcher.run (null:-1)
Exception: 06/06/15 03:40:37.626
java.lang.NullPointerException
com.brekeke.net.sip.sv.rule.matching.plugins.db.newConnection (null:-1)
com.brekeke.net.sip.sv.rule.matching.plugins.db.getConnection (null:-1)
com.brekeke.net.sip.sv.rule.matching.plugins.db.query (null:-1)
sun.reflect.NativeMethodAccessorImpl.invoke0 (null:-2)
sun.reflect.NativeMethodAccessorImpl.invoke (null:-1)
sun.reflect.DelegatingMethodAccessorImpl.invoke (null:-1)
java.lang.reflect.Method.invoke (null:-1)
com.brekeke.net.sip.sv.rule.RuleTable.getSpecialValue (null:-1)
com.brekeke.net.sip.sv.rule.RuleTable.getValue (null:-1)
com.brekeke.net.sip.sv.rule.RuleTable.evalRule (null:-1)
com.brekeke.net.sip.sv.rule.RuleTable.getMatch (null:-1)
com.brekeke.net.sip.sv.Dispatcher.run (null:-1)
Matching Pattern
$request=^INVITE
$addr=(.+)
$alias.lookup ("%1","AAA")=1
To=sip:(.*)(\d{10})@
From=sip:(.+)@
$alias.lookup ("%3","REG")=(.+)
$regaddr("%5")=(.+)
$db.query( "serverdb_sts1", "SELECT RegisteredAccount FROM serverdb_sts1.t_userdir WHERE username = '2025551212' " )=(.+)
Deploy Pattern
To=sip:%7@%6
From=sip:%4@10.0.0.14
$auth=false
$continue=false
java.lang.NullPointerException
com.brekeke.net.sip.sv.rule.matching.plugins.db.newConnection (null:-1)
com.brekeke.net.sip.sv.rule.matching.plugins.db.getConnection (null:-1)
com.brekeke.net.sip.sv.rule.matching.plugins.db.query (null:-1)
sun.reflect.NativeMethodAccessorImpl.invoke0 (null:-2)
sun.reflect.NativeMethodAccessorImpl.invoke (null:-1)
sun.reflect.DelegatingMethodAccessorImpl.invoke (null:-1)
java.lang.reflect.Method.invoke (null:-1)
com.brekeke.net.sip.sv.rule.RuleTable.getSpecialValue (null:-1)
com.brekeke.net.sip.sv.rule.RuleTable.getValue (null:-1)
com.brekeke.net.sip.sv.rule.RuleTable.evalRule (null:-1)
com.brekeke.net.sip.sv.rule.RuleTable.getMatch (null:-1)
com.brekeke.net.sip.sv.Dispatcher.run (null:-1)
Exception: 06/06/15 03:40:37.626
java.lang.NullPointerException
com.brekeke.net.sip.sv.rule.matching.plugins.db.newConnection (null:-1)
com.brekeke.net.sip.sv.rule.matching.plugins.db.getConnection (null:-1)
com.brekeke.net.sip.sv.rule.matching.plugins.db.query (null:-1)
sun.reflect.NativeMethodAccessorImpl.invoke0 (null:-2)
sun.reflect.NativeMethodAccessorImpl.invoke (null:-1)
sun.reflect.DelegatingMethodAccessorImpl.invoke (null:-1)
java.lang.reflect.Method.invoke (null:-1)
com.brekeke.net.sip.sv.rule.RuleTable.getSpecialValue (null:-1)
com.brekeke.net.sip.sv.rule.RuleTable.getValue (null:-1)
com.brekeke.net.sip.sv.rule.RuleTable.evalRule (null:-1)
com.brekeke.net.sip.sv.rule.RuleTable.getMatch (null:-1)
com.brekeke.net.sip.sv.Dispatcher.run (null:-1)
Matching Pattern
$request=^INVITE
$addr=(.+)
$alias.lookup ("%1","AAA")=1
To=sip:(.*)(\d{10})@
From=sip:(.+)@
$alias.lookup ("%3","REG")=(.+)
$regaddr("%5")=(.+)
$db.query( "serverdb_sts1", "SELECT RegisteredAccount FROM serverdb_sts1.t_userdir WHERE username = '2025551212' " )=(.+)
Deploy Pattern
To=sip:%7@%6
From=sip:%4@10.0.0.14
$auth=false
$continue=false
Izzyg,
It seems you didn't configure the DB settings correctly.
Do you have variables such as "serverdb_sts1.driver" in the [Configuration] > [Advanced] page ?
Have you read the wiki?
http://wiki.brekeke.com/wiki/Execute-SQ ... m-Dialplan
It seems you didn't configure the DB settings correctly.
Do you have variables such as "serverdb_sts1.driver" in the [Configuration] > [Advanced] page ?
Have you read the wiki?
http://wiki.brekeke.com/wiki/Execute-SQ ... m-Dialplan
These are in the advanced configuration
# Failover settings
failover.timer.inviting=10
failover.timer.provisional=360
#net.listener.loglevel.file=255
#net.sip.loglevel.file=255
#dialplan.debug.log = true
#net.registrar.loglevel.file=255
file.log.system.size=10728640
file.log.system.overflow=2
file.log.session.date.str = true
#net.sip.timer.t1=500
net.dispatcher.max.stacked.time = 86400000
net.webget.log = true
db-name.driver = com.mysql.jdbc.Driver
db-name.url = jdbc:mysql://serverdns.com/serverdb_sts1
db-name.user = brekeke_sts1_rw
db-name.password = SecuredPassword
sipadmin.cmd.hosts.allow = ^10.10.0.11$|^10.10.0.15$
# Failover settings
failover.timer.inviting=10
failover.timer.provisional=360
#net.listener.loglevel.file=255
#net.sip.loglevel.file=255
#dialplan.debug.log = true
#net.registrar.loglevel.file=255
file.log.system.size=10728640
file.log.system.overflow=2
file.log.session.date.str = true
#net.sip.timer.t1=500
net.dispatcher.max.stacked.time = 86400000
net.webget.log = true
db-name.driver = com.mysql.jdbc.Driver
db-name.url = jdbc:mysql://serverdns.com/serverdb_sts1
db-name.user = brekeke_sts1_rw
db-name.password = SecuredPassword
sipadmin.cmd.hosts.allow = ^10.10.0.11$|^10.10.0.15$
Do you want to limit the number of calls each registered user?
Read this.
http://wiki.brekeke.com/wiki/Limit-conc ... gh-a-route
Read this.
http://wiki.brekeke.com/wiki/Limit-conc ... gh-a-route