Re: [asterisk-users] AMI perl daemon

2011-05-16 Thread Ryan Bullock
Calling ->action() is going to wait for the originate to finish (even
if you use 'Async'). I think the default timeout for Originate is 60
seconds or so before it fails.

I would recommend reading up on:

http://search.cpan.org/~mlehmann/AnyEvent-5.34/
http://search.cpan.org/~mlehmann/AnyEvent-DBI-2.1/

You could us a timer to periodically poll your database and do
non-blocking originates (with async) with callbacks to catch the
response, update the log, and do the delete.

On Mon, May 16, 2011 at 11:49 AM, vip killa  wrote:
> http://pastebin.com/W5h9AMrQ
> anything else you need to see?
>
> On Mon, May 16, 2011 at 2:45 PM, Ryan Bullock  wrote:
>>
>> A normal Originate over the AMI will block all other actions until it
>> completes. So to do other commands while the Originate is still going
>> you have to call Originate with the Async option. I would suggest
>> using  an Originate with the 'Async' option and OriginateHack=>1. If
>> that is still not working I would have to see your code. Unfortunately
>> I am not on irc today.
>>
>> On Mon, May 16, 2011 at 11:16 AM, vip killa  wrote:
>> > i was able to create a daemon that queries a database every 2 seconds
>> > for
>> > outbound calls. the daemon originates a call to a destination determined
>> > by
>> > the database. what i've noticed is, after the originate, the script
>> > never
>> > does anything else. it seems i have to use "Async" or the AMI will
>> > disconnect, so i tried using OriginateHack=>1 but still no dice... any
>> > ideas?
>> > On Mon, May 16, 2011 at 11:37 AM, Ryan Bullock 
>> > wrote:
>> >>
>> >> Alex is pointing you in the right direction. You should want a single
>> >> daemon running that then gets notified by the voicemail script, either
>> >> through a FIFO, a socket, or by dropping a file in a watched
>> >> directory.
>> >>
>> >> If you are going to write a daemon, I would suggest looking at :
>> >>
>> >> http://search.cpan.org/~greenbean/Asterisk-AMI-v0.2.5/
>> >>
>> >> It has integration with event loops and should work well for what you
>> >> are doing. It also has some features for detecting disconnects and
>> >> timeouts.
>> >>
>> >> On Mon, May 16, 2011 at 5:42 AM, Alex Balashov
>> >>  wrote:
>> >> > On 05/16/2011 08:33 AM, vip killa wrote:
>> >> >
>> >> >> Thank you, that makes sense but actually I would be invoking the
>> >> >> script
>> >> >> using the "externnotify" in voicemail.conf, similar to
>> >> >> "externnotify = /var/lib/asterisk/scripts/notify.pl
>> >> >> <http://notify.pl>"
>> >> >> I assume "externnotify" cannot call the FastAGI server...correct?
>> >> >
>> >> > That is correct.  But you can call a script that notifies the daemon
>> >> > through
>> >> > a FIFO or UNIX domain socket, if local, or network socket if remote.
>> >> >
>> >> > --
>> >> > Alex Balashov - Principal
>> >> > Evariste Systems LLC
>> >> > 260 Peachtree Street NW
>> >> > Suite 2200
>> >> > Atlanta, GA 30303
>> >> > Tel: +1-678-954-0670
>> >> > Fax: +1-404-961-1892
>> >> > Web: http://www.evaristesys.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
>> >> >
>> >>
>> >> --
>> >> _
>> >> -- 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/aste

Re: [asterisk-users] AMI perl daemon

2011-05-16 Thread Ryan Bullock
A normal Originate over the AMI will block all other actions until it
completes. So to do other commands while the Originate is still going
you have to call Originate with the Async option. I would suggest
using  an Originate with the 'Async' option and OriginateHack=>1. If
that is still not working I would have to see your code. Unfortunately
I am not on irc today.

