]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Freetdm: moved some defines from ftmod_sangoma_isdn.h to ftmod_sangoma_isdn_user.h
authorDavid Yat Sin <dyatsin@sangoma.com>
Wed, 1 Dec 2010 17:28:38 +0000 (12:28 -0500)
committerDavid Yat Sin <dyatsin@sangoma.com>
Wed, 1 Dec 2010 17:33:32 +0000 (12:33 -0500)
libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn.h
libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_cfg.c
libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_user.h [new file with mode: 0644]

index eb00b1f6770068c5d7cf436d613b68dbf7d03593..6cdbde75ed0c961ff9c09522709a951c2f82dfe7 100644 (file)
 #include <ctype.h>
 
 #include "private/ftdm_core.h"
+#include "ftmod_sangoma_isdn_user.h"
 
 #include <sng_isdn.h>
 
 /* Theoretical limit for MAX_SPANS_PER_NFAS_LINK is 31,
-   but set to 8 for now to save some memor */
+   but set to 8 for now to save some memory */
 
 #define MAX_SPANS_PER_NFAS_LINK                8 
 #define NUM_E1_CHANNELS_PER_SPAN       32
 
 /* TODO: rename all *_cc_* to *_an_*  */
 
-#define SNGISDN_ENUM_NAMES(_NAME, _STRINGS) static const char * _NAME [] = { _STRINGS , NULL };
-#define SNGISDN_STR2ENUM_P(_FUNC1, _FUNC2, _TYPE) _TYPE _FUNC1 (const char *name); const char * _FUNC2 (_TYPE type);
-#define SNGISDN_STR2ENUM(_FUNC1, _FUNC2, _TYPE, _STRINGS, _MAX)    \
-        _TYPE _FUNC1 (const char *name)                                                         \
-{                                                                                                               \
-                int i;                                                                                          \
-                _TYPE t = _MAX ;                                                                        \
-                                                                                                                        \
-                for (i = 0; i < _MAX ; i++) {                                           \
-                        if (!strcasecmp(name, _STRINGS[i])) {                   \
-                                t = (_TYPE) i;                                                          \
-                                break;                                                                          \
-}                                                                                               \
-}                                                                                                       \
-                                                                                                                        \
-                return t;                                                                                       \
-}                                                                                                               \
-        const char * _FUNC2 (_TYPE type)                                                \
-{                                                                                                               \
-                if (type > _MAX) {                                                                      \
-                        type = _MAX;                                                                    \
-}                                                                                                       \
-                return _STRINGS[(int)type];                                                     \
-}                                                                                                               \
-
 
 
 typedef enum {
@@ -163,45 +139,7 @@ typedef enum {
        SNGISDN_EVENT_RST_IND,
 } ftdm_sngisdn_event_id_t;
 
-typedef enum {
-       /* Call is not end-to-end ISDN */
-       SNGISDN_PROGIND_DESCR_NETE_ISDN,
-       /* Destination address is non-ISDN */
-       SNGISDN_PROGIND_DESCR_DEST_NISDN,
-       /* Origination address is non-ISDN */
-       SNGISDN_PROGIND_DESCR_ORIG_NISDN,
-       /* Call has returned to the ISDN */
-       SNGISDN_PROGIND_DESCR_RET_ISDN,
-       /* Interworking as occured and has resulted in a telecommunication service change */
-       SNGISDN_PROGIND_DESCR_SERV_CHANGE,
-       /* In-band information or an appropriate pattern is now available */
-       SNGISDN_PROGIND_DESCR_IB_AVAIL,
-       /* Invalid */
-       SNGISDN_PROGIND_DESCR_INVALID,
-} ftdm_sngisdn_progind_descr_t;
-#define SNGISDN_PROGIND_DESCR_STRINGS "not-end-to-end-isdn", "destination-is-non-isdn", "origination-is-non-isdn", "call-returned-to-isdn", "service-change", "inband-info-available", "invalid"
-SNGISDN_STR2ENUM_P(ftdm_str2ftdm_sngisdn_progind_descr, ftdm_sngisdn_progind_descr2str, ftdm_sngisdn_progind_descr_t);
 
-typedef enum {
-       /* User */
-       SNGISDN_PROGIND_LOC_USER,
-       /* Private network serving the local user */
-       SNGISDN_PROGIND_LOC_PRIV_NET_LOCAL_USR,
-       /* Public network serving the local user */
-       SNGISDN_PROGIND_LOC_PUB_NET_LOCAL_USR,
-       /* Transit network */
-       SNGISDN_PROGIND_LOC_TRANSIT_NET,
-       /* Public network serving remote user */
-       SNGISDN_PROGIND_LOC_PUB_NET_REMOTE_USR,
-       /* Private network serving remote user */
-       SNGISDN_PROGIND_LOC_PRIV_NET_REMOTE_USR,
-       /* Network beyond the interworking point */
-       SNGISDN_PROGIND_LOC_NET_BEYOND_INTRW,
-       /* Invalid */
-       SNGISDN_PROGIND_LOC_INVALID,
-} ftdm_sngisdn_progind_loc_t;
-#define SNGISDN_PROGIND_LOC_STRINGS "user", "private-net-local-user", "public-net-local-user", "transit-network", "public-net-remote-user", "private-net-remote-user", "beyond-interworking", "invalid"
-SNGISDN_STR2ENUM_P(ftdm_str2ftdm_sngisdn_progind_loc, ftdm_sngisdn_progind_loc2str, ftdm_sngisdn_progind_loc_t);
 
 typedef struct ftdm_sngisdn_prog_ind {
        ftdm_sngisdn_progind_loc_t loc;         /* location */
@@ -499,3 +437,15 @@ void sngisdn_print_span(ftdm_stream_handle_t *stream, ftdm_span_t *span);
 
 #endif /* __FTMOD_SNG_ISDN_H__ */
 
+/* For Emacs:
+ * Local Variables:
+ * mode:c
+ * indent-tabs-mode:t
+ * tab-width:4
+ * c-basic-offset:4
+ * End:
+ * For VIM:
+ * vim:set softtabstop=4 shiftwidth=4 tabstop=4:
+ */
+
+/******************************************************************************/
index 6b4e73ab2584898dbd62e22a6bb569437a5c1e46..b7e6e26fd5b2e15eb10f94abd6c420641eda2572 100644 (file)
@@ -280,7 +280,9 @@ ftdm_status_t ftmod_isdn_parse_cfg(ftdm_conf_parameter_t *ftdm_parameters, ftdm_
                        ftdm_set_bearer_capability(val, (uint8_t*)&span->default_caller_data.bearer_capability);
                } else if (!strcasecmp(var, "outbound-bearer_layer1")) {
                        ftdm_set_bearer_layer1(val, (uint8_t*)&span->default_caller_data.bearer_layer1);
-               } else if (!strcasecmp(var, "local-number")) {
+               } else if (!strcasecmp(var, "channel-restart-on-link-up")) {
+                       parse_yesno(var, val, &signal_data->restart_opt);
+               } else if (!strcasecmp(var, "local-number")) {                  
                        if (add_local_number(val, span) != FTDM_SUCCESS) {
                                return FTDM_FAIL;
                        }
diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_user.h b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_user.h
new file mode 100644 (file)
index 0000000..5d94e6c
--- /dev/null
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2010, Sangoma Technologies 
+ * David Yat Sin <davidy@sangoma.com>
+ * All rights reserved.
+ *
+ * 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 original author; nor the names of any 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 __FTMOD_SANGOMA_ISDN_USER_H__
+#define __FTMOD_SANGOMA_ISDN_USER_H__
+
+
+#define SNGISDN_ENUM_NAMES(_NAME, _STRINGS) static const char * _NAME [] = { _STRINGS , NULL };
+#define SNGISDN_STR2ENUM_P(_FUNC1, _FUNC2, _TYPE) _TYPE _FUNC1 (const char *name); const char * _FUNC2 (_TYPE type);
+#define SNGISDN_STR2ENUM(_FUNC1, _FUNC2, _TYPE, _STRINGS, _MAX)                        \
+       _TYPE _FUNC1 (const char *name)                                                                         \
+       {                                                                                                                                       \
+               int i;                                                                                                                  \
+               _TYPE t = _MAX ;                                                                                                \
+                                                                                                                                               \
+               for (i = 0; i < _MAX ; i++) {                                                                   \
+                       if (!strcasecmp(name, _STRINGS[i])) {                                           \
+                               t = (_TYPE) i;                                                                                  \
+                               break;                                                                                                  \
+                       }                                                                                                                       \
+               }                                                                                                                               \
+               return t;                                                                                                               \
+       }                                                                                                                                       \
+       const char * _FUNC2 (_TYPE type)                                                                        \
+       {                                                                                                                                       \
+               if (type > _MAX) {                                                                                              \
+                       type = _MAX;                                                                                            \
+               }                                                                                                                               \
+               return _STRINGS[(int)type];                                                                             \
+       }                                                                                                                                       \
+
+
+typedef enum {
+       /* Call is not end-to-end ISDN */
+       SNGISDN_PROGIND_DESCR_NETE_ISDN,
+       /* Destination address is non-ISDN */
+       SNGISDN_PROGIND_DESCR_DEST_NISDN,
+       /* Origination address is non-ISDN */
+       SNGISDN_PROGIND_DESCR_ORIG_NISDN,
+       /* Call has returned to the ISDN */
+       SNGISDN_PROGIND_DESCR_RET_ISDN,
+       /* Interworking as occured and has resulted in a telecommunication service change */
+       SNGISDN_PROGIND_DESCR_SERV_CHANGE,
+       /* In-band information or an appropriate pattern is now available */
+       SNGISDN_PROGIND_DESCR_IB_AVAIL,
+       /* Invalid */
+       SNGISDN_PROGIND_DESCR_INVALID,
+} ftdm_sngisdn_progind_descr_t;
+#define SNGISDN_PROGIND_DESCR_STRINGS "not-end-to-end-isdn", "destination-is-non-isdn", "origination-is-non-isdn", "call-returned-to-isdn", "service-change", "inband-info-available", "invalid"
+SNGISDN_STR2ENUM_P(ftdm_str2ftdm_sngisdn_progind_descr, ftdm_sngisdn_progind_descr2str, ftdm_sngisdn_progind_descr_t);
+
+
+typedef enum {
+       /* User */
+       SNGISDN_PROGIND_LOC_USER,
+       /* Private network serving the local user */
+       SNGISDN_PROGIND_LOC_PRIV_NET_LOCAL_USR,
+       /* Public network serving the local user */
+       SNGISDN_PROGIND_LOC_PUB_NET_LOCAL_USR,
+       /* Transit network */
+       SNGISDN_PROGIND_LOC_TRANSIT_NET,
+       /* Public network serving remote user */
+       SNGISDN_PROGIND_LOC_PUB_NET_REMOTE_USR,
+       /* Private network serving remote user */
+       SNGISDN_PROGIND_LOC_PRIV_NET_REMOTE_USR,
+       /* Network beyond the interworking point */
+       SNGISDN_PROGIND_LOC_NET_BEYOND_INTRW,
+       /* Invalid */
+       SNGISDN_PROGIND_LOC_INVALID,
+} ftdm_sngisdn_progind_loc_t;
+#define SNGISDN_PROGIND_LOC_STRINGS "user", "private-net-local-user", "public-net-local-user", "transit-network", "public-net-remote-user", "private-net-remote-user", "beyond-interworking", "invalid"
+SNGISDN_STR2ENUM_P(ftdm_str2ftdm_sngisdn_progind_loc, ftdm_sngisdn_progind_loc2str, ftdm_sngisdn_progind_loc_t);
+
+
+#endif /* __FTMOD_SANGOMA_ISDN_USER_H__*/
+
+/* For Emacs:
+ * Local Variables:
+ * mode:c
+ * indent-tabs-mode:t
+ * tab-width:4
+ * c-basic-offset:4
+ * End:
+ * For VIM:
+ * vim:set softtabstop=4 shiftwidth=4 tabstop=4:
+ */
+
+/******************************************************************************/