FreeCalypso > hg > themwi-system-sw
comparison sip-manual-out/rtp_tx.c @ 202:f3164f732b84
sip-manual-out: add tfo-stop command
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 02 Apr 2023 18:05:30 -0800 |
parents | d3c99b41fb04 |
children | fbfa72b114e8 |
comparison
equal
deleted
inserted
replaced
201:d3c99b41fb04 | 202:f3164f732b84 |
---|---|
25 static uint16_t rtp_out_seq; | 25 static uint16_t rtp_out_seq; |
26 | 26 |
27 static uint16_t tfo_fill_buf[9], tfo_req_buf[7]; | 27 static uint16_t tfo_fill_buf[9], tfo_req_buf[7]; |
28 static uint16_t *is_out_ptr; | 28 static uint16_t *is_out_ptr; |
29 static unsigned is_out_count; | 29 static unsigned is_out_count; |
30 static int tfo_stop_req; | |
30 | 31 |
31 void | 32 void |
32 assign_rtpout_ssrc() | 33 assign_rtpout_ssrc() |
33 { | 34 { |
34 rtp_ssrc = cur_event_time.tv_sec ^ cur_event_time.tv_usec ^ getpid(); | 35 rtp_ssrc = cur_event_time.tv_sec ^ cur_event_time.tv_usec ^ getpid(); |
79 pkt.ssrc = rtp_ssrc; | 80 pkt.ssrc = rtp_ssrc; |
80 memset(pkt.payload, pcma_selected ? 0xD5 : 0xFF, RTP_MAX_PAYLOAD); | 81 memset(pkt.payload, pcma_selected ? 0xD5 : 0xFF, RTP_MAX_PAYLOAD); |
81 if (is_out_count) { | 82 if (is_out_count) { |
82 insert_is_msg(pkt.payload, *is_out_ptr++); | 83 insert_is_msg(pkt.payload, *is_out_ptr++); |
83 is_out_count--; | 84 is_out_count--; |
84 if (!is_out_count) { | 85 if (!is_out_count && !tfo_stop_req) { |
85 is_out_ptr = tfo_req_buf; | 86 is_out_ptr = tfo_req_buf; |
86 is_out_count = 7; | 87 is_out_count = 7; |
87 } | 88 } |
88 } | 89 } |
89 addrlen = sizeof(struct sockaddr_in); | 90 addrlen = sizeof(struct sockaddr_in); |
101 tfo_req_buf[3] = 0x14E; | 102 tfo_req_buf[3] = 0x14E; |
102 tfo_req_buf[4] = 0x14B; | 103 tfo_req_buf[4] = 0x14B; |
103 encode_tfo_ext_words(sig, codec, 0, tfo_req_buf + 5); | 104 encode_tfo_ext_words(sig, codec, 0, tfo_req_buf + 5); |
104 is_out_ptr = tfo_fill_buf; | 105 is_out_ptr = tfo_fill_buf; |
105 is_out_count = 9; | 106 is_out_count = 9; |
107 tfo_stop_req = 0; | |
106 } | 108 } |
109 | |
110 void | |
111 stop_tfo_out() | |
112 { | |
113 tfo_stop_req = 1; | |
114 } |