switch_status_t channel_receive_message(switch_core_session_t *session, switch_core_session_message_t *msg)
{
+ 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);
channel_answer_channel(session);
}
break;
{
skinny_session_send_call_info_all(session);
}
+ 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);
+ channel_answer_channel(session);
+ }
+ }
default:
break;
}
channel = switch_core_session_get_channel(session);
tech_pvt = switch_core_session_get_private(session);
-
- send_stop_tone(listener, line_instance, tech_pvt->call_id);
- send_open_receive_channel(listener,
- tech_pvt->call_id, /* uint32_t conference_id, */
- tech_pvt->call_id, /* uint32_t pass_thru_party_id, */
- 20, /* uint32_t packets, */
- SKINNY_CODEC_ULAW_64K, /* uint32_t payload_capacity, */
- 0, /* uint32_t echo_cancel_type, */
- 0, /* uint32_t g723_bitrate, */
- 0, /* uint32_t conference_id2, */
- 0 /* uint32_t reserved[10] */
- );
- skinny_line_set_state(listener, line_instance, tech_pvt->call_id, SKINNY_CONNECTED);
- send_select_soft_keys(listener, line_instance, tech_pvt->call_id,
- SKINNY_KEY_SET_CONNECTED, 0xffff);
- send_display_prompt_status(listener,
- 0,
- SKINNY_DISP_CONNECTED,
- line_instance,
- tech_pvt->call_id);
+
+ if (!switch_channel_test_flag(channel, CF_EARLY_MEDIA)) {
+ send_stop_tone(listener, line_instance, tech_pvt->call_id);
+ send_open_receive_channel(listener,
+ tech_pvt->call_id, /* uint32_t conference_id, */
+ tech_pvt->call_id, /* uint32_t pass_thru_party_id, */
+ 20, /* uint32_t packets, */
+ SKINNY_CODEC_ULAW_64K, /* uint32_t payload_capacity, */
+ 0, /* uint32_t echo_cancel_type, */
+ 0, /* uint32_t g723_bitrate, */
+ 0, /* uint32_t conference_id2, */
+ 0 /* uint32_t reserved[10] */
+ );
+ }
+ if (!switch_test_flag(tech_pvt, TFLAG_EARLY_MEDIA)) {
+ skinny_line_set_state(listener, line_instance, tech_pvt->call_id, SKINNY_CONNECTED);
+ send_select_soft_keys(listener, line_instance, tech_pvt->call_id,
+ SKINNY_KEY_SET_CONNECTED, 0xffff);
+ send_display_prompt_status(listener,
+ 0,
+ SKINNY_DISP_CONNECTED,
+ line_instance,
+ tech_pvt->call_id);
+ }
skinny_session_send_call_info(session, listener, line_instance);
return SWITCH_STATUS_SUCCESS;