Hi Brian,

I am not doing billing. But I need to set session variable in lua script called from api_hangup_hook.

I am able to access the session object and channel variable in lua script but could not set the channel variable from there. 

I can see that when CHANNEL_DESTROY comes it does not come with last set value from lua script.

Thanks
Varun

On Tue, Sep 27, 2022, 5:30 PM <freeswitch-dev-request@lists.freeswitch.org> wrote:
Send FreeSWITCH-dev mailing list submissions to
        freeswitch-dev@lists.freeswitch.org

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
or, via email, send a message with subject or body 'help' to
        freeswitch-dev-request@lists.freeswitch.org

You can reach the person managing the list at
        freeswitch-dev-owner@lists.freeswitch.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of FreeSWITCH-dev digest..."
Today's Topics:

   1. Cannot update a Channel Variable inside the       api_hangup_hook
      lua script (varun pratapsingh)
   2. Re: Cannot update a Channel Variable inside the
      api_hangup_hook lua script (Brian West)



---------- Forwarded message ----------
From: varun pratapsingh <varunps2003@gmail.com>
To: freeswitch-dev@lists.freeswitch.org
Cc: 
Bcc: 
Date: Mon, 26 Sep 2022 11:36:56 +0530
Subject: [Freeswitch-dev] Cannot update a Channel Variable inside the api_hangup_hook lua script
Hi Freeswitch Experts,

I am using session_in_hangup_hook = true and api_hangup_hook to call my lua script where I want to change the value of my channel variable through session:setVariable("custom_channel_variable", "new_value"). But I can see that I cannot do that. It is not getting changed. I am able to access the channel variables through session:getVariable("custom_channel_variable") but I cannot set them after the call is hung up. 

How can I do that? If I cannot do that then what is the reason? I do not see any reason yet in the Freeswitch documentation.

Can anyone enlighten me over this?

Thanks and Regards
Varun Singh



---------- Forwarded message ----------
From: Brian West <brian@freeswitch.com>
To: freeswitch-dev@lists.freeswitch.org
Cc: 
Bcc: 
Date: Mon, 26 Sep 2022 08:56:14 -0500
Subject: Re: [Freeswitch-dev] Cannot update a Channel Variable inside the api_hangup_hook lua script
Are you doing billing?

On Mon, Sep 26, 2022 at 8:48 AM varun pratapsingh <varunps2003@gmail.com> wrote:
Hi Freeswitch Experts,

I am using session_in_hangup_hook = true and api_hangup_hook to call my lua script where I want to change the value of my channel variable through session:setVariable("custom_channel_variable", "new_value"). But I can see that I cannot do that. It is not getting changed. I am able to access the channel variables through session:getVariable("custom_channel_variable") but I cannot set them after the call is hung up. 

How can I do that? If I cannot do that then what is the reason? I do not see any reason yet in the Freeswitch documentation.

Can anyone enlighten me over this?

Thanks and Regards
Varun Singh
_________________________________________________________________________

The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.
Build your next product on our scalable cloud platform.

Join our online community to chat in real time https://signalwire.community

Professional FreeSWITCH Services
sales@freeswitch.com
https://freeswitch.com

Official FreeSWITCH Sites
https://freeswitch.com/oss
https://freeswitch.org/confluence
https://cluecon.com

FreeSWITCH-dev mailing list
FreeSWITCH-dev@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
https://freeswitch.com


--

Brian West | Co-founder and Developer

Need Commercial support? email sales@freeswitch.com

FreeSWITCH Solutions | 17345 Civic Drive #2531 Brookfield, WI 53045

Email: brian@freeswitch.com

Mobile: 918-424-9378

Website: https://www.FreeSWITCH.com

https://www.facebook.com/signalwireinc?src=email https://twitter.com/freeswitch

_________________________________________________________________________

The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.
Build your next product on our scalable cloud platform.

Join our online community to chat in real time https://signalwire.community

Professional FreeSWITCH Services
sales@freeswitch.com
https://freeswitch.com

Official FreeSWITCH Sites
https://freeswitch.com/oss
https://freeswitch.org/confluence
https://cluecon.com

FreeSWITCH-dev mailing list
FreeSWITCH-dev@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
https://freeswitch.com