.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Net::SIP::Simple::RTP 3pm" .TH Net::SIP::Simple::RTP 3pm "2023-09-29" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Net::SIP::Simple::RTP \- simple RTP handling for Net::SIP::Simple .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& my $echo_10 = Net::SIP::Simple\->rtp( \*(Aqmedia_recv_echo\*(Aq, \*(Aqoutput.pcmu\-8000\*(Aq, 10 ); \& my $announce = Net::SIP::Simple\->rtp( \*(Aqmedia_send_recv\*(Aq, \*(Aqannounce.pcmu\-8000\*(Aq, 2 ); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This package handles simple \s-1RTP\s0 stuff for testing and small applications. It provides methods for receiving \s-1PCUM/8000\s0 data and for echoing them back or for sending and receiving \s-1PCMU/8000\s0 data. .PP It's used from method \fBrtp\fR in Net::SIP::Simple. .SH "SUBROUTINES" .IX Header "SUBROUTINES" .IP "media_recv_echo ( [ \s-1OUTPUT, DELAY\s0 ] )" 4 .IX Item "media_recv_echo ( [ OUTPUT, DELAY ] )" Receives \s-1RTP\s0 data and echoes them back to the sender. If \s-1OUTPUT\s0 is given it will be used as the file for saving the received data without the \s-1RTP\s0 header. .Sp \&\s-1OUTPUT\s0 might also be a callback which gets the payload as argument. .Sp If \s-1DELAY\s0 is >0 the data will not be echoed back immediately but with a delay of \s-1DELAY\s0 packets (e.g. with \s-1DELAY 10\s0 it will send back the first packet after it received the 10th packet). If \s-1DELAY\s0 is <0 the data will not be echoed back. If \s-1DELAY\s0 is not given or equal 0 the data will be echoed back immediately. .Sp If no traffic comes in for more then 10 seconds it will hang up the call because of inactivity. .IP "media_send_recv ( \s-1INPUT,\s0 [ \s-1REPEAT, OUTPUT\s0 ] )" 4 .IX Item "media_send_recv ( INPUT, [ REPEAT, OUTPUT ] )" Will read data from file \s-1INPUT\s0 and send them as \s-1RTP\s0 to peer. It will assume that each data block in \s-1INPUT\s0 consists of 160 bytes, which is right for \s-1PCMU/8000\s0 without \s-1RTP\s0 header. The \s-1RTP\s0 header will be added to the data. .Sp If it reaches the end of the file it will stop unless \s-1REPEAT\s0 is given in which case it will repeat the sending \s-1REPEAT\s0 times (if \s-1REPEAT\s0 is less 0 it will repeat forever e.g. until the other party hangs up). On stopping it will invoke the callback \fBcb_rtp_done\fR from the connection params for the Net::SIP::Simple::Call or if this is not given it will close the call by issuing a \s-1BYE.\s0 .Sp \&\s-1INPUT\s0 might also be a callback usable by \fBinvoke_callback\fR in Net::SIP::Util which returns the data to send. In this case \s-1REPEAT\s0 is not used. .Sp Incoming data will be written to the optional \s-1OUTPUT\s0 file like in \fBmedia_recv_echo\fR. The content from \s-1OUTPUT\s0 has the same format as \s-1INPUT\s0 or \s-1OUTPUT\s0 from \fBmedia_recv_echo\fR. .Sp \&\s-1OUTPUT\s0 might also be a callback which gets the payload as an argument. .Sp If no traffic comes in for more then 10 seconds it will hang up the call because of inactivity.