database query in dialplan

Discuss any topic about Brekeke SIP Server.

Moderator: Brekeke Support Team

Post Reply
purgatory
Posts: 6
Joined: Wed Nov 02, 2011 9:08 pm

database query in dialplan

Post by purgatory »

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: Select all

        <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: Select all

	<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.
Last edited by purgatory on Thu Nov 10, 2011 6:00 pm, edited 1 time in total.
taitan
Posts: 237
Joined: Sat Mar 15, 2008 10:39 pm

Post by 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
Posts: 6
Joined: Wed Nov 02, 2011 9:08 pm

Post by 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
Posts: 1
Joined: Mon Dec 26, 2011 8:44 pm
Location: Indonesia

database query

Post by 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
Posts: 223
Joined: Sun Jan 27, 2008 1:03 pm

Post by 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?
Post Reply