From 6e519047dfd538289918b465d572a84b5c3c0e7c Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Tue, 1 Dec 2020 11:02:15 -0500 Subject: [PATCH] TT#101653 add tests for codec-consume/accept Change-Id: I054584d338645ebe59ed0803aa3262f81c2e7401 --- t/auto-daemon-tests.pl | 249 +++++++++++++++++++++ t/transcode-test.c | 480 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 729 insertions(+) diff --git a/t/auto-daemon-tests.pl b/t/auto-daemon-tests.pl index 7094e40e0..3dd827d67 100755 --- a/t/auto-daemon-tests.pl +++ b/t/auto-daemon-tests.pl @@ -753,6 +753,182 @@ a=sendrecv a=rtcp:PORT SDP +## + +offer('strip-all w consume and offer', + { codec => { + strip => ['all'], + consume => ['CN'], + offer => ['PCMA', 'PCMU', 'telephone-event'], + } }, < { + strip => ['all'], + consume => ['CN'], + offer => ['PCMA', 'PCMU', 'telephone-event'], + }, + flags => ['symmetric codecs'], + }, < ['symmetric codecs'], + }, < 'remove', replace => ['origin'], + codec => { + strip => ['all'], + consume => ['CN'], + offer => ['PCMA','PCMU','telephone-event'], + } }, < 'remove', replace => ['origin'] }, < PCMA + packet_seq(A, 9, G722_payload, 0, 0, -1, ""); // nothing due to resampling + packet_seq_nf(A, 9, G722_payload, 160, 1, 8, PCMA_payload); + packet_seq_ts(A, 9, G722_payload, 320, 2, 8, PCMA_payload, 160, 0); + // asymmetric codec + packet(B, 8, PCMA_payload, 8, PCMA_payload); // nothing due to resampling + end(); + // codec-mask + transcode + accept transcoded codec + symmetric codecs + start(); + sdp_pt(104, SILK, 16000); + sdp_pt(9, G722, 8000); + sdp_pt(0, PCMU, 8000); + sdp_pt(8, PCMA, 8000); + sdp_pt(101, telephone-event, 8000); + sdp_pt(13, CN, 8000); + sdp_pt(118, CN, 16000); + ht_set(codec_mask, PCMU); + transcode(GSM); + offer(); + expect(A, recv, ""); + expect(A, send, "104/SILK/16000 9/G722/8000 0/PCMU/8000 8/PCMA/8000 101/telephone-event/8000 13/CN/8000 118/CN/16000"); + expect(B, recv, "9/G722/8000 8/PCMA/8000 3/GSM/8000 101/telephone-event/8000 13/CN/8000"); + expect(B, send, ""); + sdp_pt(8, PCMA, 8000); + sdp_pt(3, GSM, 8000); + sdp_pt(101, telephone-event, 8000); + flags.symmetric_codecs = 1; + answer(); + expect(A, recv, "8/PCMA/8000 9/G722/8000 0/PCMU/8000 13/CN/8000 101/telephone-event/8000"); + expect(A, send, "8/PCMA/8000 101/telephone-event/8000 104/SILK/16000 9/G722/8000 0/PCMU/8000 13/CN/8000 118/CN/16000"); + expect(B, recv, "8/PCMA/8000 3/GSM/8000 101/telephone-event/8000"); + expect(B, send, "8/PCMA/8000 3/GSM/8000 101/telephone-event/8000"); + end(); + // codec-consume only + start(); + sdp_pt(104, SILK, 16000); + sdp_pt(9, G722, 8000); + sdp_pt(0, PCMU, 8000); + sdp_pt(8, PCMA, 8000); + sdp_pt(101, telephone-event, 8000); + sdp_pt(13, CN, 8000); + sdp_pt(118, CN, 16000); + ht_set(codec_consume, PCMU); + offer(); + expect(A, recv, ""); + expect(A, send, "104/SILK/16000 9/G722/8000 0/PCMU/8000 8/PCMA/8000 101/telephone-event/8000 13/CN/8000 118/CN/16000"); + expect(B, recv, "9/G722/8000 8/PCMA/8000 101/telephone-event/8000 13/CN/8000"); + expect(B, send, ""); + sdp_pt(8, PCMA, 8000); + sdp_pt(101, telephone-event, 8000); + answer(); + expect(A, recv, "0/PCMU/8000 8/PCMA/8000 101/telephone-event/8000"); + expect(A, send, "104/SILK/16000 9/G722/8000 0/PCMU/8000 8/PCMA/8000 101/telephone-event/8000 13/CN/8000 118/CN/16000"); + expect(B, recv, "8/PCMA/8000 101/telephone-event/8000"); + expect(B, send, "8/PCMA/8000 101/telephone-event/8000"); + end(); + // codec-consume w symmetric codecs + start(); + sdp_pt(104, SILK, 16000); + sdp_pt(9, G722, 8000); + sdp_pt(0, PCMU, 8000); + sdp_pt(8, PCMA, 8000); + sdp_pt(101, telephone-event, 8000); + sdp_pt(13, CN, 8000); + sdp_pt(118, CN, 16000); + ht_set(codec_consume, PCMU); + offer(); + expect(A, recv, ""); + expect(A, send, "104/SILK/16000 9/G722/8000 0/PCMU/8000 8/PCMA/8000 101/telephone-event/8000 13/CN/8000 118/CN/16000"); + expect(B, recv, "9/G722/8000 8/PCMA/8000 101/telephone-event/8000 13/CN/8000"); + expect(B, send, ""); + sdp_pt(8, PCMA, 8000); + sdp_pt(101, telephone-event, 8000); + flags.symmetric_codecs = 1; + answer(); + expect(A, recv, "0/PCMU/8000 8/PCMA/8000 101/telephone-event/8000"); + expect(A, send, "0/PCMU/8000 8/PCMA/8000 101/telephone-event/8000 104/SILK/16000 9/G722/8000 13/CN/8000 118/CN/16000"); + expect(B, recv, "8/PCMA/8000 101/telephone-event/8000"); + expect(B, send, "8/PCMA/8000 101/telephone-event/8000"); + end(); + // codec-consume + transcode + reject transcoded codec + start(); + sdp_pt(104, SILK, 16000); + sdp_pt(9, G722, 8000); + sdp_pt(0, PCMU, 8000); + sdp_pt(8, PCMA, 8000); + sdp_pt(101, telephone-event, 8000); + sdp_pt(13, CN, 8000); + sdp_pt(118, CN, 16000); + ht_set(codec_consume, PCMU); + transcode(GSM); + offer(); + expect(A, recv, ""); + expect(A, send, "104/SILK/16000 9/G722/8000 0/PCMU/8000 8/PCMA/8000 101/telephone-event/8000 13/CN/8000 118/CN/16000"); + expect(B, recv, "9/G722/8000 8/PCMA/8000 3/GSM/8000 101/telephone-event/8000 13/CN/8000"); + expect(B, send, ""); + sdp_pt(8, PCMA, 8000); + sdp_pt(101, telephone-event, 8000); + answer(); + expect(A, recv, "0/PCMU/8000 8/PCMA/8000 101/telephone-event/8000"); + expect(A, send, "104/SILK/16000 9/G722/8000 0/PCMU/8000 8/PCMA/8000 101/telephone-event/8000 13/CN/8000 118/CN/16000"); + expect(B, recv, "8/PCMA/8000 101/telephone-event/8000"); + expect(B, send, "8/PCMA/8000 101/telephone-event/8000"); + end(); + // codec-consume + transcode + accept transcoded codec + start(); + sdp_pt(104, SILK, 16000); + sdp_pt(9, G722, 8000); + sdp_pt(0, PCMU, 8000); + sdp_pt(8, PCMA, 8000); + sdp_pt(101, telephone-event, 8000); + sdp_pt(13, CN, 8000); + sdp_pt(118, CN, 16000); + ht_set(codec_consume, PCMU); + transcode(GSM); + offer(); + expect(A, recv, ""); + expect(A, send, "104/SILK/16000 9/G722/8000 0/PCMU/8000 8/PCMA/8000 101/telephone-event/8000 13/CN/8000 118/CN/16000"); + expect(B, recv, "9/G722/8000 8/PCMA/8000 3/GSM/8000 101/telephone-event/8000 13/CN/8000"); + expect(B, send, ""); + sdp_pt(8, PCMA, 8000); + sdp_pt(3, GSM, 8000); + sdp_pt(101, telephone-event, 8000); + answer(); + expect(A, recv, "0/PCMU/8000 8/PCMA/8000 101/telephone-event/8000"); + expect(A, send, "104/SILK/16000 9/G722/8000 0/PCMU/8000 8/PCMA/8000 101/telephone-event/8000 13/CN/8000 118/CN/16000"); + expect(B, recv, "8/PCMA/8000 3/GSM/8000 101/telephone-event/8000"); + expect(B, send, "8/PCMA/8000 3/GSM/8000 101/telephone-event/8000"); + end(); + // codec-consume + transcode + accept transcoded codec + symmetric codecs + start(); + sdp_pt(104, SILK, 16000); + sdp_pt(9, G722, 8000); + sdp_pt(0, PCMU, 8000); + sdp_pt(8, PCMA, 8000); + sdp_pt(101, telephone-event, 8000); + sdp_pt(13, CN, 8000); + sdp_pt(118, CN, 16000); + ht_set(codec_consume, PCMU); + transcode(GSM); + offer(); + expect(A, recv, ""); + expect(A, send, "104/SILK/16000 9/G722/8000 0/PCMU/8000 8/PCMA/8000 101/telephone-event/8000 13/CN/8000 118/CN/16000"); + expect(B, recv, "9/G722/8000 8/PCMA/8000 3/GSM/8000 101/telephone-event/8000 13/CN/8000"); + expect(B, send, ""); + sdp_pt(8, PCMA, 8000); + sdp_pt(3, GSM, 8000); + sdp_pt(101, telephone-event, 8000); + flags.symmetric_codecs = 1; + answer(); + expect(A, recv, "0/PCMU/8000 8/PCMA/8000 101/telephone-event/8000"); + expect(A, send, "0/PCMU/8000 8/PCMA/8000 101/telephone-event/8000 104/SILK/16000 9/G722/8000 13/CN/8000 118/CN/16000"); + expect(B, recv, "8/PCMA/8000 3/GSM/8000 101/telephone-event/8000"); + expect(B, send, "8/PCMA/8000 3/GSM/8000 101/telephone-event/8000"); + end(); + // codec-accept only + start(); + sdp_pt(104, SILK, 16000); + sdp_pt(9, G722, 8000); + sdp_pt(0, PCMU, 8000); + sdp_pt(8, PCMA, 8000); + sdp_pt(101, telephone-event, 8000); + sdp_pt(13, CN, 8000); + sdp_pt(118, CN, 16000); + ht_set(codec_accept, PCMU); + offer(); + expect(A, recv, ""); + expect(A, send, "104/SILK/16000 9/G722/8000 0/PCMU/8000 8/PCMA/8000 101/telephone-event/8000 13/CN/8000 118/CN/16000"); + expect(B, recv, "9/G722/8000 0/PCMU/8000 8/PCMA/8000 101/telephone-event/8000 13/CN/8000"); + expect(B, send, ""); + sdp_pt(8, PCMA, 8000); + sdp_pt(101, telephone-event, 8000); + answer(); + expect(A, recv, "0/PCMU/8000 8/PCMA/8000 101/telephone-event/8000"); + expect(A, send, "104/SILK/16000 9/G722/8000 0/PCMU/8000 8/PCMA/8000 101/telephone-event/8000 13/CN/8000 118/CN/16000"); + expect(B, recv, "8/PCMA/8000 101/telephone-event/8000"); + expect(B, send, "8/PCMA/8000 101/telephone-event/8000"); + end(); + // codec-accept w symmetric codecs + start(); + sdp_pt(104, SILK, 16000); + sdp_pt(9, G722, 8000); + sdp_pt(0, PCMU, 8000); + sdp_pt(8, PCMA, 8000); + sdp_pt(101, telephone-event, 8000); + sdp_pt(13, CN, 8000); + sdp_pt(118, CN, 16000); + ht_set(codec_accept, PCMU); + offer(); + expect(A, recv, ""); + expect(A, send, "104/SILK/16000 9/G722/8000 0/PCMU/8000 8/PCMA/8000 101/telephone-event/8000 13/CN/8000 118/CN/16000"); + expect(B, recv, "9/G722/8000 0/PCMU/8000 8/PCMA/8000 101/telephone-event/8000 13/CN/8000"); + expect(B, send, ""); + sdp_pt(8, PCMA, 8000); + sdp_pt(101, telephone-event, 8000); + flags.symmetric_codecs = 1; + answer(); + expect(A, recv, "0/PCMU/8000 8/PCMA/8000 101/telephone-event/8000"); + expect(A, send, "0/PCMU/8000 8/PCMA/8000 101/telephone-event/8000 104/SILK/16000 9/G722/8000 13/CN/8000 118/CN/16000"); + expect(B, recv, "8/PCMA/8000 101/telephone-event/8000"); + expect(B, send, "8/PCMA/8000 101/telephone-event/8000"); + end(); + // codec-accept + transcode + reject transcoded codec + start(); + sdp_pt(104, SILK, 16000); + sdp_pt(9, G722, 8000); + sdp_pt(0, PCMU, 8000); + sdp_pt(8, PCMA, 8000); + sdp_pt(101, telephone-event, 8000); + sdp_pt(13, CN, 8000); + sdp_pt(118, CN, 16000); + ht_set(codec_accept, PCMU); + transcode(GSM); + offer(); + expect(A, recv, ""); + expect(A, send, "104/SILK/16000 9/G722/8000 0/PCMU/8000 8/PCMA/8000 101/telephone-event/8000 13/CN/8000 118/CN/16000"); + expect(B, recv, "9/G722/8000 0/PCMU/8000 8/PCMA/8000 3/GSM/8000 101/telephone-event/8000 13/CN/8000"); + expect(B, send, ""); + sdp_pt(8, PCMA, 8000); + sdp_pt(101, telephone-event, 8000); + answer(); + expect(A, recv, "0/PCMU/8000 8/PCMA/8000 101/telephone-event/8000"); + expect(A, send, "104/SILK/16000 9/G722/8000 0/PCMU/8000 8/PCMA/8000 101/telephone-event/8000 13/CN/8000 118/CN/16000"); + expect(B, recv, "8/PCMA/8000 101/telephone-event/8000"); + expect(B, send, "8/PCMA/8000 101/telephone-event/8000"); + end(); + // codec-accept + transcode + accept transcoded codec + start(); + sdp_pt(104, SILK, 16000); + sdp_pt(9, G722, 8000); + sdp_pt(0, PCMU, 8000); + sdp_pt(8, PCMA, 8000); + sdp_pt(101, telephone-event, 8000); + sdp_pt(13, CN, 8000); + sdp_pt(118, CN, 16000); + ht_set(codec_accept, PCMU); + transcode(GSM); + offer(); + expect(A, recv, ""); + expect(A, send, "104/SILK/16000 9/G722/8000 0/PCMU/8000 8/PCMA/8000 101/telephone-event/8000 13/CN/8000 118/CN/16000"); + expect(B, recv, "9/G722/8000 0/PCMU/8000 8/PCMA/8000 3/GSM/8000 101/telephone-event/8000 13/CN/8000"); + expect(B, send, ""); + sdp_pt(8, PCMA, 8000); + sdp_pt(3, GSM, 8000); + sdp_pt(101, telephone-event, 8000); + answer(); + expect(A, recv, "0/PCMU/8000 8/PCMA/8000 101/telephone-event/8000"); + expect(A, send, "104/SILK/16000 9/G722/8000 0/PCMU/8000 8/PCMA/8000 101/telephone-event/8000 13/CN/8000 118/CN/16000"); + expect(B, recv, "8/PCMA/8000 3/GSM/8000 101/telephone-event/8000"); + expect(B, send, "8/PCMA/8000 3/GSM/8000 101/telephone-event/8000"); + end(); + // codec-accept + transcode + accept transcoded codec + symmetric codecs + start(); + sdp_pt(104, SILK, 16000); + sdp_pt(9, G722, 8000); + sdp_pt(0, PCMU, 8000); + sdp_pt(8, PCMA, 8000); + sdp_pt(101, telephone-event, 8000); + sdp_pt(13, CN, 8000); + sdp_pt(118, CN, 16000); + ht_set(codec_accept, PCMU); + transcode(GSM); + offer(); + expect(A, recv, ""); + expect(A, send, "104/SILK/16000 9/G722/8000 0/PCMU/8000 8/PCMA/8000 101/telephone-event/8000 13/CN/8000 118/CN/16000"); + expect(B, recv, "9/G722/8000 0/PCMU/8000 8/PCMA/8000 3/GSM/8000 101/telephone-event/8000 13/CN/8000"); + expect(B, send, ""); + sdp_pt(8, PCMA, 8000); + sdp_pt(3, GSM, 8000); + sdp_pt(101, telephone-event, 8000); + flags.symmetric_codecs = 1; + answer(); + expect(A, recv, "0/PCMU/8000 8/PCMA/8000 101/telephone-event/8000"); + expect(A, send, "0/PCMU/8000 8/PCMA/8000 101/telephone-event/8000 104/SILK/16000 9/G722/8000 13/CN/8000 118/CN/16000"); + expect(B, recv, "8/PCMA/8000 3/GSM/8000 101/telephone-event/8000"); + expect(B, send, "8/PCMA/8000 3/GSM/8000 101/telephone-event/8000"); + end(); + // codec-accept first codec + start(); + sdp_pt(104, SILK, 16000); + sdp_pt(9, G722, 8000); + sdp_pt(0, PCMU, 8000); + sdp_pt(8, PCMA, 8000); + sdp_pt(101, telephone-event, 8000); + sdp_pt(13, CN, 8000); + sdp_pt(118, CN, 16000); + ht_set(codec_accept, G722); + offer(); + expect(A, recv, ""); + expect(A, send, "104/SILK/16000 9/G722/8000 0/PCMU/8000 8/PCMA/8000 101/telephone-event/8000 13/CN/8000 118/CN/16000"); + expect(B, recv, "9/G722/8000 0/PCMU/8000 8/PCMA/8000 101/telephone-event/8000 13/CN/8000"); + expect(B, send, ""); + sdp_pt(8, PCMA, 8000); + sdp_pt(101, telephone-event, 8000); + answer(); + expect(A, recv, "9/G722/8000 8/PCMA/8000 101/telephone-event/8000"); + expect(A, send, "104/SILK/16000 9/G722/8000 0/PCMU/8000 8/PCMA/8000 101/telephone-event/8000 13/CN/8000 118/CN/16000"); + expect(B, recv, "8/PCMA/8000 101/telephone-event/8000"); + expect(B, send, "8/PCMA/8000 101/telephone-event/8000"); + end(); + // gh 664 codec masking a/t + start(); + sdp_pt(120, opus, 48000); + sdp_pt(8, PCMA, 8000); + sdp_pt(0, PCMU, 8000); + sdp_pt(101, telephone-event, 8000); + ht_set(codec_mask, opus); + ht_set(codec_mask, G722); + ht_set(codec_mask, G7221); + ht_set(codec_accept, all); + offer(); + expect(B, recv, "8/PCMA/8000 0/PCMU/8000 101/telephone-event/8000"); + sdp_pt(8, PCMA, 8000); + sdp_pt(101, telephone-event, 8000); + answer(); + expect(A, recv, "120/opus/48000 8/PCMA/8000 0/PCMU/8000 101/telephone-event/8000 96/telephone-event/48000/0-15"); + // gh 664 codec masking accept=all + start(); + sdp_pt(120, opus, 48000); + sdp_pt(8, PCMA, 8000); + sdp_pt(0, PCMU, 8000); + sdp_pt(101, telephone-event, 8000); + ht_set(codec_mask, opus); + ht_set(codec_mask, G722); + ht_set(codec_mask, G7221); + ht_set(codec_accept, all); + offer(); + expect(B, recv, "8/PCMA/8000 0/PCMU/8000 101/telephone-event/8000"); + sdp_pt(8, PCMA, 8000); + sdp_pt(101, telephone-event, 8000); + answer(); + expect(A, recv, "120/opus/48000 8/PCMA/8000 0/PCMU/8000 101/telephone-event/8000 96/telephone-event/48000/0-15"); + + // CN transcoding + rtpe_config.silence_detect_int = 10 << 16; + str_init_len(&rtpe_config.cn_payload, "\x40", 1); + // CN transcoding - forward + start(); + sdp_pt(8, PCMA, 8000); + sdp_pt(0, PCMU, 8000); + transcode(CN); + offer(); + expect(B, recv, "8/PCMA/8000 0/PCMU/8000 13/CN/8000"); + sdp_pt(8, PCMA, 8000); + sdp_pt(0, PCMU, 8000); + sdp_pt(13, CN, 8000); + answer(); + expect(A, recv, "8/PCMA/8000 0/PCMU/8000"); + packet_seq(A, 8, PCMA_payload, 160, 1, 8, PCMA_payload); + packet_seq(B, 8, PCMA_payload, 160, 1, 8, PCMA_payload); + packet_seq(B, 13, "\x20", 320, 2, 8, "\xf5\x5c\x4b\xc2\xde\xf4\x5e\xd4\x47\x70\x5d\x77\x45\x51\xc5\xcd\xd7\x77\x5a\xf5\xcf\x4a\x4c\x40\xc3\x47\x74\x49\x59\xc4\x76\x57\x71\x57\x40\xc5\xf4\x5a\x47\xd6\xc4\xf6\xc7\xf3\x40\x58\x74\x54\x4b\xd7\x5c\xc7\x41\x49\xf5\x5b\x53\xd9\x70\x44\xcd\xc4\xce\xcb\xc7\x58\xcd\x45\xc6\x71\xf5\x70\x43\xca\x43\xd5\x52\x5c\x75\x74\xc6\xc3\x4f\xda\x56\xc3\x46\xf5\x49\xdf\x56\x4f\x71\x5b\x52\xc6\x4e\xd0\x43\xc2\xcd\xd5\xdf\x40\x43\x4a\xf7\xf6\xd9\xdf\xde\x45\xc9\xd9\xc2\xf0\xc1\x4a\x40\x52\xd1\x5b\xd0\x54\xc9\x5e\xde\xd5\x74\x5c\x5d\x59\x71\xc1\xc1\x71\xd2\xcb\x50\x50\x54\x53\x75\xdc\x4b\xcf\xc2\xd7\x4a\xcc\x58\xc7\xdb\xd8\x48\x4a\xd6\x58\xf0\x46"); + packet_seq(A, 8, PCMA_silence, 320, 2, 13, "\x40"); + // CN transcoding - reverse 1 + start(); + sdp_pt(8, PCMA, 8000); + sdp_pt(0, PCMU, 8000); + sdp_pt(13, CN, 8000); + ht_set(codec_consume, CN); + offer(); + expect(B, recv, "8/PCMA/8000 0/PCMU/8000"); + sdp_pt(8, PCMA, 8000); + sdp_pt(0, PCMU, 8000); + answer(); + expect(A, recv, "8/PCMA/8000 0/PCMU/8000 13/CN/8000"); + packet_seq(A, 8, PCMA_payload, 160, 1, 8, PCMA_payload); + packet_seq(B, 8, PCMA_payload, 160, 1, 8, PCMA_payload); + packet_seq(A, 13, "\x20", 320, 2, 8, "\xf5\x5c\x4b\xc2\xde\xf4\x5e\xd4\x47\x70\x5d\x77\x45\x51\xc5\xcd\xd7\x77\x5a\xf5\xcf\x4a\x4c\x40\xc3\x47\x74\x49\x59\xc4\x76\x57\x71\x57\x40\xc5\xf4\x5a\x47\xd6\xc4\xf6\xc7\xf3\x40\x58\x74\x54\x4b\xd7\x5c\xc7\x41\x49\xf5\x5b\x53\xd9\x70\x44\xcd\xc4\xce\xcb\xc7\x58\xcd\x45\xc6\x71\xf5\x70\x43\xca\x43\xd5\x52\x5c\x75\x74\xc6\xc3\x4f\xda\x56\xc3\x46\xf5\x49\xdf\x56\x4f\x71\x5b\x52\xc6\x4e\xd0\x43\xc2\xcd\xd5\xdf\x40\x43\x4a\xf7\xf6\xd9\xdf\xde\x45\xc9\xd9\xc2\xf0\xc1\x4a\x40\x52\xd1\x5b\xd0\x54\xc9\x5e\xde\xd5\x74\x5c\x5d\x59\x71\xc1\xc1\x71\xd2\xcb\x50\x50\x54\x53\x75\xdc\x4b\xcf\xc2\xd7\x4a\xcc\x58\xc7\xdb\xd8\x48\x4a\xd6\x58\xf0\x46"); + packet_seq(B, 8, PCMA_silence, 320, 2, 13, "\x40"); + // CN transcoding - reverse 2 + start(); + sdp_pt(8, PCMA, 8000); + sdp_pt(0, PCMU, 8000); + sdp_pt(13, CN, 8000); + ht_set(codec_accept, CN); + offer(); + expect(B, recv, "8/PCMA/8000 0/PCMU/8000 13/CN/8000"); + sdp_pt(8, PCMA, 8000); + sdp_pt(0, PCMU, 8000); + answer(); + expect(A, recv, "8/PCMA/8000 0/PCMU/8000 13/CN/8000"); + packet_seq(A, 8, PCMA_payload, 160, 1, 8, PCMA_payload); + packet_seq(B, 8, PCMA_payload, 160, 1, 8, PCMA_payload); + packet_seq(A, 13, "\x20", 320, 2, 8, "\xf5\x5c\x4b\xc2\xde\xf4\x5e\xd4\x47\x70\x5d\x77\x45\x51\xc5\xcd\xd7\x77\x5a\xf5\xcf\x4a\x4c\x40\xc3\x47\x74\x49\x59\xc4\x76\x57\x71\x57\x40\xc5\xf4\x5a\x47\xd6\xc4\xf6\xc7\xf3\x40\x58\x74\x54\x4b\xd7\x5c\xc7\x41\x49\xf5\x5b\x53\xd9\x70\x44\xcd\xc4\xce\xcb\xc7\x58\xcd\x45\xc6\x71\xf5\x70\x43\xca\x43\xd5\x52\x5c\x75\x74\xc6\xc3\x4f\xda\x56\xc3\x46\xf5\x49\xdf\x56\x4f\x71\x5b\x52\xc6\x4e\xd0\x43\xc2\xcd\xd5\xdf\x40\x43\x4a\xf7\xf6\xd9\xdf\xde\x45\xc9\xd9\xc2\xf0\xc1\x4a\x40\x52\xd1\x5b\xd0\x54\xc9\x5e\xde\xd5\x74\x5c\x5d\x59\x71\xc1\xc1\x71\xd2\xcb\x50\x50\x54\x53\x75\xdc\x4b\xcf\xc2\xd7\x4a\xcc\x58\xc7\xdb\xd8\x48\x4a\xd6\x58\xf0\x46"); + packet_seq(B, 8, PCMA_silence, 320, 2, 13, "\x40"); + return 0; }