Re: [asterisk-users] AGI script commands

2023-06-30 Thread Eric Wieling
You have to read stdin to accept the data Asterisk sends when the AGI 
starts before you can send any AGI commands to Asterisk.   Also, "agi 
set debug on".


On 6/30/23 21:52, TTT wrote:
I have an AGI script written in PHP that worked great with Asterisk 13.  
I’m porting it to an Asterisk 20 site and have a strange problem.  I 
tried running the script from the command line and it works fine; I see 
the script commands written to stdout like


VERBOSE “SmartScreen v1”

But when run from asterisk the CLI shows:

[2023-06-30 15:50:47] VERBOSE[1264031][C-0025] pbx.c: Executing 
[s@function-smartscreen:2] EAGI("PJSIP/Twilio-NA-W-3-In-0068", 
"smartscreen/smartscreen.php,"GEORGE SMITH" <+1234567890>") in new stack


[2023-06-30 15:50:47] VERBOSE[1264031][C-0025] res_agi.c: Launched 
AGI Script /var/lib/asterisk/agi-bin/smartscreen/smartscreen.php


[2023-06-30 15:50:48] VERBOSE[1264031][C-0025] res_agi.c: 
AGI Script smartscreen/smartscreen.php 
completed, returning 0


I never see any messages or commands sent from the script to stdout (to 
asterisk)  Has the way EAGI operates changed?  This script doesn’t use 
any AGI libraries…just simply read/write to stdin/stdout.





--
http://help.nyigc.net/

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
 https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

[asterisk-users] AGI script commands

2023-06-30 Thread TTT
I have an AGI script written in PHP that worked great with Asterisk 13.  I'm
porting it to an Asterisk 20 site and have a strange problem.  I tried
running the script from the command line and it works fine; I see the script
commands written to stdout like 

 

VERBOSE "SmartScreen v1"

 

But when run from asterisk the CLI shows:

 

[2023-06-30 15:50:47] VERBOSE[1264031][C-0025] pbx.c: Executing
[s@function-smartscreen:2] EAGI("PJSIP/Twilio-NA-W-3-In-0068",
"smartscreen/smartscreen.php,"GEORGE SMITH" <+1234567890>") in new stack

[2023-06-30 15:50:47] VERBOSE[1264031][C-0025] res_agi.c: Launched AGI
Script /var/lib/asterisk/agi-bin/smartscreen/smartscreen.php

[2023-06-30 15:50:48] VERBOSE[1264031][C-0025] res_agi.c:
AGI Script smartscreen/smartscreen.php
completed, returning 0

 

I never see any messages or commands sent from the script to stdout (to
asterisk)  Has the way EAGI operates changed?  This script doesn't use any
AGI libraries.just simply read/write to stdin/stdout.

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

Re: [asterisk-users] AGI: Why is stream file and wait for digit result ASCII, but get data is "normal"?

2021-05-24 Thread Jonathan H
On Mon, 24 May 2021 at 18:41, Steve Edwards 
wrote:

>
> If you're not using a library, you may want to consider it.

'Comma' is not a valid 'digit' so this the same as '#*0123456789'
>

I'm using ts-agi which has served me well. In the docs, it suggests
phonekeys is an array:
https://github.com/sergey12313/ts-agi/blob/master/src/__tests__/index.test.ts#L295

   ctx.streamFile("test", [1,2,3,4,5,6,7,8,9,0,"#","*"], 1000,)

But in fact, you're right! I just tried "12345*#" and it works. I learn
something new every day here!

Believe me, I'd love to be going full ARI right now, but with no way to get
the current offset of a track I have to stick with AGI.

Thanks again.


>
> --
> Thanks in advance,
> -
> Steve Edwards   sedwa...@sedwards.com  Voice: +1-760-468-3867 PST
>  https://www.linkedin.com/in/steve-edwards-4244281
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> 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 --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

Re: [asterisk-users] AGI: Why is stream file and wait for digit result ASCII, but get data is "normal"?

2021-05-24 Thread Steve Edwards

On Mon, 24 May 2021, Jonathan H wrote:


any idea why it was done like this, and why someone would ever need the
ascii result


Maybe because ABCD are valid DTMF events? Maybe because 0 means playback 
completed, not a 0 was pressed?


IIRC there are some inconsistencies in the AGI API that I stumbled across 
when I wrote my library back in '04. If you're not using a library, you 
may want to consider it.



AGI Rx << STREAM FILE "hello-world" "1,2,3,4,5,6,7,8,9,*,0,#"


'Comma' is not a valid 'digit' so this the same as '#*0123456789'

--
Thanks in advance,
-
Steve Edwards   sedwa...@sedwards.com  Voice: +1-760-468-3867 PST
https://www.linkedin.com/in/steve-edwards-4244281

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
 https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

[asterisk-users] AGI: Why is stream file and wait for digit result ASCII, but get data is "normal"?

2021-05-24 Thread Jonathan H
Having been scratching my head the whole morning to find a bug, I now have
an A4 poster on the wall (not joking!) saying:

"get data" = *number*
"wait for digit" and "stream file" = *ascii !!!*

As you can see here:

AGI Rx << STREAM FILE "hello-world" "1,2,3,4,5,6,7,8,9,*,0,#"
AGI Tx >> 200 result=49 endpos=11840
AGI Rx << GET DATA hello-world -1 1
AGI Tx >> 200 result=1
AGI Rx << WAIT FOR DIGIT -1
AGI Tx >> 200 result=49

OK, I should have RTFM a bit harder, but this is VERY confusing! Out of
interest, any idea why it was done like this, and why someone would ever
need the ascii result from a keypress, rather than the keypress as given by
"get data"?

Just curious!
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

[asterisk-users] AGI Script for thinQ CNAM lookup

2021-04-30 Thread JR Richardson
Hi All,

Does anyone have and can share with me an AGI script to dip thinQ for
cnam? oR perhaps dialplan curl using curlopts?

Thanks.

JR
-- 
JR Richardson
Engineering for the Masses
Chasing the Azeotrope

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

Re: [asterisk-users] AGI Script Returning 4

2021-01-30 Thread Steve Edwards

On 1/30/21 1:18 PM, Alexander Perkins wrote:

the PHP-AGI script fails after it is executed and simply returns 
'returning 4'.


On Sat, 30 Jan 2021, Michal Rybarik wrote:

I think this can happen by hanging up the call by one party, when SIGHUP 
is sent to AGI script. PHP will exit on SIGHUP. It can be resolved by 
initializing signal handler in PHP script (pcntl_signal) for SIGHUP and 
doing nothing in it (return).


From res_agi.c:

enum agi_result {
AGI_RESULT_FAILURE = -1,
AGI_RESULT_SUCCESS,
AGI_RESULT_SUCCESS_FAST,
AGI_RESULT_SUCCESS_ASYNC,
AGI_RESULT_NOTFOUND,
AGI_RESULT_HANGUP,
};

so, AGI_RESULT_HANGUP == 4.

When Asterisk detects the hangup on the channel, it sends a SIGHUP to your 
AGI.


I always set a signal handler on SIGHUP and do what makes sense to my 
application: maybe some cleanup or syslog() before return() or exit(). 
Almost always exit().


--
Thanks in advance,
-
Steve Edwards   sedwa...@sedwards.com  Voice: +1-760-468-3867 PST
https://www.linkedin.com/in/steve-edwards-4244281

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
 https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

Re: [asterisk-users] AGI Script Returning 4

2021-01-30 Thread Michal Rybarik
Dňa 30. 1. 2021 o 20:18 Alexander Perkins napísal(a):
> HI All.  I have a really strange issue that I'm two months into
> troubleshooting; however, I cannot figure it out.  I have an AGI
> Script (PHP) that runs every time a call comes into my Asterisk box. 
> Most of the time, it runs without any issue.  However, every now and
> then, the PHP-AGI script fails after it is executed and simply returns
> 'returning 4'.  I verify the PHP script begins to run.  However, it
> appears to just stop.  I have placed try/catch statements everywhere,
> but it does not seem to hit them.  
>
> Just to verify, this is the same script running over and over with the
> same parameter.  
>
> Any ideas/suggestions as of what can be happening?


I think this can happen by hanging up the call by one party, when SIGHUP
is sent to AGI script. PHP will exit on SIGHUP. It can be resolved by
initializing signal handler in PHP script (pcntl_signal) for SIGHUP and
doing nothing in it (return).

-- 
Regards,
Michal Rybarik


-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

Re: [asterisk-users] AGI Script Returning 4

2021-01-30 Thread Jeff LaCoursiere

Out of RAM/swap?

j

On 1/30/21 1:18 PM, Alexander Perkins wrote:
HI All.  I have a really strange issue that I'm two months into 
troubleshooting; however, I cannot figure it out.  I have an AGI 
Script (PHP) that runs every time a call comes into my Asterisk box.  
Most of the time, it runs without any issue. However, every now and 
then, the PHP-AGI script fails after it is executed and simply returns 
'returning 4'.  I verify the PHP script begins to run.  However, it 
appears to just stop.  I have placed try/catch statements everywhere, 
but it does not seem to hit them.


Just to verify, this is the same script running over and over with the 
same parameter.


Any ideas/suggestions as of what can be happening?

Thanks,
Alex



--

*Jeff LaCoursiere*
STRATUSTALK, INC. / CTO

Phone:  *+1 703.496.4990 x108*
Mobile: *+1 815.546.6599*
Email:  *j...@stratustalk.com* 
Website:*https://www.stratustalk.com*
Address:*One Freedom Square
13th Floor
Reston, VA 20190*

 
 




-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

[asterisk-users] AGI Script Returning 4

2021-01-30 Thread Alexander Perkins
HI All.  I have a really strange issue that I'm two months into
troubleshooting; however, I cannot figure it out.  I have an AGI Script
(PHP) that runs every time a call comes into my Asterisk box.  Most of the
time, it runs without any issue.  However, every now and then, the PHP-AGI
script fails after it is executed and simply returns 'returning 4'.  I
verify the PHP script begins to run.  However, it appears to just stop.  I
have placed try/catch statements everywhere, but it does not seem to hit
them.

Just to verify, this is the same script running over and over with the same
parameter.

Any ideas/suggestions as of what can be happening?

Thanks,
Alex
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

Re: [asterisk-users] AGI: "Get variable" returns variable VALUE vs "Get full variable" returns variable NAME - bug or my misunderstanding?

2019-12-27 Thread Sean Bright

On 12/27/2019 2:56 PM, Jonathan H wrote:

OK, that works - looks like a documentation bug? (Also very confusing!)

Should I report it on the page at 
https://wiki.asterisk.org/wiki/display/AST/Asterisk+17+AGICommand_get+full+variable or 
on the main tracker?


These wiki pages are automatically generated from the source code[1], so 
the best place would be the Asterisk Issues Tracker[2]. Even better 
would be to attach a patch to the issue you create which beefs up the 
documentation to your liking.


Kind regards,
Sean

[1] https://github.com/asterisk/asterisk/blob/17/res/res_agi.c#L321-L341
[2] https://issues.asterisk.org/


--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
 https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

Re: [asterisk-users] AGI: "Get variable" returns variable VALUE vs "Get full variable" returns variable NAME - bug or my misunderstanding?

2019-12-27 Thread Jonathan H
OK, that works - looks like a documentation bug? (Also very confusing!)

Should I report it on the page at
https://wiki.asterisk.org/wiki/display/AST/Asterisk+17+AGICommand_get+full+variable
or
on the main tracker?

Many thanks - couldn't figure out what was wrong!

On Fri, 27 Dec 2019 at 19:36, Sean Bright  wrote:

> On 12/27/2019 2:24 PM, Jonathan H wrote:
> > AGI Rx << SET VARIABLE myVar "Hello
> > World!!!"
> > AGI Tx >> 200 result=1
> > AGI Rx << GET FULL VARIABLE myVar
> > AGI Tx >> 200 result=1 (myVar)
> >
> > Is this a bug, poor documentation, or my poor understanding of them?
>
> I believe the syntax you are looking for is:
>
>  GET FULL VARIABLE ${myVar}
>
> Kind regards,
> Sean
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> 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 --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

Re: [asterisk-users] AGI: "Get variable" returns variable VALUE vs "Get full variable" returns variable NAME - bug or my misunderstanding?

2019-12-27 Thread Sean Bright

On 12/27/2019 2:24 PM, Jonathan H wrote:
AGI Rx << SET VARIABLE myVar "Hello 
World!!!"

AGI Tx >> 200 result=1
AGI Rx << GET FULL VARIABLE myVar
AGI Tx >> 200 result=1 (myVar)

Is this a bug, poor documentation, or my poor understanding of them?


I believe the syntax you are looking for is:

    GET FULL VARIABLE ${myVar}

Kind regards,
Sean

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
 https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

[asterisk-users] AGI: "Get variable" returns variable VALUE vs "Get full variable" returns variable NAME - bug or my misunderstanding?

