]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
sctplib changes
authorShane Burrell <shaneb@metrostat.net>
Mon, 7 Apr 2008 05:03:10 +0000 (05:03 +0000)
committerShane Burrell <shaneb@metrostat.net>
Mon, 7 Apr 2008 05:03:10 +0000 (05:03 +0000)
git-svn-id: http://svn.openzap.org/svn/openzap/trunk@448 a93c3328-9c30-0410-af19-c9cd2b2d52af

libs/openzap/src/include/zap_types.h
libs/openzap/src/m3ua_client.h
libs/openzap/src/zap_m3ua.c

index 40fd649ad238caa00f900aff856ab147c1864917..b515a1f00de00863fe3c9d2b6be952adef07c6a7 100644 (file)
@@ -164,7 +164,8 @@ typedef enum {
        ZAP_SIGTYPE_ISDN,
        ZAP_SIGTYPE_RBS,
        ZAP_SIGTYPE_ANALOG,
-       ZAP_SIGTYPE_SS7BOOST
+       ZAP_SIGTYPE_SS7BOOST,
+       ZAP_SIGTYPE_M3UA
 } zap_signal_type_t;
 
 typedef enum {
index e75a6dcee240a4e4390137955fe2ba3d7114a86f..d7eb286029b69d46d88009634c78b0562ff36168 100644 (file)
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
-#include <netinet/sctp.h>
+#include <sctp.h>
+//#include <netinet/sctp.h>
 #include <arpa/inet.h>
 #include <stdarg.h>
 #include <netdb.h>
-#include <sigboost.h>
+//#include <sigboost.h>
 #include <sys/time.h>
 
+#define MAX_DIALED_DIGITS      31
+#define MAX_CALLING_NAME       31
+
+/* Next two defines are used to create the range of values for call_setup_id
+ * in the t_sigboost structure.
+ * 0..((CORE_MAX_SPANS * CORE_MAX_CHAN_PER_SPAN) - 1) */
+#define CORE_MAX_SPANS                 200
+#define CORE_MAX_CHAN_PER_SPAN         30
+#define MAX_PENDING_CALLS      CORE_MAX_SPANS * CORE_MAX_CHAN_PER_SPAN
+/* 0..(MAX_PENDING_CALLS-1) is range of call_setup_id below */
+#define SIZE_RDNIS             80
+
+//#undef MSGWINDOW
+#define MSGWINDOW
+
+
+typedef struct
+{
+       uint32_t        event_id;
+       uint32_t        fseqno;
+#ifdef MSGWINDOW
+       uint32_t        bseqno;
+#endif
+       uint16_t        call_setup_id;
+       uint32_t        trunk_group;
+       uint32_t        span;
+       uint32_t        chan;
+       uint8_t         called_number_digits_count;
+       char            called_number_digits [MAX_DIALED_DIGITS + 1]; /* it's a null terminated string */
+       uint8_t         calling_number_digits_count; /* it's an array */
+       char            calling_number_digits [MAX_DIALED_DIGITS + 1]; /* it's a null terminated string */
+       uint8_t         release_cause;
+       struct timeval  tv;
+       /* ref. Q.931 Table 4-11 and Q.951 Section 3 */
+       uint8_t         calling_number_screening_ind;
+       uint8_t         calling_number_presentation;
+       char            redirection_string [SIZE_RDNIS]; /* it's a null terminated string */
+       
+} t_m3ua;
+
 typedef t_m3ua m3uac_event_t;
 typedef uint32_t m3uac_event_id_t;
 
+
 typedef struct m3uac_ip_cfg
 {
        char local_ip[25];
@@ -85,27 +127,27 @@ struct m3uac_connection {
 
 typedef enum {
        MSU_FLAG_EVENT = (1 << 0)
-} ss7bc_flag_t;
+} m3uac_flag_t;
 
 typedef struct m3uac_connection m3uac_connection_t;
 
 static inline void sctp_no_nagle(int socket)
 {
-    int flag = 1;
-    setsockopt(socket, IPPROTO_SCTP, SCTP_NODELAY, (char *) &flag, sizeof(int));
+    //int flag = 1;
+    //setsockopt(socket, IPPROTO_SCTP, SCTP_NODELAY, (char *) &flag, sizeof(int));
 }
 
 int m3uac_connection_close(m3uac_connection_t *mcon);
 int m3uac_connection_open(m3uac_connection_t *mcon, char *local_ip, int local_port, char *ip, int port);
-m3uac_event_t *ss7bc_connection_read(m3uac_connection_t *mcon, int iteration);
-m3uac_event_t *ss7bc_connection_readp(m3uac_connection_t *mcon, int iteration);
-int m3uac_connection_write(m3uac_connection_t *mcon, ss7bc_event_t *event);
+m3uac_event_t *m3uac_connection_read(m3uac_connection_t *mcon, int iteration);
+m3uac_event_t *m3uac_connection_readp(m3uac_connection_t *mcon, int iteration);
+int m3uac_connection_write(m3uac_connection_t *mcon, m3uac_event_t *event);
 void m3uac_event_init(m3uac_event_t *event, m3uac_event_id_t event_id, int chan, int span);
 void m3uac_call_init(m3uac_event_t *event, const char *calling, const char *called, int setup_id);
 const char *m3uac_event_id_name(uint32_t event_id);
 int m3uac_exec_command(m3uac_connection_t *mcon, int span, int chan, int id, int cmd, int cause);
 
-#endif
+
 
 
 /* For Emacs:
index dcd5aab584ffc86bec9480d1d0fc81c60f8ea031..bd35703ff9ebbede588bdc3614605f932f2f7a2c 100644 (file)
@@ -38,7 +38,7 @@
 
 
 #include "openzap.h"
-//#include "m3ua_client.h"
+#include "m3ua_client.h"
 #include "zap_m3ua.h"
 
 struct general_config {