Author |
Message |
purgatory Brekeke Junior Member
Joined: 02 Nov 2011 Posts: 6
|
Posted: Wed Nov 09, 2011 5:54 am Post subject: database query in dialplan |
|
|
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/networkpatterns.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??
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 |
|
Back to top |
|
taitan Brekeke Master Guru
Joined: 15 Mar 2008 Posts: 237
|
Posted: Wed Nov 09, 2011 12:24 pm Post subject: |
|
|
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... |
|
Back to top |
|
purgatory Brekeke Junior Member
Joined: 02 Nov 2011 Posts: 6
|
Posted: Thu Nov 10, 2011 6:07 pm Post subject: |
|
|
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.
I'll make my own db pool. |
|
Back to top |
|
euroteort Brekeke Newbie
Joined: 26 Dec 2011 Posts: 1
Location: Indonesia
|
Posted: Sat Jan 07, 2012 2:53 pm Post subject: database query |
|
|
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 |
|
Back to top |
|
Tata Brekeke Master Guru
Joined: 27 Jan 2008 Posts: 223
|
Posted: Mon Jan 09, 2012 11:23 am Post subject: |
|
|
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? |
|
Back to top |
|
|