[Freeswitch-users] Establishing a Call from .Net based application

Scott Fernandez scottferri09 at gmail.com
Fri Feb 19 12:01:34 PST 2010


Thanks a lot Deigo and Michael.

Will work on this and let you know if I face any problems.

Thanks,
Scott

On Fri, Feb 19, 2010 at 5:04 AM, Diego Toro <dftoro at yahoo.com> wrote:

> The managed module is loaded as a module during the startup of FreeSWITCH
> if set in modules.conf.xml or through the command "load mod_managed" must
> keep in mind that there is a directory "mod/managed. As mod_managed is
> loaded into FreeSWITCH process to take control of the call must be running
> FreeSWITCH. So to "talk" with FreeSWITCH is not necessary to know the IP,
> the IP depends on the profile you've defined in the configuration of the
> module sofia. If you need the local address of the box running FreeSWITCH
> try expand variable $${local_ip_v4} which is assigned automatically by
> FreeSWITCH.
>
> Being more clear, when you use mod_managed including <action
> application="managed" data="yourclassname"/>
>  in a dialplan already have way to run your C# code.
>
> Now, if you need is to have control of the call to answer, originate, etc,
> without the application run inside FreeSWITCH process, you can use managed
> ESL (see examples in libs/esl/managed) this library allows your code using
> events "talk" with FreeSWITCH.
>
> Diego Toro
> http://lacarretade.blogspot.com/
>
>
> --- On Thu, 2/18/10, Michael Giagnocavo <mgg at giagnocavo.net> wrote:
>
> > From: Michael Giagnocavo <mgg at giagnocavo.net>
> > Subject: Re: [Freeswitch-users] Establishing a Call from .Net based
> application
> > To: "freeswitch-users at lists.freeswitch.org" <
> freeswitch-users at lists.freeswitch.org>
> > Date: Thursday, February 18, 2010, 6:12 AM
> > I’m not sure what the
> > FreeSWITCH APIs are to figure out what IP Sofia SIP has
> > bound to. Whatever it is, you’d call the same thing in
> > C#. What do you want to do with the API?  mod_managed.dll or .so is the
> > FreeSWITCH native code module that loads the CLR or Mono
> > into the FreeSWITCH process and loads
> > FreeSWITCH.Managed.dll. The managed DLL contains the bulk of
> > the managed-unmanaged interop code (.NET definitions of all
> > the FS C functions).   -Michael  From:
> > freeswitch-users-bounces at lists.freeswitch.org
> > [mailto:freeswitch-users-bounces at lists.freeswitch.org] On
> > Behalf Of Scott Fernandez
> > Sent: Thursday, February 18, 2010 1:12 AM
> > To: freeswitch-users at lists.freeswitch.org
> > Subject: Re: [Freeswitch-users] Establishing a Call
> > from .Net based application
> >  Hi Diego & Michael,
> >
> > Thanks for your reply and support.
> >
> > However, I have some clarifications required from both of
> > you.
> >
> > 1. Here is the question for Diego,
> >
> > Simple Example:
> >
> > using FreeSWITCH;
> > using FreeSWITCH.Native;
> >
> > namespace BITS.Ivr.Bp.Server
> > {
> >  public class CIV_BPFSProcess : FreeSWITCH.IAppPlugin
> > {
> >  public void Run(AppContext context)
> >  {
> >   //answer call
> >   context.Session.Answer();
> >   //sleep 2 seconds
> >   context.Session.sleep(2000, 1);
> >   //hangup call
> >   context.Session.Hangup("NORMAL_CLEARING");
> >  }
> >  }
> > }
> > I understand that the concept of your example code.
> > However, would like to know as to how would my .NET C# know the
> > IP address of Freeswitch to talk to it as there is no
> > indication for that?. If not here, where would we need to
> > reference the IP address of FS in .NET code?
> >
> > I guess the IP address of FS needs to be mentioned in the
> > Target section of the below web.config file in .NET. If I am
> > right, how to specify the IP address over here. If I am
> > wrong, please let me know where do we need to mention the IP
> > address of FS.
> >
> >     <configuration>
> >
> > <dllmap dll="mod_managed.dll"
> > target="mod_managed.so"/>
> >     </configuration>
> >
> >
> > 2. Here is the question for Michael,
> >
> > You mentioned that "mod_managed.so will
> > be in your freeswitch mod directory". This is
> > very clear and what is mod_managed.dll in my .NET
> > application and the purpose of it?
> >
> > Thanks for all your help.
> >
> > Regards,
> > Scott.
> >
> >
> > On Sun, Feb 14, 2010 at 1:15
> > AM, Michael Giagnocavo <mgg at giagnocavo.net>
> > wrote:
> > 2. There is a configuration settings required to Map the
> > "DLL" to ".so" object in CentOS.
> > Now, the question is which DLL and .so file to be made
> > available and where?“If you are
> > experiencing NullReferenceExceptions with any plugin run
> > through the dialplan, make sure you have included the
> > appropriate entry in your dllmap
> > configuration:  <dllmap dll="mod_managed.dll"
> > target="mod_managed.so"
> > os="!windows"/>“mod_managed.so will
> > be in your freeswitch mod directory.
> > All I need is to initiate a call from .NET application and
> > then it should talk to mod_managed module and establish a
> > call. Secondly, I need to know the status of the call such
> > as Ringing, Active, Hangup etc. To initiate a
> > call, try ManagedSession.Originate.-Michael
> > _______________________________________________
> > 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
> > -----Inline Attachment Follows-----
> >
> > _______________________________________________
> > 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
> >
>
>
>
>
> _______________________________________________
> 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/20100220/dcb92b1b/attachment-0002.html 


More information about the FreeSWITCH-users mailing list