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

Guido Kuth gk at exram.de
Wed Apr 22 01:27:08 PDT 2009


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
Subject: Re: [Freeswitch-users] Help with mod_managed under Windows (22-Apr-2009 1:01)
From:    Michael Jerris <mike at jerris.com>
To:      gk at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20090422/43d3055c/attachment-0002.html 


More information about the FreeSWITCH-users mailing list