]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
sync
authorAnthony Minessale <anthony.minessale@gmail.com>
Tue, 18 Mar 2008 20:19:59 +0000 (20:19 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Tue, 18 Mar 2008 20:19:59 +0000 (20:19 +0000)
git-svn-id: http://svn.openzap.org/svn/openzap/trunk@423 a93c3328-9c30-0410-af19-c9cd2b2d52af

libs/freetdm/src/ss7_boost_client.c
libs/freetdm/src/zap_ss7_boost.c

index d2ec25d5973ef0b9c539dd501f9f95ca5ab925d8..53a8c8e72669c5a2d3b4c9ce642446cfb33bdced 100644 (file)
@@ -247,7 +247,7 @@ int ss7bc_connection_write(ss7bc_connection_t *mcon, ss7bc_event_t *event)
 {
        int err;
 
-       if (!event) {
+       if (!event || mcon->socket < 0 || !mcon->mutex) {
                zap_log(ZAP_LOG_DEBUG,  "Critical Error: No Event Device\n");
                return -EINVAL;
        }
index bd1507c9bd28f58b974bcea85a1c89fb9e0d9c9a..09b3c4d7a2698f6f6e40fab6a1a55655493a6cb3 100644 (file)
@@ -132,9 +132,12 @@ static ZIO_CHANNEL_REQUEST_FUNCTION(ss7_boost_channel_request)
                }
        }
 
-       if (OUTBOUND_REQUESTS[r].status == BST_READY) {
+       if (OUTBOUND_REQUESTS[r].status == BST_READY && OUTBOUND_REQUESTS[r].zchan) {
                *zchan = OUTBOUND_REQUESTS[r].zchan;
                status = ZAP_SUCCESS;
+       } else {
+               status = ZAP_FAIL;
+        *zchan = NULL;
        }
 
  done:
@@ -162,6 +165,7 @@ static void handle_call_start_ack(ss7bc_connection_t *mcon, ss7bc_event_t *event
                        zap_log(ZAP_LOG_ERROR, "OPEN ERROR [%s]\n", zchan->last_error);
                } else {
                        zap_set_state_locked(zchan, ZAP_CHANNEL_STATE_PROGRESS_MEDIA);
+                       zap_set_flag(zchan, ZAP_CHANNEL_OUTBOUND);
                        OUTBOUND_REQUESTS[event->call_setup_id].zchan = zchan;
                        return;
                }
@@ -477,6 +481,7 @@ static __inline__ void state_advance(zap_channel_t *zchan)
                {
                        sig.event_id = ZAP_SIGEVENT_STOP;
                        status = ss7_boost_data->signal_cb(&sig);
+                       zap_set_state_locked(zchan, ZAP_CHANNEL_STATE_DOWN);
                }
        default:
                break;