# HG changeset patch # User Mychaela Falconia # Date 1680487294 28800 # Node ID d3c99b41fb043a3086bcd0a5a393ec275ef4572d # Parent 834656633fa00a59206762214bb0fb5b81fb8f39 sip-manual-out TFO: rework for continuous output of TFO_REQ diff -r 834656633fa0 -r d3c99b41fb04 sip-manual-out/rtp_tx.c --- a/sip-manual-out/rtp_tx.c Sun Apr 02 17:44:23 2023 -0800 +++ b/sip-manual-out/rtp_tx.c Sun Apr 02 18:01:34 2023 -0800 @@ -24,7 +24,8 @@ static uint32_t rtp_out_ts; static uint16_t rtp_out_seq; -static uint16_t is_out_buf[7], *is_out_ptr; +static uint16_t tfo_fill_buf[9], tfo_req_buf[7]; +static uint16_t *is_out_ptr; static unsigned is_out_count; void @@ -33,6 +34,20 @@ rtp_ssrc = cur_event_time.tv_sec ^ cur_event_time.tv_usec ^ getpid(); } +void +prepare_tfo_fill() +{ + tfo_fill_buf[0] = 0x15A; + tfo_fill_buf[1] = 0x1A9; + tfo_fill_buf[2] = 0x129; + tfo_fill_buf[3] = 0x15A; + tfo_fill_buf[4] = 0x1A9; + tfo_fill_buf[5] = 0x129; + tfo_fill_buf[6] = 0x15A; + tfo_fill_buf[7] = 0x1A9; + tfo_fill_buf[8] = 0x129; +} + static void insert_is_msg(payload, word) uint8_t *payload; @@ -66,6 +81,10 @@ if (is_out_count) { insert_is_msg(pkt.payload, *is_out_ptr++); is_out_count--; + if (!is_out_count) { + is_out_ptr = tfo_req_buf; + is_out_count = 7; + } } addrlen = sizeof(struct sockaddr_in); sendto(rtp_udp_fd, &pkt, RTP_PACKET_SIZE_PSTN, 0, @@ -76,12 +95,12 @@ send_tfo_req(sig, codec) unsigned sig, codec; { - is_out_buf[0] = 0x15A; - is_out_buf[1] = 0x1A9; - is_out_buf[2] = 0x05D; - is_out_buf[3] = 0x14E; - is_out_buf[4] = 0x14B; - encode_tfo_ext_words(sig, codec, 0, is_out_buf + 5); - is_out_ptr = is_out_buf; - is_out_count = 7; + tfo_req_buf[0] = 0x15A; + tfo_req_buf[1] = 0x1A9; + tfo_req_buf[2] = 0x05D; + tfo_req_buf[3] = 0x14E; + tfo_req_buf[4] = 0x14B; + encode_tfo_ext_words(sig, codec, 0, tfo_req_buf + 5); + is_out_ptr = tfo_fill_buf; + is_out_count = 9; } diff -r 834656633fa0 -r d3c99b41fb04 sip-manual-out/sdp_in.c --- a/sip-manual-out/sdp_in.c Sun Apr 02 17:44:23 2023 -0800 +++ b/sip-manual-out/sdp_in.c Sun Apr 02 18:01:34 2023 -0800 @@ -73,4 +73,5 @@ rtp_remote_addr.sin_port = htons(sdp_parse.audio_port); rtp_out_enable = 1; assign_rtpout_ssrc(); + prepare_tfo_fill(); }