mod_managed on linux centos
Hi, I finally got mod_manage to load fine in FreeSWITCH on centos but now when I copied a .net dll that I built and runs on windows to the /mod/managed folder it loads fine on freeswitch startup but when try calling it (it's a AppPlugin) from the dialplan using <action application="managed" data="NameOfClass"/> I get these errors. 2010-09-01 00:21:23.303236 [ERR] switch_cpp.cpp:1177 Exception in Run(NameOfClass): System.NullReferenceException: Object reference not set to an instance of an object Server stack trace: at System.Runtime.Serialization.SerializationCallbacks.GetMethodsByAttribute (System.Type type, System.Type attr) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.SerializationCallbacks..ctor (System.Type type) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.SerializationCallbacks.GetSerializationCallbacks (System.Type t) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.SerializationObjectManager.RegisterObject (System.Object obj) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.GetObjectData (System.Object obj, System.Runtime.Serialization.Formatters.Binary.TypeMetadata& metadata, System.Object& data) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObject (System.IO.BinaryWriter writer, Int64 id, System.Object obj) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObjectInstance (System.IO.BinaryWriter writer, System.Object obj, Boolean isValueObject) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteQueuedObjects (System.IO.BinaryWriter writer) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObjectGraph (System.IO.BinaryWriter writer, System.Object obj, System.Runtime.Remoting.Messaging.Header[] headers) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize (System.IO.Stream serializationStream, System.Object graph, System.Runtime.Remoting.Messaging.Header[] headers) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize (System.IO.Stream serializationStream, System.Object graph) [0x00000] in <filename unknown>:0 at System.Runtime.Remoting.RemotingServices.SerializeExceptionData (System.Exception ex) [0x00000] in <filename unknown>:0 Exception rethrown at [0]: at (wrapper xdomain-invoke) FreeSWITCH.AppPluginExecutor:Execute (string,intptr) at (wrapper remoting-invoke-with-check) FreeSWITCH.AppPluginExecutor:Execute (string,intptr) at FreeSWITCH.Loader.Run (System.String command, IntPtr sessionHandle) [0x00000] in <filename unknown>:0 2010-09-01 00:21:23.303236 [ERR] mod_managed.cpp:422 Application run failed for NameOfClass (unknown module or exception). Anyone have any idea what is the problem? Thanks. Yitzchok
Don't you need to qualify that class name: NameSpace.NameOfClass ? On Wed, Sep 1, 2010 at 12:44 AM, Yitzchok <adminjew@gmail.com> wrote:
Hi,
I finally got mod_manage to load fine in FreeSWITCH on centos but now when I copied a .net dll that I built and runs on windows to the /mod/managed folder it loads fine on freeswitch startup but when try calling it (it's a AppPlugin) from the dialplan using <action application="managed" data="NameOfClass"/> I get these errors.
2010-09-01 00:21:23.303236 [ERR] switch_cpp.cpp:1177 Exception in Run(NameOfClass): System.NullReferenceException: Object reference not set to an instance of an object
Server stack trace: at System.Runtime.Serialization.SerializationCallbacks.GetMethodsByAttribute (System.Type type, System.Type attr) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.SerializationCallbacks..ctor (System.Type type) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.SerializationCallbacks.GetSerializationCallbacks (System.Type t) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.SerializationObjectManager.RegisterObject (System.Object obj) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.GetObjectData (System.Object obj, System.Runtime.Serialization.Formatters.Binary.TypeMetadata& metadata, System.Object& data) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObject (System.IO.BinaryWriter writer, Int64 id, System.Object obj) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObjectInstance (System.IO.BinaryWriter writer, System.Object obj, Boolean isValueObject) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteQueuedObjects (System.IO.BinaryWriter writer) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObjectGraph (System.IO.BinaryWriter writer, System.Object obj, System.Runtime.Remoting.Messaging.Header[] headers) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize (System.IO.Stream serializationStream, System.Object graph, System.Runtime.Remoting.Messaging.Header[] headers) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize (System.IO.Stream serializationStream, System.Object graph) [0x00000] in <filename unknown>:0 at System.Runtime.Remoting.RemotingServices.SerializeExceptionData (System.Exception ex) [0x00000] in <filename unknown>:0
Exception rethrown at [0]:
at (wrapper xdomain-invoke) FreeSWITCH.AppPluginExecutor:Execute (string,intptr) at (wrapper remoting-invoke-with-check) FreeSWITCH.AppPluginExecutor:Execute (string,intptr) at FreeSWITCH.Loader.Run (System.String command, IntPtr sessionHandle) [0x00000] in <filename unknown>:0 2010-09-01 00:21:23.303236 [ERR] mod_managed.cpp:422 Application run failed for NameOfClass (unknown module or exception).
Anyone have any idea what is the problem?
Thanks. Yitzchok
_______________________________________________ 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
When Demo.csx is places in mod/managed does it get loaded and compiled correctly? You should see it load when FS starts as well as dynamically picked up if copied while FS running. What version of the framework are you compiling the dll for? that might be the problem. -- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/mod-managed-on-linux-centos-tp... Sent from the freeswitch-users mailing list archive at Nabble.com.
@Phillip I don't think you need the namespace in there at least on windows (and in the docs it says classname) @Jeff It seems like the dll's and csx files load fine into freeswitch but when I call them in the dialplan it throws Here is the exception for the csx file 2010-09-01 10:38:04.832604 [ERR] switch_cpp.cpp:1177 Exception in Run(Ivr.TestIvr): System.NullReferenceException: Object reference not set to an instance of an object Server stack trace: at System.Runtime.Serialization.SerializationCallbacks.GetMethodsByAttribute (System.Type type, System.Type attr) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.SerializationCallbacks..ctor (System.Type type) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.SerializationCallbacks.GetSerializationCallbacks (System.Type t) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.SerializationObjectManager.RegisterObject (System.Object obj) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.GetObjectData (System.Object obj, System.Runtime.Serialization.Formatters.Binary.TypeMetadata& metadata, System.Object& data) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObject (System.IO.BinaryWriter writer, Int64 id, System.Object obj) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObjectInstance (System.IO.BinaryWriter writer, System.Object obj, Boolean isValueObject) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteQueuedObjects (System.IO.BinaryWriter writer) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObjectGraph (System.IO.BinaryWriter writer, System.Object obj, System.Runtime.Remoting.Messaging.Header[] headers) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize (System.IO.Stream serializationStream, System.Object graph, System.Runtime.Remoting.Messaging.Header[] headers) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize (System.IO.Stream serializationStream, System.Object graph) [0x00000] in <filename unknown>:0 at System.Runtime.Remoting.RemotingServices.SerializeExceptionData (System.Exception ex) [0x00000] in <filename unknown>:0 Exception rethrown at [0]: at (wrapper xdomain-invoke) FreeSWITCH.AppPluginExecutor:Execute (string,intptr) at (wrapper remoting-invoke-with-check) FreeSWITCH.AppPluginExecutor:Execute (string,intptr) at FreeSWITCH.Loader.Run (System.String command, IntPtr sessionHandle) [0x00000] in <filename unknown>:0 2010-09-01 10:38:04.832604 [ERR] mod_managed.cpp:422 Application run failed for Ivr.TestIvr (unknown module or exception). ------ I did get this exception once it then unloads the dll and it crashed FS (but I can't reproduce it) 2010-09-01 10:43:25.882172 [ALERT] switch_cpp.cpp:1177 Exception loading /usr/local/freeswitch/mod/managed/TestSystem.FreeSWITCH.Ivr.dll: System.ArgumentException: Culture name nSystem.FreeSWITCH.Ivr.dll is not supported. Parameter name: name Server stack trace: at System.Globalization.CultureInfo..ctor (System.String name, Boolean useUserOverride, Boolean read_only) [0x00000] in <filename unknown>:0 at System.Globalization.CultureInfo.CreateCulture (System.String name, Boolean reference) [0x00000] in <filename unknown>:0 at (wrapper managed-to-native) System.Reflection.Assembly:GetReferencedAssemblies () at FreeSWITCH.AsmPluginManager.LoadInternal (System.String fileName) [0x00000] in <filename unknown>:0 at FreeSWITCH.PluginManager.Load (System.String file) [0x00000] in <filename unknown>:0 at (wrapper remoting-invoke-with-check) FreeSWITCH.PluginManager:Load (string) at (wrapper xdomain-dispatch) FreeSWITCH.PluginManager:Load (object,byte[]&,byte[]&,string) Exception rethrown at [0]: at (wrapper xdomain-invoke) FreeSWITCH.PluginManager:Load (string) at (wrapper remoting-invoke-with-check) FreeSWITCH.PluginManager:Load (string) at FreeSWITCH.Loader.loadFile (System.String fileName) [0x00000] in <filename unknown>:0 Yitzchok On Wed, Sep 1, 2010 at 9:18 AM, Jeff Lenk <jeff@jefflenk.com> wrote:
When Demo.csx is places in mod/managed does it get loaded and compiled correctly? You should see it load when FS starts as well as dynamically picked up if copied while FS running. What version of the framework are you compiling the dll for? that might be the problem. -- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/mod-managed-on-linux-centos-tp... Sent from the freeswitch-users mailing list archive at Nabble.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
Does anyone have mod_managed working with Mono 2.6.7 on Linux? If no what version of mono are you using? Yitzchok On Wed, Sep 1, 2010 at 11:10 AM, Yitzchok <adminjew@gmail.com> wrote:
@Phillip I don't think you need the namespace in there at least on windows (and in the docs it says classname)
@Jeff It seems like the dll's and csx files load fine into freeswitch but when I call them in the dialplan it throws
Here is the exception for the csx file
2010-09-01 10:38:04.832604 [ERR] switch_cpp.cpp:1177 Exception in Run(Ivr.TestIvr): System.NullReferenceException: Object reference not set to an instance of an object
Server stack trace: at System.Runtime.Serialization.SerializationCallbacks.GetMethodsByAttribute (System.Type type, System.Type attr) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.SerializationCallbacks..ctor (System.Type type) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.SerializationCallbacks.GetSerializationCallbacks (System.Type t) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.SerializationObjectManager.RegisterObject (System.Object obj) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.GetObjectData (System.Object obj, System.Runtime.Serialization.Formatters.Binary.TypeMetadata& metadata, System.Object& data) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObject (System.IO.BinaryWriter writer, Int64 id, System.Object obj) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObjectInstance (System.IO.BinaryWriter writer, System.Object obj, Boolean isValueObject) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteQueuedObjects (System.IO.BinaryWriter writer) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObjectGraph (System.IO.BinaryWriter writer, System.Object obj, System.Runtime.Remoting.Messaging.Header[] headers) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize (System.IO.Stream serializationStream, System.Object graph, System.Runtime.Remoting.Messaging.Header[] headers) [0x00000] in <filename unknown>:0 at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize (System.IO.Stream serializationStream, System.Object graph) [0x00000] in <filename unknown>:0 at System.Runtime.Remoting.RemotingServices.SerializeExceptionData (System.Exception ex) [0x00000] in <filename unknown>:0
Exception rethrown at [0]:
at (wrapper xdomain-invoke) FreeSWITCH.AppPluginExecutor:Execute (string,intptr) at (wrapper remoting-invoke-with-check) FreeSWITCH.AppPluginExecutor:Execute (string,intptr) at FreeSWITCH.Loader.Run (System.String command, IntPtr sessionHandle) [0x00000] in <filename unknown>:0 2010-09-01 10:38:04.832604 [ERR] mod_managed.cpp:422 Application run failed for Ivr.TestIvr (unknown module or exception).
------
I did get this exception once it then unloads the dll and it crashed FS (but I can't reproduce it)
2010-09-01 10:43:25.882172 [ALERT] switch_cpp.cpp:1177 Exception loading /usr/local/freeswitch/mod/managed/TestSystem.FreeSWITCH.Ivr.dll: System.ArgumentException: Culture name nSystem.FreeSWITCH.Ivr.dll is not supported. Parameter name: name
Server stack trace: at System.Globalization.CultureInfo..ctor (System.String name, Boolean useUserOverride, Boolean read_only) [0x00000] in <filename unknown>:0 at System.Globalization.CultureInfo.CreateCulture (System.String name, Boolean reference) [0x00000] in <filename unknown>:0 at (wrapper managed-to-native) System.Reflection.Assembly:GetReferencedAssemblies () at FreeSWITCH.AsmPluginManager.LoadInternal (System.String fileName) [0x00000] in <filename unknown>:0 at FreeSWITCH.PluginManager.Load (System.String file) [0x00000] in <filename unknown>:0 at (wrapper remoting-invoke-with-check) FreeSWITCH.PluginManager:Load (string) at (wrapper xdomain-dispatch) FreeSWITCH.PluginManager:Load (object,byte[]&,byte[]&,string)
Exception rethrown at [0]:
at (wrapper xdomain-invoke) FreeSWITCH.PluginManager:Load (string) at (wrapper remoting-invoke-with-check) FreeSWITCH.PluginManager:Load (string) at FreeSWITCH.Loader.loadFile (System.String fileName) [0x00000] in <filename unknown>:0
Yitzchok
On Wed, Sep 1, 2010 at 9:18 AM, Jeff Lenk <jeff@jefflenk.com> wrote:
When Demo.csx is places in mod/managed does it get loaded and compiled correctly? You should see it load when FS starts as well as dynamically picked up if copied while FS running. What version of the framework are you compiling the dll for? that might be the problem. -- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/mod-managed-on-linux-centos-tp... Sent from the freeswitch-users mailing list archive at Nabble.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
One more question When you load Demo.csx can you succesfully execute "managed ApiDemo" from the cli? -- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/mod-managed-on-linux-centos-tp... Sent from the freeswitch-users mailing list archive at Nabble.com.
No it doesn't work and this is the error I get. freeswitch@internal> managed TestIvr -ERR no reply freeswitch@internal> 2010-09-02 14:23:34.096077 [ERR] switch_cpp.cpp:1177 Exception in Execute(TestIvr): System.NullReferenceException: Object reference not set to an instance of an object at System.Runtime.Remoting.Contexts.Context.get_NeedsContextSink () [0x00000] in <filename unknown>:0 at (wrapper xdomain-invoke) FreeSWITCH.ApiPluginExecutor:ExecuteApi (string,intptr,intptr) at (wrapper remoting-invoke-with-check) FreeSWITCH.ApiPluginExecutor:ExecuteApi (string,intptr,intptr) at FreeSWITCH.Loader.Execute (System.String command, IntPtr streamHandle, IntPtr eventHandle) [0x00000] in <filename unknown>:0 2010-09-02 14:23:34.096077 [ERR] mod_managed.cpp:404 Execute failed for TestIvr (unknown module or exception). --- My source code --- using System; using System.Collections.Generic; using System.Text; using FreeSWITCH; using FreeSWITCH.Native; namespace Ivr { public class TestIvr : IAppPlugin, IApiPlugin { public static void Main(string[] args) { } public void Run(AppContext context) { context.Session.Answer(); context.Session.sleep(2000, 0); context.Session.Hangup(""); } public void Execute(ApiContext context) { Console.WriteLine("!!!!WORKING!!!!"); } public void ExecuteBackground(ApiBackgroundContext context) { } } } Thanks. Yitzchok On Thu, Sep 2, 2010 at 2:12 PM, Jeff Lenk <jeff@jefflenk.com> wrote:
One more question
When you load Demo.csx can you succesfully execute "managed ApiDemo" from the cli?
-- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/mod-managed-on-linux-centos-tp... Sent from the freeswitch-users mailing list archive at Nabble.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
Please just use the file provided in src/mod/languages/mod_managed/managed/Demo.csx when you copy this file to install-location/mod/managed it should be loaded automatically in a running instance of fs. If this does not happen then the mono runtime is not setup or working correctly. -- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/mod-managed-on-linux-centos-tp... Sent from the freeswitch-users mailing list archive at Nabble.com.
So it seems like Demo.csx does work but only on the first call. freeswitch@li133-47> managed ApiDemo ApiDemo executed with args '' and event type API. freeswitch@li133-47> managed ApiDemo 2010-09-02 16:08:23.874678 [ERR] switch_cpp.cpp:1177 Exception in Execute(ApiDemo): System.NullReferenceException: Object reference not set to an instance of an object at System.Runtime.Remoting.Contexts.Context.get_NeedsContextSink () [0x00000] in <filename unknown>:0 at (wrapper xdomain-invoke) FreeSWITCH.ApiPluginExecutor:ExecuteApi (string,intptr,intptr) at (wrapper remoting-invoke-with-check) FreeSWITCH.ApiPluginExecutor:ExecuteApi (string,intptr,intptr) at FreeSWITCH.Loader.Execute (System.String command, IntPtr streamHandle, IntPtr eventHandle) [0x00000] in <filename unknown>:0 2010-09-02 16:08:23.874678 [ERR] mod_managed.cpp:404 Execute failed for ApiDemo (unknown module or exception). Yitzchok On Thu, Sep 2, 2010 at 3:45 PM, Jeff Lenk <jeff@jefflenk.com> wrote:
Please just use the file provided in src/mod/languages/mod_managed/managed/Demo.csx
when you copy this file to install-location/mod/managed it should be loaded automatically in a running instance of fs. If this does not happen then the mono runtime is not setup or working correctly.
-- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/mod-managed-on-linux-centos-tp... Sent from the freeswitch-users mailing list archive at Nabble.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
On 09/02/2010 07:48 PM, Yitzchok wrote:
Does anyone have mod_managed working with Mono 2.6.7 on Linux?
If no what version of mono are you using?
I only know that mod_managed in FreeSWITCH git from about two weeks ago built ok against mono 2.6.4 on CentOS 5.5 x86_64. And the module loaded correctly. Haven't tested anything else as I wouldn't know how to. Regards, Patrick
Anyone have any idea why it just works on the first call to the "managed" command and then all future calls to the "managed" command gets me the exception above until I restart FreeSWITCH (and that doesn't fix the problem). Yitzchok On Thu, Sep 2, 2010 at 5:47 PM, Patrick Lists < freeswitch-list@puzzled.xs4all.nl> wrote:
On 09/02/2010 07:48 PM, Yitzchok wrote:
Does anyone have mod_managed working with Mono 2.6.7 on Linux?
If no what version of mono are you using?
I only know that mod_managed in FreeSWITCH git from about two weeks ago built ok against mono 2.6.4 on CentOS 5.5 x86_64. And the module loaded correctly. Haven't tested anything else as I wouldn't know how to.
Regards, Patrick
_______________________________________________ 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
On 09/05/2010 06:28 AM, Yitzchok wrote:
Anyone have any idea why it just works on the first call to the "managed" command and then all future calls to the "managed" command gets me the exception above until I restart FreeSWITCH (and that doesn't fix the problem).
Sorry I have no idea. The only vague inverse similarity I have seen is mod_java not loading during startup but it will load fine manually once FS is started. Guess you need to do some more debugging. Regards, Patrick
I still didn't get this to work (I tried in centos and opensuse) both return the same error. Can someone with mod_managed installed on linux (after copying Demo.csx to the mod/Managed/ directory) try calling "*managed ApiDemo test* " and let me know if you get an error freeswitch@internal> *managed ApiDemo test* freeswitch@internal> *managed ApiDemo test* Yitzchok On Sun, Sep 5, 2010 at 8:25 AM, Patrick Lists < freeswitch-list@puzzled.xs4all.nl> wrote:
On 09/05/2010 06:28 AM, Yitzchok wrote:
Anyone have any idea why it just works on the first call to the "managed" command and then all future calls to the "managed" command gets me the exception above until I restart FreeSWITCH (and that doesn't fix the problem).
Sorry I have no idea. The only vague inverse similarity I have seen is mod_java not loading during startup but it will load fine manually once FS is started. Guess you need to do some more debugging.
Regards, Patrick
_______________________________________________ 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
This is interesting if I enter fs_cli and call *managed ApiDemo test *and then* /exit *and then *./fs_cli* and *managed ApiDemo test *it works again for one call to managed. * *Yitzchok On Sun, Oct 3, 2010 at 4:32 PM, Yitzchok <adminjew@gmail.com> wrote:
I still didn't get this to work (I tried in centos and opensuse) both return the same error.
Can someone with mod_managed installed on linux (after copying Demo.csx to the mod/Managed/ directory) try calling "*managed ApiDemo test* " and let me know if you get an error
freeswitch@internal> *managed ApiDemo test* freeswitch@internal> *managed ApiDemo test*
Yitzchok
On Sun, Sep 5, 2010 at 8:25 AM, Patrick Lists < freeswitch-list@puzzled.xs4all.nl> wrote:
On 09/05/2010 06:28 AM, Yitzchok wrote:
Anyone have any idea why it just works on the first call to the "managed" command and then all future calls to the "managed" command gets me the exception above until I restart FreeSWITCH (and that doesn't fix the problem).
Sorry I have no idea. The only vague inverse similarity I have seen is mod_java not loading during startup but it will load fine manually once FS is started. Guess you need to do some more debugging.
Regards, Patrick
_______________________________________________ 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
Have you seen: http://wiki.freeswitch.org/wiki/Mod_mono <dllmap dll="mod_managed.dll" target="mod_managed.so" os="!windows"/> regarding null exceptions? -- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/mod-managed-on-linux-centos-tp... Sent from the freeswitch-users mailing list archive at Nabble.com.
I have already done that but it doesn't help also note that on the first call it works fine. Yitzchok On Mon, Oct 4, 2010 at 11:12 AM, Jeff Lenk <jeff@jefflenk.com> wrote:
Have you seen: http://wiki.freeswitch.org/wiki/Mod_mono
<dllmap dll="mod_managed.dll" target="mod_managed.so" os="!windows"/>
regarding null exceptions? -- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/mod-managed-on-linux-centos-tp... Sent from the freeswitch-users mailing list archive at Nabble.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
--Bug Fix-- Here is a diff file for *src/mod/languages/mod_managed/mod_managed.cpp *it seems to work but I don't know if this has some side effects. ---- @@ -377,17 +377,13 @@ SWITCH_STANDARD_API(managedrun_api_function) stream->write_function(stream, "-ERR no args specified!\n"); return SWITCH_STATUS_SUCCESS; } -#ifndef _MANAGED - mono_thread_attach(globals.domain); -#endif + if (executeBackgroundDelegate(cmd)) { stream->write_function(stream, "+OK\n"); } else { stream->write_function(stream, "-ERR ExecuteBackground returned false (unknown module or exception?).\n"); } -#ifndef _MANAGED - mono_thread_detach(mono_thread_current()); -#endif + return SWITCH_STATUS_SUCCESS; } @@ -397,15 +393,11 @@ SWITCH_STANDARD_API(managed_api_function) stream->write_function(stream, "-ERR no args specified!\n"); return SWITCH_STATUS_SUCCESS; } -#ifndef _MANAGED - mono_thread_attach(globals.domain); -#endif + if (!(executeDelegate(cmd, stream, stream->param_event))) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Execute failed for %s (unknown module or exception).\n", cmd); } -#ifndef _MANAGED - mono_thread_detach(mono_thread_current()); -#endif + return SWITCH_STATUS_SUCCESS; } @@ -415,15 +407,11 @@ SWITCH_STANDARD_APP(managed_app_function) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No args specified!\n"); return; } -#ifndef _MANAGED - mono_thread_attach(globals.domain); -#endif + if (!(runDelegate(data, session))) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Application run failed for %s (unknown module or exception).\n", data); } -#ifndef _MANAGED - mono_thread_detach(mono_thread_current()); -#endif + } SWITCH_STANDARD_API(managedreload_api_function) @@ -432,15 +420,11 @@ SWITCH_STANDARD_API(managedreload_api_function) stream->write_function(stream, "-ERR no args specified!\n"); return SWITCH_STATUS_SUCCESS; } -#ifndef _MANAGED - mono_thread_attach(globals.domain); -#endif + if (!(reloadDelegate(cmd))) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Execute failed for %s (unknown module or exception).\n", cmd); } -#ifndef _MANAGED - mono_thread_detach(mono_thread_current()); -#endif + return SWITCH_STATUS_SUCCESS; } Yitzchok On Mon, Oct 4, 2010 at 12:04 PM, Yitzchok <adminjew@gmail.com> wrote:
I have already done that but it doesn't help also note that on the first call it works fine.
Yitzchok
On Mon, Oct 4, 2010 at 11:12 AM, Jeff Lenk <jeff@jefflenk.com> wrote:
Have you seen: http://wiki.freeswitch.org/wiki/Mod_mono
<dllmap dll="mod_managed.dll" target="mod_managed.so" os="!windows"/>
regarding null exceptions? -- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/mod-managed-on-linux-centos-tp... Sent from the freeswitch-users mailing list archive at Nabble.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
Not sure how this makes sense yet. Yitzchok would you try this with only the mono_thread_detach calls removed leaving the mono_thread_attach in place and see what happens. Thanks Jeff -- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/mod-managed-on-linux-centos-tp... Sent from the freeswitch-users mailing list archive at Nabble.com.
I tried that and it seems to work. ---diff from git head--- @@ -385,9 +385,7 @@ SWITCH_STANDARD_API(managedrun_api_function) } else { stream->write_function(stream, "-ERR ExecuteBackground returned false (unknown module or exception?).\n"); } -#ifndef _MANAGED - mono_thread_detach(mono_thread_current()); -#endif + return SWITCH_STATUS_SUCCESS; } @@ -403,9 +401,7 @@ SWITCH_STANDARD_API(managed_api_function) if (!(executeDelegate(cmd, stream, stream->param_event))) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Execute failed for %s (unknown module or exception).\n", cmd); } -#ifndef _MANAGED - mono_thread_detach(mono_thread_current()); -#endif + return SWITCH_STATUS_SUCCESS; } @@ -421,9 +417,7 @@ SWITCH_STANDARD_APP(managed_app_function) if (!(runDelegate(data, session))) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Application run failed for %s (unknown module or exception).\n", data); } -#ifndef _MANAGED - mono_thread_detach(mono_thread_current()); -#endif + } SWITCH_STANDARD_API(managedreload_api_function) @@ -438,9 +432,7 @@ SWITCH_STANDARD_API(managedreload_api_function) if (!(reloadDelegate(cmd))) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Execute failed for %s (unknown module or exception).\n", cmd); } -#ifndef _MANAGED - mono_thread_detach(mono_thread_current()); -#endif + return SWITCH_STATUS_SUCCESS; } ----- Yitzchok On Wed, Oct 6, 2010 at 10:57 AM, Jeff Lenk <jeff@jefflenk.com> wrote:
Not sure how this makes sense yet. Yitzchok would you try this with only the mono_thread_detach calls removed leaving the mono_thread_attach in place and see what happens.
Thanks Jeff -- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/mod-managed-on-linux-centos-tp... Sent from the freeswitch-users mailing list archive at Nabble.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
It looks like these errors don't happen in Mono *2.8* when I use the original code. (leaving mono_thread_detach(mono_thread_current()); in there) Though now I see that *sometimes *when I update a dll file it doesn't work and I have to restart freeswitch and then it works. Yitzchok On Wed, Oct 6, 2010 at 11:40 AM, Yitzchok <adminjew@gmail.com> wrote:
I tried that and it seems to work.
---diff from git head---
@@ -385,9 +385,7 @@ SWITCH_STANDARD_API(managedrun_api_function) } else { stream->write_function(stream, "-ERR ExecuteBackground returned false (unknown module or exception?).\n"); } -#ifndef _MANAGED - mono_thread_detach(mono_thread_current()); -#endif + return SWITCH_STATUS_SUCCESS; }
@@ -403,9 +401,7 @@ SWITCH_STANDARD_API(managed_api_function) if (!(executeDelegate(cmd, stream, stream->param_event))) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Execute failed for %s (unknown module or exception).\n", cmd); } -#ifndef _MANAGED - mono_thread_detach(mono_thread_current()); -#endif + return SWITCH_STATUS_SUCCESS; }
@@ -421,9 +417,7 @@ SWITCH_STANDARD_APP(managed_app_function) if (!(runDelegate(data, session))) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Application run failed for %s (unknown module or exception).\n", data); } -#ifndef _MANAGED - mono_thread_detach(mono_thread_current()); -#endif + }
SWITCH_STANDARD_API(managedreload_api_function) @@ -438,9 +432,7 @@ SWITCH_STANDARD_API(managedreload_api_function) if (!(reloadDelegate(cmd))) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Execute failed for %s (unknown module or exception).\n", cmd); } -#ifndef _MANAGED - mono_thread_detach(mono_thread_current()); -#endif + return SWITCH_STATUS_SUCCESS; }
-----
Yitzchok
On Wed, Oct 6, 2010 at 10:57 AM, Jeff Lenk <jeff@jefflenk.com> wrote:
Not sure how this makes sense yet. Yitzchok would you try this with only the mono_thread_detach calls removed leaving the mono_thread_attach in place and see what happens.
Thanks Jeff -- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/mod-managed-on-linux-centos-tp... Sent from the freeswitch-users mailing list archive at Nabble.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
participants (4)
-
Jeff Lenk
-
Patrick Lists
-
Phillip Jones
-
Yitzchok