Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Freeswitch-users] Re-2: Help with mod_managed under Windows


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
gk at exram.de
Guest





PostPosted: Wed Apr 22, 2009 3:35 am    Post subject: [Freeswitch-users] Re-2: Help with mod_managed under Window Reply with quote

Hi Michael, I found the problem. I had a version mismatch between mod_mamanged and my FS installation. So this is solved, but now I am running into the next problem. I have written a small Class that is nearly similar to the one on the wiki pages. The source is here (VB.NET) Imports FreeSWITCHPublic Class AppDemo Inherits AppFunction Public Shadows Function Load() Log.WriteLine(LogLevel.Info, "Inside AppDemo Load.") Return True End Function Protected Overrides Sub Run() Session.Answer() Session.Hangup("NORMAL CLEARING") End Sub Protected Sub HangupHook() Log.WriteLine(LogLevel.Debug, "AppDemo hanging up, UUID: " + Me.Uuid.ToString()) End SubEnd Class I copied the dll to the managed dir under mod in my FS installation. I reload FS. It loads mod_managed and the AppDemo Module as well, as you can see on console: 2009-04-22 09:32:33 [INFO] mod_managed.cpp:314 mod_managed_load() Loading mod_managed (Common Language Infrastructure), Microsoft CLR Version2009-04-22 09:32:36 [NOTICE] switch_cpp.cpp:1098 console_log() loadAssemblies: E:\Visual Studio 2008\Projects\freeswitch-1.0.3\Debug\mod\managed2009-04-22 09:32:42 [NOTICE] switch_cpp.cpp:1098 console_log() Function FSMMTest.AppDemo loaded.2009-04-22 09:32:42 [CONSOLE] switch_loadable_module.c:857 switch_loadable_module_load_file() Successfully Loaded [mod_managed]2009-04-22 09:32:42 [NOTICE] switch_loadable_module.c:239 switch_loadable_module_process() Adding Application 'managed'2009-04-22 09:32:42 [NOTICE] switch_loadable_module.c:259 switch_loadable_module_process() Adding API Function 'managedrun'2009-04-22 09:32:42 [NOTICE] switch_loadable_module.c:259 switch_loadable_module_process() Adding API Function 'managed'2009-04-22 09:32:42 [NOTICE] switch_loadable_module.c:259 switch_loadable_module_process() Adding API Function 'managedload' When I now try to execute the App from console it gives an error. managed FSMMTest.AppDemo2009-04-22 09:33:03 [ERR] switch_cpp.cpp:1098 console_log() Could not find function FSMMTest.AppDemo.2009-04-22 09:33:03 [ERR] mod_managed.cpp:393 managed_api_function() Execute failed for FSMMTest.AppDemo (unknown module or exception).API CALL [managed(FSMMTest.AppDemo)] output: managed AppDemo2009-04-22 09:33:36 [ERR] switch_cpp.cpp:1098 console_log() Could not find function AppDemo.2009-04-22 09:33:36 [ERR] mod_managed.cpp:393 managed_api_function() Execute failed for AppDemo (unknown module or exception).API CALL [managed(AppDemo)] output: As you can see it doesn't work even when I type it with the Namespace in front. Maybe someone can point me to the right direction with this. Thanks in advance...Guido Subject: Re: [Freeswitch-users] Help with mod_managed under Windows (22-Apr-2009 1:01) From: Michael Jerris <mike@jerris.com> (mike@jerris.com) To: gk@exram.de (gk@exram.de) Could you translate these into english? On Apr 21, 2009, at 7:08 AM, Guido Kuth wrote: I am playing around with FS (Windows) for one month now. First I tried using FreeSwitch.NET which is a good class library for inbound event socket. Unfortunatley it can't be used for outbound event socket. So I read the wiki back ond forth and also searched the net and found that I should use mod_managed. So I downloaded mod_managed in source from svn and compiled it with C# 2008 Express Edition. After that I got a dll. FreeSwitch.Managed.dll and copied it to the mod dir of FS. The Problem is that I get and error when FS loads mod_managed and I don't know what I should do with that. 2009-04-21 11:26:44 [INFO] mod_managed.cpp:314 mod_managed_load() Loading mod_managed (Common Language Infrastructure), Microsoft CLR Version2009-04-21 11:26:44 [ERR] mod_managed.cpp:333 mod_managed_load() Load did not return true. System.Reflection.TargetInvocationException: Ein Aufrufziel hat einen Ausnahmefehler verursacht. ---> System.TypeInitializationException: Der Typeninitialisierer f³r "FreeSWITCH.Native.freeswitch" hat eine Ausnahme verursacht. ---> System.EntryPointNotFoundException: Der Einstiegspunkt "CSharp_SWITCH_READ_TERMINATOR_USED_VARIABLE_get" wurde nicht in der DLL "mod_managed" gefunden. bei FreeSWITCH.Native.freeswitchPINVOKE.SWITCH_READ_TERMINATOR_USED_VARIABLE_get() bei FreeSWITCH.Native.freeswitch..cctor() --- Ende der internen Ausnahmestapel³berwachung --- bei FreeSWITCH.Native.freeswitch.get_SWITCH_GLOBAL_dirs() bei FreeSWITCH.Loader.Load() --- Ende der internen Ausnahmestapel³berwachung --- bei System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) bei System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) bei System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) bei System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) bei mod_managed_load(switch_loadable_module_interface** module_interface, apr_pool_t* pool)2009-04-21 11:26:44 [CRIT] switch_loadable_module.c:845 switch_loadable_module_load_file() Error Loading module C:\Programme\FreeSWITCH\mod\mod_managed.dll**Module load routine returned an error** Please help me with that. Thanks...Guido
Back to top
mgg at giagnocavo.net
Guest





