diff --git a/libs/libdingaling/src/libdingaling.c b/libs/libdingaling/src/libdingaling.c index 9a27e44e84..37dd67ba5f 100644 --- a/libs/libdingaling/src/libdingaling.c +++ b/libs/libdingaling/src/libdingaling.c @@ -326,6 +326,8 @@ static ldl_status parse_session_code(ldl_handle_t *handle, char *id, char *from, } tag = iks_next_tag(tag); } + } else if (!strcasecmp(type, "transport-accept")) { + signal = LDL_SIGNAL_TRANSPORT_ACCEPT; } else if (!strcasecmp(type, "transport-info")) { char *tid = iks_find_attrib(xml, "id"); signal = LDL_SIGNAL_CANDIDATES; diff --git a/libs/libdingaling/src/libdingaling.h b/libs/libdingaling/src/libdingaling.h index 7c925c371e..68ce4e2b18 100644 --- a/libs/libdingaling/src/libdingaling.h +++ b/libs/libdingaling/src/libdingaling.h @@ -123,7 +123,8 @@ typedef enum { LDL_SIGNAL_ERROR, LDL_SIGNAL_LOGIN_SUCCESS, LDL_SIGNAL_LOGIN_FAILURE, - LDL_SIGNAL_CONNECTED + LDL_SIGNAL_CONNECTED, + LDL_SIGNAL_TRANSPORT_ACCEPT } ldl_signal_t; typedef enum { diff --git a/src/mod/endpoints/mod_dingaling/mod_dingaling.c b/src/mod/endpoints/mod_dingaling/mod_dingaling.c index 8ef2bb5504..9ae57ebb66 100644 --- a/src/mod/endpoints/mod_dingaling/mod_dingaling.c +++ b/src/mod/endpoints/mod_dingaling/mod_dingaling.c @@ -66,7 +66,8 @@ typedef enum { TFLAG_AUTO = (1 << 17), TFLAG_DTMF = (1 << 18), TFLAG_TIMER = ( 1 << 19), - TFLAG_TERM = ( 1 << 20) + TFLAG_TERM = ( 1 << 20), + TFLAG_TRANSPORT_ACCEPT = (1 << 21), } TFLAGS; typedef enum { @@ -542,6 +543,7 @@ static void *SWITCH_THREAD_FUNC negotiate_thread_run(switch_thread_t *thread, vo while(! (switch_test_flag(tech_pvt, TFLAG_CODEC_READY) && switch_test_flag(tech_pvt, TFLAG_RTP_READY) && switch_test_flag(tech_pvt, TFLAG_ANSWER) && + switch_test_flag(tech_pvt, TFLAG_TRANSPORT_ACCEPT) && switch_test_flag(tech_pvt, TFLAG_TRANSPORT))) { now = switch_time_now(); elapsed = (unsigned int)((now - started) / 1000); @@ -1608,6 +1610,7 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi tech_pvt->local_port = switch_rtp_request_port(); switch_set_flag_locked(tech_pvt, TFLAG_ANSWER); tech_pvt->recip = switch_core_session_strdup(session, from); + switch_set_flag_locked(tech_pvt, TFLAG_TRANSPORT_ACCEPT); } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Hey where is my memory pool?\n"); terminate_session(&session, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); @@ -1648,7 +1651,9 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi } break; - + case LDL_SIGNAL_TRANSPORT_ACCEPT: + switch_set_flag_locked(tech_pvt, TFLAG_TRANSPORT_ACCEPT); + printf("\n**************************************\n"); break; case LDL_SIGNAL_INITIATE: if (signal) {