On Mon, May 16, 2011 at 11:16 AM, vip killa  wrote:
> i was able to create a daemon that queries a database every 2 seconds for
> outbound calls. the daemon originates a call to a destination determined by
> the database. what i've noticed is, after the originate, the script never
> does anything else. it seems i have to use "Async" or the AMI will
> disconnect, so i tried using OriginateHack=>1 but still no dice... any
> ideas?
> On Mon, May 16, 2011 at 11:37 AM, Ryan Bullock  wrote:
>>
>> Alex is pointing you in the right direction. You should want a single
>> daemon running that then gets notified by the voicemail script, either
>> through a FIFO, a socket, or by dropping a file in a watched
>> directory.
>>
>> If you are going to write a daemon, I would suggest looking at :
>>
>> http://search.cpan.org/~greenbean/Asterisk-AMI-v0.2.5/
>>
>> It has integration with event loops and should work well for what you
>> are doing. It also has some features for detecting disconnects and
>> timeouts.
>>
>> On Mon, May 16, 2011 at 5:42 AM, Alex Balashov
>>  wrote:
>> > On 05/16/2011 08:33 AM, vip killa wrote:
>> >
>> >> Thank you, that makes sense but actually I would be invoking the script
>> >> using the "externnotify" in voicemail.conf, similar to
>> >> "externnotify = /var/lib/asterisk/scripts/notify.pl <http://notify.pl>"
>> >> I assume "externnotify" cannot call the FastAGI server...correct?
>> >
>> > That is correct.  But you can call a script that notifies the daemon
>> > through
>> > a FIFO or UNIX domain socket, if local, or network socket if remote.
>> >
>> > --
>> > Alex Balashov - Principal
>> > Evariste Systems LLC
>> > 260 Peachtree Street NW
>> > Suite 2200
>> > Atlanta, GA 30303
>> > Tel: +1-678-954-0670
>> > Fax: +1-404-961-1892
>> > Web: http://www.evaristesys.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
>> >
>>
>> --
>> _
>> -- 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] AMI perl daemon

2011-05-16 Thread Ryan Bullock
Alex is pointing you in the right direction. You should want a single
daemon running that then gets notified by the voicemail script, either
through a FIFO, a socket, or by dropping a file in a watched
directory.

If you are going to write a daemon, I would suggest looking at :

http://search.cpan.org/~greenbean/Asterisk-AMI-v0.2.5/

It has integration with event loops and should work well for what you
are doing. It also has some features for detecting disconnects and
timeouts.

On Mon, May 16, 2011 at 5:42 AM, Alex Balashov
 wrote:
> On 05/16/2011 08:33 AM, vip killa wrote:
>
>> Thank you, that makes sense but actually I would be invoking the script
>> using the "externnotify" in voicemail.conf, similar to
>> "externnotify = /var/lib/asterisk/scripts/notify.pl "
>> I assume "externnotify" cannot call the FastAGI server...correct?
>
> That is correct.  But you can call a script that notifies the daemon through
> a FIFO or UNIX domain socket, if local, or network socket if remote.
>
> --
> Alex Balashov - Principal
> Evariste Systems LLC
> 260 Peachtree Street NW
> Suite 2200
> Atlanta, GA 30303
> Tel: +1-678-954-0670
> Fax: +1-404-961-1892
> Web: http://www.evaristesys.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
>

--
_
-- 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] action at registering or de-registering

2010-11-24 Thread Ryan Bullock
On Asterisk 1.8 when a SIP peer resgisters or unregisters it generates
a PeerStatus event. I don't know if this is in 1.4/1.6 as well, but
should be easy enough to test.

Here is an example of what I see on the manager interface during a
register/unregister:

Event: PeerStatus
Privilege: system,all
ChannelType: SIP
Peer: SIP/twinkle
PeerStatus: Registered
Address: 192.168.56.1:5068

Event: PeerStatus
Privilege: system,all
ChannelType: SIP
Peer: SIP/twinkle
PeerStatus: Unregistered