2019-12-27 Thread Jonathan H
Just trying out a node agi package (https://github.com/sergey12313/ts-agi/ ,
and it wasn't behaving as I expected, but when turning on agi debug, it
looks like it might be Asterisk (using 17.1.0)

This works as expected

AGI Rx << SET VARIABLE myVar "Hello World!!!"
AGI Tx >> 200 result=1
AGI Rx << GET VARIABLE myVar
AGI Tx >> 200 result=1 (Hello World!!!)

But  GET FULL VARIABLE just returns the NAME of the variable

AGI Rx << SET VARIABLE myVar "Hello World!!!"
AGI Tx >> 200 result=1
AGI Rx << GET FULL VARIABLE myVar
AGI Tx >> 200 result=1 (myVar)

Is this a bug, poor documentation, or my poor understanding of them?

https://wiki.asterisk.org/wiki/display/AST/Asterisk+17+AGICommand_get+full+variable
GET FULL VARIABLE VARIABLENAME CHANNEL NAME
Example return code: 200 result=1 (testvariable)

https://wiki.asterisk.org/wiki/display/AST/Asterisk+17+AGICommand_get+variable
GET VARIABLE VARIABLENAME
Example return code: 200 result=1 (testvariable)
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

Re: [asterisk-users] AGI GET DATA same DTMF code as Read cmd ?

2019-10-23 Thread Joshua C. Colp
On Mon, Oct 21, 2019, at 2:34 PM, Gee Jacobs wrote:
> Hi, 
> 
> I am struggling with DTMF detection in Asterisk 16.3. 
> 
> With the Asterisk read dialplan command I get excellent detection. With 
> the AGI GET DATA function the DTMF detection is however often bad.
> 
> Is the underlying DTMF detection code the same in both functions?

Yes, it is the same. The only difference is the code that actually receives 
notification of the DTMF and uses it. Have you enable DTMF debugging to see if 
there is a difference?

-- 
Joshua C. Colp
Digium - A Sangoma Company | Senior Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
Check us out at: www.digium.com & www.asterisk.org

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

[asterisk-users] AGI GET DATA same DTMF code as Read cmd ?

2019-10-21 Thread Gee Jacobs
Hi, 

I am struggling with DTMF detection in Asterisk 16.3. 

With the Asterisk read dialplan command I get excellent detection. With the AGI 
GET DATA function the DTMF detection is however often bad.

Is the underlying DTMF detection code the same in both functions?

Thanks for your help.

Best

Gee


-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

Re: [asterisk-users] AGI timeout option

2018-09-18 Thread modou lo
Sorry you know i'm student and i'm the end of my studies i must present a
memory on taxing voip services

Le mar. 18 sept. 2018 à 19:11, Matthew Fredrickson  a
écrit :

> Hey,
>
> I would suggest starting a new thread with this question instead of
> inserting this into another existing thread like this.
>
> Matthew Fredrickson
>
> On Tue, Sep 18, 2018, 11:16 AM modou lo  wrote:
>
>> Please can i ask you i want to know which code can help me to provide the
>> taxation of voip/toip services in asterisk
>>
>> Le mar. 18 sept. 2018 à 01:36, Patrick Wakano  a
>> écrit :
>>
>>> Thanks everyone for the answers!
>>> I did explored some options at the PHP level and probably will do
>>> something in this direction, but in fact what I was really looking was
>>> something in the Asterisk side, not in the script side.
>>> Because in my opinion regardless of the language or AGI type, Asterisk
>>> itself should be able to timeout a long running script and return to the
>>> dialplan. However looks like there is nothing of this sort.
>>>
>>> Kind regards,
>>> Patrick Wakano
>>>
>>> On Sat, 15 Sep 2018 at 03:56, Eric Wieling  wrote:
>>>
 I don't know AGIspeedy, but I have some PHP scripts where I set a
 connect timeout using streams.

 Example using https, but should be easily adaptable to non-s http.:

 $pbxsh_bin = @file_get_contents("https://blah.blah.blah;, FALSE,
 @stream_context_create(array('https' => array('timeout' => 5,
 "verify_peer"=>false, "verify_peer_name"=>false;

 On 09/14/2018 01:40 PM, Carlos Chavez wrote:
 > On 9/13/2018 8:04 PM, Patrick Wakano wrote:
 >
 >> Hello list,
 >> Hope you all doing  well!
 >>
 >> Recently, I had an issue with a FastAGI PHP script, which under some
 >> specific situation would run into an infinity loop, consuming all
 CPU
 >> resources. This also was preventing Asterisk to terminated the call
 >> properly because it was waiting for the AGI to return... The
 >> application uses AGIspeedy to process the AGI calls, not sure if
 this
 >> can be affecting this situation somehow
 >> Due to this problem I started looking for some option to timeout the
 >> AGI call and return to the dialplan after XYZ seconds and so this
 >> would protect Asterisk preventing the dialplan to get stuck due to
 >> some external script problem that is actually outside of Asterisk
 >> control. Does Asterisk provide some control of this sort? I searched
 >> around and could not find any.
 >> Any idea is appreciated!
 >>
 >> Kind regards
 >> Patrick Wakano
 >>
 >
 > I think this is what you may be looking for:
 >
 > http://php.net/manual/en/function.set-time-limit.php
 >

 --
 http://help.nyigc.net/

 --
 _
 -- Bandwidth and Colocation Provided by http://www.api-digital.com --

 Astricon is coming up October 9-11!  Signup is available at:
 https://www.asterisk.org/community/astricon-user-conference

 Check out the new Asterisk community forum at:
 https://community.asterisk.org/

 New to Asterisk? Start here:
   https://wiki.asterisk.org/wiki/display/AST/Getting+Started

 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 --
>>>
>>> Astricon is coming up October 9-11!  Signup is available at:
>>> https://www.asterisk.org/community/astricon-user-conference
>>>
>>> Check out the new Asterisk community forum at:
>>> https://community.asterisk.org/
>>>
>>> New to Asterisk? Start here:
>>>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>>>
>>> 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 --
>>
>> Astricon is coming up October 9-11!  Signup is available at:
>> https://www.asterisk.org/community/astricon-user-conference
>>
>> Check out the new Asterisk community forum at:
>> https://community.asterisk.org/
>>
>> New to Asterisk? Start here:
>>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>>
>> 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 --
>
> Astricon is coming up October 9-11!  Signup is available at:
> 

Re: [asterisk-users] AGI timeout option

2018-09-18 Thread Matthew Fredrickson
Hey,

I would suggest starting a new thread with this question instead of
inserting this into another existing thread like this.

Matthew Fredrickson

On Tue, Sep 18, 2018, 11:16 AM modou lo  wrote:

> Please can i ask you i want to know which code can help me to provide the
> taxation of voip/toip services in asterisk
>
> Le mar. 18 sept. 2018 à 01:36, Patrick Wakano  a
> écrit :
>
>> Thanks everyone for the answers!
>> I did explored some options at the PHP level and probably will do
>> something in this direction, but in fact what I was really looking was
>> something in the Asterisk side, not in the script side.
>> Because in my opinion regardless of the language or AGI type, Asterisk
>> itself should be able to timeout a long running script and return to the
>> dialplan. However looks like there is nothing of this sort.
>>
>> Kind regards,
>> Patrick Wakano
>>
>> On Sat, 15 Sep 2018 at 03:56, Eric Wieling  wrote:
>>
>>> I don't know AGIspeedy, but I have some PHP scripts where I set a
>>> connect timeout using streams.
>>>
>>> Example using https, but should be easily adaptable to non-s http.:
>>>
>>> $pbxsh_bin = @file_get_contents("https://blah.blah.blah;, FALSE,
>>> @stream_context_create(array('https' => array('timeout' => 5,
>>> "verify_peer"=>false, "verify_peer_name"=>false;
>>>
>>> On 09/14/2018 01:40 PM, Carlos Chavez wrote:
>>> > On 9/13/2018 8:04 PM, Patrick Wakano wrote:
>>> >
>>> >> Hello list,
>>> >> Hope you all doing  well!
>>> >>
>>> >> Recently, I had an issue with a FastAGI PHP script, which under some
>>> >> specific situation would run into an infinity loop, consuming all CPU
>>> >> resources. This also was preventing Asterisk to terminated the call
>>> >> properly because it was waiting for the AGI to return... The
>>> >> application uses AGIspeedy to process the AGI calls, not sure if this
>>> >> can be affecting this situation somehow
>>> >> Due to this problem I started looking for some option to timeout the
>>> >> AGI call and return to the dialplan after XYZ seconds and so this
>>> >> would protect Asterisk preventing the dialplan to get stuck due to
>>> >> some external script problem that is actually outside of Asterisk
>>> >> control. Does Asterisk provide some control of this sort? I searched
>>> >> around and could not find any.
>>> >> Any idea is appreciated!
>>> >>
>>> >> Kind regards
>>> >> Patrick Wakano
>>> >>
>>> >
>>> > I think this is what you may be looking for:
>>> >
>>> > http://php.net/manual/en/function.set-time-limit.php
>>> >
>>>
>>> --
>>> http://help.nyigc.net/
>>>
>>> --
>>> _
>>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>>
>>> Astricon is coming up October 9-11!  Signup is available at:
>>> https://www.asterisk.org/community/astricon-user-conference
>>>
>>> Check out the new Asterisk community forum at:
>>> https://community.asterisk.org/
>>>
>>> New to Asterisk? Start here:
>>>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>>>
>>> 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 --
>>
>> Astricon is coming up October 9-11!  Signup is available at:
>> https://www.asterisk.org/community/astricon-user-conference
>>
>> Check out the new Asterisk community forum at:
>> https://community.asterisk.org/
>>
>> New to Asterisk? Start here:
>>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>>
>> 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 --
>
> Astricon is coming up October 9-11!  Signup is available at:
> https://www.asterisk.org/community/astricon-user-conference
>
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> 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 --

Astricon is coming up October 9-11!  Signup is available at: 
https://www.asterisk.org/community/astricon-user-conference

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

Re: [asterisk-users] AGI timeout option

2018-09-18 Thread modou lo
Please can i ask you i want to know which code can help me to provide the
taxation of voip/toip services in asterisk

Le mar. 18 sept. 2018 à 01:36, Patrick Wakano  a écrit :

> Thanks everyone for the answers!
> I did explored some options at the PHP level and probably will do
> something in this direction, but in fact what I was really looking was
> something in the Asterisk side, not in the script side.
> Because in my opinion regardless of the language or AGI type, Asterisk
> itself should be able to timeout a long running script and return to the
> dialplan. However looks like there is nothing of this sort.
>
> Kind regards,
> Patrick Wakano
>
> On Sat, 15 Sep 2018 at 03:56, Eric Wieling  wrote:
>
>> I don't know AGIspeedy, but I have some PHP scripts where I set a
>> connect timeout using streams.
>>
>> Example using https, but should be easily adaptable to non-s http.:
>>
>> $pbxsh_bin = @file_get_contents("https://blah.blah.blah;, FALSE,
>> @stream_context_create(array('https' => array('timeout' => 5,
>> "verify_peer"=>false, "verify_peer_name"=>false;
>>
>> On 09/14/2018 01:40 PM, Carlos Chavez wrote:
>> > On 9/13/2018 8:04 PM, Patrick Wakano wrote:
>> >
>> >> Hello list,
>> >> Hope you all doing  well!
>> >>
>> >> Recently, I had an issue with a FastAGI PHP script, which under some
>> >> specific situation would run into an infinity loop, consuming all CPU
>> >> resources. This also was preventing Asterisk to terminated the call
>> >> properly because it was waiting for the AGI to return... The
>> >> application uses AGIspeedy to process the AGI calls, not sure if this
>> >> can be affecting this situation somehow
>> >> Due to this problem I started looking for some option to timeout the
>> >> AGI call and return to the dialplan after XYZ seconds and so this
>> >> would protect Asterisk preventing the dialplan to get stuck due to
>> >> some external script problem that is actually outside of Asterisk
>> >> control. Does Asterisk provide some control of this sort? I searched
>> >> around and could not find any.
>> >> Any idea is appreciated!
>> >>
>> >> Kind regards
>> >> Patrick Wakano
>> >>
>> >
>> > I think this is what you may be looking for:
>> >
>> > http://php.net/manual/en/function.set-time-limit.php
>> >
>>
>> --
>> http://help.nyigc.net/
>>
>> --
>> _
>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>
>> Astricon is coming up October 9-11!  Signup is available at:
>> https://www.asterisk.org/community/astricon-user-conference
>>
>> Check out the new Asterisk community forum at:
>> https://community.asterisk.org/
>>
>> New to Asterisk? Start here:
>>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>>
>> 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 --
>
> Astricon is coming up October 9-11!  Signup is available at:
> https://www.asterisk.org/community/astricon-user-conference
>
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> 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 --

Astricon is coming up October 9-11!  Signup is available at: 
https://www.asterisk.org/community/astricon-user-conference

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

Re: [asterisk-users] AGI timeout option

2018-09-17 Thread Patrick Wakano
Thanks everyone for the answers!
I did explored some options at the PHP level and probably will do something
in this direction, but in fact what I was really looking was something in
the Asterisk side, not in the script side.
Because in my opinion regardless of the language or AGI type, Asterisk
itself should be able to timeout a long running script and return to the
dialplan. However looks like there is nothing of this sort.

Kind regards,
Patrick Wakano

On Sat, 15 Sep 2018 at 03:56, Eric Wieling  wrote:

> I don't know AGIspeedy, but I have some PHP scripts where I set a
> connect timeout using streams.
>
> Example using https, but should be easily adaptable to non-s http.:
>
> $pbxsh_bin = @file_get_contents("https://blah.blah.blah;, FALSE,
> @stream_context_create(array('https' => array('timeout' => 5,
> "verify_peer"=>false, "verify_peer_name"=>false;
>
> On 09/14/2018 01:40 PM, Carlos Chavez wrote:
> > On 9/13/2018 8:04 PM, Patrick Wakano wrote:
> >
> >> Hello list,
> >> Hope you all doing  well!
> >>
> >> Recently, I had an issue with a FastAGI PHP script, which under some
> >> specific situation would run into an infinity loop, consuming all CPU
> >> resources. This also was preventing Asterisk to terminated the call
> >> properly because it was waiting for the AGI to return... The
> >> application uses AGIspeedy to process the AGI calls, not sure if this
> >> can be affecting this situation somehow
> >> Due to this problem I started looking for some option to timeout the
> >> AGI call and return to the dialplan after XYZ seconds and so this
> >> would protect Asterisk preventing the dialplan to get stuck due to
> >> some external script problem that is actually outside of Asterisk
> >> control. Does Asterisk provide some control of this sort? I searched
> >> around and could not find any.
> >> Any idea is appreciated!
> >>
> >> Kind regards
> >> Patrick Wakano
> >>
> >
> > I think this is what you may be looking for:
> >
> > http://php.net/manual/en/function.set-time-limit.php
> >
>
> --
> http://help.nyigc.net/
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Astricon is coming up October 9-11!  Signup is available at:
> https://www.asterisk.org/community/astricon-user-conference
>
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> 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 --

Astricon is coming up October 9-11!  Signup is available at: 
https://www.asterisk.org/community/astricon-user-conference

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

Re: [asterisk-users] AGI timeout option

2018-09-14 Thread Eric Wieling
I don't know AGIspeedy, but I have some PHP scripts where I set a 
connect timeout using streams.


Example using https, but should be easily adaptable to non-s http.:

$pbxsh_bin = @file_get_contents("https://blah.blah.blah;, FALSE, 
@stream_context_create(array('https' => array('timeout' => 5, 
"verify_peer"=>false, "verify_peer_name"=>false;


On 09/14/2018 01:40 PM, Carlos Chavez wrote:

On 9/13/2018 8:04 PM, Patrick Wakano wrote:


Hello list,
Hope you all doing  well!

Recently, I had an issue with a FastAGI PHP script, which under some 
specific situation would run into an infinity loop, consuming all CPU 
resources. This also was preventing Asterisk to terminated the call 
properly because it was waiting for the AGI to return... The 
application uses AGIspeedy to process the AGI calls, not sure if this 
can be affecting this situation somehow
Due to this problem I started looking for some option to timeout the 
AGI call and return to the dialplan after XYZ seconds and so this 
would protect Asterisk preventing the dialplan to get stuck due to 
some external script problem that is actually outside of Asterisk 
control. Does Asterisk provide some control of this sort? I searched 
around and could not find any.

Any idea is appreciated!

Kind regards
Patrick Wakano



I think this is what you may be looking for:

http://php.net/manual/en/function.set-time-limit.php



--
http://help.nyigc.net/

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Astricon is coming up October 9-11!  Signup is available at: 
https://www.asterisk.org/community/astricon-user-conference

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
 https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

Re: [asterisk-users] AGI timeout option

2018-09-14 Thread Carlos Chavez

On 9/13/2018 8:04 PM, Patrick Wakano wrote:


Hello list,
Hope you all doing  well!

Recently, I had an issue with a FastAGI PHP script, which under some 
specific situation would run into an infinity loop, consuming all CPU 
resources. This also was preventing Asterisk to terminated the call 
properly because it was waiting for the AGI to return... The 
application uses AGIspeedy to process the AGI calls, not sure if this 
can be affecting this situation somehow
Due to this problem I started looking for some option to timeout the 
AGI call and return to the dialplan after XYZ seconds and so this 
would protect Asterisk preventing the dialplan to get stuck due to 
some external script problem that is actually outside of Asterisk 
control. Does Asterisk provide some control of this sort? I searched 
around and could not find any.

Any idea is appreciated!

Kind regards
Patrick Wakano



I think this is what you may be looking for:

http://php.net/manual/en/function.set-time-limit.php

--
Telecomunicaciones Abiertas de México S.A. de C.V.
Carlos Chávez
+52 (55)8116-9161


--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Astricon is coming up October 9-11!  Signup is available at: 
https://www.asterisk.org/community/astricon-user-conference

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
 https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

Re: [asterisk-users] AGI timeout option

2018-09-14 Thread Tech Support
Hello;

I’ve been using AGISpeedy for Perl for years. I just works, and it works 
really well. I’m a Perl programmer, not a PHP programmer, but it seems to me 
that you need the PHP equivalent of Perl’s ‘alarm’ command.  Just a thought.

Regards;

John V.

 

From: asterisk-users [mailto:asterisk-users-boun...@lists.digium.com] On Behalf 
Of Patrick Wakano
Sent: Thursday, September 13, 2018 09:05 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion 

Subject: [asterisk-users] AGI timeout option

 

Hello list,

Hope you all doing  well!

 

Recently, I had an issue with a FastAGI PHP script, which under some specific 
situation would run into an infinity loop, consuming all CPU resources. This 
also was preventing Asterisk to terminated the call properly because it was 
waiting for the AGI to return... The application uses AGIspeedy to process the 
AGI calls, not sure if this can be affecting this situation somehow

Due to this problem I started looking for some option to timeout the AGI call 
and return to the dialplan after XYZ seconds and so this would protect Asterisk 
preventing the dialplan to get stuck due to some external script problem that 
is actually outside of Asterisk control. Does Asterisk provide some control of 
this sort? I searched around and could not find any. 

Any idea is appreciated!

 

Kind regards

Patrick Wakano

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Astricon is coming up October 9-11!  Signup is available at: 
https://www.asterisk.org/community/astricon-user-conference

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

[asterisk-users] AGI timeout option

2018-09-13 Thread Patrick Wakano
Hello list,
Hope you all doing  well!

Recently, I had an issue with a FastAGI PHP script, which under some
specific situation would run into an infinity loop, consuming all CPU
resources. This also was preventing Asterisk to terminated the call
properly because it was waiting for the AGI to return... The application
uses AGIspeedy to process the AGI calls, not sure if this can be affecting
this situation somehow
Due to this problem I started looking for some option to timeout the AGI
call and return to the dialplan after XYZ seconds and so this would protect
Asterisk preventing the dialplan to get stuck due to some external script
problem that is actually outside of Asterisk control. Does Asterisk provide
some control of this sort? I searched around and could not find any.
Any idea is appreciated!

Kind regards
Patrick Wakano
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Astricon is coming up October 9-11!  Signup is available at: 
https://www.asterisk.org/community/astricon-user-conference

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

Re: [asterisk-users] AGI fails bad permission

2018-02-23 Thread Steve Edwards

On Fri, 23 Feb 2018, Saint Michael wrote:


Launched AGI Script /var/lib/asterisk/agi-bin/adddnc.php
 adddnc.php: Failed to execute '/var/lib/asterisk/agi-bin/adddnc.php': 
Permission denied



The file is of course chmod +x /var/lib/asterisk/agi-bin/*.php


This is how a sysadmin opened up a web server to compromise a decade or 2 
ago. The CGI directory contained some flawed SGI CGIs that had been 
disabled by fiddling with the permissions.


More information may yield a clue.

1) ps -aef | grep asterisk | grep --invert-match grep

2) sudo grep 'astagidir' /etc/asterisk/asterisk.conf

3) grep adddnc /etc/asterisk/extensions.{ael,conf}

4) head --lines=1 /var/lib/asterisk/agi-bin/adddnc.php

5) ls -l $(head --lines=1 /var/lib/asterisk/agi-bin/adddnc.php\
| awk '{print substr($1, 3, 255)}')

6) sudo /usr/bin/php (or wherever you keep php) \
/var/lib/asterisk/agi-bin/adddnc.php 7) Check the 'r' and 'x' bits on /var/, /var/lib/, /var/lib/asterisk/, 
/var/lib/asterisk/agi-bin/.


8) cat /var/lib/asterisk/agi-bin/adddnc.php

--
Thanks in advance,
-
Steve Edwards   sedwa...@sedwards.com  Voice: +1-760-468-3867 PST
https://www.linkedin.com/in/steve-edwards-4244281-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

[asterisk-users] AGI fails bad permission

2018-02-23 Thread Saint Michael
Launched AGI Script /var/lib/asterisk/agi-bin/adddnc.php
 adddnc.php: Failed to execute '/var/lib/asterisk/agi-bin/adddnc.php':
Permission denied
The file is of course chmod +x /var/lib/asterisk/agi-bin/*.php
Selinux is disabled
asterisk is running as root with
live_dangerously=yes
in asterisk.conf
The box is Centos 7
What can possibly be causing this?
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

Re: [asterisk-users] AGI Exec Voicemail

2017-04-12 Thread Jeff LaCoursiere


Its not about email - the Voicemail app allows you to record a message 
that gets dropped into multiple voicemail boxes.


Thanks,

j

On 04/12/2017 12:15 PM, Telium Technical Support wrote:

Why not use an ALIAS and let sendmail send the email to a distribution
group?

-Original Message-
From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Jeff
LaCoursiere
Sent: Wednesday, April 12, 2017 1:09 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
<asterisk-users@lists.digium.com>
Subject: [asterisk-users] AGI Exec Voicemail


Hi,

I have a voicemail broadcast AGI that has been running fine for years - it
collects extensions and then EXECs the Voicemail app, like this:

EXEC Voicemail \"%s\"

(%s is the extension list like AAA etc)

This works fine, but after leaving the message and pressing "#", I just get
"Thank you" and a hangup.  I would like to have the option to review,
re-record, or cancel.  It isn't clear how to enable this option via EXEC.  I
tried:

EXEC Voicemail \"%s,review=yes\"

but there is no effect at all.

Any clues?

Thanks,

j

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at:
https://community.asterisk.org/

New to Asterisk? Start here:
   https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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 --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
 https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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


Re: [asterisk-users] AGI Exec Voicemail

2017-04-12 Thread Telium Technical Support
Why not use an ALIAS and let sendmail send the email to a distribution
group?

-Original Message-
From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Jeff
LaCoursiere
Sent: Wednesday, April 12, 2017 1:09 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
<asterisk-users@lists.digium.com>
Subject: [asterisk-users] AGI Exec Voicemail


Hi,

I have a voicemail broadcast AGI that has been running fine for years - it
collects extensions and then EXECs the Voicemail app, like this:

EXEC Voicemail \"%s\"

(%s is the extension list like AAA etc)

This works fine, but after leaving the message and pressing "#", I just get
"Thank you" and a hangup.  I would like to have the option to review,
re-record, or cancel.  It isn't clear how to enable this option via EXEC.  I
tried:

EXEC Voicemail \"%s,review=yes\"

but there is no effect at all.

Any clues?

Thanks,

j

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at:
https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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 --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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


[asterisk-users] AGI Exec Voicemail

2017-04-12 Thread Jeff LaCoursiere


Hi,

I have a voicemail broadcast AGI that has been running fine for years - 
it collects extensions and then EXECs the Voicemail app, like this:


EXEC Voicemail \"%s\"

(%s is the extension list like AAA etc)

This works fine, but after leaving the message and pressing "#", I just 
get "Thank you" and a hangup.  I would like to have the option to 
review, re-record, or cancel.  It isn't clear how to enable this option 
via EXEC.  I tried:


EXEC Voicemail \"%s,review=yes\"

but there is no effect at all.

Any clues?

Thanks,

j

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
 https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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


Re: [asterisk-users] AGI: How to break out of AGI when stream_file escape_digits are detected in middle of long sequence of files?

2016-10-11 Thread Jonathan H
Arrrgh! You are correct, of course. I hadn't realised you could do it
that way - I was assuming it was a variable that was returned to the
dialplan/channel.

Some of the finer points of AGI are still a slight mystery to me!

Thank you very much - working perfectly now, with your help and the
following code. Thank you again.

escape_digits = str("*")
pressed_digit=agi.stream_file(promptFile,escape_digits)
if pressed_digit == "*":
sys.exit(0)

On 11 October 2016 at 09:31, Lefteris Zafiris  wrote:
> On Mon, 10 Oct 2016, at 22:47, Jonathan H wrote:
>> For reasons best known to myself, I call a python agi (PYST2 - love
>> it!) which streams a series of very short files in quick succession.
>>
>> Like this:
>>
>> escape_digits = str("0")
>> agi.stream_file(promptFile,escape_digits)
>>
>> and this is what I see on the AGI debug:
>>
>> AGI Tx >> 200 result=0 endpos=6784
>> AGI Rx << STREAM FILE
>> /home/DefaultPrompts/en_GB/female/wx/low "0" 0
>> --  Playing
>> '/home/DefaultPrompts/en_GB/female/wx/low.alaw' (escape_digits=0)
>> (sample_offset 0) (language 'en_GB')
>> AGI Tx >> 200 result=48 endpos=1440
>>
>> The FIRST line is a file that finished normally, with result=0, the
>> LAST line is a file that was interrupted, and receives result=48 from
>> asterisk.
>>
>> Yes, zero stops the file playing, but it just goes onto the next file.
>>
>> So, how do I get that variable? It doesn't become available in python,
>> and trying to get it via either
>>
>> agi.env[result']
>> agi.get_variable('result')
>>
>> just makes python choke and the AGI quits. That would be fine if it
>> was a result of result being 48!
>>
>> I feel like I'm going slightly bonkers here because it's something so
>> obvious, and yet I've googled so hard over this!
>>
>> Thanks.
>
> Hello,
>
> as the docs on stream_file() mention it returns the digit if one was
> pressed.
> So you might want to try something like:
>
> pressed_digit = agi.stream_file(promptFile,escape_digits)
>
> in you case the raw value 48 is converted to its ascii equivalent so
> pressed_digit will have the value 0
>
> --
> Lefteris Zafiris
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Join the Asterisk Community at the 13th AstriCon, September 27-29, 2016
>   http://www.asterisk.org/community/astricon-user-conference
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> 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 --

Join the Asterisk Community at the 13th AstriCon, September 27-29, 2016
  http://www.asterisk.org/community/astricon-user-conference

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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


Re: [asterisk-users] AGI: How to break out of AGI when stream_file escape_digits are detected in middle of long sequence of files?

2016-10-11 Thread Lefteris Zafiris
On Mon, 10 Oct 2016, at 22:47, Jonathan H wrote:
> For reasons best known to myself, I call a python agi (PYST2 - love
> it!) which streams a series of very short files in quick succession.
> 
> Like this:
> 
> escape_digits = str("0")
> agi.stream_file(promptFile,escape_digits)
> 
> and this is what I see on the AGI debug:
> 
> AGI Tx >> 200 result=0 endpos=6784
> AGI Rx << STREAM FILE
> /home/DefaultPrompts/en_GB/female/wx/low "0" 0
> --  Playing
> '/home/DefaultPrompts/en_GB/female/wx/low.alaw' (escape_digits=0)
> (sample_offset 0) (language 'en_GB')
> AGI Tx >> 200 result=48 endpos=1440
> 
> The FIRST line is a file that finished normally, with result=0, the
> LAST line is a file that was interrupted, and receives result=48 from
> asterisk.
> 
> Yes, zero stops the file playing, but it just goes onto the next file.
> 
> So, how do I get that variable? It doesn't become available in python,
> and trying to get it via either
> 
> agi.env[result']
> agi.get_variable('result')
> 
> just makes python choke and the AGI quits. That would be fine if it
> was a result of result being 48!
> 
> I feel like I'm going slightly bonkers here because it's something so
> obvious, and yet I've googled so hard over this!
> 
> Thanks.

Hello,

as the docs on stream_file() mention it returns the digit if one was
pressed.
So you might want to try something like:

pressed_digit = agi.stream_file(promptFile,escape_digits)

in you case the raw value 48 is converted to its ascii equivalent so
pressed_digit will have the value 0

-- 
Lefteris Zafiris

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Join the Asterisk Community at the 13th AstriCon, September 27-29, 2016
  http://www.asterisk.org/community/astricon-user-conference

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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


[asterisk-users] AGI: How to break out of AGI when stream_file escape_digits are detected in middle of long sequence of files?

2016-10-10 Thread Jonathan H
For reasons best known to myself, I call a python agi (PYST2 - love
it!) which streams a series of very short files in quick succession.

Like this:

escape_digits = str("0")
agi.stream_file(promptFile,escape_digits)

and this is what I see on the AGI debug:

AGI Tx >> 200 result=0 endpos=6784
AGI Rx << STREAM FILE
/home/DefaultPrompts/en_GB/female/wx/low "0" 0
--  Playing
'/home/DefaultPrompts/en_GB/female/wx/low.alaw' (escape_digits=0)
(sample_offset 0) (language 'en_GB')
AGI Tx >> 200 result=48 endpos=1440

The FIRST line is a file that finished normally, with result=0, the
LAST line is a file that was interrupted, and receives result=48 from
asterisk.

Yes, zero stops the file playing, but it just goes onto the next file.

So, how do I get that variable? It doesn't become available in python,
and trying to get it via either

agi.env[result']
agi.get_variable('result')

just makes python choke and the AGI quits. That would be fine if it
was a result of result being 48!

I feel like I'm going slightly bonkers here because it's something so
obvious, and yet I've googled so hard over this!

Thanks.

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Join the Asterisk Community at the 13th AstriCon, September 27-29, 2016
  http://www.asterisk.org/community/astricon-user-conference

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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


[asterisk-users] AGI() or System() - Play audio in the background

2015-05-22 Thread Bruno Correia
Hello,

I need to leave an audio running in the background while other commands are
executed. I have an AGI that does some checks and tamed around a5s, need
to leave a audio running in the meantime. Does anyone know any
way? already I tried hard and so far nothing.

I tried to tip below using MusicOnHold, but it worked. It is indefinitely
on MusicOnHold() application.

*http://stackoverflow.com/questions/9043308/executing-multiple-commands-on-the-same-line-asterisk
http://stackoverflow.com/questions/9043308/executing-multiple-commands-on-the-same-line-asterisk*


--
-- 
_
-- 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

[asterisk-users] AGI Perl Question

2015-04-25 Thread CDR
From inside a Perl script, Asterisk 1.4, I am trying to get this information
$xipaddress = $AGI-get_full_variable('CHANNEL(recvip)');
or using pan get_variable
But I get nothing. How do I read the IP address of origin from an AGI Perl
script?
I cannot update the version, for this is an old system that I am being paid
to keep it running.
Philip Orleans
-- 
_
-- 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

[asterisk-users] AGI and AMI in PHP -- What's current?

2014-11-18 Thread Steve Edwards
I'm writing some code that needs to access AMI in PHP. (I'll probably be 
doing AGI later as well.)


I'm looking at phpagi (2.20), but it hasn't been updated since 2010 and 
appears to be a bit behind current Asterisk -- No event handler for event 
'fullybooted'.


What PHP framework/library are you using -- and why?

--
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] AGI and AMI in PHP -- What's current?

2014-11-18 Thread Eric Wieling
Other than a few minor patches, we use stock phpagi.  If you want simple, 
phpagi is the way to go.   

-Original Message-
From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Steve Edwards
Sent: Tuesday, November 18, 2014 3:34 PM
To: Asterisk Users Mailing List
Subject: [asterisk-users] AGI and AMI in PHP -- What's current?

I'm writing some code that needs to access AMI in PHP. (I'll probably be 
doing AGI later as well.)

I'm looking at phpagi (2.20), but it hasn't been updated since 2010 and 
appears to be a bit behind current Asterisk -- No event handler for event 
'fullybooted'.

What PHP framework/library are you using -- and why?

-- 
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] AGI and AMI in PHP -- What's current?

2014-11-18 Thread Steve Edwards

On Tue, 18 Nov 2014, Eric Wieling wrote:


Other than a few minor patches, we use stock phpagi.


Can you spare me a flat spot on my forehead and share the wealth?

--
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] AGI and AMI in PHP -- What's current?

2014-11-18 Thread Steve Edwards

On Tue, 18 Nov 2014, Eric Wieling wrote:


diff at http://pastebin.com/wfDR6u0a


--
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] AGI and AMI in PHP -- What's current?

2014-11-18 Thread Johan Wilfer

Den 2014-11-18 21:33, Steve Edwards skrev:

I'm writing some code that needs to access AMI in PHP. (I'll probably be
doing AGI later as well.)

I'm looking at phpagi (2.20), but it hasn't been updated since 2010 and
appears to be a bit behind current Asterisk -- No event handler for
event 'fullybooted'.

What PHP framework/library are you using -- and why?



I use these, works very well:

https://github.com/marcelog/PAGI
https://github.com/marcelog/PAMI

More modern, uses composer, does get updates.

--
Johan Wilfer


--
_
-- 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] AGI scripts - delay issue.

2014-09-02 Thread Thorsten Göllner


Am 02.09.2014 07:09, schrieb Bryant Zimmerman:

Hey All
We have several AGI scripts that access databases. These work well 
most of the time.
The issue we are having is that on rare occasion our script must fail 
to a backup database server.
When this occurs it may take up to two seconds to do so. The issue is 
when there is this delay the script loses access to read global 
channel  variable values only after the delay. This is driving me 
crazy is there some kind of  AGI timeout issue or bug that could be 
causing this.


What do you mean with the script loses access to read global channel  
variable values? What is the asterisk version? What channel tech is 
used? What type of AGI-Scripts do you use?
-- 
_
-- 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] AGI scripts - delay issue.

2014-09-01 Thread Bryant Zimmerman
Hey All
  
 We have several AGI scripts that access databases. These work well most of 
the time.
  
 The issue we are having is that on rare occasion our script must fail to a 
backup database server.
 When this occurs it may take up to two seconds to do so.  The issue is 
when there is this delay the script loses access to read global channel  
variable values only after the delay.  This is driving me crazy is there 
some kind of  AGI timeout issue or bug that could be causing this.
  
 Thanks

Bryant

-- 
_
-- 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] agi get_data noanswer

2014-08-13 Thread Michel Verbraak
As we are top posting I will continue this.

Please have a look at:
https://wiki.asterisk.org/wiki/display/AST/Early+Media+and+the+Progress+Application

I hope this answers your questions.

Regards,

Michel.

op 13-08-14 01:34, Rafael Visser schreef:
 I am talking about sip on asterisk  11.10.2
 rv


 2014-08-12 19:28 GMT-04:00 Eric Wieling ewiel...@nyigc.com
 mailto:ewiel...@nyigc.com:

 I do not know, maybe some of the other channel drivers sccp or sip
 support it.

  

 *From:*asterisk-users-boun...@lists.digium.com
 mailto:asterisk-users-boun...@lists.digium.com
 [mailto:asterisk-users-boun...@lists.digium.com
 mailto:asterisk-users-boun...@lists.digium.com] *On Behalf Of
 *Rafael Visser
 *Sent:* Tuesday, August 12, 2014 7:24 PM


 *To:* Asterisk Users Mailing List - Non-Commercial Discussion
 *Subject:* Re: [asterisk-users] agi get_data noanswer

  

  

 Eric is correct. There is no way to send dtmf while the call has
 not been answered.

  

 But us very confusing the read command, in specific  option =
 n(noanswer) to read digits even if the line is not up


 My AGI line is the following

  $AGI-exec(READ,umenu,VARXX,1,n,2,7);

 The command works, but there is no dtmf negotiation


  $AGI-exec(READ,umenu,VARXX,1,,2,7);

 The command works, but there is a kind of answer

 What is the purpose of this noanswer option in a read command when
 it is imposible to read?.

 Is there any way to negotiate with the end user in this early
 media situation?

  

 Thanks in advance.
 rv

  

  

  

 2014-08-07 20:02 GMT-04:00 Eric Wieling ewiel...@nyigc.com
 mailto:ewiel...@nyigc.com:

 Generally the only thing you are allowed to do before answer is
 send audio.  You can't receive audio and can't receive DTMF.   I
 assume it is to prevent people from doing exactly what you  are
 trying to do --- trying to have two way communications without
 paying for the call.

  

  

 *From:*asterisk-users-boun...@lists.digium.com
 mailto:asterisk-users-boun...@lists.digium.com
 [mailto:asterisk-users-boun...@lists.digium.com
 mailto:asterisk-users-boun...@lists.digium.com] *On Behalf Of
 *Rafael Visser
 *Sent:* Thursday, August 07, 2014 4:56 PM
 *To:* Asterisk Users Mailing List - Non-Commercial Discussion
 *Subject:* [asterisk-users] agi get_data noanswer

  

 Hi Guys..


 I am making an anoucement machine that is not allowed to answer
 the call due to a billing issue.
 I found that Playback with noanwser is usefull in this case.

 $AGI-exec('Playback',$message,noanswer)}


 But when i request some values to the user with get_data, i think
 there is an answer anywere.

 Is there a way to get_data without answering the call?

 Thanks in advance!!

 rv


 --
 _
 -- 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] agi get_data noanswer

2014-08-12 Thread Rafael Visser
Eric is correct. There is no way to send dtmf while the call has not been
answered.

But us very confusing the read command, in specific  option = n(noanswer)
to read digits even if the line is not up

My AGI line is the following

 $AGI-exec(READ,umenu,VARXX,1,n,2,7);
The command works, but there is no dtmf negotiation

 $AGI-exec(READ,umenu,VARXX,1,,2,7);
The command works, but there is a kind of answer

What is the purpose of this noanswer option in a read command when it is
imposible to read?.
Is there any way to negotiate with the end user in this early media
situation?

Thanks in advance.
rv





2014-08-07 20:02 GMT-04:00 Eric Wieling ewiel...@nyigc.com:

 Generally the only thing you are allowed to do before answer is send
 audio.  You can’t receive audio and can’t receive DTMF.   I assume it is to
 prevent people from doing exactly what you  are trying to do --- trying to
 have two way communications without paying for the call.





 *From:* asterisk-users-boun...@lists.digium.com [mailto:
 asterisk-users-boun...@lists.digium.com] *On Behalf Of *Rafael Visser
 *Sent:* Thursday, August 07, 2014 4:56 PM
 *To:* Asterisk Users Mailing List - Non-Commercial Discussion
 *Subject:* [asterisk-users] agi get_data noanswer



 Hi Guys..

 I am making an anoucement machine that is not allowed to answer the call
 due to a billing issue.
 I found that Playback with noanwser is usefull in this case.

 $AGI-exec('Playback',$message,noanswer)}


 But when i request some values to the user with get_data, i think there is
 an answer anywere.

 Is there a way to get_data without answering the call?

 Thanks in advance!!

 rv


 --
 _
 -- 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] agi get_data noanswer

2014-08-12 Thread Eric Wieling
I do not know, maybe some of the other channel drivers sccp or sip support it.

From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Rafael Visser
Sent: Tuesday, August 12, 2014 7:24 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] agi get_data noanswer


Eric is correct. There is no way to send dtmf while the call has not been 
answered.

But us very confusing the read command, in specific  option = n(noanswer) to 
read digits even if the line is not up

My AGI line is the following

 $AGI-exec(READ,umenu,VARXX,1,n,2,7);
The command works, but there is no dtmf negotiation

 $AGI-exec(READ,umenu,VARXX,1,,2,7);
The command works, but there is a kind of answer
What is the purpose of this noanswer option in a read command when it is 
imposible to read?.
Is there any way to negotiate with the end user in this early media situation?

Thanks in advance.
rv



2014-08-07 20:02 GMT-04:00 Eric Wieling 
ewiel...@nyigc.commailto:ewiel...@nyigc.com:
Generally the only thing you are allowed to do before answer is send audio.  
You can’t receive audio and can’t receive DTMF.   I assume it is to prevent 
people from doing exactly what you  are trying to do --- trying to have two way 
communications without paying for the call.


From: 
asterisk-users-boun...@lists.digium.commailto:asterisk-users-boun...@lists.digium.com
 
[mailto:asterisk-users-boun...@lists.digium.commailto:asterisk-users-boun...@lists.digium.com]
 On Behalf Of Rafael Visser
Sent: Thursday, August 07, 2014 4:56 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: [asterisk-users] agi get_data noanswer

Hi Guys..

I am making an anoucement machine that is not allowed to answer the call due 
to a billing issue.
I found that Playback with noanwser is usefull in this case.

$AGI-exec('Playback',$message,noanswer)}


But when i request some values to the user with get_data, i think there is an 
answer anywere.

Is there a way to get_data without answering the call?

Thanks in advance!!

rv

--
_
-- 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] agi get_data noanswer

2014-08-12 Thread Rafael Visser
I am talking about sip on asterisk  11.10.2
rv


2014-08-12 19:28 GMT-04:00 Eric Wieling ewiel...@nyigc.com:

 I do not know, maybe some of the other channel drivers sccp or sip support
 it.



 *From:* asterisk-users-boun...@lists.digium.com [mailto:
 asterisk-users-boun...@lists.digium.com] *On Behalf Of *Rafael Visser
 *Sent:* Tuesday, August 12, 2014 7:24 PM

 *To:* Asterisk Users Mailing List - Non-Commercial Discussion
 *Subject:* Re: [asterisk-users] agi get_data noanswer





 Eric is correct. There is no way to send dtmf while the call has not been
 answered.



 But us very confusing the read command, in specific  option = n(noanswer)
 to read digits even if the line is not up


 My AGI line is the following

  $AGI-exec(READ,umenu,VARXX,1,n,2,7);

 The command works, but there is no dtmf negotiation


  $AGI-exec(READ,umenu,VARXX,1,,2,7);

 The command works, but there is a kind of answer

 What is the purpose of this noanswer option in a read command when it is
 imposible to read?.

 Is there any way to negotiate with the end user in this early media
 situation?



 Thanks in advance.
 rv







 2014-08-07 20:02 GMT-04:00 Eric Wieling ewiel...@nyigc.com:

 Generally the only thing you are allowed to do before answer is send
 audio.  You can’t receive audio and can’t receive DTMF.   I assume it is to
 prevent people from doing exactly what you  are trying to do --- trying to
 have two way communications without paying for the call.





 *From:* asterisk-users-boun...@lists.digium.com [mailto:
 asterisk-users-boun...@lists.digium.com] *On Behalf Of *Rafael Visser
 *Sent:* Thursday, August 07, 2014 4:56 PM
 *To:* Asterisk Users Mailing List - Non-Commercial Discussion
 *Subject:* [asterisk-users] agi get_data noanswer



 Hi Guys..


 I am making an anoucement machine that is not allowed to answer the call
 due to a billing issue.
 I found that Playback with noanwser is usefull in this case.

 $AGI-exec('Playback',$message,noanswer)}


 But when i request some values to the user with get_data, i think there is
 an answer anywere.

 Is there a way to get_data without answering the call?

 Thanks in advance!!

 rv


 --
 _
 -- 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

[asterisk-users] agi get_data noanswer

2014-08-07 Thread Rafael Visser
Hi Guys..
I am making an anoucement machine that is not allowed to answer the call
due to a billing issue.
I found that Playback with noanwser is usefull in this case.

$AGI-exec('Playback',$message,noanswer)}


But when i request some values to the user with get_data, i think there is
an answer anywere.

Is there a way to get_data without answering the call?

Thanks in advance!!

rv
-- 
_
-- 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] agi get_data noanswer

2014-08-07 Thread Tech Support
What you may want to check out is the PlayTones and Ringing applications in 
your dial plan. Asterisk will answer the call, but your users won't know that 
because all they hear is the call still ringing. After a certain amount of time 
passes, you can send them directly to voicemail, hangup, run your scripts, or 
anything else you want to do with the call. My dial plan snippet looks like 
this. Just an option. 

 

exten = s,n(ringing),Answer

exten = s,n,PlayTones(ring)

exten = s,n,Ringing

exten = s,n,Wait(${TIMEOUT})

exten = s,n,GotoIf($[${BLOCKDEST} = 3]?s-NA-VOICEMAIL,1)

exten = s,n,GotoIf($[${CUSTCALLBLOCKACTION} = 3]?s-NA-VOICEMAIL,1) ; 

exten = s,n,PlayTones(congestion)

exten = s,n,Congestion(10)

exten = s,n,Hangup

 

Regards;

John V.

 

From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Rafael Visser
Sent: Thursday, August 07, 2014 4:56 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: [asterisk-users] agi get_data noanswer

 

Hi Guys..
I am making an anoucement machine that is not allowed to answer the call due 
to a billing issue.
I found that Playback with noanwser is usefull in this case.

$AGI-exec('Playback',$message,noanswer)}


But when i request some values to the user with get_data, i think there is an 
answer anywere.

Is there a way to get_data without answering the call?

Thanks in advance!!

rv

-- 
_
-- 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] agi get_data noanswer

2014-08-07 Thread Rafael Visser
Hi John.
I am making an inteligent annoucement resouce for a big ericsson switch. Is
just an ivr with agi applications.
The tricky thing try to make asterisk not to send answer. The perl
application with agi commands must be executed with out answering.

Something like

exten = 6009,1,Progress()
exten = 6009,n,Set(__INICIA=${EPOCH})
exten = 6009,n,Set(CHANNEL(language)=sc)
exten = 6009,n,AGI(anouncement.pl)
exten = 6009,n,Hangup()

Thanks anyway.
rv





2014-08-07 17:11 GMT-04:00 Tech Support aster...@voipbusiness.us:

 What you may want to check out is the PlayTones and Ringing
 applications in your dial plan. Asterisk will answer the call, but your
 users won't know that because all they hear is the call still ringing.
 After a certain amount of time passes, you can send them directly to
 voicemail, hangup, run your scripts, or anything else you want to do with
 the call. My dial plan snippet looks like this. Just an option.



 exten = s,n(ringing),Answer

 exten = s,n,PlayTones(ring)

 exten = s,n,Ringing

 exten = s,n,Wait(${TIMEOUT})

 exten = s,n,GotoIf($[${BLOCKDEST} = 3]?s-NA-VOICEMAIL,1)

 exten = s,n,GotoIf($[${CUSTCALLBLOCKACTION} = 3]?s-NA-VOICEMAIL,1) ;

 exten = s,n,PlayTones(congestion)

 exten = s,n,Congestion(10)

 exten = s,n,Hangup



 Regards;

 John V.



 *From:* asterisk-users-boun...@lists.digium.com [mailto:
 asterisk-users-boun...@lists.digium.com] *On Behalf Of *Rafael Visser
 *Sent:* Thursday, August 07, 2014 4:56 PM
 *To:* Asterisk Users Mailing List - Non-Commercial Discussion
 *Subject:* [asterisk-users] agi get_data noanswer



 Hi Guys..
 I am making an anoucement machine that is not allowed to answer the call
 due to a billing issue.
 I found that Playback with noanwser is usefull in this case.

 $AGI-exec('Playback',$message,noanswer)}


 But when i request some values to the user with get_data, i think there is
 an answer anywere.

 Is there a way to get_data without answering the call?

 Thanks in advance!!

 rv

 --
 _
 -- 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] agi get_data noanswer

2014-08-07 Thread Eric Wieling
Generally the only thing you are allowed to do before answer is send audio.  
You can’t receive audio and can’t receive DTMF.   I assume it is to prevent 
people from doing exactly what you  are trying to do --- trying to have two way 
communications without paying for the call.


From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Rafael Visser
Sent: Thursday, August 07, 2014 4:56 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: [asterisk-users] agi get_data noanswer

Hi Guys..
I am making an anoucement machine that is not allowed to answer the call due 
to a billing issue.
I found that Playback with noanwser is usefull in this case.

$AGI-exec('Playback',$message,noanswer)}


But when i request some values to the user with get_data, i think there is an 
answer anywere.

Is there a way to get_data without answering the call?

Thanks in advance!!

rv
-- 
_
-- 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

[asterisk-users] AGI Record File / what does randomerror mean? res_agi.c / line 2377

2014-07-31 Thread Thorsten Göllner

Hi,

I have a question about this here:

Asterisk-Version: 11.10.2
File: res/res_agi.c
Line: 2377

[...]
 static int handle_recordfile(struct ast_channel *chan, AGI *agi, int 
argc, const char * const argv[])

2304 {
2305 struct ast_filestream *fs;
2306 struct ast_frame *f;
2307 struct timeval start;
2308 long sample_offset = 0;
2309 int res = 0;
2310 int ms;
[...]
2365 /* backward compatibility, if no offset given, arg[6] would 
have been
2366  * caught below and taken to be a beep, else if it is a 
digit then it is a

2367  * offset */
2368 if ((argc 6)  (sscanf(argv[6], %30ld, sample_offset) 
!= 1)  (!strchr(argv[6], '=')))
2369 res = ast_streamfile(chan, beep, 
ast_channel_language(chan));

2370
2371 if ((argc  7)  (!strchr(argv[7], '=')))
2372 res = ast_streamfile(chan, beep, 
ast_channel_language(chan));

2373
2374 if (!res)
2375 res = ast_waitstream(chan, argv[4]);
2376 if (res) {
2377 ast_agi_send(agi-fd, chan, 200 result=%d 
(randomerror) endpos=%ld\n, res, sample_offset);

2378 } else {
2379 fs = ast_writefile(argv[2], argv[3], NULL, O_CREAT 
| O_WRONLY | (sample_offset ? O_APPEND : 0), 0, AST_FILE_MODE);

2380 if (!fs) {
2381 res = -1;
2382 ast_agi_send(agi-fd, chan, 200 result=%d 
(writefile)\n, res);

2383 if (sildet)
2384 ast_dsp_free(sildet);
2385 return RESULT_FAILURE;
2386 }

In line 2377 I find randomerror. And in fact I get this error 
sometimes in my AGI-Scripts but can not reproduce them by my own.


Can anybody tell me please, when this message will be fired? I do not 
really understand this source at this point. The message will be sent, 
when res is true (or larger 0). res should be set in the lines 
before. MAYBE res is 0 in line 2377 when the call hangs up at this point?


Best regards
-Thorsten-

--
_
-- 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] AGI script VERBOSE cmd

2014-06-27 Thread Bryant Zimmerman
I am working on an AGI script and all is going well except I can not get 
any of my VERBOSE commands to display.
  
 Is there any undocumented reason for this to occur? I am able to set 
variables, call other commands ect..
  
 I am sending my verbose command in the following format (VERBOSE Message 
to send 4)
  
 Any ideas what I might be doing incorrect?
  
 Thanks

Bryant Zimmerman (ZK Tech Inc.)
616-855-1030 Ext. 2003

-- 
_
-- 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] AGI script VERBOSE cmd

2014-06-27 Thread Rafael Visser
what if yoy change the verbose on the cli?
 cli core set verbose 4
 and then try again

i usually put on my perl agi something like

$verbose=5;
AGI-verbose(the number is $number, $verbose);

hope it helps.

rv


2014-06-27 11:24 GMT-04:00 Bryant Zimmerman brya...@zktech.com:

 I am working on an AGI script and all is going well except I can not get
 any of my VERBOSE commands to display.

 Is there any undocumented reason for this to occur? I am able to set
 variables, call other commands ect..

 I am sending my verbose command in the following format (VERBOSE Message
 to send 4)

 Any ideas what I might be doing incorrect?

 Thanks

 Bryant Zimmerman (ZK Tech Inc.)
 616-855-1030 Ext. 2003

 --
 _
 -- 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] AGI script VERBOSE cmd

2014-06-27 Thread Bryant Zimmerman
Hey all
  
 Please disregard my question. I was looking for the word Verbose to show 
up. I was just being dense.
 There was no real issue it is working just different than what I was 
expecting.
  
 Thanks

Bryant
  


 From: Bryant Zimmerman brya...@zktech.com
Sent: Friday, June 27, 2014 11:25 AM
  I am working on an AGI script and all is going well except I can not get 
any of my VERBOSE commands to display.

   Is there any undocumented reason for this to occur? I am able to set 
variables, call other commands ect..

   I am sending my verbose command in the following format (VERBOSE 
Message to send 4)

   Any ideas what I might be doing incorrect?

   Thanks

Bryant 


-- 
_
-- 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] AGI GET DATA behavior

2014-05-01 Thread Hoggins!
Hello,

Yes, it is fairly simple, really.

And I found out about the return code of Asterisk enabling the agi
debugging, precisely.
The documentation of the GET DATA entry specifies that Asterisk should
either return -1, nothing, or the actual result of what the user
entered, but never 0, am I right ?
(http://www.voip-info.org/wiki/view/get+data)

The problem is that Asterisk's behavior is not constant : 1 time out of
4 or 5, without ANY change in the behavior of the user, Asterisk simply
does not wait for the user input, and returns 0 before the timeout.


Le 30/04/2014 13:10, Thorsten Göllner a écrit :
 Is your script really so simple?

 Enable agi debugging (agi set debug on) and take look at it when this
 happens.


-- 
_
-- 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] AGI GET DATA behavior

2014-05-01 Thread Steve Edwards

Le 30/04/2014 13:10, Thorsten Göllner a écrit :



Is your script really so simple?

Enable agi debugging (agi set debug on) and take look at it when this 
happens.


On Thu, 1 May 2014, Hoggins! wrote:


Yes, it is fairly simple, really.

The problem is that Asterisk's behavior is not constant : 1 time out of 
4 or 5, without ANY change in the behavior of the user, Asterisk simply 
does not wait for the user input, and returns 0 before the timeout.


0) Please don't top-post.

1) Reduce your script to the smallest example that illustrates your issue.

2) Post your script along with console output (with 'core agi set debug 
on,' 'core set debug 99,' and 'core set verbose 99') of a successful and a 
failed call.


--
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

[asterisk-users] AGI GET DATA behavior

2014-04-30 Thread Hoggins!
Hello all,

I have a strange problem with a very simple AGI script, using the GET
DATA command.

When using this command, Asterisk often returns 0 as a result after a
GET DATA beep 5000 command, without even waiting for input from the
calling party.
It is quite random : sometimes Asterisk behaves exactly as documented,
and sometimes it gives 200 result=0 without any reason.

Do you have an idea of what might be happening ? I'm using version 11.6.0.

Hoggins!

-- 
_
-- 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] AGI GET DATA behavior

2014-04-30 Thread Thorsten Göllner

Is your script really so simple?

Enable agi debugging (agi set debug on) and take look at it when this 
happens.


-Thorsten-

Am 30.04.2014 11:47, schrieb Hoggins!:

Hello all,

I have a strange problem with a very simple AGI script, using the GET
DATA command.

When using this command, Asterisk often returns 0 as a result after a
GET DATA beep 5000 command, without even waiting for input from the
calling party.
It is quite random : sometimes Asterisk behaves exactly as documented,
and sometimes it gives 200 result=0 without any reason.

Do you have an idea of what might be happening ? I'm using version 11.6.0.

 Hoggins!



--
_
-- 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] AGI Script not working

2013-12-02 Thread Gopalakrishnan N
Library is Asterisk Perl library and module DBI. The same script working in
different machine with same Asterisk version and same Perl version. Am able
to see Tx and Rx from script.




On Mon, Dec 2, 2013 at 8:08 AM, Eric Wieling ewiel...@nyigc.com wrote:

 Sounds like you are violating the AGI protocol.   Which Perl AGI library
 are you using?


 -Original Message-
 From: asterisk-users-boun...@lists.digium.com [mailto:
 asterisk-users-boun...@lists.digium.com] On Behalf Of Gopalakrishnan N
 Sent: Saturday, November 30, 2013 1:27 AM
 To: Asterisk Users Mailing List - Non-Commercial Discussion
 Subject: [asterisk-users] AGI Script not working

 I have a Perl AGI script updating some values to database like recorded
 file path, unique ID and callerid. When I run the script with test
 dialplan, its not updating to database.

 Whereas database connection is fine, when I run agi debug I see only Tx
 packets not Rx packets, firewall is also OFF.

 Any other specific reason why there is no Rx.

 The same script working in one more Asterisk machine.

 Regards

 --
 _
 -- 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] AGI Script not working

2013-12-02 Thread Gopalakrishnan N
Thanks... I got it working actually I found with this command /usr/bin/perl
-d agi file name from this I got to know that my library is missing and
installed Asterisk-perl module and now its fine.

Once again thank you.


On Mon, Dec 2, 2013 at 3:05 PM, Gopalakrishnan N 
gopalakrishnan...@gmail.com wrote:

 Library is Asterisk Perl library and module DBI. The same script working
 in different machine with same Asterisk version and same Perl version. Am
 able to see Tx and Rx from script.




 On Mon, Dec 2, 2013 at 8:08 AM, Eric Wieling ewiel...@nyigc.com wrote:

 Sounds like you are violating the AGI protocol.   Which Perl AGI library
 are you using?


 -Original Message-
 From: asterisk-users-boun...@lists.digium.com [mailto:
 asterisk-users-boun...@lists.digium.com] On Behalf Of Gopalakrishnan N
 Sent: Saturday, November 30, 2013 1:27 AM
 To: Asterisk Users Mailing List - Non-Commercial Discussion
 Subject: [asterisk-users] AGI Script not working

 I have a Perl AGI script updating some values to database like recorded
 file path, unique ID and callerid. When I run the script with test
 dialplan, its not updating to database.

 Whereas database connection is fine, when I run agi debug I see only Tx
 packets not Rx packets, firewall is also OFF.

 Any other specific reason why there is no Rx.

 The same script working in one more Asterisk machine.

 Regards

 --
 _
 -- 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] AGI Script not working

2013-12-01 Thread Eric Wieling
Sounds like you are violating the AGI protocol.   Which Perl AGI library are 
you using? 


-Original Message-
From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Gopalakrishnan N
Sent: Saturday, November 30, 2013 1:27 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: [asterisk-users] AGI Script not working

I have a Perl AGI script updating some values to database like recorded file 
path, unique ID and callerid. When I run the script with test dialplan, its not 
updating to database.

Whereas database connection is fine, when I run agi debug I see only Tx packets 
not Rx packets, firewall is also OFF. 

Any other specific reason why there is no Rx. 

The same script working in one more Asterisk machine. 

Regards

-- 
_
-- 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


[asterisk-users] AGI Script not working

2013-11-29 Thread Gopalakrishnan N
I have a Perl AGI script updating some values to database like recorded
file path, unique ID and callerid. When I run the script with test
dialplan, its not updating to database.

Whereas database connection is fine, when I run agi debug I see only Tx
packets not Rx packets, firewall is also OFF.

Any other specific reason why there is no Rx.

The same script working in one more Asterisk machine.

Regards
-- 
_
-- 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

[asterisk-users] AGI return codes

2013-03-20 Thread Ishfaq Malik
Hi

Does anyone know what the different return codes from AGI script
execution mean? I'm getting a lot of

AGI Script script-name completed, returning 4

I'm using asterisk 1.8.7.0

Thanks in advance
-- 
Ishfaq Malik i...@pack-net.co.uk
Department: VOIP Support
Company: Packnet Limited
t: +44 (0)845 004 4994
f: +44 (0)161 660 9825
e: i...@pack-net.co.uk
w: http://www.pack-net.co.uk

Registered Address: PACKNET LIMITED, 2A ENTERPRISE HOUSE, LLOYD STREET
NORTH, MANCHESTER
SCIENCE PARK, MANCHESTER, M156SE
COMPANY REG NO. 04920552


--
_
-- 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] AGI return codes

2013-03-20 Thread A J Stiles
On Wednesday 20 March 2013, Ishfaq Malik wrote:
 Hi
 
 Does anyone know what the different return codes from AGI script
 execution mean? I'm getting a lot of
 
 AGI Script script-name completed, returning 4
 
 I'm using asterisk 1.8.7.0
 
 Thanks in advance

You need to check the exit statements within the AGI scripts in question.  
Different exit values usually mean different things have happened.  Typically 0 
is the most favourable exit value, i.e. everything O.K., and non-zero exit 
values indicate errors.

If the authors of the scripts were nice, then they will have provided a list 
of possible exit values in the documentation, or in the script comments.

-- 
AJS

Answers come *after* questions.

--
_
-- 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] AGI return codes

2013-03-20 Thread Ishfaq Malik
On Wed, 2013-03-20 at 11:07 +, A J Stiles wrote:
 On Wednesday 20 March 2013, Ishfaq Malik wrote:
  Hi
  
  Does anyone know what the different return codes from AGI script
  execution mean? I'm getting a lot of
  
  AGI Script script-name completed, returning 4
  
  I'm using asterisk 1.8.7.0
  
  Thanks in advance
 
 You need to check the exit statements within the AGI scripts in question.  
 Different exit values usually mean different things have happened.  Typically 
 0 
 is the most favourable exit value, i.e. everything O.K., and non-zero exit 
 values indicate errors.
 
 If the authors of the scripts were nice, then they will have provided a list 
 of possible exit values in the documentation, or in the script comments.
 

I wrote the script! I've not put exit status values in it either. 

I've been having a look the source for res_agi_c (as a non c coder) and
there is a variable called returnstatus which is instantiated with the
value AGI_RESULT_SUCCESS which I assume is a constant defined elsewhere.
This variable is where the 4 is coming from.

There are other constants referred to as well so I'm trying to work out
which one equates to 4 to give me more of an idea of why the script is
failing.

-- 
Ishfaq Malik i...@pack-net.co.uk
Department: VOIP Support
Company: Packnet Limited
t: +44 (0)845 004 4994
f: +44 (0)161 660 9825
e: i...@pack-net.co.uk
w: http://www.pack-net.co.uk

Registered Address: PACKNET LIMITED, 2A ENTERPRISE HOUSE, LLOYD STREET
NORTH, MANCHESTER
SCIENCE PARK, MANCHESTER, M156SE
COMPANY REG NO. 04920552


--
_
-- 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] AGI return codes

2013-03-20 Thread Andrew Yager

On 20/03/2013, at 10:15 PM, Ishfaq Malik i...@pack-net.co.uk wrote:

 I wrote the script! I've not put exit status values in it either. 
 
 I've been having a look the source for res_agi_c (as a non c coder) and
 there is a variable called returnstatus which is instantiated with the
 value AGI_RESULT_SUCCESS which I assume is a constant defined elsewhere.
 This variable is where the 4 is coming from.
 
 There are other constants referred to as well so I'm trying to work out
 which one equates to 4 to give me more of an idea of why the script is
 failing.

Return codes can be set by you, or can be returned from the scripting language 
you work in.

If you were working in Perl, for instance, a return code of 4 means Interrupted 
System Call.

Check the documentation for your language for a better idea. Also try running 
your script as the user that Asterisk runs as. Maybe asterisk doesn't have 
permissions to execute the script. One way to do this is via the sudo 
command, e.g. sudo -u asterisk path to agi-script

Thanks,
Andrew
--
_
-- 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] AGI return codes

2013-03-20 Thread Ishfaq Malik
On Wed, 2013-03-20 at 22:32 +1100, Andrew Yager wrote:
 On 20/03/2013, at 10:15 PM, Ishfaq Malik i...@pack-net.co.uk wrote:
 
  I wrote the script! I've not put exit status values in it either. 
  
  I've been having a look the source for res_agi_c (as a non c coder) and
  there is a variable called returnstatus which is instantiated with the
  value AGI_RESULT_SUCCESS which I assume is a constant defined elsewhere.
  This variable is where the 4 is coming from.
  
  There are other constants referred to as well so I'm trying to work out
  which one equates to 4 to give me more of an idea of why the script is
  failing.
 
 Return codes can be set by you, or can be returned from the scripting 
 language you work in.
 
 If you were working in Perl, for instance, a return code of 4 means 
 Interrupted System Call.
 
 Check the documentation for your language for a better idea. Also try running 
 your script as the user that Asterisk runs as. Maybe asterisk doesn't have 
 permissions to execute the script. One way to do this is via the sudo 
 command, e.g. sudo -u asterisk path to agi-script
 
 Thanks,
 Andrew

Hi Andrew

Thanks for the advice, I will look into it (I'm using php)

The script executes successfully over 99% of the time, it is run very
very frequently. I'm trying to track down why the 1% failures are
happening which is always a bit trickier than tracking down why a script
always fails!

Ish
-- 
Ishfaq Malik i...@pack-net.co.uk
Department: VOIP Support
Company: Packnet Limited
t: +44 (0)845 004 4994
f: +44 (0)161 660 9825
e: i...@pack-net.co.uk
w: http://www.pack-net.co.uk

Registered Address: PACKNET LIMITED, 2A ENTERPRISE HOUSE, LLOYD STREET
NORTH, MANCHESTER
SCIENCE PARK, MANCHESTER, M156SE
COMPANY REG NO. 04920552


--
_
-- 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] AGI return codes

2013-03-20 Thread Andrew Yager
Hi Ishfaq,
On 20/03/2013, at 10:46 PM, Ishfaq Malik i...@pack-net.co.uk wrote:

 On Wed, 2013-03-20 at 22:32 +1100, Andrew Yager wrote:
 
 Hi Andrew
 
 Thanks for the advice, I will look into it (I'm using php)
 
 The script executes successfully over 99% of the time, it is run very
 very frequently. I'm trying to track down why the 1% failures are
 happening which is always a bit trickier than tracking down why a script
 always fails!
 

In these cases it's always (very) good to think about attaching standard 
debugging tools like strace to the asterisk process or your AGI to see what's 
going on.

The use of good debug logging (make sure you output information to a file on 
the file system) to help you keep track of what your script is doing will also 
be very useful, and a lot less headachy than attaching strafe to a php or 
asterisk process.

Thanks,
Andrew
--
_
-- 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] AGI return codes

2013-03-20 Thread Ishfaq Malik
On Wed, 2013-03-20 at 22:52 +1100, Andrew Yager wrote:
 Hi Ishfaq,
 On 20/03/2013, at 10:46 PM, Ishfaq Malik i...@pack-net.co.uk wrote:
 
  On Wed, 2013-03-20 at 22:32 +1100, Andrew Yager wrote:
  
  Hi Andrew
  
  Thanks for the advice, I will look into it (I'm using php)
  
  The script executes successfully over 99% of the time, it is run very
  very frequently. I'm trying to track down why the 1% failures are
  happening which is always a bit trickier than tracking down why a script
  always fails!
  
 
 In these cases it's always (very) good to think about attaching standard 
 debugging tools like strace to the asterisk process or your AGI to see what's 
 going on.
 
 The use of good debug logging (make sure you output information to a file on 
 the file system) to help you keep track of what your script is doing will 
 also be very useful, and a lot less headachy than attaching strafe to a php 
 or asterisk process.
 
 Thanks,
 Andrew

Hi Andrew

I have an even simpler fix for this particular script. This one isn't
really a true AGI script, all it's doing is taking the arguments
presented to it and logging them in a db table.

I'm going to try the system command instead, should have done that in
the first place but the AGI command was just my 'goto place'...

Thanks for all the advice though

-- 
Ishfaq Malik i...@pack-net.co.uk
Department: VOIP Support
Company: Packnet Limited
t: +44 (0)845 004 4994
f: +44 (0)161 660 9825
e: i...@pack-net.co.uk
w: http://www.pack-net.co.uk

Registered Address: PACKNET LIMITED, 2A ENTERPRISE HOUSE, LLOYD STREET
NORTH, MANCHESTER
SCIENCE PARK, MANCHESTER, M156SE
COMPANY REG NO. 04920552


--
_
-- 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] AGI return codes

2013-03-20 Thread Asghar Mohammad
Hi ishfaq,
if you want just loging some info into db you can do in dialplan without
any AGI.
i am doing billing on the fly in dialplan and mysql for every single user
without AGI and enhanced call capacity almost double.
let me know you need some examples.

On Wed, Mar 20, 2013 at 12:56 PM, Ishfaq Malik i...@pack-net.co.uk wrote:

 On Wed, 2013-03-20 at 22:52 +1100, Andrew Yager wrote:
  Hi Ishfaq,
  On 20/03/2013, at 10:46 PM, Ishfaq Malik i...@pack-net.co.uk wrote:
 
   On Wed, 2013-03-20 at 22:32 +1100, Andrew Yager wrote:
  
   Hi Andrew
  
   Thanks for the advice, I will look into it (I'm using php)
  
   The script executes successfully over 99% of the time, it is run very
   very frequently. I'm trying to track down why the 1% failures are
   happening which is always a bit trickier than tracking down why a
 script
   always fails!
  
 
  In these cases it's always (very) good to think about attaching standard
 debugging tools like strace to the asterisk process or your AGI to see
 what's going on.
 
  The use of good debug logging (make sure you output information to a
 file on the file system) to help you keep track of what your script is
 doing will also be very useful, and a lot less headachy than attaching
 strafe to a php or asterisk process.
 
  Thanks,
  Andrew

 Hi Andrew

 I have an even simpler fix for this particular script. This one isn't
 really a true AGI script, all it's doing is taking the arguments
 presented to it and logging them in a db table.

 I'm going to try the system command instead, should have done that in
 the first place but the AGI command was just my 'goto place'...

 Thanks for all the advice though

 --
 Ishfaq Malik i...@pack-net.co.uk
 Department: VOIP Support
 Company: Packnet Limited
 t: +44 (0)845 004 4994
 f: +44 (0)161 660 9825
 e: i...@pack-net.co.uk
 w: http://www.pack-net.co.uk

 Registered Address: PACKNET LIMITED, 2A ENTERPRISE HOUSE, LLOYD STREET
 NORTH, MANCHESTER
 SCIENCE PARK, MANCHESTER, M156SE
 COMPANY REG NO. 04920552


 --
 _
 -- 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] AGI return codes

2013-03-20 Thread A J Stiles
On Wednesday 20 March 2013, Ishfaq Malik wrote:
 I have an even simpler fix for this particular script. This one isn't
 really a true AGI script, all it's doing is taking the arguments
 presented to it and logging them in a db table.
 
 I'm going to try the system command instead, should have done that in
 the first place but the AGI command was just my 'goto place'...

I bet there's a problem with the data, which is causing the INSERT to fail 
sometimes.  Get your script to log its inputs to a file; then log the INSERT 
as soon as you've constructed it, and the query status immediately after the 
query has been performed.  If the query fails, the script won't get far enough 
to log the status.

By the way, it will almost certainly turn out to be caused by speech marks in 
the data.  That's about as reliable a long-distance diagnosis for a PHP / SQL 
issue as saying a central heating fault is due to the diverter valve.

-- 
AJS

Answers come *after* questions.

--
_
-- 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] AGI

2013-03-18 Thread Gustavo Salvador
Thanks,

You are right, the bash version should be:

#!bin/bash

#Get and spawn AGI variables
declare -a array
while read -e ARG  [ $ARG ]; do
array=(` echo $ARG | sed -e 's/://'`)
export ${array[0]}={array[1]}
done
echo EXEC \Dial\ \DAHDI/g2/$agi_dnid\

#Get execution answer
answer=read line

Yes, it could also be written using C instead.


Regards

Gustavo

--
_
-- 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] AGI

2013-03-15 Thread Gustavo Salvador
Hi, 
Thank you. The reason I have not to use an AGI library and also use bash shells 
is because the asterisk box I'm working on, have not AGI library, there is 
installed on a basic first version of Centos, and it is not an asterisk pure 
box. It's from a vendor, and also have some annoyances specially with the 
settings and configuration files. And I can not upgrade it, because it is 
running production.

By the way, I have just get what I need.
The bash shell if anyone is interested is:

#!/usr/bin/bash
echo EXEC \Dial\ \DAHDI/g2/$1\
read line

AGI invocation:
AGI(agiFile.agi,${CALLERID(num)})

Regards,

Gustavo

El 14/03/2013, a las 17:24, Steve Edwards asterisk@sedwards.com escribió:

 (A more specific subject may yield better answers -- better bait == better 
 fish.)
 
 On Thu, 14 Mar 2013, Gustavo Salvador wrote:
 
 Does any one knows how to place a call from a shell agi? I guess is 
 something like echo Exec Dial(DAHDI/g2/2010,,W).
 
 While you can write an AGI in any language that has reasonable STDIN/STDOUT 
 facilities (fortran was a little bit frustrating), a shell language like bash 
 would not be my first choice.
 
 Is there any reason you are not open to using a more 'mainstream' scripting 
 language like Perl or PHP? You'll find more people with that experience 
 willing to help.
 
 My personal favorite is to use C because I know it best and because it is a 
 compiled language so your AGIs execute 'instantaneously.'
 
 Whatever language you choose, use an established library for the AGI 
 protocol. Nobody gets it right the first time.
 
 Algo how i get the dnid variable?
 
 This implies that you need to read up a bit on the AGI protocol. The second* 
 thing an AGI should to is read the AGI variables -- one of which is agi_dnid.
 
 You can pass command line parameters to your AGI when you execute the agi() 
 function in your dialplan. For example:
 
exten = *,n,agi(my-first-agi,${AGENT-ID})
 
 Your AGI can then access the command line arguments as you would
 normally expect for a program executed from a shell -- $argv[1],
 $argv[2], etc for PHP.
 
 Personally, I dislike 'positional' parameters. I prefer to use the
 getopt_long() function so my dialplan is 'self-documenting' and easier
 to maintain so for me, the same command would look like:
 
exten = *,n,agi(my-first-agi,--agent-id=${AGENT-ID})
 
 The difference is not all that apparent with a single parameter, but if you 
 have a half-dozen, it is much more obvious and once you've make the change, 
 you will always use it for consistency.
 
 *) The first thing an AGI should do is set up a signal handler to catch 
 'SIGHUP' if the channel is hung up prematurely.
 
 -- 
 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] AGI

2013-03-15 Thread Steve Edwards

Please don't top post.

On Fri, 15 Mar 2013, Gustavo Salvador wrote:

The reason I have not to use an AGI library and also use bash shells is 
because the asterisk box I'm working on, have not AGI library, there is 
installed on a basic first version of Centos, and it is not an asterisk 
pure box. It's from a vendor, and also have some annoyances specially 
with the settings and configuration files. And I can not upgrade it, 
because it is running production.


By the way, I have just get what I need. The bash shell if anyone is 
interested is:


#!/usr/bin/bash
echo EXEC \Dial\ \DAHDI/g2/$1\
read line


Can we at least pretend to follow the protocol? :)

#!/bin/bash

# discard the AGI variables
while   [ -s $(read) ]
do
:
done

# dial the number from the command line
echo exec dial dahdi/g2/$1

# ignore the response
read

# (end of agiFile.agi)

At least this way, the 'next guy' won't pull out his hair wondering why 
the response to 'dial' is 'agi_request: agiFile.agi'


BTW, you do not have to name an AGI 'example.agi'. 'example.sh' or just 
'example' will do just fine.


If you don't have PHP or Perl, how about C? You could always compile on a 
VM on another box.


--
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


[asterisk-users] AGI

2013-03-14 Thread Gustavo Salvador
Hi everybody,
Does any one knows how to place a call from a shell agi? I guess is something 
like  echo Exec Dial(DAHDI/g2/2010,,W). Algo how i get the dnid variable?
Thanks.

--
_
-- 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] AGI

2013-03-14 Thread Steve Edwards
(A more specific subject may yield better answers -- better bait == better 
fish.)


On Thu, 14 Mar 2013, Gustavo Salvador wrote:

Does any one knows how to place a call from a shell agi? I guess is 
something like echo Exec Dial(DAHDI/g2/2010,,W).


While you can write an AGI in any language that has reasonable 
STDIN/STDOUT facilities (fortran was a little bit frustrating), a shell 
language like bash would not be my first choice.


Is there any reason you are not open to using a more 'mainstream' 
scripting language like Perl or PHP? You'll find more people with that 
experience willing to help.


My personal favorite is to use C because I know it best and because it is 
a compiled language so your AGIs execute 'instantaneously.'


Whatever language you choose, use an established library for the AGI 
protocol. Nobody gets it right the first time.



Algo how i get the dnid variable?


This implies that you need to read up a bit on the AGI protocol. The 
second* thing an AGI should to is read the AGI variables -- one of which 
is agi_dnid.


You can pass command line parameters to your AGI when you execute the agi() 
function in your dialplan. For example:


exten = *,n,agi(my-first-agi,${AGENT-ID})

Your AGI can then access the command line arguments as you would
normally expect for a program executed from a shell -- $argv[1],
$argv[2], etc for PHP.

Personally, I dislike 'positional' parameters. I prefer to use the
getopt_long() function so my dialplan is 'self-documenting' and easier
to maintain so for me, the same command would look like:

exten = *,n,agi(my-first-agi,--agent-id=${AGENT-ID})

The difference is not all that apparent with a single parameter, but if 
you have a half-dozen, it is much more obvious and once you've make the 
change, you will always use it for consistency.


*) The first thing an AGI should do is set up a signal handler to catch 
'SIGHUP' if the channel is hung up prematurely.


--
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] AGI Script

