login | register
Fri 09 of May, 2008 [16:51 UTC]

voip-info.org

Search with Google
Search this site with Google. Results may not include recent changes.
 
Google Ads
Shoutbox
  • Nick Barnes, Fri 09 of May, 2008 [11:36 UTC]: Christopher - yesterday I tried an Asterisk install on a CentOS 5.1 box with stock GUI and it all worked fine. Sorry I can't help.
  • aero, Fri 09 of May, 2008 [08:20 UTC]: can someone help me out on this, i tried to play some sound files on my asterisk box and this is the error message i got. WARNING[4429]: format_wav.c:169 check_header: Unexpected freqency 22050 May 8 11:17:39 WARNING[4433]: codec_gsm.c:194 gsmtolin_fra
  • Christopher Faust, Thu 08 of May, 2008 [14:15 UTC]: I beleive that I may have to change something in the xserver configuration. Please advise
  • Christopher Faust, Thu 08 of May, 2008 [14:14 UTC]: Everything was perfect. In the bios I have increased the memory allocated Still receive input not supported on my display.
  • Christopher Faust, Thu 08 of May, 2008 [14:13 UTC]: This would not be my main box. I am doing some testing to see if I can install zaptel and asterisk 1.4 on a full centos 5.1 box with development software Its bizzare, because before I went through the asterisk and zaptel installation everything was perfe
  • Nick Barnes, Thu 08 of May, 2008 [13:44 UTC]: Christopher - I can't see any way in which an Asterisk installation would muck your GUI, but remember that it is advised not to use a GUI on an Asterisk box anyway.
  • Christopher Faust, Wed 07 of May, 2008 [15:28 UTC]: When I try to startx I ge input not supported. Though before installing asterisk I had no video issue to start the GUI
  • Christopher Faust, Wed 07 of May, 2008 [15:26 UTC]: Hi Nick, I got centos 5.1 and asterisk up But now I cannot start startx I have set the depth from 24 to 16 for the video i810 driver for the i845 on my netvista machine but I cannot start GNOME. Please advise
  • Nick Barnes, Wed 07 of May, 2008 [10:01 UTC]: Howard - You'll need to provide a lot more information if you really want help.
  • Nick Barnes, Wed 07 of May, 2008 [10:00 UTC]: Christopher - Search the Wiki and you'll find a page I wrote detailing exactly what you have to do for Asterisk 1.4 + CentOS 5.1.
Server Stats
  • Execution time: 0.36s
  • Memory usage: 2.19MB
  • Database queries: 32
  • GZIP: Disabled
  • Server load: 0.97

IAX2 ping tool

#!/usr/bin/perl -w
#udp ping tool

use IO::Socket;
$target = shift; #"192.168.0.255";
$target_port = 4569;

socket(PING, PF_INET, SOCK_DGRAM, getprotobyname("udp"));

# Build Packet ... 
# Names from ethereal filter of registration packet

$src_call = "8000"; #8000 most siginificant bit is IAX packet type full ... required for a poke etc...
$dst_call = "0000";
$timestamp = "00000000";
$outbound_seq = "00";
$inbound_seq = "00";
$type = "06"; #IAX_Control
$iax_type = "1e"; #POKE
$msg = pack "H24", $src_call . $dst_call . $timestamp . $outbound_seq . $inbound_seq . $type . $iax_type;

# Send UDP packet

$ipaddr = inet_aton($target);
$sendto = sockaddr_in($target_port,$ipaddr);

send(PING, $msg, 0, $sendto) == length($msg) or die "cannot send to $target : $target_port : $!\n";

# Listen for responses... listen for TIMEOUT seconds and report all responders (works for broadcast pings)

$MAXLEN = 1024;
$TIMEOUT = 5;

eval {
local $SIG{ALRM} = sub { die "alarm time out"; };
alarm $TIMEOUT;

while (1) {
$recvfrom = recv(PING, $msg, $MAXLEN, 0) or die "recv: $!";
($port, $ipaddr) = sockaddr_in($recvfrom);
$respaddr = inet_ntoa($ipaddr);
print "Response from $respaddr : $port\n";
}

};

