[Freeswitch-users] FreeSWITCH, mod_managed and IApiPlugin

Schenk, Oliver OSchenk at wnr.com.au
Tue May 3 10:52:18 MSD 2011


 Thank you!

 

It worked … at least in the basic sense. I just created a very quick example as follows:

 

 

 

ESLconnection eslConnection = new ESLConnection(“127.0.0.1”, “8021”, “ClueCon”);

 

if (eslConnection.Connected() != ESL_SUCCESS)

{

    Console.WriteLine(“Error connecting to FreeSwitch”);

    return;
}

 

eslConnection.SendRecv(“api originate sofia/xxx.xxx.xxx.xxx/1001 &managed(myAppClassName)”);

 

 

 

 

xxx.xxx.xxx.xxx – is my server IP address

1001 – is one of the default sample extensions

 

 

 

Thanks!

 

 

 

From: Yitzchok [mailto:adminjew at gmail.com] 
Sent: 03/05/11 13:56
To: FreeSWITCH Users Help
Subject: Re: [Freeswitch-users] FreeSWITCH, mod_managed and IApiPlugin

 

The correct way to do this is to connect to FreeSWITCH using ESL <http://wiki.freeswitch.org/wiki/ESL>  from your application.

 

 

Have your application that polls your database run outside of freeswitch and when you need to create a new call connect to FS using ESL (there is a .NET lib in \libs\esl\managed\) and create a new call with the Originate command that bridges to an extension or application something like this "originate sofia/gateway/name/8885551234 1024" or "originate sofia/gateway/name/8885551234 &managed(ClassNameToIApiPlugin)".

 

 

Yitzchok



On Tue, May 3, 2011 at 12:02 AM, Schenk, Oliver <OSchenk at wnr.com.au> wrote:

Hi All,

 

I’m completely new to FreeSWITCH, but in a week I managed to achieve quite a bit. It was quite a learning curve to say the least. This is my current setup:

 

-          FreeSWITCH 1.0.7 built from tarball.

-          Developing on Windows XP with VS2008 in C#.

-          Configured extension 1024 to connect to a managed dll file, which implements IAppPlugin.

-          Using X-Lite softphone I can connect to FreeSWITCH as user 1001 and dial 1024 and start going through a menu that I built in C#. It successfully retrieves records from an SQL database and so forth. No problems there.

 

My first step was to create a module that gets called whenever a user dials IN bound. They will hear the menu just described.

 

 

My struggle now is relating to OUT bound calls. What I want is a module that is started as soon as FreeSWITCH is started and begins executing on an endless processing loop in the background. This will continuously monitor a database and if certain conditions occur an outbound call should be queued and then made. If multiple calls need to be made I guess they will be queued and processed one by one. I can handle the queuing part.

 

At this stage I will be testing using extension 1001 as the receiver of the call using my softphone.

 

 

Question 1:

 

I’ve been trying to use a class that implements IApiPlugin, but how do I get it to start when FreeSWITCH starts? As I said it should simply be a never ending thread as long as FreeSWITCH is running. I can’t find any information regarding how to “Execute” a managed module immediately when FreeSWITCH has started.

 

 

Question 2:

 

If IApiPlugin can do this, how do I get the session object? Like this?

ManagedSession session = new ManagedSession();

session.Originate(???);

 

I can’t find any help at all on this.

 

 

Thanks very much!

 

 

 

Oliver Schenk

 


NOTICE - This e-mail and any files transmitted with it are confidential and are only for the use of the person to whom they are addressed. 
If you are not the intended recipient then you have received this e-mail in error; please advise us immediately if this is the case. 
Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of WestNet Rail.


_______________________________________________
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

 


NOTICE - This e-mail and any files transmitted with it are confidential and are only for the use of the person to whom they are addressed. 
If you are not the intended recipient then you have received this e-mail in error; please advise us immediately if this is the case. 
Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of WestNet Rail.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20110503/e4d4d658/attachment-0001.html 


More information about the FreeSWITCH-users mailing list