2013-03-07 Thread Gustavo Salvador


 Hi, thanks.
 
 
 .Did that include 'agi set debug on?'
 Yes, that include this command.
  
 Can you 'cut-n-paste' the relevant 'sanitized' console output?
 Ok. This is:
  trixbox146002*CLI 
 -- Launched AGI Script /var/lib/asterisk/agi-bin/agi-test.agi
 trixbox146002*CLI 
 SIP/INCONCERT-35d2AGI Tx  agi_request: agi-test.agi
 SIP/INCONCERT-35d2AGI Tx  agi_channel: SIP/INCONCERT-35d2
 trixbox146002*CLI 
 SIP/INCONCERT-35d2AGI Tx  agi_language: en
 trixbox146002*CLI 
 SIP/INCONCERT-35d2AGI Tx  agi_type: SIP
 trixbox146002*CLI 
 SIP/INCONCERT-35d2AGI Tx  agi_uniqueid: 1362669295.35561
 trixbox146002*CLI 
 SIP/INCONCERT-35d2AGI Tx  agi_version: 1.6.0.28-samy-r100
 SIP/INCONCERT-35d2AGI Tx  agi_callerid: 1044
 trixbox146002*CLI 
 SIP/INCONCERT-35d2AGI Tx  agi_calleridname: 1044
 trixbox146002*CLI 
 SIP/INCONCERT-35d2AGI Tx  agi_callingpres: 0
 trixbox146002*CLI 
 SIP/INCONCERT-35d2AGI Tx  agi_callingani2: 0
 trixbox146002*CLI 
 SIP/INCONCERT-35d2AGI Tx  agi_callington: 0
 trixbox146002*CLI 
 SIP/INCONCERT-35d2AGI Tx  agi_callingtns: 0
 trixbox146002*CLI 
 SIP/INCONCERT-35d2AGI Tx  agi_dnid: 701820101044
 trixbox146002*CLI 
 SIP/INCONCERT-35d2AGI Tx  agi_rdnis: unknown
 trixbox146002*CLI 
 SIP/INCONCERT-35d2AGI Tx  agi_context: ModernaDesv_E1
 trixbox146002*CLI 
 SIP/INCONCERT-35d2AGI Tx  agi_extension: s
 trixbox146002*CLI 
 SIP/INCONCERT-35d2AGI Tx  agi_priority: 3
 trixbox146002*CLI 
 SIP/INCONCERT-35d2AGI Tx  agi_enhanced: 0.0
 trixbox146002*CLI 
 SIP/INCONCERT-35d2AGI Tx  agi_accountcode: 
 trixbox146002*CLI 
 SIP/INCONCERT-35d2AGI Tx  agi_threadid: 29367216
 trixbox146002*CLI 
 SIP/INCONCERT-35d2AGI Tx  
 trixbox146002*CLI 
 [Mar  7 10:14:55] NOTICE[32548]: channel.c:3051 __ast_read: Dropping 
 incompatible voice frame on SIP/INCONCERT-35d2 of format ulaw since our 
 native format has changed to 0x8 (alaw)
 trixbox146002*CLI 
 -- SIP/INCONCERT-35d2AGI Script agi-test.agi completed, returning 0
 
 I looked through my AGIs and find I always set channel variables and let the 
 dialplan do the actual dial().
 
 1) Is your AGI exiting before the dial() completes?
 Yes.
  
 2) If you execute the same dial() command from the 'AGI debug output' (which 
 should show the expanded variables) in your dialplan, does that yield andy 
 clues?
 How I do that? I just use the AMI command originate. Executing this with the 
 protocol already works, but not ring.
 
 3) If you use another technology like SIP can you enable SIP debugging and 
 observe the SIP dialog?
 I can not use SIP because the call goes out to E1.
  
 Regards,
 
 Gustavo 
