chlog: freetdm: Channel indicator IE only included in first response

This commit is contained in:
David Yat Sin 2011-02-17 11:44:57 -05:00
parent bb797286d0
commit 60395cea46
2 changed files with 10 additions and 0 deletions

View File

@ -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;

View File

@ -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;