FreeSwitch - MongoDB integration - freeswitch

I've installed FreeSwitch on Linux CentOS 6.4 server. I found out that if I want to add a user, I need to make a xml file under /freeswitch/conf/directory/default folder. I was wondering why it doesn't use database to manage account and password?
FreeSwitch supports MongoDB CDR Mod. http://wiki.freeswitch.org/wiki/Mod_cdr_mongodb It shows detailed call record on web browser. It is like admin tool. However, this is not what I was looking for.
I am looking for a way to store new account and password into MongoDB and use it when a user make a call through FreeSwitch. So, I can handle user data in a better way. Does anyone know how to solve my problem? Thank you.

I think the fastest way for you to get familiar with FreeSWITCH is to read the book: http://www.packtpub.com/freeswitch-1-2/book
The book is quite short, and it answers most of potential questions, and for the rest of questions you have the Wiki and the source code :)
to answer your question, yes, there's a number of mechanisms to look up external sources for user information and credentials. The simplest one is to use mod_xml_curl: it requests pieces of XML from an HTTP server, and you can build the service with whatever database backend you prefer.

Freeswitch supports sqlite, pgsql and odbc those three way all can solve you problem .In sip_profiles/internal.xml you can find some way to connect database
<!--<param name="odbc-dsn" value="dsn:user:pass"/>-->
<!-- Or, if you have PGSQL support, you can use that -->
<!--<param name="odbc-dsn" value="pgsql://hostaddr=127.0.0.1 dbname=freeswitch user=freeswitch password='' options='-c client_min_messages=NOTICE' application_name='freeswitch'" />--> ##

Related

Ajax without backend script

I have a simple database application in mind and I am thinking of making it browser-accessible instead of creating a standalone one.
I almost finished creating the DB schema in a PostgreSQL Server and I will now start developing. My first idea was using PHP or Ruby On Rails to manage the backend logic and interfacing with the DB, but since this application is fairly simple I think that I can easily implement all business and data manipulation logic with JavaScript or with the DB triggers.
So I am now wondering: is there a way to directly send the queries to a PostgreSQL Server, without server-side scripting?
More generally: can a PostgreSQL(9.3) Server receive the queries in Http requests and provide the results in Http responses?
I know this might sound stupid, and I am not looking for answers like "Use JS for presentation, PHP for logic and DB for data storage". I believe this is a lightweight solution for a very simple application, so I want to try it if possible!
Yes, That is possible.
What you can do is to send it via REST API. (post, get request ).
Here are some reference for you:
https://github.com/begriffs/postgrest
https://github.com/pgrest/pgrest
Please take a look at this for more HTTP API
[update!]
This idea is currently not possible (as I tought when I answered you before).
I tought it was possible after checking this node-postgres library written in javascript but it uses Node.js specific functions not present in the web browser as stated by the library's creator himself and this answer at stack overflow.
There is this package called browserify that exports a Node.js javascript file into a browser front-end ready javascript file. The problem with node-postgres + browserify is that it throw some errors during the browserification process, precisely when it tries to access libpq (an API written in C for accessing PostgreSQL).
I'm sorry I have mistaken you
Yet I still have a suggestion for you. You can try CouchDB if you really want to build a backendless/serverless application. It is natively RESTful, handles authentication and authorization at some extent, is opensource but unfortunately: NoSQL. It processes queries based on Map/Reduce paradigm and Mango query language so it's an entire different world for you to discover if you are used with SQL.
[old answer, I'm leaving it here for learning purposes]
Have you considered using a PostgreSQL driver for JavaScript? It is not RESTful, but it can connect to PostgreSQL and query it!
The library is called node-postgres and you can download it via npm
https://www.npmjs.com/package/pg
Just don't forget to enable SSL connection in the PostgreSQL server and in the client to avoid man-in-the-middle attacks.
An here's a tip: if you need an ACL for allowing or denying selects or inserts for specific users you can manage that through PostgreSQL user management and privileges. PostgreSQL has row level security, allowing you to define which rows in a table can be selected updated and deleted for a given set of users or groups.

FND_VAULT package

I have to encrypt my SOAP message and send to destination and the respective decrypt algorithm should run there. I went through fnd_vault package of oracle but no where I got any useful Information so can anyone please provide me some material or way to deal with this package.
I know I am not expected to ask such question here, but I didn't find any post regarding fnd_vault package so have to post neither I got some satisfactory information after goggling on it. So thought that some discussion regarding this can be done here.
You would want to use TLS/SSL. Depending on what technology you use, you may need to select appropriate driver. I would start from here.
Example 1
You use web services that wraps database API. In this case use HTTPS connection and make sure that service side is configured to accept SSL connection (which means you need to install a trusted certificate on the web server).
Example 2
You use Java driver to directly connect to Oracle server. Use this manual to configure JDBC connection.

xmpp client with server ejabberd

I am using ejabberd as server and want to deploy it on a large scale. Can you suggest me the client best suited so that I can plug it in seamlessly. I am thinking of using wokkel or pidgin but not really sure of the best possibility. Any sort of guidance will be appreciated.
Actually my complete requirement is development of a chat engine - including server, clients etc. Currently I am working on things at my desktop only but once done, I have to host it; basically incorporate it with in a site for chatting purpose. So, now my problem is:
I am not clear about how the actual data flow is? I have googled and read about xmpp (a book by Peter Andre) also but I am not clear about the flow and what are the actual requirementsto do the above mentioned task. What I currently know is:
1) I need a server - so selected ejabberd
2) I need client - still not sure which one to use and one other doubt is how this client thing will work when deployed on some website for chatting purpose.
3) Some library - dont know which one and what is the purpose?
2) You can use a web client like Candy Chat (uses Strophe IIRC) http://candy-chat.github.io/candy/
3) Create your own webclient using javascript and the Strophe library which ggozad mentioned.

