mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-16 14:28:34 +00:00
MILESTONE: working audio and no reference to rtp_session in all of sofia
This commit is contained in:
1 parent
caee4cbf46
commit
75c95fa98e
5 files changed
+155
-64
No files matched your search
+115
-18
@@ -386,7 +386,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_process_t38_passthru(switch_co
|
||||
switch_media_handle_t *smh;
|
||||
|
||||
if (!(smh = session->media_handle)) {
|
||||
return SWITCH_STATUS_FALSE;;
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
a_engine = &smh->engines[SWITCH_MEDIA_TYPE_AUDIO];
|
||||
@@ -2931,7 +2931,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi
|
||||
switch_media_handle_t *smh;
|
||||
|
||||
if (!(smh = session->media_handle)) {
|
||||
return SWITCH_STATUS_FALSE;;
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
a_engine = &smh->engines[SWITCH_MEDIA_TYPE_AUDIO];
|
||||
@@ -3142,8 +3142,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi
|
||||
a_engine->read_impl.samples_per_packet,
|
||||
a_engine->codec_params.codec_ms * 1000,
|
||||
flags, timer_name, &err, switch_core_session_get_pool(session));
|
||||
//HACK REMOVE ME
|
||||
smh->mparams->rtp_session = a_engine->rtp_session;
|
||||
}
|
||||
|
||||
if (switch_rtp_ready(a_engine->rtp_session)) {
|
||||
@@ -3514,9 +3512,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi
|
||||
1, 90000, flags, NULL, &err, switch_core_session_get_pool(session));
|
||||
|
||||
|
||||
//HACK REMOVE ME
|
||||
smh->mparams->video_rtp_session = v_engine->rtp_session;
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%sVIDEO RTP [%s] %s:%d->%s:%d codec: %u ms: %d [%s]\n",
|
||||
switch_channel_test_flag(session->channel, CF_PROXY_MEDIA) ? "PROXY " : "",
|
||||
switch_channel_get_name(session->channel),
|
||||
@@ -4813,7 +4808,7 @@ SWITCH_DECLARE(void) switch_core_media_patch_sdp(switch_core_session_t *session)
|
||||
SWITCH_DECLARE(void) switch_core_media_start_udptl(switch_core_session_t *session, switch_t38_options_t *t38_options)
|
||||
{
|
||||
switch_media_handle_t *smh;
|
||||
switch_rtp_engine_t *a_engine;;
|
||||
switch_rtp_engine_t *a_engine;
|
||||
|
||||
if (!(smh = session->media_handle)) {
|
||||
return;
|
||||
@@ -5234,64 +5229,146 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_receive_message(switch_core_se
|
||||
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(void) switch_core_media_break(switch_media_handle_t *smh, switch_media_type_t type)
|
||||
SWITCH_DECLARE(void) switch_core_media_break(switch_core_session_t *session, switch_media_type_t type)
|
||||
{
|
||||
switch_media_handle_t *smh;
|
||||
|
||||
if (!(smh = session->media_handle)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (switch_rtp_ready(smh->engines[type].rtp_session)) {
|
||||
switch_rtp_break(smh->engines[type].rtp_session);
|
||||
}
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(void) switch_core_media_kill_socket(switch_media_handle_t *smh, switch_media_type_t type)
|
||||
SWITCH_DECLARE(void) switch_core_media_kill_socket(switch_core_session_t *session, switch_media_type_t type)
|
||||
{
|
||||
switch_media_handle_t *smh;
|
||||
|
||||
if (!(smh = session->media_handle)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (switch_rtp_ready(smh->engines[type].rtp_session)) {
|
||||
switch_rtp_kill_socket(smh->engines[type].rtp_session);
|
||||
}
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_media_queue_rfc2833(switch_media_handle_t *smh, switch_media_type_t type, const switch_dtmf_t *dtmf)
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_media_queue_rfc2833(switch_core_session_t *session, switch_media_type_t type, const switch_dtmf_t *dtmf)
|
||||
{
|
||||
switch_media_handle_t *smh;
|
||||
|
||||
if (!(smh = session->media_handle)) {
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
if (switch_rtp_ready(smh->engines[type].rtp_session)) {
|
||||
return switch_rtp_queue_rfc2833(smh->engines[type].rtp_session, dtmf);
|
||||
}
|
||||
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_media_queue_rfc2833_in(switch_media_handle_t *smh, switch_media_type_t type, const switch_dtmf_t *dtmf)
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_media_queue_rfc2833_in(switch_core_session_t *session, switch_media_type_t type, const switch_dtmf_t *dtmf)
|
||||
{
|
||||
switch_media_handle_t *smh;
|
||||
|
||||
if (!(smh = session->media_handle)) {
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
if (switch_rtp_ready(smh->engines[type].rtp_session)) {
|
||||
return switch_rtp_queue_rfc2833_in(smh->engines[type].rtp_session, dtmf);
|
||||
}
|
||||
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(uint8_t) switch_core_media_ready(switch_media_handle_t *smh, switch_media_type_t type)
|
||||
SWITCH_DECLARE(uint8_t) switch_core_media_ready(switch_core_session_t *session, switch_media_type_t type)
|
||||
{
|
||||
switch_media_handle_t *smh;
|
||||
|
||||
if (!(smh = session->media_handle)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return switch_rtp_ready(smh->engines[type].rtp_session);
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(void) switch_core_media_set_recv_pt(switch_media_handle_t *smh, switch_media_type_t type, switch_payload_t pt)
|
||||
SWITCH_DECLARE(void) switch_core_media_set_rtp_flag(switch_core_session_t *session, switch_media_type_t type, switch_rtp_flag_t flag)
|
||||
{
|
||||
switch_media_handle_t *smh;
|
||||
|
||||
if (!(smh = session->media_handle)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (switch_rtp_ready(smh->engines[type].rtp_session)) {
|
||||
switch_rtp_set_flag(smh->engines[type].rtp_session, flag);
|
||||
}
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(void) switch_core_media_clear_rtp_flag(switch_core_session_t *session, switch_media_type_t type, switch_rtp_flag_t flag)
|
||||
{
|
||||
switch_media_handle_t *smh;
|
||||
|
||||
if (!(smh = session->media_handle)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (switch_rtp_ready(smh->engines[type].rtp_session)) {
|
||||
switch_rtp_clear_flag(smh->engines[type].rtp_session, flag);
|
||||
}
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(void) switch_core_media_set_recv_pt(switch_core_session_t *session, switch_media_type_t type, switch_payload_t pt)
|
||||
{
|
||||
switch_media_handle_t *smh;
|
||||
|
||||
if (!(smh = session->media_handle)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (switch_rtp_ready(smh->engines[type].rtp_session)) {
|
||||
switch_rtp_set_recv_pt(smh->engines[type].rtp_session, pt);
|
||||
}
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(void) switch_core_media_set_telephony_event(switch_media_handle_t *smh, switch_media_type_t type, switch_payload_t te)
|
||||
SWITCH_DECLARE(void) switch_core_media_set_telephony_event(switch_core_session_t *session, switch_media_type_t type, switch_payload_t te)
|
||||
{
|
||||
switch_media_handle_t *smh;
|
||||
|
||||
if (!(smh = session->media_handle)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (switch_rtp_ready(smh->engines[type].rtp_session)) {
|
||||
switch_rtp_set_telephony_event(smh->engines[type].rtp_session, te);
|
||||
}
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(void) switch_core_media_set_telephony_recv_event(switch_media_handle_t *smh, switch_media_type_t type, switch_payload_t te)
|
||||
SWITCH_DECLARE(void) switch_core_media_set_telephony_recv_event(switch_core_session_t *session, switch_media_type_t type, switch_payload_t te)
|
||||
{
|
||||
switch_media_handle_t *smh;
|
||||
|
||||
if (!(smh = session->media_handle)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (switch_rtp_ready(smh->engines[type].rtp_session)) {
|
||||
switch_rtp_set_telephony_recv_event(smh->engines[type].rtp_session, te);
|
||||
}
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(switch_rtp_stats_t *) switch_core_media_get_stats(switch_media_handle_t *smh, switch_media_type_t type, switch_memory_pool_t *pool)
|
||||
SWITCH_DECLARE(switch_rtp_stats_t *) switch_core_media_get_stats(switch_core_session_t *session, switch_media_type_t type, switch_memory_pool_t *pool)
|
||||
{
|
||||
switch_media_handle_t *smh;
|
||||
|
||||
if (!(smh = session->media_handle)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (switch_rtp_ready(smh->engines[type].rtp_session)) {
|
||||
return switch_rtp_get_stats(smh->engines[type].rtp_session, pool);
|
||||
}
|
||||
@@ -5299,15 +5376,35 @@ SWITCH_DECLARE(switch_rtp_stats_t *) switch_core_media_get_stats(switch_media_ha
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_media_udptl_mode(switch_media_handle_t *smh, switch_media_type_t type)
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_media_udptl_mode(switch_core_session_t *session, switch_media_type_t type)
|
||||
{
|
||||
switch_media_handle_t *smh;
|
||||
|
||||
if (!(smh = session->media_handle)) {
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
if (switch_rtp_ready(smh->engines[type].rtp_session)) {
|
||||
return switch_rtp_udptl_mode(smh->engines[type].rtp_session);
|
||||
}
|
||||
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(stfu_instance_t *) switch_core_media_get_jb(switch_core_session_t *session, switch_media_type_t type)
|
||||
{
|
||||
switch_media_handle_t *smh;
|
||||
|
||||
if (!(smh = session->media_handle)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (switch_rtp_ready(smh->engines[type].rtp_session)) {
|
||||
return switch_rtp_get_jitter_buffer(smh->engines[type].rtp_session);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user