]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update
authorAnthony Minessale <anthony.minessale@gmail.com>
Sat, 22 Apr 2006 01:49:27 +0000 (01:49 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Sat, 22 Apr 2006 01:49:27 +0000 (01:49 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1225 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_dingaling/mod_dingaling.c
src/switch_core.c

index 71dee8351612f7ae1a038fc4143fa487f0d91cba..341b8b899bf8e273c69dc18acbe8607b573f5172 100644 (file)
@@ -53,7 +53,9 @@ typedef enum {
        TFLAG_ANSWER = (1 << 10),
        TFLAG_VAD_IN = ( 1 << 11),
        TFLAG_VAD_OUT = ( 1 << 12),
-       TFLAG_VAD = ( 1 << 13)
+       TFLAG_VAD = ( 1 << 13),
+       TFLAG_DO_CAND = ( 1 << 14),
+       TFLAG_DO_DESC = (1 << 15)
 } TFLAGS;
 
 typedef enum {
@@ -306,10 +308,17 @@ static int do_candidates(struct private_object *tech_pvt, int force)
        switch_channel *channel = switch_core_session_get_channel(tech_pvt->session);
        assert(channel != NULL);
 
+       if (switch_test_flag(tech_pvt, TFLAG_DO_CAND)) {
+               return 0;
+       }
+
+
+
        tech_pvt->next_cand += DL_CAND_WAIT;
        if (switch_test_flag(tech_pvt, TFLAG_BYE)) {
                return -1;
        }
+       switch_set_flag(tech_pvt, TFLAG_DO_CAND);
 
        if (force || !switch_test_flag(tech_pvt, TFLAG_RTP_READY)) {
                                ldl_candidate_t cand[1];
@@ -367,6 +376,7 @@ static int do_candidates(struct private_object *tech_pvt, int force)
                                tech_pvt->cand_id = ldl_session_candidates(tech_pvt->dlsession, cand, 1);
                                switch_set_flag(tech_pvt, TFLAG_RTP_READY);
                        }
+       switch_clear_flag(tech_pvt, TFLAG_DO_CAND);
        return 0;
 }
 
@@ -385,6 +395,10 @@ static int do_describe(struct private_object *tech_pvt, int force)
        switch_channel *channel = switch_core_session_get_channel(tech_pvt->session);
        assert(channel != NULL);
 
+       if (switch_test_flag(tech_pvt, TFLAG_DO_DESC)) {
+               return 0;
+       }
+
        tech_pvt->next_desc += DL_CAND_WAIT;
 
        if (switch_test_flag(tech_pvt, TFLAG_BYE)) {
@@ -392,7 +406,7 @@ static int do_describe(struct private_object *tech_pvt, int force)
        }
 
        memset(payloads, 0, sizeof(payloads));
-
+       switch_set_flag(tech_pvt, TFLAG_DO_CAND);
        if (!tech_pvt->num_codecs) {
                get_codecs(tech_pvt);
                if (!tech_pvt->num_codecs) {
@@ -424,7 +438,7 @@ static int do_describe(struct private_object *tech_pvt, int force)
                                                                                                 switch_test_flag(tech_pvt, TFLAG_OUTBOUND) ? LDL_DESCRIPTION_INITIATE : LDL_DESCRIPTION_ACCEPT);
                switch_set_flag(tech_pvt, TFLAG_CODEC_READY);
        } 
-
+       switch_clear_flag(tech_pvt, TFLAG_DO_CAND);
        return 0;
 }
 
index 1cc675e5e35e5083470a586de0f15037fadbea54..4abc7850779c9fbe4921de8836c2ada337a32d48 100644 (file)
@@ -1352,8 +1352,8 @@ SWITCH_DECLARE(switch_status) switch_core_session_write_frame(switch_core_sessio
                                                                status = SWITCH_STATUS_SUCCESS;
                                                                break;
                                                        default:
-                                                               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec %s encoder error!\n",
-                                                                                                         session->read_codec->codec_interface->interface_name);
+                                                               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Codec %s encoder error %d!\n",
+                                                                                                         session->read_codec->codec_interface->interface_name, status);
                                                                write_frame = NULL;
                                                                return status;
                                                        }