[Freeswitch-users] Using Lua Dialplan hunting

Leon de Rooij leon at scarlet-internet.nl
Thu Nov 11 06:44:47 PST 2010


Well, I misunderstood your question -- and getVariable gets channel  
variables as well as caller_profile fields, so my patch is useless :-)

I'd just set a channel variable before doing the execute_extension,  
don't know how to do it otherwise.

Kind regards,

Leon



On Nov 11, 2010, at 2:31 PM, Leon de Rooij wrote:

> Hi Tim,
>
> I made a small patch to provide the functionality you asked for:
>
> http://jira.freeswitch.org/browse/FS-2838
>
> It has not been accepted yet, but you can apply the patch if you want
> to test it out already.
>
> Kind regards,
>
> Leon
>
>
>
> On Nov 10, 2010, at 6:20 PM, Leon de Rooij wrote:
>
>> Hello Tim,
>>
>> I think this is not available at the moment, I have an idea how to
>> make it available from inside your Lua script, but don't have time
>> before tomorrow.
>>
>> In the mean time you may be able to set the caller field as a channel
>> variable to make it available in your Lua script as follows:
>>
>> <extension name="store_destination_number">
>>  <condition field="destination_number" expression="^(.*)$">
>>    <action application="set" data="caller_field_destination_number=
>> $1"/>
>>  </condition>
>> </extension>
>>
>> Of course this is ugly and it won't work if you immediately use LUA
>> dialplan directly from for example your sip_profile.
>>
>> Will reply with an update soon(ish).
>>
>> Kind regards,
>>
>> Leon
>>
>>
>> On Nov 8, 2010, at 8:27 PM, Tim St. Pierre wrote:
>>
>>> Hello,
>>>
>>> I am using lua extensively for dynamic dialplan generatian.
>>>
>>> In some cases, a dialplan is run with execute_extension instead of
>>> transfer.
>>>
>>> How do I get the Caller-Hunt-Destination from within the lua
>>> script?  It doesn't seem to be a
>>> session variable, and I can't pass arguments to the lua script when
>>> it is used as a dialplan.
>>>
>>> session:getVariable(caller-destination) returns the caller
>>> destination, which is usually different
>>> than the hunt-destination when execute_extension is used.
>>>
>>> Any suggestions?  Can this be added as a session variable somehow?
>>>
>>> _______________________________________________
>>> 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
>>
>>
>> _______________________________________________
>> 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
>
>
> _______________________________________________
> 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




More information about the FreeSWITCH-users mailing list