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@lists.freeswitch.org] Im Auftrag von Abaci B
Gesendet: Donnerstag, 2. November 2017 18:07
An: FreeSWITCH Users Help <freeswitch-users@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@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@lists.freeswitch.org] On Behalf Of Social Boh
Sent: Tuesday, October 31, 2017 10:47 AM
To: freeswitch-users@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