Best way to get database information to a program (windows and mac)

I'm using delphi at the moment and have a program that connects to another program (a server) which has the mysql database on it and sends the data back to the client. I have a web server that has the server program and the database but my question is can I just go straight from the client program I have made (windows and future mac) to the mysql database on the web server? Or do I really need the server program? If so, what do I need to do to connect my client program to the MySQL database over the internet?
You should be able to access the mysql database directly as long as you've created a user/pw combo for the database that allows remote access (Security discussion aside). You'll then want to search for a compatible mysql library that would ease the communication between your program and mysql. At the far technical end you might have to read/write directly to the mysql socket but that's possible as well.
Depends on whether your client programs will continue to be native applications or whether you plan to migrate to browser based clients.
If they're native applications you can obtain library components for the languages they're written in which will be able to communicate directly with the MySQL database. There are plenty of options for Delphi; I'm not familiar with what options might be available for native Mac development (but, of course, Embarcadero is in the process of rolling out a Delphi that can generate Mac applications).
If, however, you're planning on making your clients browser-based, ajax solutions want to talk to a web server rather than a database server. In that case, you will need to maintain your middleware. For a discussion of whether it's possible or desirable to have a browser based application communicate directly with a database server see this question.
I would use SOAP/XML for this, and leave the SQL out of the client entirely.
This is a typical use case where REST (for example using JSON encoded database records) can be helpful. It is easy to implement a Delphi client using lkJSON or SuperObject, to put the database records from the HTTP response into a TClientDataSet.
Yes, it's possible, but is it a good idea?
here's a basic discussion of 2 tier v 3 tier architecture

LDAP Server on Heroku?

Is it possible to run the LDAP protocol over HTTP or HTTPS?
If so, does anybody know of a Ruby LDAP server which can be made to run on Heroku.com?
No, it is not possible to run LDAP over HTTP(S). LDAP is a binary protocol in its own right, described in ASN.1 and transmitted in BER. However, DSML provides some functionality that may interest you. DSML represents directory services information using XML.
Yes, certainly it is possible, I have one where LDAP entities are sent as JSON objects. Let me know if you are interested in taking a look at it. But this is in Java not Ruby but might throw some light..

Resources