]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
get building on windows again.
authorMichael Jerris <mike@jerris.com>
Thu, 24 May 2007 04:11:32 +0000 (04:11 +0000)
committerMichael Jerris <mike@jerris.com>
Thu, 24 May 2007 04:11:32 +0000 (04:11 +0000)
git-svn-id: http://svn.openzap.org/svn/openzap/trunk@131 a93c3328-9c30-0410-af19-c9cd2b2d52af

libs/openzap/src/include/zap_types.h
libs/openzap/src/isdn/include/national.h [new file with mode: 0644]
libs/openzap/src/zap_io.c
libs/openzap/src/zap_wanpipe.c

index 03d6ba851051a13d19557d6dd35c85c16621e266..1c609a16d66171d5378c2de799264c80c97d0230 100644 (file)
@@ -37,6 +37,7 @@
 #ifdef WIN32
 #include <windows.h>
 typedef HANDLE zap_socket_t;
+typedef unsigned __int64 uint64_t;
 typedef unsigned __int32 uint32_t;
 typedef __int32 int32_t;
 #else
diff --git a/libs/openzap/src/isdn/include/national.h b/libs/openzap/src/isdn/include/national.h
new file mode 100644 (file)
index 0000000..0bc1fa9
--- /dev/null
@@ -0,0 +1,121 @@
+/******************************************************************************
+
+  FileName:         national.h
+
+  Contents:         Header and definition for the National ISDN dialect. The 
+                                                                               header contents the following parts:
+
+                                       - Definition of codes
+                    - Definition of information elements (nationalie_).
+                    - Definition of messages (nationalmes_).
+                                       - Function prototypes.
+
+  Description:         The National ISDN dialect here covers ????
+
+  Related Files:       national.h                              National ISDN Definitions
+                                       nationalie.c                    National ISDN IE encoders/coders
+                                       nationalStateTE.c               National ISDN TE State Engine
+                                       nationalStateNT.c               National ISDN NT State Engine
+
+  License/Copyright:
+
+  Copyright (c) 2007, Jan Vidar Berger, Case Labs, Ltd. All rights reserved.
+  email:janvb@caselaboratories.com  
+
+  Copyright (c) 2007, Michael Jerris. All rights reserved.
+  email:mike@jerris.com  
+
+  Redistribution and use in source and binary forms, with or without 
+  modification, are permitted provided that the following conditions are 
+  met:
+
+    * Redistributions of source code must retain the above copyright notice, 
+         this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright notice, 
+         this list of conditions and the following disclaimer in the documentation 
+         and/or other materials provided with the distribution.
+    * Neither the name of the Case Labs, Ltd nor the names of its contributors 
+         may be used to endorse or promote products derived from this software 
+         without specific prior written permission.
+
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
+  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
+  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
+  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
+  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
+  POSSIBILITY OF SUCH DAMAGE.
+******************************************************************************/
+
+#ifndef _national_NATIONAL_NL
+#define _national_NATIONAL_NL
+
+#include "Q931.h"
+
+/*****************************************************************************
+
+  Q.931 Message codes
+  Only National specific message and ie types 
+  here the rest are inherited from national.h
+  
+*****************************************************************************/
+
+
+/* Single octet information elements                                */
+
+/* Variable Length Information Elements */
+#define nationalie_GENERIC_DIGITS               0x37 /* 0011 0111       */
+
+
+
+/*****************************************************************************
+
+  Struct:       nationalie_GenericDigits
+
+
+*****************************************************************************/
+
+typedef struct
+{
+    L3UCHAR IEId;                   /* 00110111                             */
+    L3UCHAR Size;                   /* Length of Information Element        */
+}nationalie_GenericDigits;
+
+
+/*****************************************************************************
+
+  Q.931 Information Element Pack/Unpack functions. Implemented in nationalie.c
+
+*****************************************************************************/
+
+L3INT nationalPie_GenericDigits(Q931_TrunkInfo_t *pTrunk,L3UCHAR *IBuf, L3UCHAR *OBuf, L3INT *Octet);
+L3INT nationalPie_CallingNum(Q931_TrunkInfo_t *pTrunk, L3UCHAR *IBuf, L3UCHAR *OBuf, L3INT *Octet);
+
+L3INT nationalUie_CallingNum(Q931_TrunkInfo_t *pTrunk, ie *pIE, L3UCHAR * IBuf, L3UCHAR * OBuf, L3INT *IOff, L3INT *OOff);
+L3INT nationalUie_GenericDigits(Q931_TrunkInfo_t *pTrunk,ie *pIE, L3UCHAR * IBuf, L3UCHAR *OBuf, L3INT *IOff, L3INT *OOff);
+
+
+/*****************************************************************************
+
+  Q.931 Message Pack/Unpack functions. Implemented in nationalmes.c
+
+*****************************************************************************/
+L3INT nationalUmes_Setup(Q931_TrunkInfo_t *pTrunk, L3UCHAR *IBuf, L3UCHAR *OBuf, L3INT IOff, L3INT Size);
+L3INT nationalPmes_Setup(Q931_TrunkInfo_t *pTrunk, L3UCHAR *IBuf, L3INT ISize, L3UCHAR *OBuf, L3INT *OSize);
+
+/*****************************************************************************
+
+  Q.931 Process Function Prototyping. Implemented in nationalStateTE.c
+
+*****************************************************************************/
+
+
+
+void nationalCreateTE(L3UCHAR i);
+void nationalCreateNT(L3UCHAR i);
+
+#endif /* _national_NATIONAL_NL */
index f0ca7dd395b8ac74e00b7dccd148472a932e0d86..f0e382f2e602502b8f50ec3db46d492c8b500dea 100644 (file)
@@ -45,7 +45,7 @@ static int time_is_init = 0;
 
 static void time_init(void)
 {
-#ifdef WIN32_TIME_GET_TIME
+#ifdef WIN32
        timeBeginPeriod(1);
 #endif
        time_is_init = 1;
@@ -53,7 +53,7 @@ static void time_init(void)
 
 static void time_end(void)
 {
-#ifdef WIN32_TIME_GET_TIME
+#ifdef WIN32
        timeEndPeriod(1);
 #endif
        time_is_init = 0;
@@ -61,7 +61,7 @@ static void time_end(void)
 
 zap_time_t zap_current_time_in_ms(void)
 {
-#ifdef WIN32_TIME_GET_TIME
+#ifdef WIN32
        return timeGetTime();
 #else
        struct timeval tv;
@@ -518,7 +518,7 @@ static zap_status_t zap_channel_reset(zap_channel_t *zchan)
 
 zap_status_t zap_channel_open_chan(zap_channel_t *zchan)
 {
-       zap_status_t status;
+       zap_status_t status = ZAP_FAIL;
 
        zap_mutex_lock(zchan->span->mutex);
        if (zap_test_flag(zchan, ZAP_CHANNEL_READY) && ! zap_test_flag(zchan, ZAP_CHANNEL_OPEN)) {
@@ -1064,7 +1064,7 @@ zap_status_t zap_channel_read(zap_channel_t *zchan, void *data, zap_size_t *data
 
                        sln = sln_buf;
                }
-               XX printf("WTF %d\n", (int) slen);
+
                teletone_dtmf_detect(&zchan->dtmf_detect, sln, (int)slen);
                teletone_dtmf_get(&zchan->dtmf_detect, digit_str, sizeof(digit_str));
 
index 9eab6fcc4234ea7f3ab2c8e10784350f3aa7f762..dbe48cd061b56c8b3620f1a0740415ee38ab6be3 100644 (file)
@@ -412,6 +412,7 @@ static ZIO_WAIT_FUNCTION(wanpipe_wait)
        return ZAP_SUCCESS;
 }
 
+#ifndef WIN32
 ZIO_SPAN_POLL_EVENT_FUNCTION(wanpipe_poll_event)
 {
        struct pollfd pfds[ZAP_MAX_CHANNELS_SPAN];
@@ -445,15 +446,17 @@ ZIO_SPAN_POLL_EVENT_FUNCTION(wanpipe_poll_event)
        return k ? ZAP_SUCCESS : ZAP_FAIL;
 }
 
+#endif
+
 ZIO_SPAN_NEXT_EVENT_FUNCTION(wanpipe_next_event)
 {
-       int i;
+       uint32_t i;
        zap_oob_event_t event_id;
        
        for(i = 1; i <= span->chan_count; i++) {
                if (span->channels[i].last_event_time && !zap_test_flag((&span->channels[i]), ZAP_CHANNEL_EVENT)) {
-                       uint32_t diff = zap_current_time_in_ms() - span->channels[i].last_event_time;
-                       XX printf("%u %u %u\n", diff, (unsigned)zap_current_time_in_ms(), (unsigned)span->channels[i].last_event_time);
+                       uint32_t diff = (uint32_t)(zap_current_time_in_ms() - span->channels[i].last_event_time);
+                       /* XX printf("%u %u %u\n", diff, (unsigned)zap_current_time_in_ms(), (unsigned)span->channels[i].last_event_time); */
                        if (zap_test_flag((&span->channels[i]), ZAP_CHANNEL_WINK)) {
                                if (diff > wp_globals.wink_ms) {
                                        zap_clear_flag_locked((&span->channels[i]), ZAP_CHANNEL_WINK);
@@ -554,7 +557,9 @@ zap_status_t wanpipe_init(zap_io_interface_t **zio)
        wanpipe_interface.wait = wanpipe_wait;
        wanpipe_interface.read = wanpipe_read;
        wanpipe_interface.write = wanpipe_write;
+#ifndef WIN32
        wanpipe_interface.poll_event = wanpipe_poll_event;
+#endif
        wanpipe_interface.next_event = wanpipe_next_event;
        *zio = &wanpipe_interface;