Listen to Dave. I fixed the lock leak, it was down deep into code I am not sure is ever used. You want to be careful with what you do especially since you are on linux which means you must be using Mono which I am also not sure is used a lot. On Tue, Sep 4, 2012 at 2:08 PM, Dave R. Kompel <drk@drkngs.net> wrote:
This may be a bug, but ManagedSession really is not the right way to do this from API context. Because of the APP_DOMAIN issue its much easier to just do Api.ExecuteString("originate ... "). If you need to get to the "managed session of the leg you have two options:
For getting to it before the originate set the variable execute_on_originate to call a managed AppPlugin, or:
For getting results at the end of the call in API code, set the variable API_HANGUP_HOOK.
Both of these methoods are much easier to do from API context in mod_managed, and you won't have to worry about crossing app domain boundries, and you won't have do do any cleanup on the leg.
________________________________ From: Anthony Minessale [mailto:anthony.minessale@gmail.com] To: FreeSWITCH Users Help [mailto:freeswitch-users@lists.freeswitch.org] Sent: Tue, 04 Sep 2012 11:37:54 -0700
Subject: Re: [Freeswitch-users] Problem with originated calls hanging in CS_SOFT_EXEC state
now that you have a jira do not continue this thread it doubles the work effort, see comments there
On Tue, Sep 4, 2012 at 1:00 PM, Phillip Boles <freeswitch-users@vocalspace.com> wrote:
I have tried to get the Current HEAD to run mod_managed with this to the top of switch_core.h #define SWITCH_DEBUG_RWLOCKS 1
I am getting this error now.
2012-09-04 12:57:38.318859 [CRIT] switch_loadable_module.c:1310 Error Loading module /usr/local/freeswitch/mod/mod_managed.so **/usr/local/freeswitch/mod/mod_managed.so: undefined symbol: switch_core_session_read_lock**
Thoughts?
Thanks! On Aug 31, 2012, at 5:20 PM, Anthony Minessale wrote:
add this to the top of switch_core.h #define SWITCH_DEBUG_RWLOCKS 1
rebuild and get a full log of the call look for sign of unhandled rwlock
and put this on jira why I am i helping you over ml .... >=0
On Fri, Aug 31, 2012 at 4:16 PM, Phillip Boles <freeswitch-users@vocalspace.com> wrote:
Sorry Yes using the latest.
Using commit a8ce9ac29f3ba000bf42ab2286be04cc7bf9f509 Author: Anthony Minessale <anthm@freeswitch.org> Date: Thu Aug 30 17:17:15 2012 -0500
Changes made switch_cpp.cpp starting at Line 1000 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Calling CoreSession::destroy\n"); if (session) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "We still have valid session\n");
if (!channel) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Channel is undefined! Trying to get it!\n");
channel = switch_core_session_get_channel(session); }
if (channel) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s destroy/unlink session from object\n", switch_channel_get_name(channel)); switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s destroy/unlink uuid\n", switch_channel_get_uuid(channel)); switch_channel_set_private(channel, "CoreSession", NULL); if (switch_channel_up(channel) && switch_test_flag(this, S_HUP) && !switch_channel_test_flag(channel, CF_TRANSFER)) { switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING); } } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Channel is undefined! We Failed to get it!\n"); }
[CRIT] switch_cpp.cpp:1000 Calling CoreSession::destroy [CRIT] switch_cpp.cpp:1002 We still have valid session [DEBUG] switch_cpp.cpp:1011 sofia/external/12146635351 destroy/unlink session from object [DEBUG] switch_cpp.cpp:1013 83451093-e04f-49c1-9f55-5dd966bc4ba9 destroy/unlink uuid [DEBUG] switch_core_state_machine.c:92 sofia/external/XXXXXXXXXX Standard REPORTING, cause: NORMAL_CLEARING [DEBUG] switch_core_state_machine.c:703 (sofia/external/XXXXXXXXXX ) State REPORTING going to sleep [DEBUG] switch_core_state_machine.c:423 (sofia/external/XXXXXXXXXX ) State Change CS_REPORTING -> CS_DESTROY [DEBUG] switch_core_session.c:1210 Send signal sofia/external/XXXXXXXXXX [BREAK] [DEBUG] switch_core_session.c:1415 Session 2 (sofia/external/XXXXXXXXXX ) Locked, Waiting on external entities
channel remains hung
P
On Aug 31, 2012, at 12:26 PM, Anthony Minessale wrote:
1) You did not answer the question if you are on latest GIT HEAD. If you are on anything else update... 2) Add some debugging to switch_cpp.cpp about line 1000
use lines like this to follow the code paths when you call destroy switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "BLAH\n");
The part I am concerned with is when you call destroy you dont see the log line you should:
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s destroy/unlink session from object\n", switch_channel_get_name(channel));
This makes me wonder if you are some older version...
On Fri, Aug 31, 2012 at 11:57 AM, Phillip Boles <freeswitch-users@vocalspace.com> wrote:
var session = ManagedSession.OriginateHandleHangup(s, dialString, ts, (y) => { try { Log.WriteLine(LogLevel.Info, "Hanging UP: "+ y.GetUuid()); y.SetAutoHangup(true); y.flushDigits(); y.flushEvents(); y.destroy(); y.Dispose(); GC.Collect(); } catch( Exception ) { Log.WriteLine(LogLevel.Critical, "Exception While Trying to handup"); } }); Changes yield no fix. Neither .Dispose() or .destroy() separately or together destroy the channel. I see in the log the hangup 11da29f3-2d9e-4b74-a439-a96ba60f2db1 but this is what I get from show channels. The last log lines of the debug is: 2012-08-31 11:25:52.109393 [DEBUG] switch_core_state_machine.c:407 (sofia/external/XXXXXXXXXX) State Change CS_REPORTING -> CS_DESTROY 2012-08-31 11:25:52.109393 [DEBUG] switch_core_session.c:1224 Send signal sofia/external/XXXXXXXXXX [BREAK] 2012-08-31 11:25:52.109393 [DEBUG] switch_core_session.c:1424 Session 1 (sofia/external/XXXXXXXXXX) Locked, Waiting on external entities
freeswitch@fs03.int.colo> show channels 11da29f3-2d9e-4b74-a439-a96ba60f2db1,outbound,2012-08-31
11:25:24,1346430324,sofia/external/12146635351,CS_SOFT_EXECUTE,Vocalspace,2223334444,,12146635351,,,,default,PCMU,8000,64000,PCMU,8000,64000,,fs03.int.colo,,,ACTIVE,Outbound Call,12146635351,,,,
freeswitch@fs03.int.colo> uuid_kill 11da29f3-2d9e-4b74-a439-a96ba60f2db1
-ERR No Such Channel!
I am calling this from "managed CustomModule.Api"
Calling GC.Collect() later in the execution does not resolve either. //------------------------------------------------------ // Entrypoint for blocking API execution //------------------------------------------------------ public void Execute (ApiContext context) { context.Arguments, context.Event == null ? "<none>" : context.Event.GetEventType ()));
// this contains the above code Run(ParseArguments(context.Arguments)); GC.Collect(); }
Thanks! Suggestions appreciated. On Aug 30, 2012, at 5:22 PM, Dave R. Kompel wrote:
Actually, all the managed objects are derived from IDisposable, so you should use the .Dispose() method, and let the wrapper do it's job.
________________________________ From: Anthony Minessale [mailto:anthony.minessale@gmail.com] To: FreeSWITCH Users Help [mailto:freeswitch-users@lists.freeswitch.org] Sent: Thu, 30 Aug 2012 13:48:07 -0700 Subject: Re: [Freeswitch-users] Problem with originated calls hanging in CS_SOFT_EXEC state
destroy method should have a log line about (destroy/unlink session from object) try calling your garbage collector, this is common issue with scripts and make sure you are on latest GIT build
On Thu, Aug 30, 2012 at 3:24 PM, Phillip Boles <freeswitch-users@vocalspace.com> wrote: > Sorry for the excessive logs. Here is my call to originate. > > var session = ManagedSession.OriginateHandleHangup(s, dialString, ts, > (y) > => { > try { > Log.WriteLine(LogLevel.Info, "Hanging UP: "+ y.GetUuid()); > y.SetAutoHangup(true); > y.destroy(); > > } catch( Exception ) { > Log.WriteLine(LogLevel.Critical, "Exception While Trying to handup"); > } > }); > > > My hangup callback is getting hit and I am destroying the session > > 2012-08-28 10:49:27.296108 [INFO] switch_cpp.cpp:1227 Handing UP: > e315f2e8-1fa8-4fd9-849b-f687dad8aed5 > > This is the only call on the system as it is a develpment machine and > I > see > the call state being changed. > > 2012-08-28 10:49:27.296108 [DEBUG] switch_core_state_machine.c:79 > sofia/external/XXXXXXXXXXX Standard REPORTING, cause: NORMAL_CLEARING > 2012-08-28 10:49:27.296108 [DEBUG] switch_core_state_machine.c:682 > (sofia/external/XXXXXXXXXXX) State REPORTING going to sleep > 2012-08-28 10:49:27.296108 [DEBUG] switch_core_state_machine.c:407 > (sofia/external/XXXXXXXXXXX) State Change CS_REPORTING -> CS_DESTROY > > > If I call show channels after the above output it show there is a > session > sitting in CS_SOFT_EXEC corresponding to UUID > e315f2e8-1fa8-4fd9-849b-f687dad8aed5. > Is there something else I need to do to release the lock on this > session > to > let the resources be reclaimed. > > Thanks! > > Phillip > > > > > > _________________________________________________________________________ > Professional FreeSWITCH Consulting Services: > consulting@freeswitch.org > http://www.freeswitchsolutions.com > > FreeSWITCH-powered IP PBX: The CudaTel Communication Server > http://www.cudatel.com > > Official FreeSWITCH Sites > http://www.freeswitch.org > http://wiki.freeswitch.org > http://www.cluecon.com > > 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
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
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
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
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
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
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
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
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
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
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
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
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
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
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
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
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
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
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