1 /* 2 * Copyright (c) 2007, Anthony Minessale II 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 9 * * Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * 12 * * Redistributions in binary form must reproduce the above copyright 13 * notice, this list of conditions and the following disclaimer in the 14 * documentation and/or other materials provided with the distribution. 15 * 16 * * Neither the name of the original author; nor the names of any contributors 17 * may be used to endorse or promote products derived from this software 18 * without specific prior written permission. 19 * 20 * 21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 25 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 26 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 27 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 28 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 29 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 30 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 31 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 */ 33 34 #ifndef FTDM_ISDN_H 35 #define FTDM_ISDN_H 36 #include "freetdm.h" 37 38 #define DEFAULT_DIGIT_TIMEOUT 10000 /* default overlap timeout: 10 seconds */ 39 40 41 typedef enum { 42 FTDM_ISDN_OPT_NONE = 0, 43 FTDM_ISDN_OPT_SUGGEST_CHANNEL = (1 << 0), 44 FTDM_ISDN_OPT_OMIT_DISPLAY_IE = (1 << 1), /*!< Do not send Caller name in outgoing SETUP message (= Display IE) */ 45 FTDM_ISDN_OPT_DISABLE_TONES = (1 << 2), /*!< Disable tone generating thread (NT mode) */ 46 47 FTDM_ISDN_OPT_MAX = (2 << 0) 48 } ftdm_isdn_opts_t; 49 50 typedef enum { 51 FTDM_ISDN_RUNNING = (1 << 0), 52 FTDM_ISDN_TONES_RUNNING = (1 << 1), 53 FTDM_ISDN_STOP = (1 << 2) 54 } ftdm_isdn_flag_t; 55 56 57 struct ftdm_isdn_data { 58 Q921Data_t q921; 59 Q931_TrunkInfo_t q931; 60 ftdm_channel_t *dchan; 61 ftdm_channel_t *dchans[2]; 62 struct ftdm_sigmsg sigmsg; 63 uint32_t flags; 64 int32_t mode; 65 int32_t digit_timeout; 66 ftdm_isdn_opts_t opts; 67 ftdm_caller_data_t *outbound_crv[32768]; 68 ftdm_channel_t *channels_local_crv[32768]; 69 ftdm_channel_t *channels_remote_crv[32768]; 70 }; 71 72 typedef struct ftdm_isdn_data ftdm_isdn_data_t; 73 74 75 /* b-channel private data */ 76 struct ftdm_isdn_bchan_data 77 { 78 L2ULONG digit_timeout; 79 }; 80 81 typedef struct ftdm_isdn_bchan_data ftdm_isdn_bchan_data_t; 82 83 84 #endif 85 86 /* For Emacs: 87 * Local Variables: 88 * mode:c 89 * indent-tabs-mode:t 90 * tab-width:4 91 * c-basic-offset:4 92 * End: 93 * For VIM: 94 * vim:set softtabstop=4 shiftwidth=4 tabstop=4: 95 */ 96