Fixed handling of early audio

This commit is contained in:
Andreas Eversberg 2021-03-28 12:53:57 +02:00
parent 9ae3bfcbc5
commit 31b82eb27d
1 changed files with 31 additions and 8 deletions

View File

@ -459,10 +459,14 @@ void cc_message(osmo_cc_endpoint_t *ep, uint32_t callref, osmo_cc_msg_t *msg)
if (ui_autoanswer) {
/* create osmo-cc message */
new_msg = osmo_cc_new_msg(OSMO_CC_MSG_SETUP_CNF);
/* sdp */
osmo_cc_add_ie_sdp(new_msg, call->sdp);
free((char *)call->sdp);
call->sdp = NULL;
if (call->telephone_ep->early_audio) {
/* progress */
osmo_cc_add_ie_progress(msg, OSMO_CC_CODING_ITU_T, call->telephone_ep->serving_location, OSMO_CC_PROGRESS_INBAND_INFO_AVAILABLE);
/* sdp */
osmo_cc_add_ie_sdp(new_msg, call->sdp);
free((char *)call->sdp);
call->sdp = NULL;
}
/* send message to osmo-cc */
osmo_cc_ll_msg(&call->telephone_ep->cc_ep, call->cc_callref, new_msg);
/* change state */
@ -471,14 +475,33 @@ void cc_message(osmo_cc_endpoint_t *ep, uint32_t callref, osmo_cc_msg_t *msg)
if (ui_autoalert) {
/* create osmo-cc message */
new_msg = osmo_cc_new_msg(OSMO_CC_MSG_ALERT_IND);
/* sdp */
osmo_cc_add_ie_sdp(new_msg, call->sdp);
free((char *)call->sdp);
call->sdp = NULL;
if (call->telephone_ep->early_audio) {
/* progress */
osmo_cc_add_ie_progress(msg, OSMO_CC_CODING_ITU_T, call->telephone_ep->serving_location, OSMO_CC_PROGRESS_INBAND_INFO_AVAILABLE);
/* sdp */
osmo_cc_add_ie_sdp(new_msg, call->sdp);
free((char *)call->sdp);
call->sdp = NULL;
}
/* send message to osmo-cc */
osmo_cc_ll_msg(&call->telephone_ep->cc_ep, call->cc_callref, new_msg);
/* change state */
call_new_state(call, CALL_STATE_IN_ALERTING);
} else {
/* create osmo-cc message */
new_msg = osmo_cc_new_msg(OSMO_CC_MSG_SETUP_ACK_IND);
if (call->telephone_ep->early_audio) {
/* progress */
osmo_cc_add_ie_progress(msg, OSMO_CC_CODING_ITU_T, call->telephone_ep->serving_location, OSMO_CC_PROGRESS_INBAND_INFO_AVAILABLE);
/* sdp */
osmo_cc_add_ie_sdp(new_msg, call->sdp);
free((char *)call->sdp);
call->sdp = NULL;
}
/* send message to osmo-cc */
osmo_cc_ll_msg(&call->telephone_ep->cc_ep, call->cc_callref, new_msg);
/* change state */
call_new_state(call, CALL_STATE_IN_OVERLAP);
}
break;
case OSMO_CC_MSG_SETUP_ACK_REQ: /* more information is needed */