VoIP Mailing List Archives
Mailing list archives for the VoIP community |
|
View previous topic :: View next topic |
Author |
Message |
lei.tlfly at gmail.com Guest
|
Posted: Mon Oct 26, 2009 10:11 am Post subject: [Freeswitch-users] How to load user account from databse ? |
|
|
Hi All:
I'm a newbie to FS. I'm using FS as a sbc and have about 20000 user account . Does somebody can tell me how to make FS load use account information from a database such as mssql or mysql? Could you give me a sample configuration file?
Thanks a lots.
|
|
Back to top |
|
|
freeswitch.noob at gma... Guest
|
Posted: Mon Oct 26, 2009 10:27 am Post subject: [Freeswitch-users] How to load user account from databse ? |
|
|
Lei,
I am still learning myself, but I think I can help enough and others can chime in where I am wrong.
If you have FS up and running you will need to install xml_curl (http://wiki.freeswitch.org/wiki/Mod_xml_curl).
Then you will need to edit the config for it in your conf/autoload_configs/xml_curl_conf.xml and add the following to the file.
<binding name="externalDir">
<param name="gateway-url" value="http://my.webserver.com/index.php" bindings="directory"/>
</binding>
Then for every registered user call, a request will be posted to that script location.
The posts vary but look something like:
[hostname] => test.local
[section] => directory
[tag_name] => domain
[key_name] => name
[key_value] => company1.test.local
[action] => sip_auth
[sip_profile] => internal
[sip_user_agent] => eyeBeam release 1100v stamp 47073
[sip_auth_username] => 100
[sip_auth_realm] => company1.test.local
[sip_auth_nonce] => 37bd639a-d181-4df3-b53d-ab4172ca3be9
[sip_auth_uri] => sip:company1.test.local;transport=udp
[sip_contact_user] => 100
[sip_contact_host] => 10.43.43.2
[sip_to_user] => 100
[sip_to_host] => company1.test.local
[sip_from_user] => 100
[sip_from_host] => company1.test.local
[sip_request_host] => company1.test.local
[sip_auth_qop] => auth
[sip_auth_cnonce] => 207aae18a2af959346f87a2a3c2c7f8a
[sip_auth_nc] => 00000001
[sip_auth_response] => 770a1519789ba7606b3dcc6c4b7a99c5
[sip_auth_method] => REGISTER
[key] => id
[user] => 100
[domain] => company1.test.local
[ip] => 10.43.43.2
Then your script can handle the connection to the DB and the verification of the user information. My example uses PHP but any server side language that can be posted to can be used in the above scenario.
On Sun, Oct 25, 2009 at 8:58 AM, Lei Tang <lei.tlfly@gmail.com (lei.tlfly@gmail.com)> wrote:
|
|
Back to top |
|
|
msc at freeswitch.org Guest
|
Posted: Mon Oct 26, 2009 3:32 pm Post subject: [Freeswitch-users] How to load user account from databse ? |
|
|
On Sun, Oct 25, 2009 at 6:58 AM, Lei Tang <lei.tlfly@gmail.com (lei.tlfly@gmail.com)> wrote:
Quote: | Hi All:
I'm a newbie to FS. I'm using FS as a sbc and have about 20000 user account . Does somebody can tell me how to make FS load use account information from a database such as mssql or mysql? Could you give me a sample configuration file?
Thanks a lots.
| Lei,
The feature that you want is mod_xml_curl - it allows you to pull config information from a web server, and that web server will do the db lookup. For more information check out these resources:
Wiki docs: http://wiki.freeswitch.org/wiki/Mod_xml_curl
Example: http://fisheye.freeswitch.org/browse/FreeSWITCH/contrib/trixter/xml-curl
We don't have a soup-to-nuts how-to on mod_xml_curl because it can be done in so many different ways. Someone could write a book on implementing xml_curl techniques. Your best bet is to figure out how you want to store your user information, then decide what's the best way to pull that information from the database, then setup a web server to handle the request/return process. Between the docs and the examples you should be able to get up and running.
-MC |
|
Back to top |
|
|
costa.zikalala at gmai... Guest
|
Posted: Mon Oct 26, 2009 4:47 pm Post subject: [Freeswitch-users] How to load user account from databse ? |
|
|
Thanks for your response Michael,
Both the resources you've referred to don't explicitly say much about databases. Could you elaborate just a bit on how on information would retrieved from a database (MySQL) and presented to mod_xml_curl.
Thanks again.
2009/10/26 Michael Collins <msc@freeswitch.org (msc@freeswitch.org)>
|
|
Back to top |
|
|
red.rain.seven at gmai... Guest
|
Posted: Mon Oct 26, 2009 11:01 pm Post subject: [Freeswitch-users] How to load user account from databse ? |
|
|
We have used xml_odbc to get user data from database.Â
One question though, xml_odbc will load all the user info in database to memory just like it is loading from plain xml config files when FS starts. I was wondering if mod_xml_curl is doing this differently by only requesting user information on demand (real time)? and not loading all the user information from the beginning of FS start.
On Tue, Oct 27, 2009 at 5:39 AM, Costa Zikalala <costa.zikalala@gmail.com (costa.zikalala@gmail.com)> wrote:
--
Henry Huang
UniC Solution - Communication Unified
VoIP & Open Source software Consultant |
|
Back to top |
|
|
lei.tlfly at gmail.com Guest
|
Posted: Tue Oct 27, 2009 1:51 am Post subject: [Freeswitch-users] How to load user account from databse ? |
|
|
Hi noob and Michael, thanks for your answers, I'll try to use mod_xml_curl.
Hi Henry, http://wiki.freeswitch.org/wiki/Mod_xml_curl has mentioned, FS will post a request to webserver when it get a registration request. you can refer to the doc for more detail.
Lei.Tang
lei.tlfly@gmail.com (lei.tlfly@gmail.com) |
|
Back to top |
|
|
red.rain.seven at gmai... Guest
|
Posted: Tue Oct 27, 2009 3:01 am Post subject: [Freeswitch-users] How to load user account from databse ? |
|
|
Sorry, guys, I need to fix my earlier statement about xml_odbc. I just talked to my developer and xml_odbc IS loading registered user on real time, not from the beginning of the FS start.Â
So Lei Tang, you can use xml_odbc as well
On Tue, Oct 27, 2009 at 2:41 PM, Lei Tang <lei.tlfly@gmail.com (lei.tlfly@gmail.com)> wrote:
--
Henry Huang
UniC Solution - Communication Unified
VoIP & Open Source software Consultant |
|
Back to top |
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|