how do I get my DID number from lua script with session:getvariable
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@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.
try rdnis But you could put your lua script in your public context, where the calls are handled first. I dont really see the point to do that in default. David Ponzone Direction Technique email: david.ponzone@ipeva.fr tel: 01 74 03 18 97 gsm: 06 66 98 76 34 Service Client IPeva tel: 0811 46 26 26 www.ipeva.fr - www.ipeva-studio.com Ce message et toutes les pièces jointes sont confidentiels et établis à l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisée est interdite. Tout message électronique est susceptible d'altération. IPeva décline toute responsabilité au titre de ce message s'il a été altéré, déformé ou falsifié. Si vous n'êtes pas destinataire de ce message, merci de le détruire immédiatement et d'avertir l'expéditeur. Le 05/04/2010 à 17:00, Uzo Uzo a écrit :
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@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
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@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@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@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (3)
-
David Ponzone
-
Nandy Dagondon
-
Uzo Uzo