From 60395cea462ecfa0f34c546892918a5427979f51 Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Thu, 17 Feb 2011 11:44:57 -0500 Subject: [PATCH] chlog: freetdm: Channel indicator IE only included in first response --- .../src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn.h | 2 ++ .../ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_support.c | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn.h b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn.h index 80dc73f0fa..b369deae1f 100644 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn.h +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn.h @@ -80,6 +80,8 @@ typedef enum { FLAG_ACTIVATING = (1 << 10), /* Used when we receive an ALERT msg + inband tones ready */ FLAG_MEDIA_READY = (1 << 11), + /* Set when we already sent a Channel ID IE */ + FLAG_SENT_CHAN_ID = (1 << 12), } sngisdn_flag_t; diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_support.c b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_support.c index 23fe08b983..08e5984a4f 100644 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_support.c +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_support.c @@ -821,9 +821,17 @@ ftdm_status_t set_prog_ind_ie(ftdm_channel_t *ftdmchan, ProgInd *progInd, ftdm_s ftdm_status_t set_chan_id_ie(ftdm_channel_t *ftdmchan, ChanId *chanId) { + sngisdn_chan_data_t *sngisdn_info = (sngisdn_chan_data_t*)ftdmchan->call_data; if (!ftdmchan) { return FTDM_SUCCESS; } + + if (ftdm_test_flag(sngisdn_info, FLAG_SENT_CHAN_ID)) { + /* Indicate channel ID only in first response */ + return FTDM_SUCCESS; + } + ftdm_set_flag(sngisdn_info, FLAG_SENT_CHAN_ID); + chanId->eh.pres = PRSNT_NODEF; chanId->prefExc.pres = PRSNT_NODEF; chanId->prefExc.val = IN_PE_EXCLSVE;