[Freeswitch-users] Originate using inbound socket connection

Michael Lutz mytemike72 at gmail.com
Wed Mar 21 16:48:49 MSK 2012


Hi Guys,

I am working on a .net  ESL host (inbound mode) and connect to the ESL
using ESLConnection.
Now I am trying to originate a call using the ESLConnection.Api()
function. But it does't work as expected.

It always returns:
===
Content-Type: api/response
Content-Length: 125
Content-Length: 125

-USAGE: <call url> <exten>|&<application_name>(<app_args>)
[<dialplan>] [<context>] [<cid_name>] [<cid_num>] [<timeout_sec>]
===

But I am pretty sure my string is right:

{origination_caller_id_number=31341.....,origination_caller_id_name=31341......}sofia/external/31634258... at xxx.xxx.xxx.xxx

I also tried with double {{ and }} but same result. Even if I take out
the whole {} string and just use "sofia/external/etc.." I get the same
message back.

My code:

ESLconnection eslDial = new ESLconnection("x.x.x.x", "8021", "x");
if (eslDial.Connected() == ESL_SUCCESS)
{
   // Create a uuid used to identify the b-leg.
   string legb_uuid = eslDial.Api("create_uuid", "").GetBody();
   string cDialString = "{{origination_uuid=" + legb_uuid +
",origination_caller_id_number=" + thisAni +
",origination_caller_id_name=" + thisAniName + "}}sofia/external/" +
thisDestination;

   // Send the command
   var eslEvent = eslDial.Api("originate", cDialString);

   // Write the result to the console
   Console.WriteLine(eslEvent.Serialize(string.Empty));
   return true;
}

Thanks for your help!,

Regards,
Michael Lutz



Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list