Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] pipeast [was: Re: How to repeat pri show span and zap show channel commands]


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
tzafrir.cohen at xorco...
Guest





PostPosted: Sun Dec 01, 2013 6:47 am    Post subject: [asterisk-users] pipeast [was: Re: How to repeat pri show sp Reply with quote

Hi,

Long ago, On Wed, Feb 21, 2007 at 09:32:26AM +0200, Tzafrir Cohen wrote:
Quote:
On Wed, Feb 21, 2007 at 07:56:18AM +0100, Olivier wrote:

[snip]

Quote:
Quote:
Any better idea than running an dedicated shell script with a "asterisk -rx
pri show span 1" line ?

Here is my pipeast script:

(while read line; do
echo -n "$line" # trim the ending newline
sleep 0.001 # generate different write(2)-s
done) | socat - /var/run/asterisk/asterisk.ctl

You can pipe whatever you want to that. e.g:

while true; do
echo pri show span 1
sleep 30
done | pipeast

Note: socat is available as a debian package:
http://packages.debian.org/socat .

It has lately come to my attention that this method is broken (and has
been, for quite some time. Sure enough. It does not use any published
inteerface) and that there is actually some demand for using it.

A version of pipeast that seems to work now is:

#!/bin/sh
while read line; do
echo "$line" | tr '\n' '\0'
sleep 0.001
done | nc -U /var/run/asterisk/asterisk.ctl


Notes:
1. nc, or at least openbsd-netcat, can use unix domain sockets (-U).
No need for socat.

2. that /var/run is slowly converting to /run , though the
compatibility link /var/run will likely stay for quite some time.

3. If this script breaks in the future, you get to keep both pieces.
But this is only guaranteed if it breaks to exactly two pieces.

--
Tzafrir Cohen
icq#16849755 jabber:tzafrir.cohen@xorcom.com
+972-50-7952406 mailto:tzafrir.cohen@xorcom.com
http://www.xorcom.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
Back to top
indreias at gmail.com
Guest





PostPosted: Wed Dec 04, 2013 1:29 am    Post subject: [asterisk-users] pipeast [was: Re: How to repeat pri show sp Reply with quote

Many thanks Tzafrir - it works like a charm.

Best regards,
Ioan



On Sun, Dec 1, 2013 at 1:46 PM, Tzafrir Cohen <tzafrir.cohen@xorcom.com (tzafrir.cohen@xorcom.com)> wrote:
Quote:
Hi,

Long ago, On Wed, Feb 21, 2007 at 09:32:26AM +0200, Tzafrir Cohen wrote:
Quote:
On Wed, Feb 21, 2007 at 07:56:18AM +0100, Olivier wrote:

[snip]

Quote:
Quote:
Any better idea than running an dedicated shell script with a "asterisk -rx
pri show span 1" line ?

Here is my pipeast script:

(while read line; do
  echo -n "$line"   # trim the ending newline
  sleep 0.001       # generate different write(2)-s
done) | socat - /var/run/asterisk/asterisk.ctl

You can pipe whatever you want to that. e.g:

while true; do
  echo pri show span 1
  sleep 30
done | pipeast

Note: socat is available as a debian package:
http://packages.debian.org/socat .

It has lately come to my attention that this method is broken (and has
been, for quite some time. Sure enough. It does not use any published
inteerface) and that there is actually some demand for using it.

A version of pipeast that seems to work now is:

#!/bin/sh
while read line; do
  echo "$line" | tr '\n' '\0'
  sleep 0.001
done | nc -U /var/run/asterisk/asterisk.ctl


Notes:
1. nc, or at least openbsd-netcat, can use unix domain sockets (-U).
   No need for socat.

2. that /var/run is slowly converting to /run , though the
   compatibility link /var/run will likely stay for quite some time.

3. If this script breaks in the future, you get to keep both pieces.
   But this is only guaranteed if it breaks to exactly two pieces.

--
               Tzafrir Cohen
icq#16849755              jabber:tzafrir.cohen@xorcom.com ([email]jabber%3Atzafrir.cohen@xorcom.com[/email])
tzafrir.cohen@xorcom.com (tzafrir.cohen@xorcom.com)
http://www.xorcom.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
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services