Re: [asterisk-users] 'System' application in asterisk

2010-08-10 Thread Steve Edwards

Un-top-posting...


>> Un-top-posting...
>>
>> On Tue, 10 Aug 2010, Tino wrote:
>>
>>> >Is there any  way to capture the output of the 'System' application 
>>> >in asterisk dialplan and evaluate it.



> On Tue, Aug 10, 2010 at 12:42 PM, Steve Edwards 
>
>> Unless the output from your system command is trivial, you should 
>> parse it in the AGI and set channel variables as needed.

>>
>> If you provide a bit more detail, you may get a more specific answer. 
>> System() may not be the "best" approach.



On 10 August 2010 08:36, Tino  wrote:
>
> In my asterisk server before an agent doing manual dial is allowed a 
> call, asterisk will make an http request (to my crm, do not worry 
> about this part )  and get back an OK or something else. … if it 
> receives OK, it allows the call, otherwise we just play an 
> "unauthorized call"  recording to the agent. We make the http request 
> using a  "wget | perl " command and we want to capture the output of 
> the wget | perl command.



On Tue, Aug 10, 2010 at 1:21 PM, Julian Lyndon-Smith  wrote:

  You could always use the CURL  function directly in the dialplan


On Tue, 10 Aug 2010, Tino wrote:

I am using Asterisk 1.4.33.1(AsteriskNOW iso) and curl function is not 
available in this version.


I'm a 1.2 Luddite, but loading app_curl.so adds the application curl() and 
the function CURL(). Is app_curl not included in AsteriskNow or is it not 
loading for some reason?


You could always compile the 1.4.33.1 source and copy app_curl.so to 
/usr/lib/asterisk/modules/.


--
Thanks in advance,
-
Steve Edwards   sedwa...@sedwards.com  Voice: +1-760-468-3867 PST
Newline  Fax: +1-760-731-3000-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] 'System' application in asterisk

2010-08-10 Thread Tino
Hello Julian,

I am using Asterisk 1.4.33.1(AsteriskNOW iso) and curl function is not
available in this version.

On Tue, Aug 10, 2010 at 1:21 PM, Julian Lyndon-Smith wrote:

> You could always use the CURL  function directly in the dialplan
>
> Julian
>
> On 10 August 2010 08:36, Tino  wrote:
> >
> > Hi Steve, thanks for your interest in this matter.
> > I will explain my requirement here.
> >
> > In my asterisk server before an agent doing manual dial is allowed a
> call,
> > asterisk will make an http request (to my crm, do not worry about this
> part
> > )  and get back an OK or something else. … if it receives OK, it allows
> the
> > call, otherwise we just play an "unauthorized call"  recording to the
> agent.
> > We make the http request using a  "wget | perl " command and we want to
> > capture the output of the wget | perl command.
> >
> >
> > On Tue, Aug 10, 2010 at 12:42 PM, Steve Edwards  sedwards.com>
> > wrote:
> >>
> >> Un-top-posting...
> >>
> >> On Tue, 10 Aug 2010, Tino wrote:
> >>
> >>> >Is there any  way to capture the output of the 'System' application in
> >>> > >asterisk dialplan and evaluate it.
> >>
> >>> On Mon, Aug 9, 2010 at 11:51 PM, Danny Nicholas 
> >>> wrote:
> >>
> >>> I think this answer is no.  system only returns ${SYSTEMSTATUS} as
> >>> SUCCESS or FAILURE to tell you that the command finished or died.  You
> could
> >>> however do a bash AGI that would set a variable with the result of what
> you
> >>> would have sent to system
> >>
> >> On Tue, 10 Aug 2010, Tino wrote:
> >>
> >>> Sorry Dany, I am new to agi scripting. If you do not mind can you
> please
> >>> give me a sample script for this. That would be really helpful to me.
> >>
> >> Unless the output from your system command is trivial, you should parse
> it
> >> in the AGI and set channel variables as needed.
> >>
> >> If you provide a bit more detail, you may get a more specific answer.
> >> System() may not be the "best" approach.
> >>
> >> --
> >> Thanks in advance,
> >>
> -
> >> Steve Edwards   sedwa...@sedwards.com  Voice: +1-760-468-3867
> PST
> >> Newline  Fax:
> +1-760-731-3000
> >> --
> >> _
> >> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> >> New to Asterisk? Join us for a live introductory webinar every Thurs:
> >>   http://www.asterisk.org/hello
> >>
> >> asterisk-users mailing list
> >> To UNSUBSCRIBE or update options visit:
> >>   http://lists.digium.com/mailman/listinfo/asterisk-users
> >
> >
> > --
> > _
> > -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> > New to Asterisk? Join us for a live introductory webinar every Thurs:
> >   http://www.asterisk.org/hello
> >
> > asterisk-users mailing list
> > To UNSUBSCRIBE or update options visit:
> >   http://lists.digium.com/mailman/listinfo/asterisk-users
> >
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>   http://www.asterisk.org/hello
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] 'System' application in asterisk