PostPosted: Wed Apr 22, 2009 11:10 am    Post subject: [Freeswitch-users] Re-2: Help with mod_managed under Window Reply with quote

The problem, I think, is that applications must be run from the dialplan; only API functions can be executed from the console.

Try subclassing ApiFunction or calling your AppDemo from the dialplan.

-Michael

From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Guido Kuth
Sent: Wednesday, April 22, 2009 2:27 AM
To: freeswitch-users@lists.freeswitch.org
Subject: [Freeswitch-users] Re-2: Help with mod_managed under Windows



Hi Michael,



I found the problem. I had a version mismatch between mod_mamanged and my FS installation. So this is solved, but now I am running into the next problem. I have written a small Class that is nearly similar to the one on the wiki pages. The source is here (VB.NET)



Imports FreeSWITCH
Public Class AppDemo
Inherits AppFunction
Public Shadows Function Load()
Log.WriteLine(LogLevel.Info, "Inside AppDemo Load.")
Return True
End Function
Protected Overrides Sub Run()
Session.Answer()
Session.Hangup("NORMAL CLEARING")
End Sub
Protected Sub HangupHook()
Log.WriteLine(LogLevel.Debug, "AppDemo hanging up, UUID: " + Me.Uuid.ToString())
End Sub
End Class



I copied the dll to the managed dir under mod in my FS installation. I reload FS. It loads mod_managed and the AppDemo Module as well, as you can see on console:



2009-04-22 09:32:33 [INFO] mod_managed.cpp:314 mod_managed_load() Loading mod_ma
naged (Common Language Infrastructure), Microsoft CLR Version
2009-04-22 09:32:36 [NOTICE] switch_cpp.cpp:1098 console_log() loadAssemblies: E
:\Visual Studio 2008\Projects\freeswitch-1.0.3\Debug\mod\managed
2009-04-22 09:32:42 [NOTICE] switch_cpp.cpp:1098 console_log() Function FSMMTest
.AppDemo loaded.
2009-04-22 09:32:42 [CONSOLE] switch_loadable_module.c:857 switch_loadable_modul
e_load_file() Successfully Loaded [mod_managed]
2009-04-22 09:32:42 [NOTICE] switch_loadable_module.c:239 switch_loadable_module
_process() Adding Application 'managed'
2009-04-22 09:32:42 [NOTICE] switch_loadable_module.c:259 switch_loadable_module
_process() Adding API Function 'managedrun'
2009-04-22 09:32:42 [NOTICE] switch_loadable_module.c:259 switch_loadable_module
_process() Adding API Function 'managed'
2009-04-22 09:32:42 [NOTICE] switch_loadable_module.c:259 switch_loadable_module
_process() Adding API Function 'managedload'



