forked from Mirrors/freeswitch
Skinny: handle early media
See MODSKINNY-8 (switch_core_io.c:121 SKINNY/internal/SEP002699438FB6:0/1 has no read codec when using early media)
This commit is contained in:
parent
df92a3ca07
commit
5017869399
@ -972,9 +972,12 @@ switch_status_t channel_answer_channel(switch_core_session_t *session)
|
||||
|
||||
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;
|
||||
@ -982,6 +985,14 @@ switch_status_t channel_receive_message(switch_core_session_t *session, switch_c
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
@ -146,10 +146,11 @@ typedef switch_status_t (*skinny_listener_callback_func_t) (listener_t *listener
|
||||
/* CHANNEL TYPES */
|
||||
/*****************************************************************************/
|
||||
typedef enum {
|
||||
TFLAG_IO = (1 << 0),
|
||||
TFLAG_READING = (1 << 9),
|
||||
TFLAG_WRITING = (1 << 10),
|
||||
TFLAG_FORCE_ROUTE = (1 << 11)
|
||||
TFLAG_FORCE_ROUTE = (1 << 0),
|
||||
TFLAG_EARLY_MEDIA = (1 << 1),
|
||||
TFLAG_IO = (1 << 2),
|
||||
TFLAG_READING = (1 << 3),
|
||||
TFLAG_WRITING = (1 << 4)
|
||||
} TFLAGS;
|
||||
|
||||
typedef enum {
|
||||
|
@ -697,26 +697,30 @@ switch_status_t skinny_session_start_media(switch_core_session_t *session, liste
|
||||
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user