--
_
-- 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

[asterisk-users] AGI Script

2013-03-06 Thread Gustavo Salvador
 
 Hi every body,
 
 Please if some one could help me with this:
 I'm writing an AGU Perl Script which basically makes a call using an 
 extension provided by other asterisk box to an E1. The asterisk version is 
 1.6.0.28, so it hasn't the Wellington know AGI class. The code is as follows:
 
 =
 #!/usr/bin/perl
 use strict;
 
 my %AGI;
 :
 print EXEC Dial(DAHDI/g2/$AGI{dnid},,W);
 =
 
 When dialplan executes the AGI, asterisk throw the following error: Dropping 
 incompatible voice fraile on SIP/INCONCERT-4796 of formar ulaw since our 
 native format has changed to 0x8 (alaw).
 
 And connection is never make.
 
 It's the code OK?, I'm newbie on asterisk, and really don't know what is 
 going wrong.
 
 Regards,
 
 Gustavo

--
_
-- 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] AGI Script

2013-03-06 Thread Gertjan Baarda
Might be a codec issue, try allow=all in your sip.conf

Sent from my iPhone

On 6 mrt. 2013, at 17:49, Gustavo Salvador
gustavo.salvador...@gmail.com wrote:


 Hi every body,

 Please if some one could help me with this:
 I'm writing an AGU Perl Script which basically makes a call using an 
 extension provided by other asterisk box to an E1. The asterisk version is 
 1.6.0.28, so it hasn't the Wellington know AGI class. The code is as follows:

 =
 #!/usr/bin/perl
 use strict;

 my %AGI;
 :
 print EXEC Dial(DAHDI/g2/$AGI{dnid},,W);
 =

 When dialplan executes the AGI, asterisk throw the following error: 
 Dropping incompatible voice fraile on SIP/INCONCERT-4796 of formar ulaw 
 since our native format has changed to 0x8 (alaw).

 And connection is never make.

 It's the code OK?, I'm newbie on asterisk, and really don't know what is 
 going wrong.

 Regards,

 Gustavo

 --
 _
 -- 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] AGI Script

