[Freeswitch-users] how do I get my DID number from lua script with session:getvariable
David Ponzone
david.ponzone at gmail.com
Tue Apr 6 16:27:17 PDT 2010
In the public context, your extension must now look like:
<extension name="mylua">
<condition field="destination_number"
"expression="^regexp_matching_your_DIDs$">
<action application="lua" data="/usr/local/freeswitch/scripts/
foo.lua"/>
</condition>
</extension>
Inside the script, you should be able to get the DID using the
variable destination_number.
Another way, simpler I would say, is to do:
<extension name="mylua">
<condition field="destination_number"
"expression="^(regexp_matching_your_DIDs)$">
<action application="lua" data="/usr/local/freeswitch/scripts/
foo.lua $1"/>
</condition>
</extension>
This way, you get the DID as argv[1] in your LUA script.
David Ponzone Direction Technique
email: david.ponzone at 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 06/04/2010 à 21:55, Uzo Uzo a écrit :
> I placed the script in the public context and tried that, but it
> shows nothing. In the default context, it will show 1002. But in
> public, it shows nothing.
>
> From: David Ponzone <david.ponzone at gmail.com>
> To: freeswitch-users at lists.freeswitch.org
> Sent: Mon, April 5, 2010 12:58:03 PM
> Subject: Re: [Freeswitch-users] how do I get my DID number from lua
> script with session:getvariable
>
> 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 at 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
>
> _______________________________________________
> 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/20100407/8e2dfbd2/attachment.html
More information about the FreeSWITCH-users
mailing list