Hello, I was building some lua apps, and clearly went wrong somewhere. I now have several channels in the hangup state, all from the extension I was testing, to the script I was testing. There are lots of errors in the script at this point, so I'm sure it's something I did. However, these channels sent the CPU to 120% (according to top), and I'm not at a load average of 4. Fortunately, Freeswitch handles this rather gracefully and call quality seems to be okay in spite of it. Is there a way to kill these threads without killing the other calls? I tried using uuid_kill, but it came back as no such channel. I can see the channels in "show channels", but the uuids listed don't exist according to uuid_exists. Any suggestions? Thanks! -Tim
look for endless loops in your code that are not using session:ready On Thu, Oct 7, 2010 at 1:48 PM, Tim St. Pierre <fs-list@communicatefreely.net> wrote:
Hello,
I was building some lua apps, and clearly went wrong somewhere.
I now have several channels in the hangup state, all from the extension I was testing, to the script I was testing. There are lots of errors in the script at this point, so I'm sure it's something I did.
However, these channels sent the CPU to 120% (according to top), and I'm not at a load average of 4. Fortunately, Freeswitch handles this rather gracefully and call quality seems to be okay in spite of it.
Is there a way to kill these threads without killing the other calls? I tried using uuid_kill, but it came back as no such channel. I can see the channels in "show channels", but the uuids listed don't exist according to uuid_exists.
Any suggestions?
Thanks!
-Tim
_______________________________________________ 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
-- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_minessale@hotmail.com GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org googletalk:conf+888@conference.freeswitch.org pstn:+19193869900
Okay, I think I see where I'm going wrong with Lua. I didn't realize that the script persists even if the user hangs up. When this does happen, is there any way to kill the thread and make the script stop? I had to completely restart freeswitch to make these calls go away. Is there a less disruptive way to terminate the scripts? Anthony Minessale wrote:
look for endless loops in your code that are not using session:ready
On Thu, Oct 7, 2010 at 1:48 PM, Tim St. Pierre <fs-list@communicatefreely.net> wrote:
Well anthony gave you a hint... wrap your whole loop in a while(session:ready) it will then end the script if the session hangs up. /b On Oct 7, 2010, at 9:15 PM, Tim St. Pierre wrote:
I had to completely restart freeswitch to make these calls go away. Is there a less disruptive way to terminate the scripts?
If you have the FS book this topic is discussed nicely in chapter 7. -MC On Fri, Oct 8, 2010 at 7:45 AM, Brian West <brian@freeswitch.org> wrote:
Well anthony gave you a hint... wrap your whole loop in a while(session:ready) it will then end the script if the session hangs up.
/b
On Oct 7, 2010, at 9:15 PM, Tim St. Pierre wrote:
I had to completely restart freeswitch to make these calls go away. Is there a less disruptive way to terminate the scripts?
_______________________________________________ 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
Yes, I'm doing that in all scripts that loop from now on. What I was trying to find out, was if there is some sort of fs_cli command that I can run to remove all those calls, other than fsctl restart. It likely won't be an issue in the future, now that I have the correct control flow, but just in case - it helps to know these tricks. I'm hoping to get the book ordered. I think it will be useful, and I do like books. -Tim Brian West wrote:
Well anthony gave you a hint... wrap your whole loop in a while(session:ready) it will then end the script if the session hangs up.
/b
On Oct 7, 2010, at 9:15 PM, Tim St. Pierre wrote:
I had to completely restart freeswitch to make these calls go away. Is there a less disruptive way to terminate the scripts?
_______________________________________________ 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
Well you have a few choices: uuid_kill <uuid> (if you know the uuid) hupall <reason> (if you don't mind dropping ALL calls on your system) I'd say hupall is a good choice. Now, if you want to get really fancy and you know that your Lua script always sets a particular channel variable then you can do something like this: hupall matching <chan_var_name> <value> Then it will selectively hangup any channel with a chan var matching the value you specify. -MC On Mon, Oct 11, 2010 at 3:37 PM, Tim St. Pierre < fs-list@communicatefreely.net> wrote:
Yes, I'm doing that in all scripts that loop from now on.
What I was trying to find out, was if there is some sort of fs_cli command that I can run to remove all those calls, other than fsctl restart.
It likely won't be an issue in the future, now that I have the correct control flow, but just in case - it helps to know these tricks.
I'm hoping to get the book ordered. I think it will be useful, and I do like books.
-Tim
Brian West wrote:
Well anthony gave you a hint... wrap your whole loop in a while(session:ready) it will then end the script if the session hangs up.
/b
On Oct 7, 2010, at 9:15 PM, Tim St. Pierre wrote:
I had to completely restart freeswitch to make these calls go away. Is there a less disruptive way to terminate the scripts?
_______________________________________________ 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
_______________________________________________ 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 (4)
-
Anthony Minessale
-
Brian West
-
Michael Collins
-
Tim St. Pierre