2013-03-06 Thread Gustavo Salvador
Thanks,

But SIP uses the caller box to send the call to the second box where is running 
the AGI script, the second box uses DAHDI to routes the call to E1. I've tested 
the codec routing a call between a E1 extension and a local one with the 
originate extension command and works.
So that is because I'm loose with this

Regards,

Gustavo

On 06/03/2013, at 12:12, Gertjan Baarda gertjan.baa...@gmail.com wrote:

 Might be a codec issue, try allow=all in your sip.conf
 
 Sent from my iPhone
 
 On 6 mrt. 2013, at 17:49, Gustavo Salvador
 gustavo.salvador...@gmail.com wrote:
 
 
 Hi every body,
 
 Please if some one could help me with this:
 I'm writing an AGU Perl Script which basically makes a call using an 
 extension provided by other asterisk box to an E1. The asterisk version is 
 1.6.0.28, so it hasn't the Wellington know AGI class. The code is as 
 follows:
 
 =
 #!/usr/bin/perl
 use strict;
 
 my %AGI;
 :
 print EXEC Dial(DAHDI/g2/$AGI{dnid},,W);
 =
 
 When dialplan executes the AGI, asterisk throw the following error: 
 Dropping incompatible voice fraile on SIP/INCONCERT-4796 of formar 
 ulaw since our native format has changed to 0x8 (alaw).
 
 And connection is never make.
 
 It's the code OK?, I'm newbie on asterisk, and really don't know what is 
 going wrong.
 
 Regards,
 
 Gustavo
 
 --
 _
 -- 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] AGI Script

2013-03-06 Thread Steve Edwards

On Wed, 6 Mar 2013, Gustavo Salvador wrote:


I'm writing an AGI Perl Script...



=
#!/usr/bin/perl
use strict;

my %AGI;
:
print EXEC Dial(DAHDI/g2/$AGI{dnid},,W);
=


Is this your entire script or just a snippet? If this is all, this is not 
an AGI.


An AGI is an executable that follows the AGI protocol. At a minimum, this 
means:


1) Read the AGI variables from STDIN.

2) Write an AGI request to STDOUT.

3) Read the AGI response from STDIN.

4) Repeat steps 2  3 as needed.

Asterisk creates the process executing your AGI and sends a bunch of cruft 
to it via the process's STDIN. If you don't read this, even if you don't 
need to use the variables, your AGI will not execute correctly and 
reliably.


If you do not read the response after every request, your AGI will not 
execute correctly and reliably.


Most people use an established AGI library since nobody understands the 
implications of the protocol correctly the first time.


Can you enable AGI debugging on the Asterisk console and see if that 
yields any clues?


When dialplan executes the AGI, asterisk throw the following error: 
Dropping incompatible voice fraile on SIP/INCONCERT-4796 of formar 
ulaw since our native format has changed to 0x8 (alaw).


(Actual 'cut-n-paste' is better than 'retyping' console output.)

I think if you take another look, this is a warning, not an error. No big 
deal, it means just what it says, just ignore it.


--
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] AGI Script

2013-03-06 Thread Gustavo Salvador
Thanks Steve,

That was just a snippet, the complete script is as follow:

#!/usr/bin/perl

use strict;


$|=1;


# Setup some variables

my %AGI; my $tests = 0; my $fail = 0; my $pass = 0;

my $key; my $value;


while(STDIN) {

chomp;

last unless length($_);

if (/^agi_(\w+)\:\s+(.*)$/) {

$AGI{$1} = $2;

}

}


print STDERR AGI Environment Dump:\n;

foreach my $i (sort keys %AGI) {

print STDERR  -- $i = $AGI{$i}\n;

}


sub checkresult {

my ($res) = @_;

my $retval;

$tests++;

chomp $res;

if ($res =~ /^200/) {

$res =~ /result=(-?\d+)/;

if (!length($1)) {

print STDERR FAIL ($res)\n;

$fail++;

} else {

print STDERR PASS ($1)\n;

$pass++;

}

} else {

print STDERR FAIL (unexpected result '$res')\n;

$fail++;

}

}


my $count = keys(%AGI);

print EXEC Dial('DAHDI/g2/$AGI{dnid},,W');

my $result = STDIN;

checkresult($result);

There I'm not using the AGI class because as test not works ( seems to me 
because it is not there within this asterisk version) . I have tested the 
Script communication with asterisk works making it to execute a voice prompt.

I have run asterisk in verbose mode, and also set on the debug, but the only 
clue I have is just this error.

Regards,

Gustavo

On 06/03/2013, at 13:24, Steve Edwards asterisk@sedwards.com wrote:

 On Wed, 6 Mar 2013, Gustavo Salvador wrote:
 
 I'm writing an AGI Perl Script...
 
 =
 #!/usr/bin/perl
 use strict;
 
 my %AGI;
 :
 print EXEC Dial(DAHDI/g2/$AGI{dnid},,W);
 =
 
 Is this your entire script or just a snippet? If this is all, this is not an 
 AGI.
 
 An AGI is an executable that follows the AGI protocol. At a minimum, this 
 means:
 
 1) Read the AGI variables from STDIN.
 
 2) Write an AGI request to STDOUT.
 
 3) Read the AGI response from STDIN.
 
 4) Repeat steps 2  3 as needed.
 
 Asterisk creates the process executing your AGI and sends a bunch of cruft to 
 it via the process's STDIN. If you don't read this, even if you don't need to 
 use the variables, your AGI will not execute correctly and reliably.
 
 If you do not read the response after every request, your AGI will not 
 execute correctly and reliably.
 
 Most people use an established AGI library since nobody understands the 
 implications of the protocol correctly the first time.
 
 Can you enable AGI debugging on the Asterisk console and see if that yields 
 any clues?
 
 When dialplan executes the AGI, asterisk throw the following error: 
 Dropping incompatible voice fraile on SIP/INCONCERT-4796 of formar 
 ulaw since our native format has changed to 0x8 (alaw).
 
 (Actual 'cut-n-paste' is better than 'retyping' console output.)
 
 I think if you take another look, this is a warning, not an error. No big 
 deal, it means just what it says, just ignore it.
 
 -- 
 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] AGI Script

2013-03-06 Thread Steve Edwards

Please don't top-post...

On 06/03/2013, at 13:24, Steve Edwards asterisk@sedwards.com 
wrote:


Can you enable AGI debugging on the Asterisk console and see if that 
yields any clues?


On Wed, 6 Mar 2013, Gustavo Salvador wrote:

I have run asterisk in verbose mode, and also set on the debug, but the 
only clue I have is just this error.


Did that include 'agi set debug on?'

Can you 'cut-n-paste' the relevant 'sanitized' console output?

I looked through my AGIs and find I always set channel variables and let 
the dialplan do the actual dial().


1) Is your AGI exiting before the dial() completes?

2) If you execute the same dial() command from the 'AGI debug output' 
(which should show the expanded variables) in your dialplan, does that 
yield andy clues?


3) If you use another technology like SIP can you enable SIP debugging and 
observe the SIP dialog?


--
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] AGI command

2013-01-20 Thread Muhammad
Thanks Salman.
Here is my cli debug when run agi:


-- Launched AGI Script /var/lib/asterisk/agi-bin/testAGI.php
-- SIP/101-0007AGI Script testAGI.php completed, returning 0


and here is my php agi source code:

#!/usr/bin/php -q
?php

error_reporting(E_ALL);
ob_implicit_flush(false);
set_time_limit(6);
$stdin = fopen('php://stdin', 'r');
$stdlog = fopen('tmp/agi_log.log', 'w');
$debug = false;
// Read input from Asterisk and output via $astOutput *
function astRead()
{
global $stdin, $debug, $stdlog;
$astOutput = str_replace(\n, , fgets($stdin, 4096));
 if ($debug) fputs($stdlog, read: $input\n);
return $astOutput;
}
// Write AGI command to Asterisk
function astWrite($agiCommand)
{
global $debug, $stdlog;
if ($debug) fputs($stdlog, write: $agiCommand\n);
 echo $agiCommand.\n;
}
// Handling execution input from Asterisk
while (!feof($stdin))
{
$temp = fgets($stdin);
$temp = str_replace(\n,,$temp);
$s = explode(:,$temp);
$agivar[$s[0]] = trim($s[1]);
if ($temp == )
{
break;
}
}
// Operational Code starts here

astWrite(STREAM FILE demo-congrats #);
astRead();
astWrite(SAY NUMBER 123456 #);
astRead();

// Finalization of AGI script and clean-ups
fclose ($stdin);
fclose ($stdlog);
exit(0);


as you see, it was return 0. agi is running successful or not?

[from-internal]
exten = _X.,1,NOOP(++Invoking AGI Script now(before agi): MGH)
exten = _X.,2,AGI(testAGI.php)
exten = _X.,3,NOOP(***After AGI)
exten = _X.,100,DeadAGI(getCDRLog.php)





On Sat, Jan 19, 2013 at 11:49 AM, Salman Zafar msalman...@gmail.com wrote:

 You seriously need to go through Asterisk text books available online or
 at-least read the manual.

 NoOP is just a No Operation, so its just printing text in your case.

 To execute an AGI you need to call it from dialpan like exten =
 _X.,n,AGI(name_of_AGI), agi should be appropriate directory, which I reckon
 you already know.



 On Sat, Jan 19, 2013 at 1:06 PM, Muhammad mohammad.ghaz...@gmail.comwrote:

 Thanks Steve.

 but explain me more about your dialplan codes. Im a beginner.


 exten = _X.,1,NOOP(Invoking AGI Script now)

 what is Invoking AGI Script now and what should I do in this method?

 what is _X. it seems it is dynamic extension number.
 and n?

 Thanks

 On Wed, Jan 16, 2013 at 11:12 AM, SamyGo govoi...@gmail.com wrote:

 Hi,
 Please see my comments in line.

 Regards,
 Sammy


 On Wed, Jan 16, 2013 at 12:13 PM, Zohair Raza 
 engineerzuhairr...@gmail.com wrote:


 On Wed, Jan 16, 2013 at 11:01 AM, Muhammad 
 mohammad.ghaz...@gmail.comwrote:

 *Thanks Zohair!
 I wrote some php code to working with AGI, but it dosen't work.
 *

 *I don't know how can run it. please explain me when I put my php code
 inside /var/lib/asterisk/agi-bin  so, what should I do after that. *


 Make sure Asterisk has access to your AGI script, and make it
 executable (chmod u+x agi.php). Also make sure it has shebang
 (!#/usr/bin/php)


 Besides  that you'll need to create SIP users and define their *
 context=my-agi* and in your context call this AGI.

 [my-agi]
 exten = _X.,1,NOOP(Invoking AGI Script now)
 same = n,AGI(my-agi-filename.php)
 same = n,NOOP(Any other post AGI things here)
 same = n,Hangup()



 *and the second one, how can limit users to call just my number in
 list at database and permit to call another numbers.*
 *
 *

 That depends on logic in your script, you can also separate users by
 contexts


 Alternative to the above approach there are other possibilities, like
 applying a GotoIF() condition in the *[my-agi]*  dialplan code above
 restricting a particluar number,  or Instead of *_X. *in the above code
 implement some regex to enable only local area dialing i.e

 exten = _78XX,1,NOOP(Invoking AGI Script now for dialled string
 starting with 78 and 8 digit in length)

 If you don't like any of the above because you've a list of numbers
 which should be dialled only in a DB.table then in your php-AGI script do
 some restrictions based on that table.



 * *
 On Tue, Jan 15, 2013 at 12:39 PM, Zohair Raza 
 engineerzuhairr...@gmail.com wrote:

 you need to run full command, like

 agi show commands topic answer
 agi show commands topic gosub
 agi set debug on


 Regards,
 Zohair Raza


 On Tue, Jan 15, 2013 at 1:05 PM, Muhammad mohammad.ghaz...@gmail.com
  wrote:

 Hi,

 in CLI, I type agi show or other agi commad, but response me
 command not found.
 How can see agi is work normally in my server?


 --
 _
 -- 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 

Re: [asterisk-users] AGI command

2013-01-20 Thread Eric Wieling
Stop Asterisk.  Start Asterisk as asterisk -cvvvd then in the CLI issue the 
command agi set debug on.

Starting Asterisk as this command will make it run in the foreground and show 
you STDERR.  You do not normally get to see STDERR when running AGIs in 
Asterisk.Since Asterisk is running in the foreground, if you do a ctrl-S to 
stop output it pauses Asterisk's call processing.  Remember that.  

This should help you figure out what is wrong.Personally, I use the PHPAGI 
library and don't worry about all the low level stuff.

-Original Message-
From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Muhammad
Sent: Sunday, January 20, 2013 6:46 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] AGI command

Thanks Salman.
Here is my cli debug when run agi:



-- Launched AGI Script /var/lib/asterisk/agi-bin/testAGI.php
-- SIP/101-0007AGI Script testAGI.php completed, returning 0


and here is my php agi source code:

#!/usr/bin/php -q
?php

error_reporting(E_ALL);
ob_implicit_flush(false);
set_time_limit(6);
$stdin = fopen('php://stdin', 'r');
$stdlog = fopen('tmp/agi_log.log', 'w');
$debug = false;
// Read input from Asterisk and output via $astOutput *
function astRead()
{
global $stdin, $debug, $stdlog;
$astOutput = str_replace(\n, , fgets($stdin, 4096));
if ($debug) fputs($stdlog, read: $input\n);
return $astOutput;
}
// Write AGI command to Asterisk
function astWrite($agiCommand)
{
global $debug, $stdlog;
if ($debug) fputs($stdlog, write: $agiCommand\n);
echo $agiCommand.\n;
}
// Handling execution input from Asterisk
while (!feof($stdin))
{
$temp = fgets($stdin);
$temp = str_replace(\n,,$temp);
$s = explode(:,$temp);
$agivar[$s[0]] = trim($s[1]);
if ($temp == )
{
break;
}
}
// Operational Code starts here

astWrite(STREAM FILE demo-congrats #);
astRead();
astWrite(SAY NUMBER 123456 #);
astRead();

// Finalization of AGI script and clean-ups
fclose ($stdin);
fclose ($stdlog);
exit(0);


as you see, it was return 0. agi is running successful or not?

[from-internal]
exten = _X.,1,NOOP(++Invoking AGI Script now(before agi): MGH)
exten = _X.,2,AGI(testAGI.php)
exten = _X.,3,NOOP(***After AGI)
exten = _X.,100,DeadAGI(getCDRLog.php) 





On Sat, Jan 19, 2013 at 11:49 AM, Salman Zafar msalman...@gmail.com wrote:


You seriously need to go through Asterisk text books available online 
or at-least read the manual.

NoOP is just a No Operation, so its just printing text in your case. 

To execute an AGI you need to call it from dialpan like exten = 
_X.,n,AGI(name_of_AGI), agi should be appropriate directory, which I reckon you 
already know.



On Sat, Jan 19, 2013 at 1:06 PM, Muhammad mohammad.ghaz...@gmail.com 
wrote:


Thanks Steve.

but explain me more about your dialplan codes. Im a beginner.



exten = _X.,1,NOOP(Invoking AGI Script now)


what is Invoking AGI Script now and what should I do in this 
method?

what is _X. it seems it is dynamic extension number.
and n?

Thanks


On Wed, Jan 16, 2013 at 11:12 AM, SamyGo govoi...@gmail.com 
wrote:


Hi,
Please see my comments in line.


Regards,
Sammy


On Wed, Jan 16, 2013 at 12:13 PM, Zohair Raza 
engineerzuhairr...@gmail.com wrote:



On Wed, Jan 16, 2013 at 11:01 AM, Muhammad 
mohammad.ghaz...@gmail.com wrote:


Thanks Zohair!
I wrote some php code to working with 
AGI, but it dosen't work.


I don't know how can run it. please 
explain me when I put my php code inside /var/lib/asterisk/agi-bin  so, what 
should I do after that. 


Make sure Asterisk has access to your AGI 
script, and make it executable (chmod u+x agi.php). Also make sure it has 
shebang (!#/usr/bin/php)


Besides  that you'll need to create SIP users and 
define their context=my-agi and in your context call this AGI.

[my-agi]
exten = _X.,1,NOOP(Invoking AGI Script now)
same = n,AGI(my-agi-filename.php)
same = n,NOOP(Any other post AGI things here)
same = n,Hangup

Re: [asterisk-users] AGI command

2013-01-20 Thread Chris Bagnall

On 20/1/13 4:15 pm, Eric Wieling wrote:

Personally, I use the PHPAGI library and don't worry about all the low level 
stuff.


This. It also gives you a nice logging function you can use to output 
debug information to the asterisk CLI so you don't have to kill and 
start asterisk interactively.


Kind regards,

Chris
--
This email is made from 100% recycled electrons

--
_
-- 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] AGI command

2013-01-19 Thread Muhammad
*Hi,
sorry to delay.**

here is my answers.
 1) What does the Asterisk console log look like when you try to execute
the AGI?
**first let me know how can I execute the AGI?**

 2) If you enter '/usr/bin/php -v', what do you get? I get:
**$ php -v give me:
PHP 5.1.6 (cli) (built: Nov 29 2010 16:47:37)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies**

**but not in path /usr/bin/php -v**

3) If you enter the following command in a shell, what do you get?

sudo -u asterisk /var/lib/asterisk/agi-bin/testAGI.php

**Asterisk already running on /var/run/asterisk/asterisk.ctl.  Use
'asterisk -r' to connect.**



*
On Wed, Jan 16, 2013 at 8:33 PM, Steve Edwards asterisk@sedwards.comwrote:

 On Wed, 16 Jan 2013, Muhammad wrote:

  **When you say 'doesn't work' do you mean 'doesn't do what I want' or
 'does not execute?'

 I mean I do all steps in Mr. Nir presentation documents and not works.


 Your PHP script executes correctly on my dev box, but I would change the
 log file path to something absolute like '/tmp/agi_log.log' so we know
 where it is.

 1) What does the Asterisk console log look like when you try to execute
 the AGI?

 2) If you enter '/usr/bin/php -v', what do you get? I get:

 PHP 5.1.6 (cli) (built: Feb 22 2012 19:34:21)
 Copyright (c) 1997-2006 The PHP Group
 Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies

 3) If you enter the following command in a shell, what do you get?

 sudo -u asterisk /var/lib/asterisk/agi-bin/**testAGI.php
 /dev/null

 (If you run Asterisk as another user, use that user name in the command
 above.)

 I get:

 PHP Notice:  Undefined offset:  1 in /var/lib/asterisk/agi-bin/**testAGI.php
 on line 31
 STREAM FILE demo-congrats #
 SAY NUMBER 123456 #

 The 'notice' is because we passed an empty AGI environment.


 --
 Thanks in advance,
 --**--**
 -
 Steve Edwards   sedwa...@sedwards.com  Voice: 
 +1-760-468-3867https://2.177.142.31/_AMI/tidy.php?exten=147number=%2B17604683867PST
 Newline  Fax: 
 +1-760-731-3000https://2.177.142.31/_AMI/tidy.php?exten=147number=%2B17607313000

 --
 __**__**_
 -- 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-**usershttp://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] AGI command

2013-01-19 Thread Muhammad
Thanks Steve.

but explain me more about your dialplan codes. Im a beginner.


exten = _X.,1,NOOP(Invoking AGI Script now)

what is Invoking AGI Script now and what should I do in this method?

what is _X. it seems it is dynamic extension number.
and n?

Thanks

On Wed, Jan 16, 2013 at 11:12 AM, SamyGo govoi...@gmail.com wrote:

 Hi,
 Please see my comments in line.

 Regards,
 Sammy


 On Wed, Jan 16, 2013 at 12:13 PM, Zohair Raza 
 engineerzuhairr...@gmail.com wrote:


 On Wed, Jan 16, 2013 at 11:01 AM, Muhammad mohammad.ghaz...@gmail.comwrote:

 *Thanks Zohair!
 I wrote some php code to working with AGI, but it dosen't work.
 *

 *I don't know how can run it. please explain me when I put my php code
 inside /var/lib/asterisk/agi-bin  so, what should I do after that. *


 Make sure Asterisk has access to your AGI script, and make it executable
 (chmod u+x agi.php). Also make sure it has shebang (!#/usr/bin/php)


 Besides  that you'll need to create SIP users and define their *
 context=my-agi* and in your context call this AGI.

 [my-agi]
 exten = _X.,1,NOOP(Invoking AGI Script now)
 same = n,AGI(my-agi-filename.php)
 same = n,NOOP(Any other post AGI things here)
 same = n,Hangup()



 *and the second one, how can limit users to call just my number in list
 at database and permit to call another numbers.*
 *
 *

 That depends on logic in your script, you can also separate users by
 contexts


 Alternative to the above approach there are other possibilities, like
 applying a GotoIF() condition in the *[my-agi]*  dialplan code above
 restricting a particluar number,  or Instead of *_X. *in the above code
 implement some regex to enable only local area dialing i.e

 exten = _78XX,1,NOOP(Invoking AGI Script now for dialled string
 starting with 78 and 8 digit in length)

 If you don't like any of the above because you've a list of numbers which
 should be dialled only in a DB.table then in your php-AGI script do some
 restrictions based on that table.



 * *
 On Tue, Jan 15, 2013 at 12:39 PM, Zohair Raza 
 engineerzuhairr...@gmail.com wrote:

 you need to run full command, like

 agi show commands topic answer
 agi show commands topic gosub
 agi set debug on


 Regards,
 Zohair Raza


 On Tue, Jan 15, 2013 at 1:05 PM, Muhammad 
 mohammad.ghaz...@gmail.comwrote:

 Hi,

 in CLI, I type agi show or other agi commad, but response me command
 not found.
 How can see agi is work normally in my server?


 --
 _
 -- 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



 --
 _
 -- 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] AGI command

2013-01-19 Thread Salman Zafar
You seriously need to go through Asterisk text books available online or
at-least read the manual.

NoOP is just a No Operation, so its just printing text in your case.

To execute an AGI you need to call it from dialpan like exten =
_X.,n,AGI(name_of_AGI), agi should be appropriate directory, which I reckon
you already know.


On Sat, Jan 19, 2013 at 1:06 PM, Muhammad mohammad.ghaz...@gmail.comwrote:

 Thanks Steve.

 but explain me more about your dialplan codes. Im a beginner.


 exten = _X.,1,NOOP(Invoking AGI Script now)

 what is Invoking AGI Script now and what should I do in this method?

 what is _X. it seems it is dynamic extension number.
 and n?

 Thanks

 On Wed, Jan 16, 2013 at 11:12 AM, SamyGo govoi...@gmail.com wrote:

 Hi,
 Please see my comments in line.

 Regards,
 Sammy


 On Wed, Jan 16, 2013 at 12:13 PM, Zohair Raza 
 engineerzuhairr...@gmail.com wrote:


 On Wed, Jan 16, 2013 at 11:01 AM, Muhammad 
 mohammad.ghaz...@gmail.comwrote:

 *Thanks Zohair!
 I wrote some php code to working with AGI, but it dosen't work.
 *

 *I don't know how can run it. please explain me when I put my php code
 inside /var/lib/asterisk/agi-bin  so, what should I do after that. *


 Make sure Asterisk has access to your AGI script, and make it executable
 (chmod u+x agi.php). Also make sure it has shebang (!#/usr/bin/php)


 Besides  that you'll need to create SIP users and define their *
 context=my-agi* and in your context call this AGI.

 [my-agi]
 exten = _X.,1,NOOP(Invoking AGI Script now)
 same = n,AGI(my-agi-filename.php)
 same = n,NOOP(Any other post AGI things here)
 same = n,Hangup()



 *and the second one, how can limit users to call just my number in
 list at database and permit to call another numbers.*
 *
 *

 That depends on logic in your script, you can also separate users by
 contexts


 Alternative to the above approach there are other possibilities, like
 applying a GotoIF() condition in the *[my-agi]*  dialplan code above
 restricting a particluar number,  or Instead of *_X. *in the above code
 implement some regex to enable only local area dialing i.e

 exten = _78XX,1,NOOP(Invoking AGI Script now for dialled string
 starting with 78 and 8 digit in length)

 If you don't like any of the above because you've a list of numbers which
 should be dialled only in a DB.table then in your php-AGI script do some
 restrictions based on that table.



 * *
 On Tue, Jan 15, 2013 at 12:39 PM, Zohair Raza 
 engineerzuhairr...@gmail.com wrote:

 you need to run full command, like

 agi show commands topic answer
 agi show commands topic gosub
 agi set debug on


 Regards,
 Zohair Raza


 On Tue, Jan 15, 2013 at 1:05 PM, Muhammad 
 mohammad.ghaz...@gmail.comwrote:

 Hi,

 in CLI, I type agi show or other agi commad, but response me command
 not found.
 How can see agi is work normally in my server?


 --
 _
 -- 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



 --
 _
 -- 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 

Re: [asterisk-users] AGI command

2013-01-16 Thread Steve Edwards

On Wed, 16 Jan 2013, Zohair Raza wrote:

Make sure Asterisk has access to your AGI script, and make it executable 
(chmod u+x agi.php). Also make sure it has shebang (!#/usr/bin/php)


Make sure that the user executing the Asterisk process can execute your 
script. Ownership (user and group), directory permissions, and file 
permissions all play a part.


--
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] AGI command

2013-01-16 Thread Muhammad
***When you say 'doesn't work' do you mean 'doesn't do what I want' or
'does not execute?'*

I mean I do all steps in Mr. Nir presentation documents and not works.

Here is my php code:

#!/usr/bin/php -q
?php
error_reporting(E_ALL);
ob_implicit_flush(false);
set_time_limit(6);
$stdin = fopen('php://stdin', 'r');
$stdlog = fopen('agi_log.log', 'w');
$debug = false;
/* Read input from Asterisk and output via $astOutput */
function astRead()
{
global $stdin, $debug, $stdlog;
$astOutput = str_replace(\n, , fgets($stdin, 4096));
if ($debug) fputs($stdlog, read: $input\n);
return $astOutput;
}
/* Write AGI command to Asterisk */
function astWrite($agiCommand)
{
global $debug, $stdlog;
if ($debug) fputs($stdlog, write: $agiCommand\n);

echo $agiCommand.\n;
}
/* Handling execution input from Asterisk */
while (!feof($stdin))
{
$temp = fgets($stdin);
$temp = str_replace(\n,,$temp);
$s = explode(:,$temp);
$agivar[$s[0]] = trim($s[1]);
if ($temp == )
{
break;
}
}
/* Operational Code starts here */