When I now try to execute the App from console it gives an error.



managed FSMMTest.AppDemo
2009-04-22 09:33:03 [ERR] switch_cpp.cpp:1098 console_log() Could not find funct
ion FSMMTest.AppDemo.
2009-04-22 09:33:03 [ERR] mod_managed.cpp:393 managed_api_function() Execute fai
led for FSMMTest.AppDemo (unknown module or exception).
API CALL [managed(FSMMTest.AppDemo)] output:



managed AppDemo
2009-04-22 09:33:36 [ERR] switch_cpp.cpp:1098 console_log() Could not find funct
ion AppDemo.
2009-04-22 09:33:36 [ERR] mod_managed.cpp:393 managed_api_function() Execute fai
led for AppDemo (unknown module or exception).
API CALL [managed(AppDemo)] output:



As you can see it doesn't work even when I type it with the Namespace in front.



Maybe someone can point me to the right direction with this.



Thanks in advance...Guido
Quote:

Subject:

Re: [Freeswitch-users] Help with mod_managed under Windows (22-Apr-2009 1:01)

From:

Michael Jerris <mike@jerris.com> (mike@jerris.com)

To:

gk@exram.de (gk@exram.de)



Could you translate these into english?

On Apr 21, 2009, at 7:08 AM, Guido Kuth wrote:




I am playing around with FS (Windows) for one month now. First I tried using FreeSwitch.NET which is a good class library for inbound event socket. Unfortunatley it can't be used for outbound event socket. So I read the wiki back ond forth and also searched the net and found that I should use mod_managed.



So I downloaded mod_managed in source from svn and compiled it with C# 2008 Express Edition. After that I got a dll. FreeSwitch.Managed.dll and copied it to the mod dir of FS. The Problem is that I get and error when FS loads mod_managed and I don't know what I should do with that.



2009-04-21 11:26:44 [INFO] mod_managed.cpp:314 mod_managed_load() Loading mod_ma
naged (Common Language Infrastructure), Microsoft CLR Version
2009-04-21 11:26:44 [ERR] mod_managed.cpp:333 mod_managed_load() Load did not re
turn true. System.Reflection.TargetInvocationException: Ein Aufrufziel hat einen
Ausnahmefehler verursacht. ---> System.TypeInitializationException: Der Typenin
itialisierer f³r "FreeSWITCH.Native.freeswitch" hat eine Ausnahme verursacht. --
-> System.EntryPointNotFoundException: Der Einstiegspunkt "CSharp_SWITCH_READ_TE
RMINATOR_USED_VARIABLE_get" wurde nicht in der DLL "mod_managed" gefunden.
bei FreeSWITCH.Native.freeswitchPINVOKE.SWITCH_READ_TERMINATOR_USED_VARIABLE_
get()
bei FreeSWITCH.Native.freeswitch..cctor()
--- Ende der internen Ausnahmestapel³berwachung ---
bei FreeSWITCH.Native.freeswitch.get_SWITCH_GLOBAL_dirs()
bei FreeSWITCH.Loader.Load()
--- Ende der internen Ausnahmestapel³berwachung ---
bei System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] argu
ments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandl
e typeOwner)
bei System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] argum
ents, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOw
ner)
bei System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invok
eAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisi
bilityChecks)
bei System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invok
eAttr, Binder binder, Object[] parameters, CultureInfo culture)
bei mod_managed_load(switch_loadable_module_interface** module_interface, apr
_pool_t* pool)
2009-04-21 11:26:44 [CRIT] switch_loadable_module.c:845 switch_loadable_module_l
oad_file() Error Loading module C:\Programme\FreeSWITCH\mod\mod_managed.dll
**Module load routine returned an error**

Please help me with that.



Thanks...Guido




Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services