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 37 #define DEFAULT_DIGIT_TIMEOUT 10000 /* default overlap timeout: 10 seconds */ 38 39 40 typedef enum { 41 FTDM_ISDN_OPT_NONE = 0, 42 FTDM_ISDN_OPT_SUGGEST_CHANNEL = (1 << 0), 43 FTDM_ISDN_OPT_OMIT_DISPLAY_IE = (1 << 1), /*!< Do not send Caller name in outgoing SETUP message (= Display IE) */ 44 FTDM_ISDN_OPT_DISABLE_TONES = (1 << 2), /*!< Disable tone generating thread (NT mode) */ 45 46 FTDM_ISDN_OPT_MAX = (2 << 0) 47 } ftdm_isdn_opts_t; 48 49 typedef enum { 50 FTDM_ISDN_RUNNING = (1 << 0), 51 FTDM_ISDN_TONES_RUNNING = (1 << 1), 52 FTDM_ISDN_STOP = (1 << 2), 53 54 FTDM_ISDN_CAPTURE = (1 << 3), 55 FTDM_ISDN_CAPTURE_L3ONLY = (1 << 4) 56 } ftdm_isdn_flag_t; 57 58 #ifdef HAVE_PCAP 59 struct pcap_context; 60 #endif 61 62 struct ftdm_isdn_data { 63 Q921Data_t q921; 64 Q931_TrunkInfo_t q931; 65 ftdm_channel_t *dchan; 66 uint32_t flags; 67 int32_t mode; 68 int32_t digit_timeout; 69 ftdm_isdn_opts_t opts; 70 ftdm_caller_data_t *outbound_crv[32768]; 71 ftdm_channel_t *channels_local_crv[32768]; 72 ftdm_channel_t *channels_remote_crv[32768]; 73 #ifdef HAVE_PCAP 74 struct pcap_context *pcap; 75 #endif 76 }; 77 78 typedef struct ftdm_isdn_data ftdm_isdn_data_t; 79 80 81 /* b-channel private data */ 82 struct ftdm_isdn_bchan_data 83 { 84 int32_t digit_timeout; 85 }; 86 87 typedef struct ftdm_isdn_bchan_data ftdm_isdn_bchan_data_t; 88 89 90 #endif 91 92 /* For Emacs: 93 * Local Variables: 94 * mode:c 95 * indent-tabs-mode:t 96 * tab-width:4 97 * c-basic-offset:4 98 * End: 99 * For VIM: 100 * vim:set softtabstop=4 shiftwidth=4 tabstop=4 expandtab: 101 */ 102