Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Freeswitch-users] How to load user account from databse ?


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
lei.tlfly at gmail.com
Guest





PostPosted: Mon Oct 26, 2009 10:11 am    Post subject: [Freeswitch-users] How to load user account from databse ? Reply with 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.
 
Back to top
freeswitch.noob at gma...
Guest





PostPosted: Mon Oct 26, 2009 10:27 am    Post subject: [Freeswitch-users] How to load user account from databse ? Reply with quote

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:
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.
 

_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org

Back to top
msc at freeswitch.org
Guest





PostPosted: Mon Oct 26, 2009 3:32 pm    Post subject: [Freeswitch-users] How to load user account from databse ? Reply with quote

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





PostPosted: Mon Oct 26, 2009 4:47 pm    Post subject: [Freeswitch-users] How to load user account from databse ? Reply with quote

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)>
Quote:


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

_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org

Back to top
red.rain.seven at gmai...
Guest





PostPosted: Mon Oct 26, 2009 11:01 pm    Post subject: [Freeswitch-users] How to load user account from databse ? Reply with quote

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:
Quote:
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)>
Quote:



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



_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org





_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org




--
Henry Huang
UniC Solution - Communication Unified
VoIP & Open Source software Consultant
Back to top
lei.tlfly at gmail.com
Guest





PostPosted: Tue Oct 27, 2009 1:51 am    Post subject: [Freeswitch-users] How to load user account from databse ? Reply with quote

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





PostPosted: Tue Oct 27, 2009 3:01 am    Post subject: [Freeswitch-users] How to load user account from databse ? Reply with quote

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:
Quote:
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)



_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org




--
Henry Huang
UniC Solution - Communication Unified
VoIP & Open Source software Consultant
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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

VoiceMeUp - Corporate & Wholesale VoIP Services