diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_out.c b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_out.c index c2305e445f..add4d3fad0 100644 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_out.c +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_out.c @@ -69,6 +69,8 @@ void sngisdn_snd_setup(ftdm_channel_t *ftdmchan) set_calling_subaddr(ftdmchan, &conEvnt.cgPtySad); set_redir_num(ftdmchan, &conEvnt.redirNmb); set_calling_name(ftdmchan, &conEvnt); + + /* set_facility_ie will overwrite Calling Name for NI-2 if user specifies custom Facility IE */ set_facility_ie(ftdmchan, &conEvnt.facilityStr); set_prog_ind_ie(ftdmchan, &conEvnt.progInd, prog_ind); 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 9a633b902a..d744ad2942 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 @@ -719,12 +719,19 @@ ftdm_status_t set_calling_name(ftdm_channel_t *ftdmchan, ConEvnt *conEvnt) } else { switch (signal_data->switchtype) { case SNGISDN_SWITCH_NI2: - /* TODO: Need to send the caller ID as a facility IE */ - +#ifdef SNGISDN_SUPPORT_CALLING_NAME_IN_FACILITY + { + if (signal_data->signalling == SNGISDN_SIGNALING_NET) { + sng_isdn_encode_facility_caller_name(caller_data->cid_name, conEvnt->facilityStr.facilityStr.val, &conEvnt->facilityStr.facilityStr.len); + conEvnt->facilityStr.eh.pres = PRSNT_NODEF; + conEvnt->facilityStr.facilityStr.pres = PRSNT_NODEF; + } + } +#endif break; case SNGISDN_SWITCH_EUROISDN: if (signal_data->signalling != SNGISDN_SIGNALING_NET) { - break; + break; } /* follow through */ case SNGISDN_SWITCH_5ESS: