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

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

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

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

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

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:
> https://www.asterisk.org/community/astricon-user-confere

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

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

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

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&BBB&CCC 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

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&BBB&CCC 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: 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


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 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 Eric Wieling
The changes were to phpagi-asmanager.php.  Looks like most of the changes are 
commenting out noisy log messages, but I did add wait_response2 function to 
phpagi, which adds a timeout option.  We have not used the wait_response2 
function for quite a while.  I don't recall how well it works.  

diff at http://pastebin.com/wfDR6u0a

-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:54 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] AGI and AMI in PHP -- What's current?

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

-- 
_
-- 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 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 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  <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  <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
I am talking about sip on asterisk  11.10.2
rv


2014-08-12 19:28 GMT-04:00 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 :
>
> 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

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

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 :

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

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 :

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

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

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-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
Thanks... I got it working actually I found with this command /usr/bin/perl
-d  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  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
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  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


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 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  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  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 
> 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 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  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 
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  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:32 +1100, Andrew Yager wrote:
> On 20/03/2013, at 10:15 PM, Ishfaq Malik  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 
> 
> 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 
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  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 

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

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


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  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-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> 
> AGI Tx >> agi_request: agi-test.agi
> AGI Tx >> agi_channel: SIP/INCONCERT-35d2
> trixbox146002*CLI> 
> AGI Tx >> agi_language: en
> trixbox146002*CLI> 
> AGI Tx >> agi_type: SIP
> trixbox146002*CLI> 
> AGI Tx >> agi_uniqueid: 1362669295.35561
> trixbox146002*CLI> 
> AGI Tx >> agi_version: 1.6.0.28-samy-r100
> AGI Tx >> agi_callerid: 1044
> trixbox146002*CLI> 
> AGI Tx >> agi_calleridname: 1044
> trixbox146002*CLI> 
> AGI Tx >> agi_callingpres: 0
> trixbox146002*CLI> 
> AGI Tx >> agi_callingani2: 0
> trixbox146002*CLI> 
> AGI Tx >> agi_callington: 0
> trixbox146002*CLI> 
> AGI Tx >> agi_callingtns: 0
> trixbox146002*CLI> 
> AGI Tx >> agi_dnid: 701820101044
> trixbox146002*CLI> 
> AGI Tx >> agi_rdnis: unknown
> trixbox146002*CLI> 
> AGI Tx >> agi_context: ModernaDesv_E1
> trixbox146002*CLI> 
> AGI Tx >> agi_extension: s
> trixbox146002*CLI> 
> AGI Tx >> agi_priority: 3
> trixbox146002*CLI> 
> AGI Tx >> agi_enhanced: 0.0
> trixbox146002*CLI> 
> AGI Tx >> agi_accountcode: 
> trixbox146002*CLI> 
> AGI Tx >> agi_threadid: 29367216
> trixbox146002*CLI> 
> AGI 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> 
> -- AGI 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

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  
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 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() {

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

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

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,

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  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
>  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 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
 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 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-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
-- AGI Script testAGI.php completed, returning 0


and here is my php agi source code:

#!/usr/bin/php -q
 _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  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  
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  
wrote:


Hi,
Please see my comments in line.


Regards,
Sammy


On Wed, Jan 16, 2013 at 12:13 PM, Zohair Raza 
 wrote:



On Wed, Jan 16, 2013 at 11:01 AM, Muhammad 
 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()


 

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.


 


 

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
-- AGI Script testAGI.php completed, returning 0


and here is my php agi source code:

#!/usr/bin/php -q
 _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  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 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  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 
 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()
>>>
>>>

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

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 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  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 
>>> 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()
>>
>>
>>>
 *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 
> 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 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

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  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 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()
>
>
>>
>>> *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 
 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 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

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

> 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
> 
> (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-3867PST
> 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 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 (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


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

> 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 
> --
> Thanks in advance,
> --**--**
> -
> Steve Edwards   sedwa...@sedwards.com  Voice: 
> +1-760-468-3867PST
> 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 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-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 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
wrote:

>
> On Wed, Jan 16, 2013 at 11:01 AM, Muhammad 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()


>
>> *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 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 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 Zohair Raza
On Wed, Jan 16, 2013 at 11:01 AM, Muhammad 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)


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


Re: [asterisk-users] AGI and AMI stuff.

2012-11-15 Thread Ken D'Ambrosio
Heh.  Shortly after I sent my e-mail, I bumped into the Adhearsion you 
mentioned, below.  Boy, but that looks exactly like what I'm thinking 
of!  Thanks much...


-Ken

On 2012-11-15 13:08, David M. Lee wrote:

On Nov 15, 2012, at 10:54 AM, Ken D'Ambrosio wrote:

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.


AGI commands and AMI actions and events are documented on the wiki -

https://wiki.asterisk.org/wiki/display/AST/Asterisk+11+Command+Reference
[1]

The wiki also has command references for 1.8 and 10.

Asterisk: The Definitive Guide has good chapters on the protocols:

* Book - http://shop.oreilly.com/product/9780596517342.do [2]
* AMI - 
http://ofps.oreilly.com/titles/9780596517342/asterisk-AMI.html [3]

* AGI - http://ofps.oreilly.com/titles/9780596517342/AGI.html [4]

There are client libraries that handle the protocol details for you.
StarPy for Python is a fairly low-level wrapper around AMI/AGI.
Adhearsion for Ruby is a fairly high level wrapper for building voice
applications. I believe some exist for PHP, but I know nothing about
them.


Thanks!

-Ken


Good luck!

--
David M. Lee
Digium, Inc. | Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: www.digium.com [5] & www.asterisk.org [6]


Links:
--
[1] 
https://wiki.asterisk.org/wiki/display/AST/Asterisk+11+Command+Reference

[2] http://shop.oreilly.com/product/9780596517342.do
[3] http://ofps.oreilly.com/titles/9780596517342/asterisk-AMI.html
[4] http://ofps.oreilly.com/titles/9780596517342/AGI.html
[5] http://www.digium.com/
[6] http://www.asterisk.org/

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

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



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


Re: [asterisk-users] AGI and AMI stuff.

2012-11-15 Thread David M. Lee

On Nov 15, 2012, at 10:54 AM, Ken D'Ambrosio wrote:

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

AGI commands and AMI actions and events are documented on the wiki - 
https://wiki.asterisk.org/wiki/display/AST/Asterisk+11+Command+Reference

The wiki also has command references for 1.8 and 10.

Asterisk: The Definitive Guide has good chapters on the protocols:

* Book - http://shop.oreilly.com/product/9780596517342.do
* AMI - http://ofps.oreilly.com/titles/9780596517342/asterisk-AMI.html
* AGI - http://ofps.oreilly.com/titles/9780596517342/AGI.html

There are client libraries that handle the protocol details for you. StarPy for 
Python is a fairly low-level wrapper around AMI/AGI. Adhearsion for Ruby is a 
fairly high level wrapper for building voice applications. I believe some exist 
for PHP, but I know nothing about them.

> Thanks!
> 
> -Ken


Good luck!
-- 
David M. Lee
Digium, Inc. | Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at:  www.digium.com  & www.asterisk.org

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

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

Re: [asterisk-users] AGI HANGUP PROBLEM

2012-09-18 Thread A J Stiles
On Tuesday 18 September 2012, Mehdi Rahimi wrote:
> Hi Tony,
> 
> Thank you for your attention , and appreciate your contribution .
> You are right we can not do anything till the caller hangup BUT how
> can we prevent to hearing DTMF when someone else is trying on another
> extension ?
> to clearance :
> someone calls (from landlines os mobile , no difference) and our AGI
> has executed and after some processes finish and hangup , but the
> caller has not hungup yet and till then if i pickup my extension and
> try to call , that caller who has not hungup the call yet can hear
> DTMF and that's a problem and some conflict.

Yes, that is the way a "calling party disconnects" telephone network works.  
Someone else rang you --> You answered --> You put the phone down --> They 
didn't put their phone down --> You will still be connected to them --> If you 
dial, they will hear your digits; if you speak, they will hear your voice.

It is a telephone company issue, not an Asterisk issue.

Asterisk gets around this the only way it can:  by not marking an FXO line on 
which an incoming call has been answered as "free" until the calling party has 
hung up.

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

2012-09-18 Thread Mehdi Rahimi
Hi Tony,

Thank you for your attention , and appreciate your contribution .
You are right we can not do anything till the caller hangup BUT how
can we prevent to hearing DTMF when someone else is trying on another
extension ?
to clearance :
someone calls (from landlines os mobile , no difference) and our AGI
has executed and after some processes finish and hangup , but the
caller has not hungup yet and till then if i pickup my extension and
try to call , that caller who has not hungup the call yet can hear
DTMF and that's a problem and some conflict.

Regards,
Mehdi

On Tue, Sep 18, 2012 at 5:35 PM, Tony Mountifield  wrote:
> In article 
> ,
> SamyGo  wrote:
>>
>> So basically the FXO cards configurations need to be tweaked i.e
>> hanguponpolarityinverse=yes etc.
>> Since this is a Hangup request initiated by the SIP client, Asterisk then
>> atleast it should close all the media streams and channel should get
>> deleted.
>> Keeping an eye on BYE : *CLI> "sip set debug on" Then make this call and
>> see if a SIP BYE method is triggered properly and appears on screen.
>> More likely you need to look into you dahdi configs.
>>
>> Thanks,
>> Sammy
>
> I think you are misunderstanding the OP's issue.
>
> Hangup on polarity reversal would only apply if Asterisk were making the
> call to a phone and wanted to me informed if the phone (called party)
> hung up.
>
> The OP's situation is different. The extension below is invoked by an
> INCOMING call to Asterisk, and he is then trying to hang up that call
> from the Asterisk (called) end.
>
> If the caller is a SIP phone, that is fine, as either end can hang up.
>
> Hi problem is that when the incoming call is via his FXO port, the PSTN
> does not drop the call when the Asterisk end hangs up the FXO line. In
> this scenario there is on SIP involved. The problem is that the PSTN
> will not drop the call when the called party on an analogue line hangs
> up, until after a long timeout. There is usually no solution to this.
>
> Cheers
> Tony
>
>> On Tue, Sep 18, 2012 at 2:03 PM, Tony Mountifield wrote:
>>
>> > In article <
>> > caehsoweantztyoebdobjchoeszhfk_z9sigaujsij15xx-u...@mail.gmail.com>,
>> > Mehdi Rahimi  wrote:
>> > > Hi all,
>> > >
>> > > I need to handle a problem from AGI please guide me
>> > >
>> > >  in extensions_custom.conf :
>> > >
>> > >  exten => s,1,Answer
>> > >  exten => s,n,AGI(hang.php)
>> > >  exten => s,n,Hangup
>> > >
>> > >  in hang.php :
>> > >
>> > >  #!/usr/bin/php -q
>> > >  > > >  set_time_limit(30);
>> > >  require('phpagi.php');
>> > >  error_reporting(E_ALL);
>> > >  $agi = new AGI();
>> > >  $agi->answer();
>> > >  $agi->say_number('1');
>> > >  $agi->hangup();
>> > >  ?>
>> > >
>> > >
>> > >  calling from an extension has no problem but whenever i use landline
>> > >  or mobile it can not hangup the call and the caller has to hangup the
>> > >  call.
>> >
>> > In the UK phone network, and I suspect in many other countries too, for
>> > analogue lines it is the caller who holds the call open. For example in
>> > a call between two normal analogue phones, the called party can hangup
>> > their phone, and then within a short while pick it up again (or another
>> > phone on the same line) and the caller is still there. Hanging up the
>> > called phone does not clear down the call until after quite a long
>> > timeout (a couple of minutes perhaps).
>> >
>> > In your above example with Asterisk connected to an analogue line with an
>> > FXO card, Asterisk is the called party, and is therefore unable to clear
>> > down the line forcibly. This is not an Asterisk or AGI problem but a PSTN
>> > one.
>> >
>> > Cheers
>> > Tony
>> > --
>> > Tony Mountifield
>> > Work: t...@softins.co.uk - http://www.softins.co.uk
>> > Play: t...@mountifield.org - http://tony.mountifield.org
>> >
>> > --
>> > _
>> > -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>> > New to Asterisk? Join us for a live introductory webinar every Thurs:
>> >http://www.asterisk.org/hello
>> >
>> > asterisk-users mailing list
>> > To UNSUBSCRIBE or update options visit:
>> >http://lists.digium.com/mailman/listinfo/asterisk-users
>> >
>>
>> -=-=-=-=-=-
>> [Alternative: text/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
>> -=-=-=-=-=-
>
>
> --
> Tony Mountifield
> Work: t...@softins.co.uk - http://www.softins.co.uk
> Play: t...@mountifield.org - http://tony.mountifield.org
>
> --
> _
> -- Bandwidth and Col

Re: [asterisk-users] AGI HANGUP PROBLEM

2012-09-18 Thread Tony Mountifield
In article ,
SamyGo  wrote:
> 
> So basically the FXO cards configurations need to be tweaked i.e
> hanguponpolarityinverse=yes etc.
> Since this is a Hangup request initiated by the SIP client, Asterisk then
> atleast it should close all the media streams and channel should get
> deleted.
> Keeping an eye on BYE : *CLI> "sip set debug on" Then make this call and
> see if a SIP BYE method is triggered properly and appears on screen.
> More likely you need to look into you dahdi configs.
> 
> Thanks,
> Sammy

I think you are misunderstanding the OP's issue.

Hangup on polarity reversal would only apply if Asterisk were making the
call to a phone and wanted to me informed if the phone (called party)
hung up.

The OP's situation is different. The extension below is invoked by an
INCOMING call to Asterisk, and he is then trying to hang up that call
from the Asterisk (called) end.

If the caller is a SIP phone, that is fine, as either end can hang up.

Hi problem is that when the incoming call is via his FXO port, the PSTN
does not drop the call when the Asterisk end hangs up the FXO line. In
this scenario there is on SIP involved. The problem is that the PSTN
will not drop the call when the called party on an analogue line hangs
up, until after a long timeout. There is usually no solution to this.

Cheers
Tony

> On Tue, Sep 18, 2012 at 2:03 PM, Tony Mountifield wrote:
> 
> > In article <
> > caehsoweantztyoebdobjchoeszhfk_z9sigaujsij15xx-u...@mail.gmail.com>,
> > Mehdi Rahimi  wrote:
> > > Hi all,
> > >
> > > I need to handle a problem from AGI please guide me
> > >
> > >  in extensions_custom.conf :
> > >
> > >  exten => s,1,Answer
> > >  exten => s,n,AGI(hang.php)
> > >  exten => s,n,Hangup
> > >
> > >  in hang.php :
> > >
> > >  #!/usr/bin/php -q
> > >   > >  set_time_limit(30);
> > >  require('phpagi.php');
> > >  error_reporting(E_ALL);
> > >  $agi = new AGI();
> > >  $agi->answer();
> > >  $agi->say_number('1');
> > >  $agi->hangup();
> > >  ?>
> > >
> > >
> > >  calling from an extension has no problem but whenever i use landline
> > >  or mobile it can not hangup the call and the caller has to hangup the
> > >  call.
> >
> > In the UK phone network, and I suspect in many other countries too, for
> > analogue lines it is the caller who holds the call open. For example in
> > a call between two normal analogue phones, the called party can hangup
> > their phone, and then within a short while pick it up again (or another
> > phone on the same line) and the caller is still there. Hanging up the
> > called phone does not clear down the call until after quite a long
> > timeout (a couple of minutes perhaps).
> >
> > In your above example with Asterisk connected to an analogue line with an
> > FXO card, Asterisk is the called party, and is therefore unable to clear
> > down the line forcibly. This is not an Asterisk or AGI problem but a PSTN
> > one.
> >
> > Cheers
> > Tony
> > --
> > Tony Mountifield
> > Work: t...@softins.co.uk - http://www.softins.co.uk
> > Play: t...@mountifield.org - http://tony.mountifield.org
> >
> > --
> > _
> > -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> > New to Asterisk? Join us for a live introductory webinar every Thurs:
> >http://www.asterisk.org/hello
> >
> > asterisk-users mailing list
> > To UNSUBSCRIBE or update options visit:
> >http://lists.digium.com/mailman/listinfo/asterisk-users
> >
> 
> -=-=-=-=-=-
> [Alternative: text/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
> -=-=-=-=-=-


-- 
Tony Mountifield
Work: t...@softins.co.uk - http://www.softins.co.uk
Play: t...@mountifield.org - http://tony.mountifield.org

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

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


Re: [asterisk-users] AGI HANGUP PROBLEM

2012-09-18 Thread SamyGo
Hi,

So basically the FXO cards configurations need to be tweaked i.e
hanguponpolarityinverse=yes etc.
Since this is a Hangup request initiated by the SIP client, Asterisk then
atleast it should close all the media streams and channel should get
deleted.
Keeping an eye on BYE : *CLI> "sip set debug on" Then make this call and
see if a SIP BYE method is triggered properly and appears on screen.
More likely you need to look into you dahdi configs.

Thanks,
Sammy




On Tue, Sep 18, 2012 at 2:03 PM, Tony Mountifield wrote:

> In article <
> caehsoweantztyoebdobjchoeszhfk_z9sigaujsij15xx-u...@mail.gmail.com>,
> Mehdi Rahimi  wrote:
> > Hi all,
> >
> > I need to handle a problem from AGI please guide me
> >
> >  in extensions_custom.conf :
> >
> >  exten => s,1,Answer
> >  exten => s,n,AGI(hang.php)
> >  exten => s,n,Hangup
> >
> >  in hang.php :
> >
> >  #!/usr/bin/php -q
> >   >  set_time_limit(30);
> >  require('phpagi.php');
> >  error_reporting(E_ALL);
> >  $agi = new AGI();
> >  $agi->answer();
> >  $agi->say_number('1');
> >  $agi->hangup();
> >  ?>
> >
> >
> >  calling from an extension has no problem but whenever i use landline
> >  or mobile it can not hangup the call and the caller has to hangup the
> >  call.
>
> In the UK phone network, and I suspect in many other countries too, for
> analogue lines it is the caller who holds the call open. For example in
> a call between two normal analogue phones, the called party can hangup
> their phone, and then within a short while pick it up again (or another
> phone on the same line) and the caller is still there. Hanging up the
> called phone does not clear down the call until after quite a long
> timeout (a couple of minutes perhaps).
>
> In your above example with Asterisk connected to an analogue line with an
> FXO card, Asterisk is the called party, and is therefore unable to clear
> down the line forcibly. This is not an Asterisk or AGI problem but a PSTN
> one.
>
> Cheers
> Tony
> --
> Tony Mountifield
> Work: t...@softins.co.uk - http://www.softins.co.uk
> Play: t...@mountifield.org - http://tony.mountifield.org
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>http://www.asterisk.org/hello
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users
>
--
_
-- 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 HANGUP PROBLEM

2012-09-18 Thread Tony Mountifield
In article ,
Mehdi Rahimi  wrote:
> Hi all,
> 
> I need to handle a problem from AGI please guide me
> 
>  in extensions_custom.conf :
> 
>  exten => s,1,Answer
>  exten => s,n,AGI(hang.php)
>  exten => s,n,Hangup
> 
>  in hang.php :
> 
>  #!/usr/bin/php -q
>set_time_limit(30);
>  require('phpagi.php');
>  error_reporting(E_ALL);
>  $agi = new AGI();
>  $agi->answer();
>  $agi->say_number('1');
>  $agi->hangup();
>  ?>
> 
> 
>  calling from an extension has no problem but whenever i use landline
>  or mobile it can not hangup the call and the caller has to hangup the
>  call.

In the UK phone network, and I suspect in many other countries too, for
analogue lines it is the caller who holds the call open. For example in
a call between two normal analogue phones, the called party can hangup
their phone, and then within a short while pick it up again (or another
phone on the same line) and the caller is still there. Hanging up the
called phone does not clear down the call until after quite a long
timeout (a couple of minutes perhaps).

In your above example with Asterisk connected to an analogue line with an
FXO card, Asterisk is the called party, and is therefore unable to clear
down the line forcibly. This is not an Asterisk or AGI problem but a PSTN one.

Cheers
Tony
-- 
Tony Mountifield
Work: t...@softins.co.uk - http://www.softins.co.uk
Play: t...@mountifield.org - http://tony.mountifield.org

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

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


Re: [asterisk-users] AGI HANGUP PROBLEM

2012-09-18 Thread Mehdi Rahimi
ِDear Sammy,

Thank you for your following ,
1- Land line i mean telco company which is calling to my server , i
use FXO VOIP CARD (ATCOM 4 port) and test on a gateway too.
2-please explain me more about "Enable SIP traces and keep an eye on
the originating BYE request"

Regards,
Mehdi

On Tue, Sep 18, 2012 at 12:01 PM, SamyGo  wrote:
> Hi,
>
> Just following this thread for few days, I've some basic troubleshooting
> questions for you.
> 1- What do you mean by calling from landline? How is your Landline /mobile
> reaching your asterisk box ? is there a Hardware card ! or a VoIP provider.
> 2- Enable SIP traces and keep an eye on the originating BYE request when the
> agi->hangup() is called. See if that BYE reaches to the caller !
>
> I suspect its a Hardware card that is not dropping the channel and
> maintaining the call with server.
>
> Regards,
> Sammy
>
>
> On Tue, Sep 18, 2012 at 12:49 PM, Hoggins!  wrote:
>>
>> Hello,
>>
>> I experience the same problem, and I would really appreciate if someone
>> could give us a hint on that.
>>
>> Hoggins!
>>
>> Le 17/09/2012 19:22, Mehdi Rahimi a écrit :
>> > Hi all,
>> >
>> > I need to handle a problem from AGI please guide me
>> >
>> >  in extensions_custom.conf :
>> >
>> >  exten => s,1,Answer
>> >  exten => s,n,AGI(hang.php)
>> >  exten => s,n,Hangup
>> >
>> >  in hang.php :
>> >
>> >  #!/usr/bin/php -q
>> >  > >  set_time_limit(30);
>> >  require('phpagi.php');
>> >  error_reporting(E_ALL);
>> >  $agi = new AGI();
>> >  $agi->answer();
>> >  $agi->say_number('1');
>> >  $agi->hangup();
>> >  ?>
>> >
>> >
>> >  calling from an extension has no problem but whenever i use landline
>> >  or mobile it can not hangup the call and the caller has to hangup the
>> >  call.
>> >  if the caller does not hangup the call it becomes kind of SPY (the
>> >  caller can listen DTMF if someone call from an extension)
>> >
>> >  I am using elastix 2.3.0 which has asterisk 1.8.10.0 .
>> >
>> >  I really appreciate your sharing.
>> >
>> >  Regards,
>> >  Mehdi
>> >
>> > --
>> > _
>> > -- 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 HANGUP PROBLEM

2012-09-18 Thread SamyGo
Hi,

Just following this thread for few days, I've some basic troubleshooting
questions for you.
1- What do you mean by calling from landline? How is your Landline /mobile
reaching your asterisk box ? is there a Hardware card ! or a VoIP provider.
2- Enable SIP traces and keep an eye on the originating BYE request when
the agi->hangup() is called. See if that BYE reaches to the caller !

I suspect its a Hardware card that is not dropping the channel and
maintaining the call with server.

Regards,
Sammy


On Tue, Sep 18, 2012 at 12:49 PM, Hoggins!  wrote:

> Hello,
>
> I experience the same problem, and I would really appreciate if someone
> could give us a hint on that.
>
> Hoggins!
>
> Le 17/09/2012 19:22, Mehdi Rahimi a écrit :
> > Hi all,
> >
> > I need to handle a problem from AGI please guide me
> >
> >  in extensions_custom.conf :
> >
> >  exten => s,1,Answer
> >  exten => s,n,AGI(hang.php)
> >  exten => s,n,Hangup
> >
> >  in hang.php :
> >
> >  #!/usr/bin/php -q
> >   >  set_time_limit(30);
> >  require('phpagi.php');
> >  error_reporting(E_ALL);
> >  $agi = new AGI();
> >  $agi->answer();
> >  $agi->say_number('1');
> >  $agi->hangup();
> >  ?>
> >
> >
> >  calling from an extension has no problem but whenever i use landline
> >  or mobile it can not hangup the call and the caller has to hangup the
> >  call.
> >  if the caller does not hangup the call it becomes kind of SPY (the
> >  caller can listen DTMF if someone call from an extension)
> >
> >  I am using elastix 2.3.0 which has asterisk 1.8.10.0 .
> >
> >  I really appreciate your sharing.
> >
> >  Regards,
> >  Mehdi
> >
> > --
> > _
> > -- 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 HANGUP PROBLEM

2012-09-18 Thread Hoggins!
Hello,

I experience the same problem, and I would really appreciate if someone
could give us a hint on that.

Hoggins!

Le 17/09/2012 19:22, Mehdi Rahimi a écrit :
> Hi all,
>
> I need to handle a problem from AGI please guide me
>
>  in extensions_custom.conf :
>
>  exten => s,1,Answer
>  exten => s,n,AGI(hang.php)
>  exten => s,n,Hangup
>
>  in hang.php :
>
>  #!/usr/bin/php -q
>set_time_limit(30);
>  require('phpagi.php');
>  error_reporting(E_ALL);
>  $agi = new AGI();
>  $agi->answer();
>  $agi->say_number('1');
>  $agi->hangup();
>  ?>
>
>
>  calling from an extension has no problem but whenever i use landline
>  or mobile it can not hangup the call and the caller has to hangup the
>  call.
>  if the caller does not hangup the call it becomes kind of SPY (the
>  caller can listen DTMF if someone call from an extension)
>
>  I am using elastix 2.3.0 which has asterisk 1.8.10.0 .
>
>  I really appreciate your sharing.
>
>  Regards,
>  Mehdi
>
> --
> _
> -- 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->hangup() Does not hang up the channel

2012-09-16 Thread Raj Mathur (राज माथुर)
On Monday 17 Sep 2012, Mehdi Rahimi wrote:
> Thank you for your reply
> i did it in both ways (AGI and DIALPLAN) but not working.
> so you mean it is because of telco ?
> what about digital lines such as E1 ?

>From my experience: the call gets disconnected if the called party 
executes HangUp on a digital line.  The problem is only with Analog 
lines.

Regards,

-- Raj
-- 
Raj Mathur  || r...@kandalaya.org   || GPG:
http://otheronepercent.blogspot.com || http://kandalaya.org || CC68
It is the mind that moves   || http://schizoid.in   || D17F

--
_
-- 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->hangup() Does not hang up the channel

2012-09-16 Thread Mehdi Rahimi
This is happen whenever caller calls from mobile phone and if the
caller calls from analog line i can handle with :

;exten => s,n,Playtones(congestion) ; send the audio sequence that
humans understand means "congestion"
;exten => s,n,Congestion(5) ; signal the other end of congestion. Wait
for hangup.

and call hangs up from the telco , but it does not for mobile calls

Regards,
Mehdi

On Mon, Sep 17, 2012 at 8:57 AM, Raj Mathur (राज माथुर)
 wrote:
> On Monday 17 Sep 2012, Mehdi Rahimi wrote:
>> I need to use agi to handle some issue , after finishing agi i want
>> to hang up the channel , if i call from an extension there is no
>> problem but i want to be the same for PSTN (outside) caller , if
>> someone call asterisk show the hang up channel but the caller is not
>> disconnected and if meanwhile someone inside try to call from an
>> extension the outide caller can listen to DTMF and everything . . .
>> .
>> I would be really grateful if you share your close experience .
>
> If this is on Analog (FXO) lines then you may be out of luck.  In India,
> at least, the called party cannot hang up an incoming call on an analog
> line -- the caller has to do it.
>
> In any case, what happens if you execute HangUp() in your dialplan
> instead of in AGI?
>
> Regards,
>
> -- Raj
> --
> Raj Mathur  || r...@kandalaya.org   || GPG:
> http://otheronepercent.blogspot.com || http://kandalaya.org || CC68
> It is the mind that moves   || http://schizoid.in   || D17F
>
> --
> _
> -- 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->hangup() Does not hang up the channel

2012-09-16 Thread Mehdi Rahimi
Thank you for your reply
i did it in both ways (AGI and DIALPLAN) but not working.
so you mean it is because of telco ?
what about digital lines such as E1 ?

Regards,
Mehdi

On Mon, Sep 17, 2012 at 8:57 AM, Raj Mathur (राज माथुर)
 wrote:
> On Monday 17 Sep 2012, Mehdi Rahimi wrote:
>> I need to use agi to handle some issue , after finishing agi i want
>> to hang up the channel , if i call from an extension there is no
>> problem but i want to be the same for PSTN (outside) caller , if
>> someone call asterisk show the hang up channel but the caller is not
>> disconnected and if meanwhile someone inside try to call from an
>> extension the outide caller can listen to DTMF and everything . . .
>> .
>> I would be really grateful if you share your close experience .
>
> If this is on Analog (FXO) lines then you may be out of luck.  In India,
> at least, the called party cannot hang up an incoming call on an analog
> line -- the caller has to do it.
>
> In any case, what happens if you execute HangUp() in your dialplan
> instead of in AGI?
>
> Regards,
>
> -- Raj
> --
> Raj Mathur  || r...@kandalaya.org   || GPG:
> http://otheronepercent.blogspot.com || http://kandalaya.org || CC68
> It is the mind that moves   || http://schizoid.in   || D17F
>
> --
> _
> -- 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->hangup() Does not hang up the channel

2012-09-16 Thread Raj Mathur (राज माथुर)
On Monday 17 Sep 2012, Mehdi Rahimi wrote:
> I need to use agi to handle some issue , after finishing agi i want
> to hang up the channel , if i call from an extension there is no
> problem but i want to be the same for PSTN (outside) caller , if
> someone call asterisk show the hang up channel but the caller is not
> disconnected and if meanwhile someone inside try to call from an
> extension the outide caller can listen to DTMF and everything . . .
> .
> I would be really grateful if you share your close experience .

If this is on Analog (FXO) lines then you may be out of luck.  In India, 
at least, the called party cannot hang up an incoming call on an analog 
line -- the caller has to do it.

In any case, what happens if you execute HangUp() in your dialplan 
instead of in AGI?

Regards,

-- Raj
-- 
Raj Mathur  || r...@kandalaya.org   || GPG:
http://otheronepercent.blogspot.com || http://kandalaya.org || CC68
It is the mind that moves   || http://schizoid.in   || D17F

--
_
-- 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 variables being wrong

2012-03-30 Thread Mikhail Lischuk
 

Warren Selby wrote 30.03.2012 18:37: 

> A couple things - what
version of asterisk are you using? Are you actually using zaptel or do
you have DAHDI as your interface to your TDM cards?

Asterisk
SVN-branch-1.4-r359615 

I have to work with wicked Tormenta cards with
weird chip which requires specific kernel to be recognized by Zaptel.


tor2+ 10b5:d00d Tormenta 2 Quad T1/PRI or E1/PRA 

I have no idea
about who and why did this, but in newer versions of Asterisk this card
does not work (only first span comes up). 

So I use libpri-1.4.11.3 and
Zaptel SVN-branch-1.4-r4697M 

Chances are that this is Zaptel problem?


-- 
With Best Regards
Mikhail Lischuk

+380681244933

+380504182274

 --
_
-- 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 variables being wrong

2012-03-30 Thread Warren Selby
On Fri, Mar 30, 2012 at 8:43 AM, Mikhail Lischuk wrote:

> **
>
> Warren Selby wrote 29.03.2012 22:46:
>
>
>>
> To do this, you change your features.conf setting like so:
>
> parse => *9,peer/both,Macro,Parse
>
>
> The same result when I changed to Macro. I believe that it's true that
> callerid on outgoing call is "crap shoot". Here is output:
>
A couple things - what version of asterisk are you using?  Are you actually
using zaptel or do you have DAHDI as your interface to your TDM cards?


-- 
Thanks,
--Warren Selby, dCAP
http://www.SelbyTech.com 
--
_
-- 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 variables being wrong

2012-03-30 Thread Mikhail Lischuk
 

Warren Selby wrote 29.03.2012 22:46: 

>> 
> 
> To do this, you
change your features.conf setting like so:
> 
> parse =>
*9,peer/both,Macro,Parse

The same result when I changed to Macro. I
believe that it's true that callerid on outgoing call is "crap shoot".
Here is output: 

-- Executing [044201@test:1]
SetCallerPres("SIP/404-05fb", "allowed") in new stack
 -- Executing
[044201@test:2] SetCallerID("SIP/404-05fb", "404") in new stack

-- Executing [044201@test:3] Dial("SIP/404-05fb",
"Zap/g3/201") in new stack
 -- Requested transfer capability: 0x00 -
SPEECH
 -- Called g3/201
 -- Zap/64-1 is ringing
 -- Zap/64-1
answered SIP/404-05fb
[2012-03-30 16:46:07] DTMF[2036]:
channel.c:2455 __ast_read: DTMF end '*' received on SIP/404-05fb,
duration 100 ms
[2012-03-30 16:46:07] DTMF[2036]: channel.c:2481
__ast_read: DTMF begin emulation of '*' with duration 100 queued on
SIP/404-05fb
[2012-03-30 16:46:07] DTMF[2036]: channel.c:2613
__ast_read: DTMF end emulation of '*' queued on
SIP/404-05fb
[2012-03-30 16:46:07] DTMF[2036]: channel.c:2455
__ast_read: DTMF end '9' received on SIP/404-05fb, duration 100
ms
[2012-03-30 16:46:07] DTMF[2036]: channel.c:2481 __ast_read: DTMF
begin emulation of '9' with duration 100 queued on
SIP/404-05fb
[2012-03-30 16:46:07] DTMF[2036]: channel.c:2613
__ast_read: DTMF end emulation of '9' queued on SIP/404-05fb
 --
Executing [s@macro-Parse:1] Verbose("Zap/64-1", "Parsing AGI variables")
in new stack
Parsing AGI variables
 -- Executing [s@macro-Parse:2]
AGI("Zap/64-1", "/etc/asterisk/agi/map.pl") in new stack
 -- Launched
AGI Script /etc/asterisk/agi/map.pl
AGI Tx >> agi_request:
/etc/asterisk/agi/map.pl
AGI Tx >> agi_channel: Zap/64-1
AGI Tx >>
agi_language: en
AGI Tx >> agi_type: Zap
AGI Tx >> agi_uniqueid:
1333115161.4651
AGI Tx >> agi_callerid: 044201
AGI Tx >>
agi_calleridname: unknown
AGI Tx >> agi_callingpres: 3
AGI Tx >>
agi_callingani2: 0
AGI Tx >> agi_callington: 0
AGI Tx >> agi_callingtns:
0
AGI Tx >> agi_dnid: 424
AGI Tx >> agi_rdnis: unknown
AGI Tx >>
agi_context: macro-Parse
AGI Tx >> agi_extension: s
AGI Tx >>
agi_priority: 2
AGI Tx >> agi_enhanced: 0.0
AGI Tx >>
agi_accountcode:
AGI Tx >>
 -- Span 3: Channel 0/2 got hangup request,
cause 16
AGI Tx >> 200 result=0
 == Spawn extension (macro-Parse, s, 2)
exited non-zero on 'Zap/64-1' in macro 'Parse'
 -- Executing [h@test:1]
Hangup("SIP/404-05fb", "16") in new stack
 == Spawn h extension
(test, h, 1) exited non-zero on 'SIP/404-05fb'
 -- Hungup 'Zap/64-1'


-- 
With Best Regards
Mikhail Lischuk

 --
_
-- 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 variables being wrong

2012-03-29 Thread Warren Selby
On Thu, Mar 29, 2012 at 2:16 PM, Mikhail Lischuk wrote:

> **
>
> Warren Selby писал 29.03.2012 20:20:
>
>   I'd be really curious to see the entire CLI log of the call, with
> verbose set to 6 and AGI debug enabled, from when the call first comes in
> to when it's hung up, including the execution of the *9 feature code.
> Also, knowing which version of Asterisk and DAHDI we're dealing with here
> couldn't hurt
>
>  The output is pretty same. I can enable DTMF debugging, but can't
> imagine how could it help us:
>
> -- Launched AGI Script /etc/asterisk/agi/map.pl
>
>
What I meant was, let's see the CLI output of the entire call, from the
time it starts, to the time it stops.  Something like the following:

-- Accepting call from 'XX' to 'YY' on channel 0/16,
span 1
-- Executing [YY@incoming-pri:1] Wait("DAHDI/16-1", "2") in new
stack
-- Executing [YY@incoming-pri:2] Verbose("DAHDI/16-1",
"Incoming call from XX to Main Line YY on 03/29/12 at
14:39:15.") in new stack
-- Executing [YY@incoming-pri:3] Goto("DAHDI/16-1",
"remote-phones,7999,1") in new stack
-- Goto (remote-phones,7999,1)
-- Executing [7999@remote-phones:1] Verbose("DAHDI/16-1", "Trying
extension 7999 on remote host remote.") in new stack
-- Executing [7999@remote-phones:2] Dial("DAHDI/16-1",
"SIP/7999@pbx-remote") in new stack
  == Using SIP RTP CoS mark 5
  == Using UDPTL CoS mark 5
-- Called 7999@pbx-remote
-- SIP/pbx-remote-0405 answered DAHDI/16-1
-- Channel 0/16, span 1 got hangup request, cause 16
  == Spawn extension (remote-phones, 7999, 2) exited non-zero on
'DAHDI/16-1'
-- Hungup 'DAHDI/16-1'

But with the AGI debug thrown in the middle where appropriate.


>
> To the OP - just trying to think outside the box here, but what if instead
> of calling the AGI directly from the features.conf feature code, you wrote
> a Macro or GoSub that you could then use as your application, and within
> the Macro / GoSub you executed your AGI?
>
> I'd love to, but I need that script to run only when user hits some key
> combo during call. All I was able to find regarding that, was using
> features.conf and dynamic application. If you can advise me some workaround
> - I would appreciate.
>
>
To do this, you change your features.conf setting like so:

parse => *9,peer/both,Macro,Parse

And you add something like this to your extensions.conf:

[macro-Parse]
exten => s,1,Verbose(Parsing AGI variables)
exten => s,n,AGI(map.pl)

Assuming your map.pl is in the place where your asterisk looks for agi (by
default this is /var/lib/asterisk/agi-bin), otherwise include the entire
path to the file.



-- 
Thanks,
--Warren Selby, dCAP
http://www.SelbyTech.com 
--
_
-- 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 variables being wrong

2012-03-29 Thread Danny Nicholas
This link may be helpful to OP - 
http://www.the-asterisk-book.com/unstable/funktionen-callerid.html#ftn.id2546149
 :  When you look for DNID on an incoming call, life is generally good.  On 
outgoing calls it’s a crap shoot.  Another “out of the box” suggestion;  run an 
‘asterisk –rx “core show channels verbose”’ and match the caller ID from that 
output.  Since you are already in an AGI,  it shouldn’t be more than 10-20 more 
lines of code. 

 

From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Mikhail Lischuk
Sent: Thursday, March 29, 2012 2:17 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] AGI variables being wrong

 

Warren Selby писал 29.03.2012 20:20:

 I'd be really curious to see the entire CLI log of the call, with verbose set 
to 6 and AGI debug enabled, from when the call first comes in to when it's hung 
up, including the execution of the *9 feature code.  Also, knowing which 
version of Asterisk and DAHDI we're dealing with here couldn't hurt

The output is pretty same. I can enable DTMF debugging, but can't imagine how 
could it help us:

-- Launched AGI Script /etc/asterisk/agi/map.pl
AGI Tx >> agi_request: /etc/asterisk/agi/map.pl
AGI Tx >> agi_channel: Zap/63-1
AGI Tx >> agi_language: en
AGI Tx >> agi_type: Zap
AGI Tx >> agi_uniqueid: 1333048969.6682
AGI Tx >> agi_callerid: 044201
AGI Tx >> agi_calleridname: unknown
AGI Tx >> agi_callingpres: 3
AGI Tx >> agi_callingani2: 0
AGI Tx >> agi_callington: 0
AGI Tx >> agi_callingtns: 0
AGI Tx >> agi_dnid: 408
AGI Tx >> agi_rdnis: unknown
AGI Tx >> agi_context: from_pstn
AGI Tx >> agi_extension:
AGI Tx >> agi_priority: 1
AGI Tx >> agi_enhanced: 0.0
AGI Tx >> agi_accountcode:
AGI Tx >>
AGI Tx >> 200 result=0 (i hang up the call)


To the OP - just trying to think outside the box here, but what if instead of 
calling the AGI directly from the features.conf feature code, you wrote a Macro 
or GoSub that you could then use as your application, and within the Macro / 
GoSub you executed your AGI?

I'd love to, but I need that script to run only when user hits some key combo 
during call. All I was able to find regarding that, was using features.conf and 
dynamic application. If you can advise me some workaround - I would appreciate.

-- 
With Best Regards
Mikhail Lischuk <mailto:mlisc...@itx.com.ua> 
--
_
-- 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 variables being wrong

2012-03-29 Thread Mikhail Lischuk
 

Warren Selby писал 29.03.2012 20:20: 

> I'd be really curious
to see the entire CLI log of the call, with verbose set to 6 and AGI
debug enabled, from when the call first comes in to when it's hung up,
including the execution of the *9 feature code. Also, knowing which
version of Asterisk and DAHDI we're dealing with here couldn't hurt

The
output is pretty same. I can enable DTMF debugging, but can't imagine
how could it help us: 

-- Launched AGI Script
/etc/asterisk/agi/map.pl
AGI Tx >> agi_request:
/etc/asterisk/agi/map.pl
AGI Tx >> agi_channel: Zap/63-1
AGI Tx >>
agi_language: en
AGI Tx >> agi_type: Zap
AGI Tx >> agi_uniqueid:
1333048969.6682
AGI Tx >> agi_callerid: 044201
AGI Tx >>
agi_calleridname: unknown
AGI Tx >> agi_callingpres: 3
AGI Tx >>
agi_callingani2: 0
AGI Tx >> agi_callington: 0
AGI Tx >> agi_callingtns:
0
AGI Tx >> agi_dnid: 408
AGI Tx >> agi_rdnis: unknown
AGI Tx >>
agi_context: from_pstn
AGI Tx >> agi_extension:
AGI Tx >> agi_priority:
1
AGI Tx >> agi_enhanced: 0.0
AGI Tx >> agi_accountcode:
AGI Tx >>
AGI
Tx >> 200 result=0 (i hang up the call) 

> To the OP - just trying to
think outside the box here, but what if instead of calling the AGI
directly from the features.conf feature code, you wrote a Macro or GoSub
that you could then use as your application, and within the Macro /
GoSub you executed your AGI?

I'd love to, but I need that script to run
only when user hits some key combo during call. All I was able to find
regarding that, was using features.conf and dynamic application. If you
can advise me some workaround - I would appreciate. 

-- 
With Best
Regards
Mikhail Lischuk

 --
_
-- 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 variables being wrong

2012-03-29 Thread Warren Selby
On Thu, Mar 29, 2012 at 10:10 AM, Steve Edwards
wrote:

> On Thu, 29 Mar 2012, Mikhail Lischuk wrote:
>
>  I have the following line in features.conf:
>> parse => *9,peer/both,AGI,/etc/**asterisk/agi/map.pl
>>
>
> I've never invoked an AGI from 'features,' but I'll assume it's 'the same'
> as executing an AGI from the dialplan.


Neither have I.  I'd be really curious to see the entire CLI log of the
call, with verbose set to 6 and AGI debug enabled, from when the call first
comes in to when it's hung up, including the execution of the *9 feature
code.  Also, knowing which version of Asterisk and DAHDI we're dealing with
here couldn't hurt



>
>  During outgoing call, those variables get messed up.
>>
>
>  Is that some bug, or misconfiguration, or maybe wrong programming?
>>
>
> Usual 'fails' in AGIs are:
>
> 1) Not using an established AGI library. While the AGI protocol is simple,
> nobody gets it right the first time.
>
> 2) Forgetting that your AGI's STDIN and STDOUT 'belong' to Asterisk and
> printing a debugging message or something similar.
>
> 3) Not reading the AGI environment from STDIN before requesting an AGI
> command.
>
>
While I would normally completely agree with you on this, he showed in his
original example the AGI environment that is being sent to the script is
what is "wrong", not the script's handling of said environment.  To be more
specific, the agi_callerid: and the agi_dnid: variables appear to have
incorrect values for an outbound call.  My guess would be that this has to
do with calling the AGI from a features.conf feature code, and not from
within dialplan itself.

To the OP - just trying to think outside the box here, but what if instead
of calling the AGI directly from the features.conf feature code, you wrote
a Macro or GoSub that you could then use as your application, and within
the Macro / GoSub you executed your AGI?


-- 
Thanks,
--Warren Selby, dCAP
http://www.SelbyTech.com 
--
_
-- 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 variables being wrong

2012-03-29 Thread Steve Edwards

On Thu, 29 Mar 2012, Mikhail Lischuk wrote:


I have the following line in features.conf:
parse => *9,peer/both,AGI,/etc/asterisk/agi/map.pl


I've never invoked an AGI from 'features,' but I'll assume it's 'the same' 
as executing an AGI from the dialplan.



During outgoing call, those variables get messed up.



Is that some bug, or misconfiguration, or maybe wrong programming?


Usual 'fails' in AGIs are:

1) Not using an established AGI library. While the AGI protocol is simple, 
nobody gets it right the first time.


2) Forgetting that your AGI's STDIN and STDOUT 'belong' to Asterisk and 
printing a debugging message or something similar.


3) Not reading the AGI environment from STDIN before requesting an AGI 
command.


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


  1   2   3   4   5   6   7   8   9   >