[Freeswitch-users] ESL Log to console

Michael Collins msc at freeswitch.org
Fri Aug 3 19:26:58 MSD 2012


I think you need to pastebin your dialplan and script so we can see this in
context...
-MC

On Fri, Aug 3, 2012 at 4:39 AM, David Villasmil <
david.villasmil.work at gmail.com> wrote:

> Hello,
>
> Using ESL, at what point can one start sending commands to the channel?
> It seems impossible for me to issue commands at
>
> EVENT: CHANNEL_CREATE
> STATE: CS_ROUTING
>
> It maybe important to mention I don't have anything runing in the dialplan!
> My script connects via ESL to FS and wait for events (incoming calls, etc)
> and will issue commands like bridge the calls to their destination, etc.
>
> Any help would be appreciated!
>
> Thanks
>
> David
>
> On Fri, Aug 3, 2012 at 1:13 PM, David Villasmil <
> david.villasmil.work at gmail.com> wrote:
>
>> Any thoughts?
>>
>>
>> On Thu, Aug 2, 2012 at 9:21 PM, David Villasmil <
>> david.villasmil.work at gmail.com> wrote:
>>
>>> Actually no. I'm writing a script to control FS, incoming calls will be
>>> screened and routing will de done via this script... I already have this in
>>> Lua, but everyting a call comes in a new script is lunched, and I don't
>>> want that anymore. So I'm trying to write an ESL script wich will connect
>>> to FS via ESL and receive events, act accordingly and instruct fs what to
>>> do, in terms of routing, channel variables definition (for later use in
>>> xml_curl_cdr, etc.
>>>
>>> Maybe my approach is not the correct one...
>>>
>>> Thanks for your help...
>>>
>>> David
>>>
>>> On Thu, Aug 2, 2012 at 9:07 PM, Michael Collins <msc at freeswitch.org>wrote:
>>>
>>>> Well, it all depends on how you're calling this script. Is it being
>>>> called from the dialplan?
>>>> -MC
>>>>
>>>>
>>>> On Thu, Aug 2, 2012 at 11:25 AM, David Villasmil <
>>>> david.villasmil.work at gmail.com> wrote:
>>>>
>>>>> Ouch!
>>>>>
>>>>> Ok, this is not like in Lua... Ok, I'll try that.... is there any
>>>>> documentation regarding what can and can't be set and the conditions for
>>>>> setting them? What about bridging channels, etc?
>>>>>
>>>>> :(
>>>>>
>>>>> David
>>>>>
>>>>> On Thu, Aug 2, 2012 at 8:19 PM, Michael Collins <msc at freeswitch.org>wrote:
>>>>>
>>>>>> Can't use execute and set unless this is an outbound ESL connection,
>>>>>> which it seems not to be. I'd try this:
>>>>>>
>>>>>> $con->api("uuid_setvar","$uuid customer_company $local_variable");
>>>>>>
>>>>>> -MC
>>>>>>
>>>>>>
>>>>>> On Thu, Aug 2, 2012 at 11:01 AM, David Villasmil <
>>>>>> david.villasmil.work at gmail.com> wrote:
>>>>>>
>>>>>>> Hello Michael,
>>>>>>>
>>>>>>> Yes, there's a call in progress. Executing it like you said worked.
>>>>>>> (api)
>>>>>>>
>>>>>>>
>>>>>>> Now, I'm trying to set a variable like so:
>>>>>>>
>>>>>>> $con->execute("set","customer_company             = " .
>>>>>>>  $local_variable , $uuid );
>>>>>>>
>>>>>>> But it doesn't get set...
>>>>>>>
>>>>>>> :(
>>>>>>>
>>>>>>> Thanks for your help!
>>>>>>>
>>>>>>> David
>>>>>>>
>>>>>>>
>>>>>>> On Thu, Aug 2, 2012 at 6:25 PM, Michael Collins <msc at freeswitch.org>wrote:
>>>>>>>
>>>>>>>> David,
>>>>>>>>
>>>>>>>> Do you have a call in progress at this point? If not then you'll
>>>>>>>> need to supply a uuid of a live call, as mentioned here:
>>>>>>>> http://wiki.freeswitch.org/wiki/Event_Socket_Library#execute
>>>>>>>>
>>>>>>>> Remember, "execute" means "execute dialplan application" so if
>>>>>>>> there's no channel then "execute" really doesn't mean a whole lot.
>>>>>>>>
>>>>>>>> Alternatively you could try something like this:
>>>>>>>>
>>>>>>>> $con->api("log","WARNING Don't cross the streams!!");
>>>>>>>>
>>>>>>>> Remember this rule of thumb: pretty much anything you type at
>>>>>>>> fs_cli is an "API" and therefore you can use $con->api(), whereas anything
>>>>>>>> that is a diaplan application requires an actual channel on which to run
>>>>>>>> $con->execute().
>>>>>>>>
>>>>>>>> Hope that makes sense... :)
>>>>>>>>
>>>>>>>> -Michael
>>>>>>>>
>>>>>>>> On Thu, Aug 2, 2012 at 8:43 AM, David Villasmil <
>>>>>>>> david.villasmil.work at gmail.com> wrote:
>>>>>>>>
>>>>>>>>> Hello Guys,
>>>>>>>>>
>>>>>>>>> I'm starting off with ESL, which is cool, but I'm trying to log to
>>>>>>>>> the console like Lua's "freeswitch.consoleLog("info", "BLAH BLAH");" doing
>>>>>>>>> it like:
>>>>>>>>>
>>>>>>>>> my $con = new ESL::ESLconnection("localhost", "8021", "ClueCon");
>>>>>>>>> $con->execute("log", "1, BlahBlah");
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> But nothing gets in the log files or console... and I can't find
>>>>>>>>> any documentation as to how to log using "execute"...
>>>>>>>>>
>>>>>>>>> any ideas?
>>>>>>>>>
>>>>>>>>> Thanks!
>>>>>>>>>
>>>>>>>>> David
>>>>>>>>>
>>>>>>>>>
>>>>
>>>>
>>>> _________________________________________________________________________
>>>> 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
>>>>
>>>> Join Us At ClueCon - Aug 7-9, 2012
>>>>
>>>> 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
>>>>
>>>>
>>>
>>
>
> _________________________________________________________________________
> 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
>
> Join Us At ClueCon - Aug 7-9, 2012
>
> 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
>
>


-- 
Michael S Collins
Twitter: @mercutioviz
http://www.FreeSWITCH.org
http://www.ClueCon.com
http://www.OSTAG.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20120803/ef926a7b/attachment.html 


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