comparison sip-in/invite.c @ 104:ce3b1db7d1d7

sip-in: force-pcma-codec config option to use PCMA when both are offered
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 27 Sep 2022 21:52:07 -0800
parents fe39404092d9
children 372209628038
comparison
equal deleted inserted replaced
103:3b3f07b112f3 104:ce3b1db7d1d7
22 #include "call.h" 22 #include "call.h"
23 23
24 extern struct in_addr sip_bind_ip; 24 extern struct in_addr sip_bind_ip;
25 extern unsigned sip_bind_port; 25 extern unsigned sip_bind_port;
26 extern int cfg_use_100rel; 26 extern int cfg_use_100rel;
27 extern int cfg_force_pcma;
27 extern struct call *call_list; 28 extern struct call *call_list;
28 29
29 extern struct call *find_call_by_sip_id(); 30 extern struct call *find_call_by_sip_id();
30 extern char *get_single_header(); 31 extern char *get_single_header();
31 32
208 start_response_out_msg(&resp, "488 Malformed SDP body"); 209 start_response_out_msg(&resp, "488 Malformed SDP body");
209 goto error_resp; 210 goto error_resp;
210 } 211 }
211 switch (sdp_parse.codec_mask) { 212 switch (sdp_parse.codec_mask) {
212 case SDP_CODEC_MASK_PCMU: 213 case SDP_CODEC_MASK_PCMU:
213 case SDP_CODEC_MASK_BOTH:
214 use_pcma = 0; 214 use_pcma = 0;
215 break; 215 break;
216 case SDP_CODEC_MASK_PCMA: 216 case SDP_CODEC_MASK_PCMA:
217 case SDP_CODEC_MASK_BOTH | SDP_CODEC_MASK_PCMA_PREF: 217 case SDP_CODEC_MASK_BOTH | SDP_CODEC_MASK_PCMA_PREF:
218 use_pcma = 1; 218 use_pcma = 1;
219 break;
220 case SDP_CODEC_MASK_BOTH:
221 use_pcma = cfg_force_pcma;
219 break; 222 break;
220 default: 223 default:
221 start_response_out_msg(&resp, 224 start_response_out_msg(&resp,
222 "488 Unsupported codec selection"); 225 "488 Unsupported codec selection");
223 rc = add_resp_basic_headers(&resp, ess, req->req_method); 226 rc = add_resp_basic_headers(&resp, ess, req->req_method);