diff --git a/src/mod/endpoints/mod_skinny/mod_skinny.c b/src/mod/endpoints/mod_skinny/mod_skinny.c index 889af65001..7dff9b7209 100644 --- a/src/mod/endpoints/mod_skinny/mod_skinny.c +++ b/src/mod/endpoints/mod_skinny/mod_skinny.c @@ -1051,27 +1051,40 @@ switch_status_t channel_receive_message(switch_core_session_t *session, switch_c private_t *tech_pvt = switch_core_session_get_private(session); switch (msg->message_id) { - case SWITCH_MESSAGE_INDICATE_ANSWER: - switch_clear_flag_locked(tech_pvt, TFLAG_EARLY_MEDIA); + case SWITCH_MESSAGE_INDICATE_ANSWER: + switch_clear_flag_locked(tech_pvt, TFLAG_EARLY_MEDIA); + return channel_answer_channel(session); + + case SWITCH_MESSAGE_INDICATE_DISPLAY: + skinny_session_send_call_info_all(session); + break; + + case SWITCH_MESSAGE_INDICATE_PROGRESS: + if (!switch_test_flag(tech_pvt, TFLAG_EARLY_MEDIA)) { + /* early media */ + switch_set_flag_locked(tech_pvt, TFLAG_EARLY_MEDIA); return channel_answer_channel(session); - - case SWITCH_MESSAGE_INDICATE_DISPLAY: - skinny_session_send_call_info_all(session); - return SWITCH_STATUS_SUCCESS; - - case SWITCH_MESSAGE_INDICATE_PROGRESS: - if (!switch_test_flag(tech_pvt, TFLAG_EARLY_MEDIA)) { - /* early media */ - switch_set_flag_locked(tech_pvt, TFLAG_EARLY_MEDIA); - return channel_answer_channel(session); - } - return SWITCH_STATUS_SUCCESS; - - default: - return SWITCH_STATUS_SUCCESS; - + } + break; + + case SWITCH_MESSAGE_INDICATE_BRIDGE: + if (switch_rtp_ready(tech_pvt->rtp_session)) { + rtp_flush_read_buffer(tech_pvt->rtp_session, SWITCH_RTP_FLUSH_STICK); + } + break; + case SWITCH_MESSAGE_INDICATE_UNBRIDGE: + if (switch_rtp_ready(tech_pvt->rtp_session)) { + rtp_flush_read_buffer(tech_pvt->rtp_session, SWITCH_RTP_FLUSH_UNSTICK); + } + break; + + default: + break; + } + return SWITCH_STATUS_SUCCESS; + } /* Make sure when you have 2 sessions in the same scope that you pass the appropriate one to the routines diff --git a/src/mod/endpoints/mod_skinny/skinny_server.c b/src/mod/endpoints/mod_skinny/skinny_server.c index 823a8beb0c..ccd87b0295 100644 --- a/src/mod/endpoints/mod_skinny/skinny_server.c +++ b/src/mod/endpoints/mod_skinny/skinny_server.c @@ -58,6 +58,8 @@ uint32_t soft_key_template_default_textids[] = { SKINNY_TEXTID_IDIVERT }; +#define TEXT_ID_LEN 20 + uint32_t soft_key_template_default_events[] = { SOFTKEY_REDIAL, SOFTKEY_NEWCALL, @@ -1731,6 +1733,10 @@ switch_status_t skinny_handle_open_receive_channel_ack_message(listener_t *liste switch_channel_t *channel = NULL; struct in_addr addr; + flags[SWITCH_RTP_FLAG_DATAWAIT]++; + flags[SWITCH_RTP_FLAG_AUTOADJ]++; + flags[SWITCH_RTP_FLAG_RAW_WRITE]++; + tech_pvt = switch_core_session_get_private(session); channel = switch_core_session_get_channel(session); @@ -1954,7 +1960,7 @@ switch_status_t skinny_handle_unregister(listener_t *listener, skinny_message_t switch_status_t skinny_handle_soft_key_template_request(listener_t *listener, skinny_message_t *request) { - int i; + size_t i; skinny_message_t *message; switch_assert(listener->profile); @@ -1969,7 +1975,7 @@ switch_status_t skinny_handle_soft_key_template_request(listener_t *listener, sk message->data.soft_key_template.total_soft_key_count = 21; memset(message->data.soft_key_template.soft_key, 0, sizeof(message->data.soft_key_template)); - for (i=0; idata.soft_key_template.soft_key[i].soft_key_label, skinny_textid2raw(soft_key_template_default_textids[i])); switch_safe_free(label);