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۹{yst{xuzy|qvvuuuu[|wxyxwwxt{صxڵ6ߜ\ܲquyyxywxzٸzzx|\w~~wx|ywwx||[u|{uyxx~ruuܵx|w{\\|ܷxuyyܺ~]|uxyۻu{x״psuuYxڶ{tzvyyyut{sy\Xy]~w{w۴qz\wuzxutZys^tw|[yٶx|ںxYsxv[wuyuuu~ztzxv\twt|{{w|\x~xxt|~9{xtxruڹuvvxxxvv~yx~wxxyqx{^z|~߸]{[x{X~xyw|7ݵwWuwv|~Ywyxxt|ڶ_w~]x{]zwy]^ޘys^vu{^zzs:tuxx{tu[y߸xwuwuywu|v~vֹvXwyZu{ܻuxxwܼ_yxv~x~]r5y{w~tywyxڞxzvv|V{ssx۟7tws\xXw[sx\ry]ܾw will stream the audio contained in @@ -209,7 +209,8 @@ controls this. stream the audio contained in [filename], repeat the stream [loopcount] times (the default is 1, and -1 indicates it will repeat forever), and will treat the audio as being of [payloadtype] (where 8 - is the default of PCMA, 0 indicates PCMU, and 18 indicates G729). + is the default of PCMA, 0 indicates PCMU, 9 indicates G722, 18 + indicates G729 and 98 indicates iLBC in 30ms 13.33kbps). + will pause any currently active playback. + will resume any currently paused @@ -231,7 +232,22 @@ play_pcap_audio="[file_to_play]" with: + file_to_play: the pre-recorded pcap file to play +The audio file should be the raw samples, example files are included +for PCMA, G722 and iLBC (mode=30). +===== ========== =========== =========== ================================ +Codec Payload id Packet size Packet time FFMpeg arguments +===== ========== =========== =========== ================================ +PCMU 0 160 bytes 20 ms -f ulaw -ar 8k -ac 1 +PCMA 8 160 bytes 20 ms -f alaw -ar 8k -ac 1 +G722 9 160 bytes 20 ms -f g722 -ar 16k -ac 1 +G729 18 20 bytes 20 ms *not supported by ffmpeg* +iLBC 98 50 bytes 30 ms -f ilbc -ar 8k -ac 1 -b:a 13.33k +===== ========== =========== =========== ================================ + +.. note:: + FFmpeg adds a header to iLBC files denoting the mode that is used, either 20 + or 30 ms per packet. This header needs to be stripped from the file. .. note:: The action is non-blocking. SIPp will start a light-weight thread to play the file and the scenario with continue immediately. If needed, diff --git a/src/actions.cpp b/src/actions.cpp index 9c9b85b0..7f0ae257 100644 --- a/src/actions.cpp +++ b/src/actions.cpp @@ -540,11 +540,21 @@ void CAction::setRTPStreamActInfo(const char* P_value) M_rtpstream_actinfo.bytes_per_packet = 160; M_rtpstream_actinfo.ticks_per_packet = 160; break; + case 9: + M_rtpstream_actinfo.ms_per_packet = 20; + M_rtpstream_actinfo.bytes_per_packet = 160; + M_rtpstream_actinfo.ticks_per_packet = 160; + break; case 18: M_rtpstream_actinfo.ms_per_packet = 20; M_rtpstream_actinfo.bytes_per_packet = 20; M_rtpstream_actinfo.ticks_per_packet = 160; break; + case 98: + M_rtpstream_actinfo.ms_per_packet = 30; + M_rtpstream_actinfo.bytes_per_packet = 50; + M_rtpstream_actinfo.ticks_per_packet = 240; + break; default: M_rtpstream_actinfo.ms_per_packet= -1; M_rtpstream_actinfo.bytes_per_packet= -1;