I think that should work for whatever you need to do.

-- 
_
-- 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] Dial plan question.

2010-04-28 Thread Ryan Bullock
Try: exten => bob,1,Dial(SIP/ext-sip/${EXTEN},20) ?

-- 
_
-- 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] Asterisk 1.4.30 is slow sending STDIN to AGI script

2010-04-28 Thread Ryan Bullock
Looking at the Asterisk::AGI docs, maybe try calling ReadParse() early
in the script to read in anything from stdin?

(From the docs)
# pull AGI variables into %input
%input = $AGI->ReadParse();

-- 
_
-- 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] Follow-me to my answering machine :-(

2010-04-22 Thread Ryan Bullock
Ah, sorry, I totally missed that in your description.

Other than the speech recognition that Danny is suggesting, my only thought
is to use an agi that will originate another leg, run AMD (answering machine
detect) and then dump the two parties into a conference to re-join them(or
use the Bridge command in newer version).
-- 
_
-- 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] More efficient dial plan for a list of selective inbound numbers

2010-04-22 Thread Ryan Bullock
Catches 555 through 559:

exten => _55[5-9],1,answer
exten => _55[5-9],n,playback(beep)

http://www.voip-info.org/wiki/index.php?page=Asterisk+Dialplan+Patterns
-- 
_
-- 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] Hangup after n seconds using originate ?

2010-04-22 Thread Ryan Bullock
Have you tried setting 'Variable: TIMEOUT(absolute)*=*60' or something like
that when creating the originate command?

I don't know if it works, but it is worth a shot.
-- 
_
-- 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] Follow-me to my answering machine :-(

2010-04-22 Thread Ryan Bullock
Check out the 'p' option for the Dial command.

http://www.voip-info.org/wiki/view/Asterisk+cmd+Dial

It enables call screening, so you have to press 1 to answer. This can also
prevent the voice mail from being left on your cell phone.
-- 
_
-- 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] Asterisk choking on voice messages announcements

2010-04-21 Thread Ryan Bullock
So I be it sounds like all the recordings are underwater.

Are you using dahdi for timing? Can you run dahdi_test?

Asterisk needs a good timing source, in the case when you don't have a
physical card providing it, it relies on kernel ticks or the RTC (or HPET).
Because of the nature of virtual machines they don't always get access to
the processor when they want and therefore their timing can get skewed and
can be bad for real-time applications.

There are some patches/work-arounds that you can do. You might want to
google 'asterisk in a virtual machine' or 'asterisk timing virutal machine',
or anything along those lines.

I think I remember in some of the recent dahdi or asterisk release notes
that they changed some settings to be more virtual machine friendly. So
maybe make sure you are running the latest versions?
-- 
_
-- 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] Asterisk choking on voice messages announcements

2010-04-21 Thread Ryan Bullock
Are you running asterisk in a virtual machine?
-- 
_
-- 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] A matter of context

2010-04-19 Thread Ryan Bullock
Have you tried 'type = friend', might also want to make sure 'allowguest' is
set to 'no', as this may be putting guest calls into your default context.
-- 
_
-- 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] Better SIP security please! Was: (no subject)

2010-03-19 Thread Ryan Bullock
>
> Hey Philipp,
>

You can check out
http://www.voip-info.org/wiki/view/Fail2Ban+(with+iptables)+And+Asterisk for
setting up from brute force detection and blocking with asterisk. There are
also a link at the bottom about rate limiting registrations via iptables.
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

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

[asterisk-users] Testers Need Issue #0016965: [patch] DBGet response does not end with a 'Complete' event

2010-03-11 Thread Ryan Bullock
This patch adds a 'DBGetComplete' event after the 'DBGetResponse' to bring
the behavior of the DBGet Action in line with how other actions behave. I
have tested the patch against 1.4.29.1 and it worked for me.

Patch is available on the issue page.

https://issues.asterisk.org/view.php?id=16965

Please post your results as a note for the issue.

Thanks.

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