2010-08-10 Thread Julian Lyndon-Smith
You could always use the CURL  function directly in the dialplan

Julian

On 10 August 2010 08:36, Tino  wrote:
>
> Hi Steve, thanks for your interest in this matter.
> I will explain my requirement here.
>
> In my asterisk server before an agent doing manual dial is allowed a call,
> asterisk will make an http request (to my crm, do not worry about this part
> )  and get back an OK or something else. … if it receives OK, it allows the
> call, otherwise we just play an "unauthorized call"  recording to the agent.
> We make the http request using a  "wget | perl " command and we want to
> capture the output of the wget | perl command.
>
>
> On Tue, Aug 10, 2010 at 12:42 PM, Steve Edwards 
> wrote:
>>
>> Un-top-posting...
>>
>> On Tue, 10 Aug 2010, Tino wrote:
>>
>>> >Is there any  way to capture the output of the 'System' application in
>>> > >asterisk dialplan and evaluate it.
>>
>>> On Mon, Aug 9, 2010 at 11:51 PM, Danny Nicholas 
>>> wrote:
>>
>>> I think this answer is no.  system only returns ${SYSTEMSTATUS} as
>>> SUCCESS or FAILURE to tell you that the command finished or died.  You could
>>> however do a bash AGI that would set a variable with the result of what you
>>> would have sent to system
>>
>> On Tue, 10 Aug 2010, Tino wrote:
>>
>>> Sorry Dany, I am new to agi scripting. If you do not mind can you please
>>> give me a sample script for this. That would be really helpful to me.
>>
>> Unless the output from your system command is trivial, you should parse it
>> in the AGI and set channel variables as needed.
>>
>> If you provide a bit more detail, you may get a more specific answer.
>> System() may not be the "best" approach.
>>
>> --
>> Thanks in advance,
>> -
>> Steve Edwards       sedwa...@sedwards.com      Voice: +1-760-468-3867 PST
>> Newline                                              Fax: +1-760-731-3000
>> --
>> _
>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>> New to Asterisk? Join us for a live introductory webinar every Thurs:
>>               http://www.asterisk.org/hello
>>
>> asterisk-users mailing list
>> To UNSUBSCRIBE or update options visit:
>>   http://lists.digium.com/mailman/listinfo/asterisk-users
>
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>               http://www.asterisk.org/hello
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] 'System' application in asterisk

2010-08-10 Thread Tino
Hi Steve, thanks for your interest in this matter.
I will explain my requirement here.

In my asterisk server before an agent doing manual dial is allowed a call,
asterisk will make an http request (to my crm, do not worry about this part
)  and get back an OK or something else. … if it receives OK, it allows the
call, otherwise we just play an "unauthorized call"  recording to the agent.
We make the http request using a  "wget | perl " command and we want to
capture the output of the wget | perl command.


On Tue, Aug 10, 2010 at 12:42 PM, Steve Edwards
wrote:

> Un-top-posting...
>
>
> On Tue, 10 Aug 2010, Tino wrote:
>
>  >Is there any  way to capture the output of the 'System' application in
>> >asterisk dialplan and evaluate it.
>>
>
>  On Mon, Aug 9, 2010 at 11:51 PM, Danny Nicholas 
>> wrote:
>>
>
>  I think this answer is no.  system only returns ${SYSTEMSTATUS} as SUCCESS
>> or FAILURE to tell you that the command finished or died.  You could however
>> do a bash AGI that would set a variable with the result of what you would
>> have sent to system
>>
>
> On Tue, 10 Aug 2010, Tino wrote:
>
>  Sorry Dany, I am new to agi scripting. If you do not mind can you please
>> give me a sample script for this. That would be really helpful to me.
>>
>
> Unless the output from your system command is trivial, you should parse it
> in the AGI and set channel variables as needed.
>
> If you provide a bit more detail, you may get a more specific answer.
> System() may not be the "best" approach.
>
> --
> Thanks in advance,
> -
> Steve Edwards   sedwa...@sedwards.com  Voice: +1-760-468-3867 PST
> Newline  Fax: +1-760-731-3000
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>   http://www.asterisk.org/hello
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] 'System' application in asterisk