Created by Nezer, Last modification by Nezer on Thu 13 of Oct, 2005 [15:16 UTC]

Comments Filter

Re: Needs to send an ACK

by John Hass on Tuesday 22 of May, 2007 [16:17:27 UTC]
Here is an example of how to send an ack:

                       $type = "06"; #IAX_Control
                       $iax_type = "04"; #ACK
                        $msg = pack "H24", $src_call . $dst_call . $timestamp . $outbound_seq . $inbound_seq . $type . $iax_type;
                       send(PING, $msg, 0, $sendto) == length($msg) or die "cannot send to $target : $target_port : $!\n";

check this out for more:
http://www.heise.de/netze/rfc/drafts/draft-guy-iax-03.shtml

It is important to note this will kill the current ping process maybe a better way to utilize this would be:

#!/usr/bin/perl -w
#udp ping tool

use IO::Socket;
$target = shift; #"192.168.0.255";
$target_port = 4569;

socket(PING, PF_INET, SOCK_DGRAM, getprotobyname("udp"));

# Build Packet ... 
# Names from ethereal filter of registration packet

$src_call = "8000"; #8000 most siginificant bit is IAX packet type full ... required for a poke etc...
$dst_call = "0000";
$timestamp = "00000000";
$outbound_seq = "00";
$inbound_seq = "00";
$type = "06"; #IAX_Control
$iax_type = "1e"; #POKE
$msg = pack "H24", $src_call . $dst_call . $timestamp . $outbound_seq . $inbound_seq . $type . $iax_type;

# Send UDP packet

$ipaddr = inet_aton($target);
$sendto = sockaddr_in($target_port,$ipaddr);

send(PING, $msg, 0, $sendto) == length($msg) or die "cannot send to $target : $target_port : $!\n";

# Listen for responses... listen for TIMEOUT seconds and report all responders (works for broadcast pings)

$MAXLEN = 1024;
$TIMEOUT = 5;

eval {
local $SIG{ALRM} = sub { die "alarm time out"; };
alarm $TIMEOUT;
$total = 3;
$count = 0;
while ($count < $total) {
  $recvfrom = recv(PING, $msg, $MAXLEN, 0) or die "recv: $!";
  ($port, $ipaddr) = sockaddr_in($recvfrom);
  $respaddr = inet_ntoa($ipaddr);
  print "Response from $respaddr : $port\n";
  $count++;
}

$type = "06"; #IAX_Control
$iax_type = "04"; #ACK
$msg = pack "H24", $src_call . $dst_call . $timestamp . $outbound_seq . $inbound_seq . $type . $iax_type;
send(PING, $msg, 0, $sendto) == length($msg) or die "cannot send to $target : $target_port : $!\n";

};

if ($@) {
       print "Error Timeout waiting for packet from: $target\r\n";
       $type = "06"; #IAX_Control
       $iax_type = "04"; #ACK
       $msg = pack "H24", $src_call . $dst_call . $timestamp . $outbound_seq . $inbound_seq . $type . $iax_type;
       send(PING, $msg, 0, $sendto) == length($msg) or die "cannot send to $target : $target_port : $!\n";
}

Needs to send an ACK

by Chip Schweiss on Thursday 09 of March, 2006 [18:31:37 UTC]
Asterisk really doesn't like this tool.

Once you ping Asterisk with this tool, Asterisk keeps responding looking for an ACK packet in return.

My perl is very rusty. Anyone care to update the this tool to be more friendly?

Please update this page with new information, just login and click on the "Edit" or "Add Comment" button above. Get a free login here: Register Thanks! - support@voip-info.org

Page Changes | Comments

Sponsored by:

Terms of Service Privacy Policy
© 2003-2008 VOIP-Info.org LLC

Powered by bitweaver