]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
organizw
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 16 May 2007 21:59:11 +0000 (21:59 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 16 May 2007 21:59:11 +0000 (21:59 +0000)
git-svn-id: http://svn.openzap.org/svn/openzap/trunk@6 a93c3328-9c30-0410-af19-c9cd2b2d52af

libs/freetdm/src/openzap.c
libs/freetdm/src/zap_skel.c
libs/freetdm/src/zap_wanpipe.c
libs/freetdm/src/zap_zt.c

index 0ac20f533a0a05e54e4612662c64bdaad6635b74..4905f230bb4f529217fe6b97231a6c8c77560cbe 100644 (file)
@@ -139,10 +139,15 @@ zap_status_t zap_channel_close(zap_channel_t **zchan)
 zap_status_t zap_channel_set_codec(zap_channel_t *zchan, zap_codec_t codec)
 {
        assert(zchan != NULL);
+       assert(zchan->zint != NULL);
 
        if (!zap_test_flag(zchan, ZAP_CHANNEL_OPEN)) {
                return ZAP_FAIL;
        }
+       
+       if (!zchan->zint->set_codec) {
+               return ZAP_FAIL;
+       }
 
        return zchan->zint->set_codec(zchan, codec);
        
@@ -151,24 +156,34 @@ zap_status_t zap_channel_set_codec(zap_channel_t *zchan, zap_codec_t codec)
 zap_status_t zap_channel_set_interval(zap_channel_t *zchan, unsigned ms)
 {
        assert(zchan != NULL);
+       assert(zchan->zint != NULL);
 
     if (!zap_test_flag(zchan, ZAP_CHANNEL_OPEN)) {
         return ZAP_FAIL;
     }
 
+       if (!zchan->zint->set_interval) {
+               return ZAP_FAIL;
+       }
+
     return zchan->zint->set_interval(zchan, ms);
 
 }
 
-zap_status_t zap_channel_wait(zap_channel_t *zchan, zap_wait_flag_t flags)
+zap_status_t zap_channel_wait(zap_channel_t *zchan, zap_wait_flag_t flags, unsigned to)
 {
        assert(zchan != NULL);
+       assert(zchan->zint != NULL);
 
     if (!zap_test_flag(zchan, ZAP_CHANNEL_OPEN)) {
         return ZAP_FAIL;
     }
 
-    return zchan->zint->wait(zchan, flags);
+       if (!zchan->zint->wait) {
+               return ZAP_FAIL;
+       }
+
+    return zchan->zint->wait(zchan, flags, to);
 
 }
 
@@ -176,11 +191,17 @@ zap_status_t zap_channel_wait(zap_channel_t *zchan, zap_wait_flag_t flags)
 zap_status_t zap_channel_read(zap_channel_t *zchan, void *data, zap_size_t *datalen)
 {
        assert(zchan != NULL);
+       assert(zchan->zint != NULL);
+       assert(zchan->zint != NULL);
 
     if (!zap_test_flag(zchan, ZAP_CHANNEL_OPEN)) {
         return ZAP_FAIL;
     }
 
+       if (!zchan->zint->read) {
+               return ZAP_FAIL;
+       }
+
     return zchan->zint->read(zchan, data, datalen);
        
 }
@@ -189,11 +210,16 @@ zap_status_t zap_channel_read(zap_channel_t *zchan, void *data, zap_size_t *data
 zap_status_t zap_channel_write(zap_channel_t *zchan, void *data, zap_size_t *datalen)
 {
        assert(zchan != NULL);
+       assert(zchan->zint != NULL);
 
     if (!zap_test_flag(zchan, ZAP_CHANNEL_OPEN)) {
         return ZAP_FAIL;
     }
 
+       if (!zchan->zint->write) {
+               return ZAP_FAIL;
+       }
+
     return zchan->zint->write(zchan, data, datalen);
        
 }
index 2cefd04603279ab3a89030996ced9788fa767d5b..4341309649dff2050ee8e2e252e8f076ff8ab11f 100644 (file)
 #include "openzap.h"
 #include "zap_skel.h"
 
+static ZINT_CONFIGURE_FUNCTION(skel_configure)
+{
+       ZINT_CONFIGURE_MUZZLE;
+       return ZAP_FAIL;
+}
+
+static ZINT_OPEN_FUNCTION(skel_open) 
+{
+       ZINT_OPEN_MUZZLE;
+       return ZAP_FAIL;
+}
+
+static ZINT_CLOSE_FUNCTION(skel_close)
+{
+       ZINT_CLOSE_MUZZLE;
+       return ZAP_FAIL;
+}
+
+static ZINT_SET_CODEC_FUNCTION(skel_set_codec)
+{
+       ZINT_SET_CODEC_MUZZLE;
+       return ZAP_FAIL;
+}
+
+static ZINT_SET_INTERVAL_FUNCTION(skel_set_interval)
+{
+       ZINT_SET_INTERVAL_MUZZLE;
+       return ZAP_FAIL;
+}
+
+static ZINT_WAIT_FUNCTION(skel_wait)
+{
+       ZINT_WAIT_MUZZLE;
+       return ZAP_FAIL;
+}
+
+static ZINT_READ_FUNCTION(skel_read)
+{
+       ZINT_READ_MUZZLE;
+       return ZAP_FAIL;
+}
+
+static ZINT_WRITE_FUNCTION(skel_write)
+{
+       ZINT_WRITE_MUZZLE;
+       return ZAP_FAIL;
+}
+
+static zap_software_interface_t skel_interface;
+
 zap_status_t skel_init(zap_software_interface_t **zint)
 {
        assert(zint != NULL);
+       memset(&skel_interface, 0, sizeof(skel_interface));
+
+       skel_interface.name = "skel";
+       skel_interface.configure =  skel_configure;
+       skel_interface.open = skel_open;
+       skel_interface.close = skel_close;
+       skel_interface.set_codec = skel_set_codec;
+       skel_interface.set_interval = skel_set_interval;
+       skel_interface.wait = skel_wait;
+       skel_interface.read = skel_read;
+       skel_interface.write = skel_write;
+       *zint = &skel_interface;
 
        return ZAP_FAIL;
 }
index 7cce6d6783796bc69aff44e7bc7b2c97d1eef461..ba05bfd5860d8c69e8b1cc0cac0f5cc13ea4d085 100644 (file)
 #include "openzap.h"
 #include "zap_wanpipe.h"
 
+static ZINT_CONFIGURE_FUNCTION(wanpipe_configure)
+{
+       ZINT_CONFIGURE_MUZZLE;
+       return ZAP_FAIL;
+}
+
+static ZINT_OPEN_FUNCTION(wanpipe_open) 
+{
+       ZINT_OPEN_MUZZLE;
+       return ZAP_FAIL;
+}
+
+static ZINT_CLOSE_FUNCTION(wanpipe_close)
+{
+       ZINT_CLOSE_MUZZLE;
+       return ZAP_FAIL;
+}
+
+static ZINT_SET_CODEC_FUNCTION(wanpipe_set_codec)
+{
+       ZINT_SET_CODEC_MUZZLE;
+       return ZAP_FAIL;
+}
+
+static ZINT_SET_INTERVAL_FUNCTION(wanpipe_set_interval)
+{
+       ZINT_SET_INTERVAL_MUZZLE;
+       return ZAP_FAIL;
+}
+
+static ZINT_WAIT_FUNCTION(wanpipe_wait)
+{
+       ZINT_WAIT_MUZZLE;
+       return ZAP_FAIL;
+}
+
+static ZINT_READ_FUNCTION(wanpipe_read)
+{
+       ZINT_READ_MUZZLE;
+       return ZAP_FAIL;
+}
+
+static ZINT_WRITE_FUNCTION(wanpipe_write)
+{
+       ZINT_WRITE_MUZZLE;
+       return ZAP_FAIL;
+}
+
+static zap_software_interface_t wanpipe_interface;
+
 zap_status_t wanpipe_init(zap_software_interface_t **zint)
 {
        assert(zint != NULL);
+       memset(&wanpipe_interface, 0, sizeof(wanpipe_interface));
+
+       wanpipe_interface.name = "wanpipe";
+       wanpipe_interface.configure =  wanpipe_configure;
+       wanpipe_interface.open = wanpipe_open;
+       wanpipe_interface.close = wanpipe_close;
+       wanpipe_interface.set_codec = wanpipe_set_codec;
+       wanpipe_interface.set_interval = wanpipe_set_interval;
+       wanpipe_interface.wait = wanpipe_wait;
+       wanpipe_interface.read = wanpipe_read;
+       wanpipe_interface.write = wanpipe_write;
+       *zint = &wanpipe_interface;
 
        return ZAP_FAIL;
 }
index 012abc76b7504acd3653757b2e9a116ab30effd4..802523d393f6e59648eb9347643304f31ea89c96 100644 (file)
 #include "openzap.h"
 #include "zap_zt.h"
 
+static ZINT_CONFIGURE_FUNCTION(zt_configure)
+{
+       ZINT_CONFIGURE_MUZZLE;
+       return ZAP_FAIL;
+}
+
+static ZINT_OPEN_FUNCTION(zt_open) 
+{
+       ZINT_OPEN_MUZZLE;
+       return ZAP_FAIL;
+}
+
+static ZINT_CLOSE_FUNCTION(zt_close)
+{
+       ZINT_CLOSE_MUZZLE;
+       return ZAP_FAIL;
+}
+
+static ZINT_SET_CODEC_FUNCTION(zt_set_codec)
+{
+       ZINT_SET_CODEC_MUZZLE;
+       return ZAP_FAIL;
+}
+
+static ZINT_SET_INTERVAL_FUNCTION(zt_set_interval)
+{
+       ZINT_SET_INTERVAL_MUZZLE;
+       return ZAP_FAIL;
+}
+
+static ZINT_WAIT_FUNCTION(zt_wait)
+{
+       ZINT_WAIT_MUZZLE;
+       return ZAP_FAIL;
+}
+
+static ZINT_READ_FUNCTION(zt_read)
+{
+       ZINT_READ_MUZZLE;
+       return ZAP_FAIL;
+}
+
+static ZINT_WRITE_FUNCTION(zt_write)
+{
+       ZINT_WRITE_MUZZLE;
+       return ZAP_FAIL;
+}
+
+static zap_software_interface_t zt_interface;
+
 zap_status_t zt_init(zap_software_interface_t **zint)
 {
        assert(zint != NULL);
+       memset(&zt_interface, 0, sizeof(zt_interface));
+
+       zt_interface.name = "zt";
+       zt_interface.configure =  zt_configure;
+       zt_interface.open = zt_open;
+       zt_interface.close = zt_close;
+       zt_interface.set_codec = zt_set_codec;
+       zt_interface.set_interval = zt_set_interval;
+       zt_interface.wait = zt_wait;
+       zt_interface.read = zt_read;
+       zt_interface.write = zt_write;
+       *zint = &zt_interface;
 
        return ZAP_FAIL;
 }