astWrite(STREAM FILE demo-congrats #);
astRead();
/* Say the number 123456 */
astWrite(SAY NUMBER 123456 #);
astRead();

/* Finalization of AGI script and clean-ups */
fclose ($stdin);
fclose ($stdlog);
exit(0);

and have wrote in extension_custom.conf:

[from-internal-custom]
include = testAGI

[testAGI]
exten = 147,1,Answer
exten = 147,2,AGI(testAGI.php)
exten = 147,3,Hangup


147 is my extension.
operators can call a number via their extension(each extension may use for
one or more users?)

I register extension 147 in my client softphone and call a number. what
happen after that?

On Wed, Jan 16, 2013 at 11:19 AM, Steve Edwards
asterisk@sedwards.comwrote:

 On Wed, 16 Jan 2013, Muhammad wrote:

  I wrote some php code to working with AGI, but it dosen't work.


 When you say 'doesn't work' do you mean 'doesn't do what I want' or 'does
 not execute?'

 If you enable AGI debugging, what does the Asterisk console log look like?

 Did you use an established PHP library or 'roll your own?'

 A good way to test an AGI is to create a text file containing all the
 cruft (the AGI 'environment') Asterisk sends to the AGI along with the
 expected responses. Then you can execute your AGI completely external from
 Asterisk with a shell command line like:

 /var/lib/asterisk/agi-bin/my-**firs-agi example environment

 --
 Thanks in advance,
 --**--**
 -
 Steve Edwards   sedwa...@sedwards.com  Voice: 
 +1-760-468-3867https://2.177.142.31/_AMI/tidy.php?exten=147number=%2B17604683867PST
 Newline  Fax: 
 +1-760-731-3000https://2.177.142.31/_AMI/tidy.php?exten=147number=%2B17607313000


 --
 __**__**_
 -- 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-**usershttp://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] AGI command

2013-01-16 Thread Steve Edwards

On Wed, 16 Jan 2013, Muhammad wrote:

**When you say 'doesn't work' do you mean 'doesn't do what I want' or 
'does not execute?'


I mean I do all steps in Mr. Nir presentation documents and not works.


Your PHP script executes correctly on my dev box, but I would change the 
log file path to something absolute like '/tmp/agi_log.log' so we know 
where it is.


1) What does the Asterisk console log look like when you try to execute 
the AGI?


2) If you enter '/usr/bin/php -v', what do you get? I get:

PHP 5.1.6 (cli) (built: Feb 22 2012 19:34:21)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies

3) If you enter the following command in a shell, what do you get?

sudo -u asterisk /var/lib/asterisk/agi-bin/testAGI.php /dev/null

(If you run Asterisk as another user, use that user name in the command 
above.)


I get:

PHP Notice:  Undefined offset:  1 in /var/lib/asterisk/agi-bin/testAGI.php 
on line 31

STREAM FILE demo-congrats #
SAY NUMBER 123456 #

The 'notice' is because we passed an empty AGI environment.

--
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


[asterisk-users] AGI command

2013-01-15 Thread Muhammad
Hi,

in CLI, I type agi show or other agi commad, but response me command not
found.
How can see agi is work normally in my server?
--
_
-- 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] AGI command

2013-01-15 Thread Zohair Raza
you need to run full command, like

agi show commands topic answer
agi show commands topic gosub
agi set debug on


Regards,
Zohair Raza


On Tue, Jan 15, 2013 at 1:05 PM, Muhammad mohammad.ghaz...@gmail.comwrote:

 Hi,

 in CLI, I type agi show or other agi commad, but response me command not
 found.
 How can see agi is work normally in my server?


 --
 _
 -- 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] AGI command

2013-01-15 Thread Muhammad
*Thanks Zohair!
I wrote some php code to working with AGI, but it dosen't work.
I don't know how can run it. please explain me when I put my php code inside
/var/lib/asterisk/agi-bin  so, what should I do after that. and the second
one, how can limit users to call just my number in list at database and
permit to call another numbers.**
*
On Tue, Jan 15, 2013 at 12:39 PM, Zohair Raza
engineerzuhairr...@gmail.comwrote:

 you need to run full command, like

 agi show commands topic answer
 agi show commands topic gosub
 agi set debug on


 Regards,
 Zohair Raza


 On Tue, Jan 15, 2013 at 1:05 PM, Muhammad mohammad.ghaz...@gmail.comwrote:

 Hi,

 in CLI, I type agi show or other agi commad, but response me command not
 found.
 How can see agi is work normally in my server?


 --
 _
 -- 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] AGI command

2013-01-15 Thread Zohair Raza
On Wed, Jan 16, 2013 at 11:01 AM, Muhammad mohammad.ghaz...@gmail.comwrote:

 *Thanks Zohair!
 I wrote some php code to working with AGI, but it dosen't work.
 *

*I don't know how can run it. please explain me when I put my php code inside
 /var/lib/asterisk/agi-bin  so, what should I do after that. *


Make sure Asterisk has access to your AGI script, and make it executable
(chmod u+x agi.php). Also make sure it has shebang (!#/usr/bin/php)


 *and the second one, how can limit users to call just my number in list
 at database and permit to call another numbers.*
 *
 *

That depends on logic in your script, you can also separate users by
contexts


 * *
 On Tue, Jan 15, 2013 at 12:39 PM, Zohair Raza 
 engineerzuhairr...@gmail.com wrote:

 you need to run full command, like

 agi show commands topic answer
 agi show commands topic gosub
 agi set debug on


 Regards,
 Zohair Raza


 On Tue, Jan 15, 2013 at 1:05 PM, Muhammad mohammad.ghaz...@gmail.comwrote:

 Hi,

 in CLI, I type agi show or other agi commad, but response me command
 not found.
 How can see agi is work normally in my server?


 --
 _
 -- 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] AGI command

2013-01-15 Thread SamyGo
Hi,
Please see my comments in line.

Regards,
Sammy


On Wed, Jan 16, 2013 at 12:13 PM, Zohair Raza
engineerzuhairr...@gmail.comwrote:


 On Wed, Jan 16, 2013 at 11:01 AM, Muhammad mohammad.ghaz...@gmail.comwrote:

 *Thanks Zohair!
 I wrote some php code to working with AGI, but it dosen't work.
 *

 *I don't know how can run it. please explain me when I put my php code
 inside /var/lib/asterisk/agi-bin  so, what should I do after that. *


 Make sure Asterisk has access to your AGI script, and make it executable
 (chmod u+x agi.php). Also make sure it has shebang (!#/usr/bin/php)


Besides  that you'll need to create SIP users and define their *
context=my-agi* and in your context call this AGI.

[my-agi]
exten = _X.,1,NOOP(Invoking AGI Script now)
same = n,AGI(my-agi-filename.php)
same = n,NOOP(Any other post AGI things here)
same = n,Hangup()



 *and the second one, how can limit users to call just my number in list
 at database and permit to call another numbers.*
 *
 *

 That depends on logic in your script, you can also separate users by
 contexts


Alternative to the above approach there are other possibilities, like
applying a GotoIF() condition in the *[my-agi]*  dialplan code above
restricting a particluar number,  or Instead of *_X. *in the above code
implement some regex to enable only local area dialing i.e

exten = _78XX,1,NOOP(Invoking AGI Script now for dialled string
starting with 78 and 8 digit in length)

If you don't like any of the above because you've a list of numbers which
should be dialled only in a DB.table then in your php-AGI script do some
restrictions based on that table.



 * *
 On Tue, Jan 15, 2013 at 12:39 PM, Zohair Raza 
 engineerzuhairr...@gmail.com wrote:

 you need to run full command, like

 agi show commands topic answer
 agi show commands topic gosub
 agi set debug on


 Regards,
 Zohair Raza


 On Tue, Jan 15, 2013 at 1:05 PM, Muhammad mohammad.ghaz...@gmail.comwrote:

 Hi,

 in CLI, I type agi show or other agi commad, but response me command
 not found.
 How can see agi is work normally in my server?


 --
 _
 -- 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

--
_
-- 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] AGI command

2013-01-15 Thread Steve Edwards

On Wed, 16 Jan 2013, Muhammad wrote:


I wrote some php code to working with AGI, but it dosen't work.


When you say 'doesn't work' do you mean 'doesn't do what I want' or 'does 
not execute?'


If you enable AGI debugging, what does the Asterisk console log look like?

Did you use an established PHP library or 'roll your own?'

A good way to test an AGI is to create a text file containing all the 
cruft (the AGI 'environment') Asterisk sends to the AGI along with the 
expected responses. Then you can execute your AGI completely external from 
Asterisk with a shell command line like:


/var/lib/asterisk/agi-bin/my-firs-agi example environment

--
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


[asterisk-users] AGI exec command

2012-11-28 Thread Vieri
Hi,

I'm trying to understand how AGI works.
I'm using php-agi library from sf.net.

*CLI agi show commands
  Yes   exec   Executes a given Application

*CLI core show application set

My PHP-AGI script contains:

$AGI-exec(Set, CUSTOM_VAR=2);
$AGI-exec(NoOp, \DEBUG - ${CUSTOM_VAR}\);

An AGI debug from *CLI shows:

SIP/4053-004dAGI Rx  EXEC Set CUSTOM_VAR=2
-- AGI Script Executing Application: (Set) Options: (CUSTOM_VAR=2)
SIP/4053-004dAGI Tx  200 result=0
SIP/4053-004dAGI Rx  EXEC NoOp DEBUG - 
-- AGI Script Executing Application: (NoOp) Options: (DEBUG - )

Why isn't CUSTOM_VAR set?

I know I could use agi command set variable but I'd like to know why the 
above code doesn't seem to work.

Also, there's no AGI-specific command for NoCDR(). So I did something like this:

$AGI-exec(NoCDR, );

but the CDR was written to cdr-csv/Master.csv so I'm assuming I'm doing 
something wrong with the agi exec command.

Any ideas?

Thanks,

Vieri


--
_
-- 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] AGI exec command

2012-11-28 Thread Vieri
Never mind. Figured it out.
Sorry for the noise.



--
_
-- 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


[asterisk-users] AGI and AMI stuff.

2012-11-15 Thread Ken D'Ambrosio
Hey, all.  I'm interested in doing some simple, very specific web pages 
for some of my users -- things like call groups, setting forwarding, and 
for the receptionist to transfer calls and see calls.  Probably do this 
in Ruby or PHP, though I'm open-minded.  Anyway, if someone could point 
me to some documentation -- dead tree, electronic, whatever -- that 
gives some fairly in-depth detail on this, I'd be most appreciative.


Thanks!

-Ken

--
This mail was scanned by BitDefender
For more information please visit http://www.bitdefender.com/links/en/frams.html



--
_
-- 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


  1   2   3   4   5   6   7   8   9   10   >