[Freeswitch-users] mod_managed trouble
Dave R. Kompel
drk at drkngs.net
Sun Sep 15 21:46:34 MSD 2013
Ed,
There are really no good examples that explain it. I have a few projects I've done with demos they're all public in my GitLab server: http://git.drkngs.com/public to get a list of the feeds.
>From what it looks like , you want to do something with an inbound call, what you really need to do, is implment a class that implments IAppPlugin. This interface allows you to write a dial plan app from managed code. What you ned to do for the example you have there is:
Change it from a module to a class that implments IAppPlugin.
Change the Main to Run, the only method defined in that interface.
The run method gets passed one argument (IAppPluginContext) which has a property named "Session", us it rather then trying to new up a ManagedSession, it gets passed to you on an inbound call.
Route something to your code in the dial plan, Applicaition name is managed, and data should be the name of your class.
--Dave
_____
From: Peter Olsson [mailto:peter at olssononline.se]
To: FreeSWITCH Users Help [mailto:freeswitch-users at lists.freeswitch.org]
Sent: Sun, 15 Sep 2013 01:17:21 -0700
Subject: Re: [Freeswitch-users] mod_managed trouble
Please read http://wiki.freeswitch.org/wiki/Mod_managed#Native_Interop, There is also a sample that links here, which should be enough to get you started; https://github.com/joshrivers/FreeSWITCH_Managed_ParkingLot.
/Peter
2013/9/15 Ed Graves <egravesvip at gmail.com>
Hi. I've been working for days now trying to get a simple inbound call to work using vb.net on Windows using FreeSWITCH version 1.2.12 and Visual Studio 2012.
I'm tired and frustrated, but I think I'm almost there. Please help.
I'm using the sample script below, but when I copy the .exe into place, FreeSWITCH tries to execute it immediately. When this happens, I get the output below, with lots of "session is not initialized" errors, which makes sense, because there is no session.
But then when I place an inbound call using my soft-phone, the script runs and I still get the "session not initialized" errors.
So, I don't understand why A) FreeSWITCH tries to run my app immediately when I copy it into place when I don't ask it to, and B) why I get these "session not initialized" errors when it runs in response to my inbound softphone call.
********** My Sample App **********
Module inbound
Sub Main()
Dim fs As New FreeSWITCH.Native.ManagedSession()
fs.Answer()
fs.StreamFile("C:\Genesis\freeswitch\freeswitch1.2.12\Debug\sounds\en\us\callie\ivr\8000\ivr-congratulations_you_pressed_star.wav", 0)
FreeSWITCH.Log.WriteLine(FreeSWITCH.LogLevel.Error, "I'm working!!!")
fs.StreamFile("C:\Genesis\freeswitch\freeswitch-1.2.12\Debug\sounds\en\us\callie\ivr\8000\ivr-congratulations_you_pressed_star.wav", 0)
fs.Hangup("end")
End Sub
End Module
******** My output ********
2013-09-14 01:55:08.541500 [INFO] mod_dialplan_xml.c:558 Processing egg <egg>->12345 in context public
2013-09-14 01:55:08.541500 [ERR] switch_cpp.cpp:632 session is not initalized
2013-09-14 01:55:08.541500 [ERR] switch_cpp.cpp:951 session is not initalized
2013-09-14 01:55:08.541500 [ERR] switch_cpp.cpp:1287 I'm working!!!
2013-09-14 01:55:08.541500 [ERR] switch_cpp.cpp:951 session is not initalized
2013-09-14 01:55:08.541500 [ERR] switch_cpp.cpp:668 session is not initalized
Again, I'd really appreciate any help.
Thanks in adance,
Ed
_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting at freeswitch.org
http://www.freeswitchsolutions.com
Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com
FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130915/b42615ed/attachment.html
Join us at ClueCon 2013 Aug 6-8, 2013
More information about the FreeSWITCH-users
mailing list