freetdm: Merged arnaldo.sng_isdn branch (changes for win32 port)

This commit is contained in:
David Yat Sin 2010-11-01 12:24:11 -02:00
parent 21418b083d
commit 25c56f6dc9
12 changed files with 53 additions and 144 deletions

View File

@ -48,7 +48,6 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Debug", "Debug", "{6374D55C-FABE-4A02-9CF1-4145308A56C5}"
ProjectSection(SolutionItems) = preProject
debug\conf\freeswitch.xml = debug\conf\freeswitch.xml
debug\conf\vars.xml = debug\conf\vars.xml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Build System", "_Build System", "{DB1024A8-41BF-4AD7-9AE6-13202230D1F3}"
@ -59,7 +58,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_Build System", "_Build Sys
configure.in = configure.in
Makefile.am = Makefile.am
build\modmake.rules.in = build\modmake.rules.in
build\modules.conf.in = build\modules.conf.in
libs\win32\util.vbs = libs\win32\util.vbs
EndProjectSection
EndProject
@ -92,13 +90,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "autoload_configs", "autoloa
conf\autoload_configs\limit.conf.xml = conf\autoload_configs\limit.conf.xml
conf\autoload_configs\local_stream.conf.xml = conf\autoload_configs\local_stream.conf.xml
conf\autoload_configs\logfile.conf.xml = conf\autoload_configs\logfile.conf.xml
conf\autoload_configs\modules.conf.xml = conf\autoload_configs\modules.conf.xml
conf\autoload_configs\openmrcp.conf.xml = conf\autoload_configs\openmrcp.conf.xml
conf\autoload_configs\portaudio.conf.xml = conf\autoload_configs\portaudio.conf.xml
conf\autoload_configs\rss.conf.xml = conf\autoload_configs\rss.conf.xml
conf\autoload_configs\sofia.conf.xml = conf\autoload_configs\sofia.conf.xml
conf\autoload_configs\spidermonkey.conf.xml = conf\autoload_configs\spidermonkey.conf.xml
conf\autoload_configs\switch.conf.xml = conf\autoload_configs\switch.conf.xml
conf\autoload_configs\syslog.conf.xml = conf\autoload_configs\syslog.conf.xml
conf\autoload_configs\voicemail.conf.xml = conf\autoload_configs\voicemail.conf.xml
conf\autoload_configs\wanpipe.conf.xml = conf\autoload_configs\wanpipe.conf.xml
@ -123,7 +119,6 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sip_profiles", "sip_profiles", "{8E2E8798-8B6F-4A55-8E4F-4E6FDE40ED26}"
ProjectSection(SolutionItems) = preProject
conf\sip_profiles\external.xml = conf\sip_profiles\external.xml
conf\sip_profiles\internal.xml = conf\sip_profiles\internal.xml
conf\sip_profiles\nat.xml = conf\sip_profiles\nat.xml
EndProjectSection
EndProject
@ -212,7 +207,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "autoload_configs", "autoloa
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dialplan", "dialplan", "{D44DD429-FE98-42AA-B5B7-4B4EBE33AEFD}"
ProjectSection(SolutionItems) = preProject
debug\conf\dialplan\default.xml = debug\conf\dialplan\default.xml
debug\conf\dialplan\US.conf.xml = debug\conf\dialplan\US.conf.xml
EndProjectSection
EndProject
@ -2213,12 +2207,10 @@ Global
{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.All|x64.ActiveCfg = Release|Any CPU
{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Debug|Win32.ActiveCfg = Debug|Any CPU
{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Debug|Win32.Build.0 = Debug|Any CPU
{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Debug|x64.ActiveCfg = Debug|x64
{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Debug|x64.Build.0 = Debug|x64
{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Debug|x64.ActiveCfg = Debug|Any CPU
{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Release|Win32.ActiveCfg = Release|Any CPU
{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Release|Win32.Build.0 = Release|Any CPU
{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Release|x64.ActiveCfg = Release|x64
{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Release|x64.Build.0 = Release|x64
{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}.Release|x64.ActiveCfg = Release|Any CPU
{E796E337-DE78-4303-8614-9A590862EE95}.All|Win32.ActiveCfg = Release|Win32
{E796E337-DE78-4303-8614-9A590862EE95}.All|Win32.Build.0 = Release|Win32
{E796E337-DE78-4303-8614-9A590862EE95}.All|x64.ActiveCfg = Release|Win32

View File

@ -63,7 +63,7 @@ endpoints/mod_loopback
#endpoints/mod_skypopen
#endpoints/mod_h323
#../../libs/openzap/mod_openzap
#../../libs/freetdm/mod_freetdm
../../libs/freetdm/mod_freetdm
#asr_tts/mod_unimrcp
#asr_tts/mod_flite
#asr_tts/mod_pocketsphinx

View File

@ -1,112 +1,15 @@
<configuration name="modules.conf" description="Modules">
<modules>
<!-- Loggers (I'd load these first) -->
<load module="mod_console"/>
<load module="mod_logfile"/>
<!-- <load module="mod_syslog"/> -->
<!--<load module="mod_yaml"/>-->
<!-- Multi-Faceted -->
<!-- mod_enum is a dialplan interface, an application interface and an api command interface -->
<load module="mod_enum"/>
<!-- XML Interfaces -->
<!-- <load module="mod_xml_rpc"/> -->
<!-- <load module="mod_xml_curl"/> -->
<!-- <load module="mod_xml_cdr"/> -->
<!-- Event Handlers -->
<load module="mod_cdr_csv"/>
<!-- <load module="mod_event_multicast"/> -->
<load module="mod_event_socket"/>
<!-- <load module="mod_zeroconf"/> -->
<!-- <load module="mod_erlang_event"/> -->
<!-- Directory Interfaces -->
<!-- <load module="mod_ldap"/> -->
<!-- Endpoints -->
<!-- <load module="mod_dingaling"/> -->
<!-- <load module="mod_portaudio"/> -->
<!-- <load module="mod_alsa"/> -->
<load module="mod_sofia"/>
<load module="mod_loopback"/>
<!-- <load module="mod_woomera"/> -->
<!-- <load module="mod_openzap"/> -->
<!-- <load module="mod_unicall"/> -->
<!-- <load module="mod_skinny"/> -->
<!-- Applications -->
<load module="mod_commands"/>
<load module="mod_conference"/>
<load module="mod_db"/>
<load module="mod_dptools"/>
<load module="mod_expr"/>
<load module="mod_fifo"/>
<load module="mod_hash"/>
<load module="mod_voicemail"/>
<!--<load module="mod_directory"/>-->
<!--<load module="mod_lcr"/>-->
<load module="mod_esf"/>
<load module="mod_fsv"/>
<load module="mod_cluechoo"/>
<load module="mod_valet_parking"/>
<!--<load module="mod_spy"/>-->
<!-- SNOM Module -->
<!--<load module="mod_snom"/>-->
<!-- Dialplan Interfaces -->
<!-- <load module="mod_dialplan_directory"/> -->
<load module="mod_dialplan_xml"/>
<load module="mod_dialplan_asterisk"/>
<!-- Codec Interfaces -->
<load module="mod_spandsp"/>
<load module="mod_g723_1"/>
<load module="mod_g729"/>
<load module="mod_amr"/>
<load module="mod_ilbc"/>
<load module="mod_speex"/>
<load module="mod_h26x"/>
<load module="mod_siren"/>
<!--<load module="mod_celt"/>-->
<!-- File Format Interfaces -->
<load module="mod_sndfile"/>
<load module="mod_native_file"/>
<!--For icecast/mp3 streams/files-->
<!--<load module="mod_shout"/>-->
<!--For local streams (play all the files in a directory)-->
<load module="mod_local_stream"/>
<load module="mod_tone_stream"/>
<load module="mod_file_string"/>
<!-- Timers -->
<!-- Languages -->
<load module="mod_spidermonkey"/>
<!-- <load module="mod_perl"/> -->
<!-- <load module="mod_python"/> -->
<!-- <load module="mod_java"/> -->
<load module="mod_lua"/>
<!-- ASR /TTS -->
<!-- <load module="mod_flite"/> -->
<!-- <load module="mod_pocketsphinx"/> -->
<!-- <load module="mod_cepstral"/> -->
<!-- <load module="mod_tts_commandline"/> -->
<!-- <load module="mod_rss"/> -->
<!-- Say -->
<load module="mod_say_en"/>
<load module="mod_say_ru"/>
<!-- <load module="mod_say_zh"/> -->
<!-- Third party modules -->
<!--<load module="mod_nibblebill"/>-->
</modules>
</configuration>

View File

@ -7,7 +7,7 @@ cp Debug/mod/*.dll $fsdir/Debug/mod/
cp mod_freetdm/Debug/*.pdb $fsdir/Debug/mod/
cp Debug/*.dll $fsdir/Debug/
cp Debug/*.pdb $fsdir/Debug/
cp Debug/testsangomaboost.exe $fsdir/Debug/
#cp Debug/testsangomaboost.exe $fsdir/Debug/
echo "FRIENDLY REMINDER: RECOMPILE ftmod_wanpipe WHENEVER YOU INSTALL NEW DRIVERS"
set +x

View File

@ -913,7 +913,8 @@ static FIO_SIG_LOAD_FUNCTION(ftdm_sangoma_isdn_init)
}
/* initalize sng_isdn library */
sng_isdn_init(&g_sngisdn_event_interface);
ftdm_assert_return(!sng_isdn_init(&g_sngisdn_event_interface), FTDM_FAIL, "Failed to initialize stack\n");
return FTDM_SUCCESS;
}

View File

@ -266,15 +266,15 @@ extern ftdm_sngisdn_data_t g_sngisdn_data;
ftdm_status_t ftmod_isdn_parse_cfg(ftdm_conf_parameter_t *ftdm_parameters, ftdm_span_t *span);
/* Support functions */
FT_DECLARE_INLINE(uint32_t) get_unique_suInstId(uint8_t cc_id);
FT_DECLARE_INLINE(uint32_t) get_unique_suInstId(int16_t cc_id);
FT_DECLARE_INLINE(void) clear_call_data(sngisdn_chan_data_t *sngisdn_info);
FT_DECLARE_INLINE(void) clear_call_glare_data(sngisdn_chan_data_t *sngisdn_info);
void stack_hdr_init(Header *hdr);
void stack_pst_init(Pst *pst);
FT_DECLARE_INLINE(ftdm_status_t) get_ftdmchan_by_spInstId(uint8_t cc_id, uint32_t spInstId, sngisdn_chan_data_t **sngisdn_data);
FT_DECLARE_INLINE(ftdm_status_t) get_ftdmchan_by_suInstId(uint8_t cc_id, uint32_t suInstId, sngisdn_chan_data_t **sngisdn_data);
FT_DECLARE_INLINE(ftdm_status_t) get_ftdmchan_by_spInstId(int16_t cc_id, uint32_t spInstId, sngisdn_chan_data_t **sngisdn_data);
FT_DECLARE_INLINE(ftdm_status_t) get_ftdmchan_by_suInstId(int16_t cc_id, uint32_t suInstId, sngisdn_chan_data_t **sngisdn_data);
FT_DECLARE_INLINE(ftdm_status_t) sng_isdn_set_avail_rate(ftdm_span_t *ftdmspan, sngisdn_avail_t avail);
/* Outbound Call Control functions */

View File

@ -198,7 +198,7 @@ ftdm_status_t sng_isdn_stack_cfg_phy_psap(ftdm_span_t *span)
L1Mngmt cfg;
Pst pst;
S32 d_channel_fd = -1;
int32_t d_channel_fd = -1;
sngisdn_span_data_t *signal_data = (sngisdn_span_data_t*)span->signal_data;
/* initalize the post structure */
@ -227,7 +227,7 @@ ftdm_status_t sng_isdn_stack_cfg_phy_psap(ftdm_span_t *span)
for (curr = chaniter; curr; curr = ftdm_iterator_next(curr)) {
ftdm_channel_t *ftdmchan = (ftdm_channel_t*)ftdm_iterator_current(curr);
if (ftdmchan->type == FTDM_CHAN_TYPE_DQ921) {
d_channel_fd = (S32) ftdmchan->sockfd;
d_channel_fd = (int32_t)ftdmchan->sockfd;
break;
}
}

View File

@ -78,7 +78,7 @@ void sngisdn_process_con_ind (sngisdn_event_data_t *sngisdn_event)
break;
}
sngisdn_info->suInstId = get_unique_suInstId((int8_t) suId);
sngisdn_info->suInstId = get_unique_suInstId(suId);
sngisdn_info->spInstId = spInstId;
@ -205,7 +205,7 @@ void sngisdn_process_con_ind (sngisdn_event_data_t *sngisdn_event)
sngisdn_set_flag(sngisdn_info, FLAG_DELAYED_REL);
sngisdn_info->glare.suId = suId;
sngisdn_info->glare.suInstId = get_unique_suInstId((int8_t) suId);
sngisdn_info->glare.suInstId = get_unique_suInstId(suId);
sngisdn_info->glare.spInstId = spInstId;
sngisdn_info->glare.dChan = dChan;

View File

@ -112,7 +112,7 @@ void sngisdn_rcv_con_cfm (int16_t suId, uint32_t suInstId, uint32_t spInstId, Cn
ftdm_assert(g_sngisdn_data.ccs[suId].activation_done != 0, "Con Cfm on unconfigured cc\n");
ftdm_assert(g_sngisdn_data.dchans[dChan].num_spans != 0, "Con Cfm on unconfigured dchan\n");
if (get_ftdmchan_by_suInstId((int8_t) suId, suInstId, &sngisdn_info) != FTDM_SUCCESS) {
if (get_ftdmchan_by_suInstId(suId, suInstId, &sngisdn_info) != FTDM_SUCCESS) {
ftdm_log(FTDM_LOG_CRIT, "Could not find matching call suId:%u suInstId:%u spInstId:%u\n", suId, suInstId, spInstId);
ISDN_FUNC_TRACE_EXIT(__FUNCTION__);
return;
@ -156,7 +156,7 @@ void sngisdn_rcv_cnst_ind (int16_t suId, uint32_t suInstId, uint32_t spInstId, C
ftdm_assert(g_sngisdn_data.ccs[suId].activation_done != 0, "Cnst Ind on unconfigured cc\n");
ftdm_assert(g_sngisdn_data.dchans[dChan].num_spans != 0, "Cnst Ind on unconfigured dchan\n");
if (get_ftdmchan_by_suInstId((int8_t) suId, suInstId, &sngisdn_info) != FTDM_SUCCESS) {
if (get_ftdmchan_by_suInstId(suId, suInstId, &sngisdn_info) != FTDM_SUCCESS) {
ftdm_log(FTDM_LOG_CRIT, "Could not find matching call suId:%u suInstId:%u spInstId:%u\n", suId, suInstId, spInstId);
ISDN_FUNC_TRACE_EXIT(__FUNCTION__);
return;
@ -206,8 +206,8 @@ void sngisdn_rcv_disc_ind (int16_t suId, uint32_t suInstId, uint32_t spInstId, D
ftdm_assert(spInstId != 0, "Received DISCONNECT with invalid id");
if (!(spInstId && get_ftdmchan_by_spInstId((int8_t) suId, spInstId, &sngisdn_info) == FTDM_SUCCESS) &&
!(suInstId && get_ftdmchan_by_suInstId((int8_t) suId, suInstId, &sngisdn_info) == FTDM_SUCCESS)) {
if (!(spInstId && get_ftdmchan_by_spInstId(suId, spInstId, &sngisdn_info) == FTDM_SUCCESS) &&
!(suInstId && get_ftdmchan_by_suInstId(suId, suInstId, &sngisdn_info) == FTDM_SUCCESS)) {
ftdm_log(FTDM_LOG_CRIT, "Could not find matching call suId:%u suInstId:%u spInstId:%u\n", suId, suInstId, spInstId);
ftdm_assert(0, "Inconsistent call states\n");
@ -240,8 +240,8 @@ void sngisdn_rcv_rel_ind (int16_t suId, uint32_t suInstId, uint32_t spInstId, Re
ISDN_FUNC_TRACE_ENTER(__FUNCTION__);
if (!(spInstId && get_ftdmchan_by_spInstId((int8_t) suId, spInstId, &sngisdn_info) == FTDM_SUCCESS) &&
!(suInstId && get_ftdmchan_by_suInstId((int8_t) suId, suInstId, &sngisdn_info) == FTDM_SUCCESS)) {
if (!(spInstId && get_ftdmchan_by_spInstId(suId, spInstId, &sngisdn_info) == FTDM_SUCCESS) &&
!(suInstId && get_ftdmchan_by_suInstId(suId, suInstId, &sngisdn_info) == FTDM_SUCCESS)) {
ftdm_log(FTDM_LOG_CRIT, "Could not find matching call suId:%u suInstId:%u spInstId:%u\n", suId, suInstId, spInstId);
/* It seems that Trillium has a bug where they sometimes send release twice on a call, so do not crash on these for now */
@ -274,8 +274,8 @@ void sngisdn_rcv_dat_ind (int16_t suId, uint32_t suInstId, uint32_t spInstId, In
ISDN_FUNC_TRACE_ENTER(__FUNCTION__);
if (!(spInstId && get_ftdmchan_by_spInstId((int8_t) suId, spInstId, &sngisdn_info) == FTDM_SUCCESS) &&
!(suInstId && get_ftdmchan_by_suInstId((int8_t) suId, suInstId, &sngisdn_info) == FTDM_SUCCESS)) {
if (!(spInstId && get_ftdmchan_by_spInstId(suId, spInstId, &sngisdn_info) == FTDM_SUCCESS) &&
!(suInstId && get_ftdmchan_by_suInstId(suId, suInstId, &sngisdn_info) == FTDM_SUCCESS)) {
ftdm_log(FTDM_LOG_CRIT, "Could not find matching call suId:%u suInstId:%u spInstId:%u\n", suId, suInstId, spInstId);
ftdm_assert(0, "Inconsistent call states\n");
@ -307,8 +307,8 @@ void sngisdn_rcv_sshl_ind (int16_t suId, uint32_t suInstId, uint32_t spInstId, S
ISDN_FUNC_TRACE_ENTER(__FUNCTION__);
if (!(spInstId && get_ftdmchan_by_spInstId((int8_t) suId, spInstId, &sngisdn_info) == FTDM_SUCCESS) &&
!(suInstId && get_ftdmchan_by_suInstId((int8_t) suId, suInstId, &sngisdn_info) == FTDM_SUCCESS)) {
if (!(spInstId && get_ftdmchan_by_spInstId(suId, spInstId, &sngisdn_info) == FTDM_SUCCESS) &&
!(suInstId && get_ftdmchan_by_suInstId(suId, suInstId, &sngisdn_info) == FTDM_SUCCESS)) {
ftdm_log(FTDM_LOG_CRIT, "Could not find matching call suId:%u suInstId:%u spInstId:%u\n", suId, suInstId, spInstId);
ftdm_assert(0, "Inconsistent call states\n");
@ -341,8 +341,8 @@ void sngisdn_rcv_sshl_cfm (int16_t suId, uint32_t suInstId, uint32_t spInstId, S
ISDN_FUNC_TRACE_ENTER(__FUNCTION__);
if (!(spInstId && get_ftdmchan_by_spInstId((int8_t) suId, spInstId, &sngisdn_info) == FTDM_SUCCESS) &&
!(suInstId && get_ftdmchan_by_suInstId((int8_t) suId, suInstId, &sngisdn_info) == FTDM_SUCCESS)) {
if (!(spInstId && get_ftdmchan_by_spInstId(suId, spInstId, &sngisdn_info) == FTDM_SUCCESS) &&
!(suInstId && get_ftdmchan_by_suInstId(suId, suInstId, &sngisdn_info) == FTDM_SUCCESS)) {
ftdm_log(FTDM_LOG_CRIT, "Could not find matching call suId:%u suInstId:%u spInstId:%u\n", suId, suInstId, spInstId);
ftdm_assert(0, "Inconsistent call states\n");
@ -374,8 +374,8 @@ void sngisdn_rcv_rmrt_ind (int16_t suId, uint32_t suInstId, uint32_t spInstId, R
ISDN_FUNC_TRACE_ENTER(__FUNCTION__);
if (!(spInstId && get_ftdmchan_by_spInstId((int8_t) suId, spInstId, &sngisdn_info) == FTDM_SUCCESS) &&
!(suInstId && get_ftdmchan_by_suInstId((int8_t) suId, suInstId, &sngisdn_info) == FTDM_SUCCESS)) {
if (!(spInstId && get_ftdmchan_by_spInstId(suId, spInstId, &sngisdn_info) == FTDM_SUCCESS) &&
!(suInstId && get_ftdmchan_by_suInstId(suId, suInstId, &sngisdn_info) == FTDM_SUCCESS)) {
ftdm_log(FTDM_LOG_CRIT, "Could not find matching call suId:%u suInstId:%u spInstId:%u\n", suId, suInstId, spInstId);
ftdm_assert(0, "Inconsistent call states\n");
@ -408,8 +408,8 @@ void sngisdn_rcv_rmrt_cfm (int16_t suId, uint32_t suInstId, uint32_t spInstId, R
ISDN_FUNC_TRACE_ENTER(__FUNCTION__);
if (!(spInstId && get_ftdmchan_by_spInstId((int8_t) suId, spInstId, &sngisdn_info) == FTDM_SUCCESS) &&
!(suInstId && get_ftdmchan_by_suInstId((int8_t) suId, suInstId, &sngisdn_info) == FTDM_SUCCESS)) {
if (!(spInstId && get_ftdmchan_by_spInstId(suId, spInstId, &sngisdn_info) == FTDM_SUCCESS) &&
!(suInstId && get_ftdmchan_by_suInstId(suId, suInstId, &sngisdn_info) == FTDM_SUCCESS)) {
ftdm_log(FTDM_LOG_CRIT, "Could not find matching call suId:%u suInstId:%u spInstId:%u\n", suId, suInstId, spInstId);
ftdm_assert(0, "Inconsistent call states\n");
@ -442,8 +442,8 @@ void sngisdn_rcv_flc_ind (int16_t suId, uint32_t suInstId, uint32_t spInstId, St
ISDN_FUNC_TRACE_ENTER(__FUNCTION__);
if (!(spInstId && get_ftdmchan_by_spInstId((int8_t) suId, spInstId, &sngisdn_info) == FTDM_SUCCESS) &&
!(suInstId && get_ftdmchan_by_suInstId((int8_t) suId, suInstId, &sngisdn_info) == FTDM_SUCCESS)) {
if (!(spInstId && get_ftdmchan_by_spInstId(suId, spInstId, &sngisdn_info) == FTDM_SUCCESS) &&
!(suInstId && get_ftdmchan_by_suInstId(suId, suInstId, &sngisdn_info) == FTDM_SUCCESS)) {
ftdm_log(FTDM_LOG_CRIT, "Could not find matching call suId:%u suInstId:%u spInstId:%u\n", suId, suInstId, spInstId);
ftdm_assert(0, "Inconsistent call states\n");
@ -476,8 +476,8 @@ void sngisdn_rcv_fac_ind (int16_t suId, uint32_t suInstId, uint32_t spInstId, Fa
ISDN_FUNC_TRACE_ENTER(__FUNCTION__);
if (!(spInstId && get_ftdmchan_by_spInstId((int8_t) suId, spInstId, &sngisdn_info) == FTDM_SUCCESS) &&
!(suInstId && get_ftdmchan_by_suInstId((int8_t) suId, suInstId, &sngisdn_info) == FTDM_SUCCESS)) {
if (!(spInstId && get_ftdmchan_by_spInstId(suId, spInstId, &sngisdn_info) == FTDM_SUCCESS) &&
!(suInstId && get_ftdmchan_by_suInstId(suId, suInstId, &sngisdn_info) == FTDM_SUCCESS)) {
ftdm_log(FTDM_LOG_CRIT, "Could not find matching call suId:%u suInstId:%u spInstId:%u\n", suId, suInstId, spInstId);
ftdm_assert(0, "Inconsistent call states\n");
@ -510,8 +510,8 @@ void sngisdn_rcv_sta_cfm (int16_t suId, uint32_t suInstId, uint32_t spInstId, St
ISDN_FUNC_TRACE_ENTER(__FUNCTION__);
if (!(spInstId && get_ftdmchan_by_spInstId((int8_t) suId, spInstId, &sngisdn_info) == FTDM_SUCCESS) &&
!(suInstId && get_ftdmchan_by_suInstId((int8_t) suId, suInstId, &sngisdn_info) == FTDM_SUCCESS)) {
if (!(spInstId && get_ftdmchan_by_spInstId(suId, spInstId, &sngisdn_info) == FTDM_SUCCESS) &&
!(suInstId && get_ftdmchan_by_suInstId(suId, suInstId, &sngisdn_info) == FTDM_SUCCESS)) {
ftdm_log(FTDM_LOG_CRIT, "Could not find matching call suId:%u suInstId:%u spInstId:%u\n", suId, suInstId, spInstId);
ftdm_assert(0, "Inconsistent call states\n");

View File

@ -91,9 +91,10 @@ FT_DECLARE_INLINE(void) clear_call_glare_data(sngisdn_chan_data_t *sngisdn_info)
}
FT_DECLARE_INLINE(uint32_t) get_unique_suInstId(uint8_t cc_id)
FT_DECLARE_INLINE(uint32_t) get_unique_suInstId(int16_t cc_id)
{
uint32_t suInstId;
ftdm_assert_return((cc_id > 0 && cc_id <=MAX_VARIANTS), FTDM_FAIL, "Invalid cc_id\n");
ftdm_mutex_lock(g_sngisdn_data.ccs[cc_id].mutex);
suInstId = g_sngisdn_data.ccs[cc_id].last_suInstId;
@ -112,8 +113,9 @@ FT_DECLARE_INLINE(uint32_t) get_unique_suInstId(uint8_t cc_id)
return 0;
}
FT_DECLARE_INLINE(ftdm_status_t) get_ftdmchan_by_suInstId(uint8_t cc_id, uint32_t suInstId, sngisdn_chan_data_t **sngisdn_data)
FT_DECLARE_INLINE(ftdm_status_t) get_ftdmchan_by_suInstId(int16_t cc_id, uint32_t suInstId, sngisdn_chan_data_t **sngisdn_data)
{
ftdm_assert_return((cc_id > 0 && cc_id <=MAX_VARIANTS), FTDM_FAIL, "Invalid cc_id\n");
ftdm_assert_return(g_sngisdn_data.ccs[cc_id].activation_done, FTDM_FAIL, "Trying to find call on unconfigured CC\n");
if (g_sngisdn_data.ccs[cc_id].active_suInstIds[suInstId] == NULL) {
@ -123,8 +125,9 @@ FT_DECLARE_INLINE(ftdm_status_t) get_ftdmchan_by_suInstId(uint8_t cc_id, uint32_
return FTDM_SUCCESS;
}
FT_DECLARE_INLINE(ftdm_status_t) get_ftdmchan_by_spInstId(uint8_t cc_id, uint32_t spInstId, sngisdn_chan_data_t **sngisdn_data)
FT_DECLARE_INLINE(ftdm_status_t) get_ftdmchan_by_spInstId(int16_t cc_id, uint32_t spInstId, sngisdn_chan_data_t **sngisdn_data)
{
ftdm_assert_return((cc_id > 0 && cc_id <=MAX_VARIANTS), FTDM_FAIL, "Invalid cc_id\n");
ftdm_assert_return(g_sngisdn_data.ccs[cc_id].activation_done, FTDM_FAIL, "Trying to find call on unconfigured CC\n");
if (g_sngisdn_data.ccs[cc_id].active_spInstIds[spInstId] == NULL) {

View File

@ -1011,6 +1011,16 @@ static FIO_GET_ALARMS_FUNCTION(wanpipe_get_alarms)
}
alarms = tdm_api.wp_tdm_cmd.fe_alarms;
#endif
#if 1
/* DAVIDY - Temporary fix: in the current trunk of libsangoma, for BRI,
WAN_TE_BIT_ALARM_RED bit is set if the card is in disconnected state, but this has
not been ported to Windows-libsangoma yet */
if (alarms) {
ftdmchan->alarm_flags |= FTDM_ALARM_RED;
alarms = 0;
}
#endif
ftdmchan->alarm_flags = FTDM_ALARM_NONE;
if (alarms & WAN_TE_BIT_ALARM_RED) {

View File

@ -70,7 +70,7 @@ extern "C" {
#define FT_DECLARE_NONSTD(type) __declspec(dllimport) type __cdecl
#define FT_DECLARE_DATA __declspec(dllimport)
#endif
#define FT_DECLARE_INLINE(type) type
#define FT_DECLARE_INLINE(type) extern __inline__ type /* why extern? see http://support.microsoft.com/kb/123768 */
#define EX_DECLARE_DATA __declspec(dllexport)
#else
#if (defined(__GNUC__) || defined(__SUNPRO_CC) || defined (__SUNPRO_C)) && defined(HAVE_VISIBILITY)
@ -82,7 +82,7 @@ extern "C" {
#define FT_DECLARE_NONSTD(type) type
#define FT_DECLARE_DATA
#endif
#define FT_DECLARE_INLINE(type) type __inline__
#define FT_DECLARE_INLINE(type) __inline__ type
#define EX_DECLARE_DATA
#endif