2010-08-10 Thread Steve Edwards

Un-top-posting...

On Tue, 10 Aug 2010, Tino wrote:

>Is there any  way to capture the output of the 'System' application in 
>asterisk dialplan and evaluate it.


On Mon, Aug 9, 2010 at 11:51 PM, Danny Nicholas  
wrote:


I think this answer is no.  system only returns ${SYSTEMSTATUS} as 
SUCCESS or FAILURE to tell you that the command finished or died.  You 
could however do a bash AGI that would set a variable with the result of 
what you would have sent to system


On Tue, 10 Aug 2010, Tino wrote:

Sorry Dany, I am new to agi scripting. If you do not mind can you please 
give me a sample script for this. That would be really helpful to me.


Unless the output from your system command is trivial, you should parse it 
in the AGI and set channel variables as needed.


If you provide a bit more detail, you may get a more specific answer. 
System() may not be the "best" approach.


--
Thanks in advance,
-
Steve Edwards   sedwa...@sedwards.com  Voice: +1-760-468-3867 PST
Newline  Fax: +1-760-731-3000-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] 'System' application in asterisk

2010-08-09 Thread Tino
Sorry Dany, I am new to agi scripting. If you do not mind can you please
give me a sample script for this. That would be really helpful to me.


On Mon, Aug 9, 2010 at 11:51 PM, Danny Nicholas  wrote:

>   *From:* asterisk-users-boun...@lists.digium.com [mailto:
> asterisk-users-boun...@lists.digium.com] *On Behalf Of *Tino
> *Subject:* [asterisk-users] 'System' application in asterisk
>
> >Hello,
> >Is there any  way to capture the output of the 'System' application in
> asterisk dialplan and evaluate it.
>
> >For example, i would like to get the output of following System
> application and use its value in next line
> >for decision making
>
> >exten => 5000,n,System(command)
>
>  I think this answer is no.  system only returns ${SYSTEMSTATUS} as
> SUCCESS or FAILURE to tell you that the command finished or died.  You could
> however do a bash AGI that would set a variable with the result of what you
> would have sent to system
>
> Replace
>
> Exten => 5000,n,System(‘/bin/ls’)
>
> With
>
> Exten => 5000,n,AGI(bashsys.sh,”/bin/ls’)
>
> Exten => 5000,n.Gotoif(${RESULT}…
>
>
>
>
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>   http://www.asterisk.org/hello
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] 'System' application in asterisk

2010-08-09 Thread Tilghman Lesher
On Monday 09 August 2010 13:08:19 Tino wrote:
> Is there any  way to capture the output of the 'System' application in
> asterisk dialplan and evaluate it.
>
> For example, i would like to get the output of following System application
> and use its value in next line
> for decision making
>
> exten => 5000,n,System(command)

No, but you may use the SHELL dialplan function in versions which support it:

Set(output=${SHELL(command)})

-- 
Tilghman Lesher
Digium, Inc. | Senior Software Developer
twitter: Corydon76 | IRC: Corydon76-dig (Freenode)
Check us out at: www.digium.com & www.asterisk.org

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] 'System' application in asterisk

2010-08-09 Thread Danny Nicholas
From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Tino
Subject: [asterisk-users] 'System' application in asterisk

>Hello,
>Is there any  way to capture the output of the 'System' application in
asterisk dialplan and evaluate it. 

>For example, i would like to get the output of following System application
and use its value in next line
>for decision making

>exten => 5000,n,System(command)



I think this answer is no.  system only returns ${SYSTEMSTATUS} as SUCCESS
or FAILURE to tell you that the command finished or died.  You could however
do a bash AGI that would set a variable with the result of what you would
have sent to system

Replace 

Exten => 5000,n,System('/bin/ls')

With 

Exten => 5000,n,AGI(bashsys.sh,"/bin/ls')

Exten => 5000,n.Gotoif(${RESULT}.






-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users