[Freeswitch-users] How to originate a new call from mod_managed?

Chris freeswitch at gilligan.id.au
Mon Mar 8 13:59:34 PST 2010


Thanks phillip.
I assume i could then use the command new ManagedSession(uuid); to get
access to the session after it is created.  I will give it a go later today
but i think you are right that should work.

For a mater of interest would you have any idea where in the source code for
FS i could find the implementation for the originate method called via the
API command you just suggested?  If the implementation is not too
complicated I may look at adding it to the managed code as the managed code
is meant to have access to the native APIs so it should be able to issue the
same commands i would have thought. If it is impossible i will stick with
the way you just suggested.

Thanks

Chris

On Tue, Mar 9, 2010 at 7:04 AM, Phillip Jones <pjintheusa at gmail.com> wrote:

> You could use the api:
>
>  FreeSWITCH.Native.Api fsApi = new FreeSWITCH.Native.Api();
> string apiResult = string.Empty;
> string Uuid;
> string NumberToDial = "3475558308";
> string OutgoingCallerID = "2155556666";
>
> Uuid = fsApi.ExecuteString("create_uuid");
>
> apiResult = fsApi.Execute("originate",
> string.Format("{{ignore_early_media=false,absolute_codec_string='PCMU'}}[origination_uuid={0},origination_caller_id_number={1}]sofia/gateway/broadvox/{2}",
> Uuid, OutgoingCallerID, NumberToDial));
>
>
>
>
>
>
> On Sun, Mar 7, 2010 at 12:02 AM, Chris <freeswitch at gilligan.id.au> wrote:
>
>> Hi,
>> I am trying to create a mod_managed API application that takes 2 phone
>> numbers as params.  These numbers should then be used to make 2 calls and to
>> bridge them. The issue i am having is working out how to place the first
>> call leg from in mod_managed.  All the methods i have found are for the
>> second leg and require you to pass in the first call leg.
>>
>> I know there are easier way to do this out of the managed code but i want
>> it in the managed code as this is just a proof of concept to prove we can do
>> a callback like system via managed code to be hooked into other external
>> systems.
>> In wiki http://wiki.freeswitch.org/wiki/Session there is this example
>>
>> s = new Session("{ignore_early_media=true}sofia/default/foo at bar.com");
>> while (s.ready()) {
>> // The call has been answered
>> }
>>
>> This seems to be exactly what i am looking for but seems to be missing
>> from mod_managed. I am hoping someone can tell me how to do something
>> similar in mod_managed since even if it is not part of the managed code
>> mod_managed is meant to have the native access as well so i would assume it
>> would be possible.
>>
>> Thanks in advance
>>
>> Chris
>>
>> _______________________________________________
>> 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/20100309/8c728e05/attachment-0002.html 


More information about the FreeSWITCH-users mailing list