If you are using phksh, ksh88 or ksh93, here is an example of testing an input to determine if it is all numeric, letters or a mix of numbers and letters:
How can I compare two integer values which is stored in char pointers?
suppose I have char *a and char *b having values 10 and 20. how can i find the shorter value? (1 Reply)
This is the code:
while test 1 -eq 1
do
read a
$a
if test $a = stop
then
break
fi
done
I read a command on every loop an execute it.
I check if the string equals the word stop to end the loop,but it say that I gave too many arguments to test.
For example echo hello.
Now the... (1 Reply)
Hi guys, I asked for help on programming forums and no one didn't helped me so I ask for help here. I am playing with some tasks from my book and I can't figure where did I get wrong.
From the first program I get a blank screen, program won't generate 10*10 matrix.
And second problem is I... (6 Replies)
Hi folks,
I am self-learning as I can
I have a script that has read a file into an array.
I can read out each line in the array with the code:
for INDEX in {0..$LENGTH} ## $LENGTH was determined at the read in
do
echo "${data}"
done
What I need to do is test the first char... (2 Replies)
Working out a small problem, I have a need of a Perl snippet which might look something like this:
use integer;
...
if ($changingNumber / 2)
{
do something;
}
else
{
do something else;
}
...
What I want to happen is for "if" to resolve as "true" every time a whole... (3 Replies)
Discussion started by: LinQ
3 Replies
LEARN ABOUT DEBIAN
net::sip::simple::rtp
Net::SIP::Simple::RTP(3pm) User Contributed Perl Documentation Net::SIP::Simple::RTP(3pm)NAME
Net::SIP::Simple::RTP - simple RTP handling for Net::SIP::Simple
SYNOPSIS
my $echo_10 = Net::SIP::Simple->rtp( 'media_recv_echo', 'output.pcmu-8000', 10 );
my $announce = Net::SIP::Simple->rtp( 'media_send_recv', 'announce.pcmu-8000', 2 );
DESCRIPTION
This package handles simple RTP stuff for testing and small applications. It provides methods for receiving PCUM/8000 data and for echoing
them back or for sending and receiving PCMU/8000 data.
It's used from method rtp in Net::SIP::Simple.
SUBROUTINES
media_recv_echo ( [ OUTPUT, DELAY ] )
Receives RTP data and echos them back to the sender. If OUTPUT is given it will be used as the file for saving the received data
without the RTP header.
OUTPUT might also be a callback which gets the payload as argument.
If DELAY is >0 the data will not be echoed back immediatly but with an delay of DELAY packets (e.g. with DELAY 10 it will send back
the first packet after it received the 10th packet). If DELAY is <0 the data will not be echoed back. If DELAY is not given or equal
0 the data will be echoed back immediatly.
If no traffic comes in for more then 10 seconds it will hang up the call because of inactivity.
media_send_recv ( INPUT, [ REPEAT, OUTPUT ] )
Will read data from file INPUT and send them as RTP to peer. It will assume that each data block in INPUT consists of 160 bytes, which
is right for PCMU/8000 without RTP header. The RTP header will be added to the data.
If it reaches the end of the file it will stop unless REPEAT is given in which case it will repeat the sending REPEAT times (if REPEAT
is less 0 it will repeat forever e.g. until the other party hangs up). On stopping it will invoke the callback cb_rtp_done from the
connection params for the Net::SIP::Simple::Call or if this is not given it will close the call by issuing a BYE.
INPUT might also be a callback usable by invoke_callback in Net::SIP::Util which returns the data to send. In this case REPEAT is not
used.
Incoming data will be written to the optional OUTPUT file like in media_recv_echo. The content from OUTPUT has the same format as INPUT
or OUTPUT from media_recv_echo.
OUTPUT might also be a callback which gets the payload as argument.
If no traffic comes in for more then 10 seconds it will hang up the call because of inactivity.
perl v5.14.2 2009-01-23 Net::SIP::Simple::RTP(3pm)