]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update
authorAnthony Minessale <anthony.minessale@gmail.com>
Thu, 16 Nov 2006 21:20:00 +0000 (21:20 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Thu, 16 Nov 2006 21:20:00 +0000 (21:20 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3389 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/mod_sofia.c
src/switch_log.c

index 2242b691279f000305b602d8f349bf7da440858b..cc756470923f9a0447518a2667746db5b38756a6 100644 (file)
@@ -167,7 +167,8 @@ typedef enum {
        TFLAG_XFER = (1 << 19),
        TFLAG_NOMEDIA = (1 << 20),
        TFLAG_BUGGY_2833 = (1 << 21),
-       TFLAG_SIP_HOLD = (1 << 22)
+       TFLAG_SIP_HOLD = (1 << 22),
+       TFLAG_RWLOCK = (1 << 23)
 } TFLAGS;
 
 static struct {
@@ -2754,7 +2755,12 @@ static void sip_i_state(int status,
                break;
        case nua_callstate_terminated: 
                if (session) {
+                       if (switch_test_flag(tech_pvt, TFLAG_RWLOCK)) {
+                               switch_core_session_rwunlock(session);
+                               switch_clear_flag(tech_pvt, TFLAG_RWLOCK);
+                       }
                        if (!switch_test_flag(tech_pvt, TFLAG_BYE)) {
+
                                switch_set_flag_locked(tech_pvt, TFLAG_BYE);
                                if (switch_test_flag(tech_pvt, TFLAG_NOHUP)) {
                                        switch_clear_flag_locked(tech_pvt, TFLAG_NOHUP);
@@ -3977,7 +3983,8 @@ static void sip_i_invite(nua_t *nua,
                        }
 
                        attach_private(session, profile, tech_pvt, username);
-
+                       switch_core_session_read_lock(session);
+                       switch_set_flag(tech_pvt, TFLAG_RWLOCK);
                        channel = switch_core_session_get_channel(session);
                        switch_channel_set_variable(channel, "endpoint_disposition", "INBOUND CALL");
                        set_chat_hash(tech_pvt, sip);
index 257e4c1687185da2f9d3564993dcfea770a248d0..6495212481bdf07113c0877a00dca5e3a9296562 100644 (file)
@@ -238,6 +238,8 @@ SWITCH_DECLARE(void) switch_log_printf(switch_text_channel_t channel, char *file
                                        node->content = content;
                                        node->timestamp = now;
                                        switch_queue_push(LOG_QUEUE, node);
+                               } else {
+                                       free(data);
                                }
                        } 
                }