LUA session prevents channel's DOWN state
On 12/16/2010 10:39 AM, Tóth Róbert wrote:
/ Hello />>/ />>/ I have a LUA script, what runs permamently and listen to callstate-change events. />>/ />/> When i attached to a channel by />/> session = freeswitch.session(uuid), />/> it prevents the finish of the channel. (I get some variables from the channel.) />/> It hangs up, the call finishes, but the channel exists until i shutdown FS. />/> state=CS_REPORING and callstate=HANGUP until the end of times... />/> />/> How can i detach from the channel? /> Iirc you need to have all your sessions enclosed in while (session:ready() == true) do
Regards, Patrick
Sorry, i don't understand what you think. When the script receives an event, uses the event's headers, but some variables have to be asked from the channel directly. After these datas are collected, they are saved in the db, and wait for the next the callstate-event. So i dont know where could i put this line where it would be useful. (But this does not mean i'm thinking right...)
On 12/16/2010 11:34 AM, Tóth Róbert wrote:
On 12/16/2010 10:39 AM, Tóth Róbert wrote:
/ Hello />>/ />>/ I have a LUA script, what runs permamently and listen to callstate-change events. />>/ />/> When i attached to a channel by />/> session = freeswitch.session(uuid), />/> it prevents the finish of the channel. (I get some variables from the channel.) />/> It hangs up, the call finishes, but the channel exists until i shutdown FS. />/> state=CS_REPORING and callstate=HANGUP until the end of times... />/> />/> How can i detach from the channel? /> Iirc you need to have all your sessions enclosed in while (session:ready() == true) do
Regards, Patrick
Sorry, i don't understand what you think.
When the script receives an event, uses the event's headers, but some variables have to be asked from the channel directly. After these datas are collected, they are saved in the db, and wait for the next the callstate-event.
So i dont know where could i put this line where it would be useful.
(But this does not mean i'm thinking right...)
Look at the Lua examples on the wiki. There you can see how this is used. Regards, Patrick
Anywhere you wait for a while you should check session:ready(), and before any long function calls. While your lua script has the session it cannot hangup, only when you return the session to the core during the ready() call. Steve on iPhone On 16 Dec 2010, at 10:34, Tóth Róbert <trob@freemail.hu> wrote:
On 12/16/2010 10:39 AM, Tóth Róbert wrote:
/ Hello />>/ />>/ I have a LUA script, what runs permamently and listen to callstate-change events. />>/ />/> When i attached to a channel by />/> session = freeswitch.session(uuid), />/> it prevents the finish of the channel. (I get some variables from the channel.) />/> It hangs up, the call finishes, but the channel exists until i shutdown FS. />/> state=CS_REPORING and callstate=HANGUP until the end of times... />/> />/> How can i detach from the channel? /> Iirc you need to have all your sessions enclosed in while (session:ready() == true) do
Regards, Patrick
Sorry, i don't understand what you think.
When the script receives an event, uses the event's headers, but some variables have to be asked from the channel directly. After these datas are collected, they are saved in the db, and wait for the next the callstate-event.
So i dont know where could i put this line where it would be useful.
(But this does not mean i'm thinking right...)
_______________________________________________ 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)
-
Patrick Lists
-
Steven Ayre
-
Tóth Róbert