diff --git a/src/mod/endpoints/mod_iaxchan/mod_iaxchan.c b/src/mod/endpoints/mod_iaxchan/mod_iaxchan.c index fe2b33227d..59fe2f70bb 100644 --- a/src/mod/endpoints/mod_iaxchan/mod_iaxchan.c +++ b/src/mod/endpoints/mod_iaxchan/mod_iaxchan.c @@ -310,10 +310,11 @@ static switch_status iax_set_codec(struct private_object *tech_pvt, struct iax_s assert(channel != NULL); if (*samprate) { - srate = 8000; unsigned short samples = iax_build_codec_rates(); unsigned short mixed = (*samprate & samples); + srate = 8000; + if (mixed & IAX_RATE_16KHZ) { srate = 16000; }