[Freeswitch-users] Query a Database

Marcel Haldemann marcel.haldemann at convercom.ch
Fri Nov 3 08:52:14 UTC 2017


Use lua and set channel variables inside the lua script, to use them in the dialplan after the lua script. This is by far the best way imho.

See Here:

https://freeswitch.org/confluence/display/FREESWITCH/Lua+with+Database
https://freeswitch.org/confluence/display/FREESWITCH/Lua+FreeSWITCH+Dbh

To set or get channel vars inside lua:
  result = session:getVariable(“name”);
  session:setVariable(“name”,”value”)

if u didn’t work with lua yet at all:
https://freeswitch.org/confluence/display/FREESWITCH/Lua+examples

finally it will look in ur dialplan like:

<application=”lua” data=”script.lua” />
<application=”whateveruwant” data=”xxxx${myChannelVarSetInLUA}xxxx”

Von: FreeSWITCH-users [mailto:freeswitch-users-bounces at lists.freeswitch.org] Im Auftrag von Abaci B
Gesendet: Donnerstag, 2. November 2017 18:07
An: FreeSWITCH Users Help <freeswitch-users at lists.freeswitch.org>
Betreff: Re: [Freeswitch-users] Query a Database

you can use mod_xml_odbc from contrib which I'm not sure if it's stable or you can use something like lua inline

On Wed, Nov 1, 2017 at 2:23 PM, Social Boh <social at bohboh.info<mailto:social at bohboh.info>> wrote:
I'd like query, for example, MariaDB database from dialplan and use the result on dialplan too.

Thank you

Regards

---
I'm SoCIaL, MayBe

El 01/11/2017 a las 09:14, Ken Rice escribió:
This depends on what you are trying to do... but one of the easiest is just use mod_xml_curl... see https://www.youtube.com/watch?v=IxhLXATa1Ss

-----Original Message-----
From: FreeSWITCH-users [mailto:freeswitch-users-bounces at lists.freeswitch.org<mailto:freeswitch-users-bounces at lists.freeswitch.org>] On Behalf Of Social Boh
Sent: Tuesday, October 31, 2017 10:47 AM
To: freeswitch-users at lists.freeswitch.org<mailto:freeswitch-users at lists.freeswitch.org>
Subject: [Freeswitch-users] Query a Database

Hello List,

which is the best way to query a Database and use the results in Dialplan?

Thank you.

Regards

_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting at freeswitch.org<mailto:consulting at freeswitch.org>
http://www.freeswitchsolutions.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://confluence.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org<mailto:FreeSWITCH-users at lists.freeswitch.org>
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20171103/52cd6ded/attachment.html>


More information about the FreeSWITCH-users mailing list