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_SANGOMA_BOOST_H 35 #define FTDM_SANGOMA_BOOST_H 36 #include "sangoma_boost_client.h" 37 #include "freetdm.h" 38 39 #define MAX_CHANS_PER_TRUNKGROUP 1024 40 41 typedef enum { 42 FTDM_SANGOMA_BOOST_RUNNING = (1 << 0), 43 FTDM_SANGOMA_BOOST_RESTARTING = (1 << 1), 44 FTDM_SANGOMA_BOOST_EVENTS_RUNNING = (1 << 2), 45 } ftdm_sangoma_boost_flag_t; 46 47 typedef struct ftdm_sangoma_boost_data { 48 sangomabc_connection_t mcon; 49 sangomabc_connection_t pcon; 50 int iteration; 51 uint32_t flags; 52 boost_sigmod_interface_t *sigmod; 53 ftdm_queue_t *boost_queue; 54 } ftdm_sangoma_boost_data_t; 55 56 typedef struct ftdm_sangoma_boost_trunkgroup { 57 ftdm_mutex_t *mutex; 58 ftdm_size_t size; /* Number of b-channels in group */ 59 unsigned int last_used_index; /* index of last b-channel used */ 60 ftdm_channel_t* ftdmchans[MAX_CHANS_PER_TRUNKGROUP]; 61 //DAVIDY need to merge congestion timeouts to this struct 62 } ftdm_sangoma_boost_trunkgroup_t; 63 #endif 64 65 /* For Emacs: 66 * Local Variables: 67 * mode:c 68 * indent-tabs-mode:t 69 * tab-width:4 70 * c-basic-offset:4 71 * End: 72 * For VIM: 73 * vim:set softtabstop=4 shiftwidth=4 tabstop=4: 74 */ 75