Forums Read-only archive

database query in dialplan

5 posts · Brekeke SIP Server Forum

purgatory Original post
1. Brekeke Product Name and version:
sip server standard 2.4.8.6

2. Java version:
jre x86 1.6.0.16

3. OS type and the version:
win2008R2 x64

4. UA (phone), gateway or other hardware/software involved:
moimstone phone, nortel SSW

5. Select your network pattern from http://www.brekeke-sip.com/bbs/network/ ... terns.html :
pattern 9 + pattern 10

6. Your problem:
Sorry for bad english :)

I know advanced version has $db.query function.
But we use standard version.



since bkk is based tomcat, database configuration is set to tomcat.

1) Modify "ProgramFiles\Brekeke\proxy\conf\server.xml"

Code:

        <Context path="/proxy">
		  <Resource name="jdbc/mytro" auth="Container" 
			type="javax.sql.DataSource" 
			driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" 
			maxActive="20" maxIdle="10" maxWait="5000" 
			username="bkk" 
			password="bkk1234" 
			url="jdbc:sqlserver://192.168.20.12;DatabaseName=BREKEKE" />
        </Context>
2) Modify "ProgramFiles\Brekeke\proxy\webapps\proxy\WEB-INF\web.xml"

Code:

	<resource-ref>
		<description>DB Connection</description>
		<res-ref-name>jdbc/mytro</res-ref-name>
		<res-type>javax.sql.DataSource</res-type>
		<res-auth>Container</res-auth>
	</resource-ref>
3) Added MSSQL JDBC driver to "Program Files\Brekeke\proxy\webapps\proxy\WEB-INF\lib\"

4) Added MSSQL JDBC driver to "ProgramFiles\Brekeke\proxy\common\lib\"


Test with dialplan -> Exception ?? Error?? :cry:

Test with jnditest.jsp file -> OK

Please help.
taitan
Hi

Brekeke SIP Server is an independent application from Tomcat, it doesn't read Tomcat's database configuration.

If you are using your own plugin, call the JDBC driver from the plugin.
For debugging the plugin, write a log or error messages into a file...
purgatory
taitan wrote: Brekeke SIP Server is an independent application from Tomcat, it doesn't read Tomcat's database configuration.
Thanks!
My code is wrong approch. :oops:
I'll make my own db pool.
euroteort
Hi All,

I am able to query the external database which is running on the same DB server as that of BPF metastore.

But I want to understand, Whether the same is possible or not when the external database is running on a remote DB server.
From the syntax I can see an option of specifying the server name but want to understand the prerequisites like.
1 Both the DB servers should be on the same domain or can be anywhere
2 How the performance will affect etc...

Please share your views on this.


Thanks,
Suman
Tata
Suman,

It depends on your code.
If you write a plugin, it can access to any database as you want.
Are you writing a plugin?