[Freeswitch-users] how do I get my DID number from lua script with session:getvariable

Nandy Dagondon nandy1925 at gmail.com
Mon Apr 5 18:06:20 PDT 2010


you can pass the caller_id_number parameter to the Lua script e.g.
<action application="lua" data="/usr/local/freeswitch/scripts/foo.lua
${caller_id_number}"/>
-nandy


On Mon, Apr 5, 2010 at 11:00 PM, Uzo Uzo <uzoechi at yahoo.com> wrote:

> I probably am doing this wrong, but here is what I have.
> I have a bunch of DID's.  I want my lua script to intercept all calls then
> handle them based on which DID was called.
>
> What I have done is create my lua script foo.lua
>
> then in the dialplan/default.xml
>
> I have
> <extension name="mylua">
>  <condition field="destination_number" "expression="^1002$">
>  <action application="lua" data="/usr/local/freeswitch/scripts/foo.lua"/>
> </condition>
> </extension>
>
> then i forward all my DIDs to extension 1002 at myfreeswitchbox
>
> when I get a call to the DID the lua script intercepts it, is this the best
> way?
>
> from the lua script,  I can do session:getVariable("caller_id_number")
>
> but that gives me the caller id of the incoming number, which is cool.
> which variable can i examine to get the DID number?
>
> thanks.
>
>
>
>
>
> _______________________________________________
> FreeSWITCH-users mailing list
> 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/20100406/88c677df/attachment.html 


More information about the FreeSWITCH-users mailing list