1 /* 2 * Copyright (c) 2010, Sangoma Technologies 3 * David Yat Sin <davidy@sangoma.com> 4 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 11 * * Redistributions of source code must retain the above copyright 12 * notice, this list of conditions and the following disclaimer. 13 * 14 * * Redistributions in binary form must reproduce the above copyright 15 * notice, this list of conditions and the following disclaimer in the 16 * documentation and/or other materials provided with the distribution. 17 * 18 * * Neither the name of the original author; nor the names of any contributors 19 * may be used to endorse or promote products derived from this software 20 * without specific prior written permission. 21 * 22 * 23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 27 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 28 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 29 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 30 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 31 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 32 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 ******************************************************************************/ 35 36 #include "ftmod_sangoma_isdn.h" 37 38 void sngisdn_set_chan_sig_status(ftdm_channel_t *ftdmchan, ftdm_signaling_status_t status); 39 40 void sngisdn_set_chan_sig_status(ftdm_channel_t *ftdmchan, ftdm_signaling_status_t status) 41 { 42 ftdm_sigmsg_t sig; 43 ftdm_log_chan(ftdmchan, FTDM_LOG_DEBUG, "Signalling link status changed to %s\n", ftdm_signaling_status2str(status)); 44 45 memset(&sig, 0, sizeof(sig)); 46 sig.chan_id = ftdmchan->chan_id; 47 sig.span_id = ftdmchan->span_id; 48 sig.channel = ftdmchan; 49 sig.event_id = FTDM_SIGEVENT_SIGSTATUS_CHANGED; 50 sig.sigstatus = status; 51 ftdm_span_send_signal(ftdmchan->span, &sig); 52 return; 53 } 54 55 void sngisdn_set_span_sig_status(ftdm_span_t *span, ftdm_signaling_status_t status) 56 { 57 ftdm_iterator_t *chaniter = NULL; 58 ftdm_iterator_t *curr = NULL; 59 60 61 chaniter = ftdm_span_get_chan_iterator(span, NULL); 62 for (curr = chaniter; curr; curr = ftdm_iterator_next(curr)) { 63 sngisdn_set_chan_sig_status(((ftdm_channel_t*)ftdm_iterator_current(curr)), status); 64 } 65 ftdm_iterator_free(chaniter); 66 return; 67 } 68 69 70 /* For Emacs: 71 * Local Variables: 72 * mode:c 73 * indent-tabs-mode:t 74 * tab-width:4 75 * c-basic-offset:4 76 * End: 77 * For VIM: 78 * vim:set softtabstop=4 shiftwidth=4 tabstop=4: 79 */ 80 81 /******************************************************************************/ 82