From 6f1cafa983320fa507a2804fe57b4059835d1615 Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Mon, 14 Dec 2009 17:47:41 +0000 Subject: [PATCH] Merged r910:r938 from trunk git-svn-id: http://svn.openzap.org/svn/openzap/branches/sangoma_boost@939 a93c3328-9c30-0410-af19-c9cd2b2d52af --- libs/freetdm/build/libpcap.m4 | 1 + libs/freetdm/conf/tones.conf | 38 ++++ libs/freetdm/mod_openzap/Makefile.in | 2 +- .../mod_openzap/mod_openzap.2008.vcproj | 169 ++++++++++++++++++ libs/freetdm/mod_openzap/mod_openzap.c | 13 +- libs/freetdm/msvc/openzap.2008.vcproj | 154 ++++++++++++++++ .../msvc/testanalog/testanalog.2008.vcproj | 159 ++++++++++++++++ .../msvc/testisdn/testisdn.2008.vcproj | 159 ++++++++++++++++ libs/freetdm/src/isdn/Q931api.c | 2 +- .../ozmod_analog/ozmod_analog.2008.vcproj | 156 ++++++++++++++++ .../ozmod_analog_em.2008.vcproj | 156 ++++++++++++++++ .../ozmod/ozmod_isdn/ozmod_isdn.2008.vcproj | 154 ++++++++++++++++ .../freetdm/src/ozmod/ozmod_isdn/ozmod_isdn.c | 2 +- .../ozmod_sangoma_boost/ozmod_sangoma_boost.c | 105 ++++++----- .../sangoma_boost_client.c | 20 +-- .../ozmod_wanpipe/ozmod_wanpipe.2008.vcproj | 159 ++++++++++++++++ libs/freetdm/src/ozmod/ozmod_zt/ozmod_zt.c | 8 +- libs/freetdm/src/ozmod/ozmod_zt/ozmod_zt.h | 3 +- 18 files changed, 1393 insertions(+), 67 deletions(-) diff --git a/libs/freetdm/build/libpcap.m4 b/libs/freetdm/build/libpcap.m4 index 8c758a1a5e..c20d345ca6 100644 --- a/libs/freetdm/build/libpcap.m4 +++ b/libs/freetdm/build/libpcap.m4 @@ -72,6 +72,7 @@ test "X$with_lib_subdir" = "Xno" && with_lib_subdir= ac_cv_cmu_lib_subdir=lib if test $ac_cv_sizeof_long -eq 4 ; then test -d /usr/lib32 && ac_cv_cmu_lib_subdir=lib32 + test -r /usr/lib/libpcap.so && ac_cv_cmu_lib_subdir=lib fi if test $ac_cv_sizeof_long -eq 8 ; then test -d /usr/lib64 && ac_cv_cmu_lib_subdir=lib64 diff --git a/libs/freetdm/conf/tones.conf b/libs/freetdm/conf/tones.conf index db6658d78e..36db1d4d91 100644 --- a/libs/freetdm/conf/tones.conf +++ b/libs/freetdm/conf/tones.conf @@ -22,4 +22,42 @@ detect-fail2 => 1370.6 detect-fail3 => 1776.7 +[sg] +generate-dial => v=-7;%(1000,0,425) +detect-dial => 425 +generate-ring => v=-7;%(2000,4000,425) +detect-ring => 425 + +generate-busy => v=-7;%(750,750,425) +detect-busy => 425 + +generate-attn => v=0;%(100,100,1400,2060,2450,2600) +detect-attn => 1400,2060,2450,2600 + +generate-callwaiting-sas => v=0;%(300,0,440) +detect-callwaiting-sas => 440 + +generate-callwaiting-cas => v=0;%(80,0,2750,2130) +detect-callwaiting-cas => 2750,2130 + +detect-fail1 => 913.8 +detect-fail2 => 1370.6 +detect-fail3 => 1776.7 + +[ru] +generate-dial => v=-7;%(1000,425) +detect-dial => 0 +generate-ring => v=-7;%(800,5000,425,0) +detect-ring => 425,0 +generate-busy => v=-7;%(350,350,425,0) +detect-busy => 425,0 +generate-attn => v=0;%(100,100,1400,2060,2450,2600) +detect-attn => 1400,2060,2450,2600 +generate-callwaiting-sas => v=0;%(300,0,440) +detect-callwaiting-sas => 440,480 +generate-callwaiting-cas => v=0;%(80,0,2750,2130) +detect-callwaiting-cas => 2750,2130 +detect-fail1 => 913.8 +detect-fail2 => 1370.6 +detect-fail3 => 1776.7 diff --git a/libs/freetdm/mod_openzap/Makefile.in b/libs/freetdm/mod_openzap/Makefile.in index 27eb4f3e8b..85275d1d8d 100644 --- a/libs/freetdm/mod_openzap/Makefile.in +++ b/libs/freetdm/mod_openzap/Makefile.in @@ -15,7 +15,7 @@ $(OZLA): $(OZ_DIR)/.update local_install: cd $(OZ_DIR) && $(MAKE) install - [ -f $(DESTDIR)$(PREFIX)/conf/autoload_configs/openzap.conf.xml ] || cp -f $(OZ_DIR)/conf/openzap.conf.xml $(DESTDIR)$(PREFIX)/conf/autoload_configs + [ -f $(DESTDIR)@confdir@/autoload_configs/openzap.conf.xml ] || cp -f $(OZ_DIR)/conf/openzap.conf.xml $(DESTDIR)@confdir@/autoload_configs local_clean: cd $(OZ_DIR) && $(MAKE) clean diff --git a/libs/freetdm/mod_openzap/mod_openzap.2008.vcproj b/libs/freetdm/mod_openzap/mod_openzap.2008.vcproj index 720849dee9..bf5be95c21 100644 --- a/libs/freetdm/mod_openzap/mod_openzap.2008.vcproj +++ b/libs/freetdm/mod_openzap/mod_openzap.2008.vcproj @@ -12,6 +12,9 @@ + @@ -180,6 +183,172 @@ Name="VCPostBuildEventTool" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libs/freetdm/mod_openzap/mod_openzap.c b/libs/freetdm/mod_openzap/mod_openzap.c index 53546e23ec..0e4efdb8d5 100644 --- a/libs/freetdm/mod_openzap/mod_openzap.c +++ b/libs/freetdm/mod_openzap/mod_openzap.c @@ -470,9 +470,7 @@ static switch_status_t channel_on_hangup(switch_core_session_t *session) case ZAP_CHAN_TYPE_EM: case ZAP_CHAN_TYPE_CAS: { - zap_set_state_locked(tech_pvt->zchan, ZAP_CHANNEL_STATE_HANGUP); - } break; case ZAP_CHAN_TYPE_FXS: @@ -488,10 +486,12 @@ static switch_status_t channel_on_hangup(switch_core_session_t *session) break; case ZAP_CHAN_TYPE_B: { - if (tech_pvt->zchan->state != ZAP_CHANNEL_STATE_DOWN && tech_pvt->zchan->state != ZAP_CHANNEL_STATE_TERMINATING) { - tech_pvt->zchan->caller_data.hangup_cause = switch_channel_get_cause_q850(channel); - if (tech_pvt->zchan->caller_data.hangup_cause < 1 || tech_pvt->zchan->caller_data.hangup_cause > 127) { - tech_pvt->zchan->caller_data.hangup_cause = ZAP_CAUSE_DESTINATION_OUT_OF_ORDER; + if (tech_pvt->zchan->state != ZAP_CHANNEL_STATE_DOWN) { + if (tech_pvt->zchan->state != ZAP_CHANNEL_STATE_TERMINATING) { + tech_pvt->zchan->caller_data.hangup_cause = switch_channel_get_cause_q850(channel); + if (tech_pvt->zchan->caller_data.hangup_cause < 1 || tech_pvt->zchan->caller_data.hangup_cause > 127) { + tech_pvt->zchan->caller_data.hangup_cause = ZAP_CAUSE_DESTINATION_OUT_OF_ORDER; + } } zap_set_state_locked(tech_pvt->zchan, ZAP_CHANNEL_STATE_HANGUP); } @@ -2196,6 +2196,7 @@ static switch_status_t load_config(void) "dialect", dialect, "digit_timeout", &to, "opts", opts, + "tonemap", tonegroup, "q921loglevel", q921loglevel, "q931loglevel", q931loglevel, TAG_END) != ZAP_SUCCESS) { diff --git a/libs/freetdm/msvc/openzap.2008.vcproj b/libs/freetdm/msvc/openzap.2008.vcproj index a3751be544..952cdd3822 100644 --- a/libs/freetdm/msvc/openzap.2008.vcproj +++ b/libs/freetdm/msvc/openzap.2008.vcproj @@ -12,6 +12,9 @@ + @@ -163,6 +166,157 @@ Name="VCPostBuildEventTool" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libs/freetdm/msvc/testanalog/testanalog.2008.vcproj b/libs/freetdm/msvc/testanalog/testanalog.2008.vcproj index 7a80eeea94..120eb5fd75 100644 --- a/libs/freetdm/msvc/testanalog/testanalog.2008.vcproj +++ b/libs/freetdm/msvc/testanalog/testanalog.2008.vcproj @@ -12,6 +12,9 @@ + @@ -170,6 +173,162 @@ Name="VCPostBuildEventTool" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libs/freetdm/msvc/testisdn/testisdn.2008.vcproj b/libs/freetdm/msvc/testisdn/testisdn.2008.vcproj index 56d8e52983..e350a45edf 100644 --- a/libs/freetdm/msvc/testisdn/testisdn.2008.vcproj +++ b/libs/freetdm/msvc/testisdn/testisdn.2008.vcproj @@ -12,6 +12,9 @@ + @@ -170,6 +173,162 @@ Name="VCPostBuildEventTool" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libs/freetdm/src/isdn/Q931api.c b/libs/freetdm/src/isdn/Q931api.c index e59247a26a..ed0d13836b 100644 --- a/libs/freetdm/src/isdn/Q931api.c +++ b/libs/freetdm/src/isdn/Q931api.c @@ -207,7 +207,7 @@ ie Q931AppendIE( L3UCHAR *pm, L3UCHAR *pi) L3INT iISize = pIE->Size; L3UCHAR *pBuf = &pMes->buf[0]; - L3INT Off = pMes->Size - (pBuf - pm); + L3INT Off = (L3INT)(pMes->Size - (pBuf - pm)); IE = (ie)(Off | 0x8000); memcpy(&pm[pMes->Size], pi, iISize); diff --git a/libs/freetdm/src/ozmod/ozmod_analog/ozmod_analog.2008.vcproj b/libs/freetdm/src/ozmod/ozmod_analog/ozmod_analog.2008.vcproj index a8211ca10d..da21d1f48f 100644 --- a/libs/freetdm/src/ozmod/ozmod_analog/ozmod_analog.2008.vcproj +++ b/libs/freetdm/src/ozmod/ozmod_analog/ozmod_analog.2008.vcproj @@ -12,6 +12,9 @@ + @@ -167,6 +170,159 @@ Name="VCPostBuildEventTool" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libs/freetdm/src/ozmod/ozmod_analog_em/ozmod_analog_em.2008.vcproj b/libs/freetdm/src/ozmod/ozmod_analog_em/ozmod_analog_em.2008.vcproj index 70f057ab37..35a0d89da0 100644 --- a/libs/freetdm/src/ozmod/ozmod_analog_em/ozmod_analog_em.2008.vcproj +++ b/libs/freetdm/src/ozmod/ozmod_analog_em/ozmod_analog_em.2008.vcproj @@ -12,6 +12,9 @@ + @@ -167,6 +170,159 @@ Name="VCPostBuildEventTool" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libs/freetdm/src/ozmod/ozmod_isdn/ozmod_isdn.2008.vcproj b/libs/freetdm/src/ozmod/ozmod_isdn/ozmod_isdn.2008.vcproj index de6f1718b1..75815df561 100644 --- a/libs/freetdm/src/ozmod/ozmod_isdn/ozmod_isdn.2008.vcproj +++ b/libs/freetdm/src/ozmod/ozmod_isdn/ozmod_isdn.2008.vcproj @@ -12,6 +12,9 @@ + @@ -165,6 +168,157 @@ Name="VCPostBuildEventTool" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libs/freetdm/src/ozmod/ozmod_isdn/ozmod_isdn.c b/libs/freetdm/src/ozmod/ozmod_isdn/ozmod_isdn.c index cd92d2b900..f703c86f93 100644 --- a/libs/freetdm/src/ozmod/ozmod_isdn/ozmod_isdn.c +++ b/libs/freetdm/src/ozmod/ozmod_isdn/ozmod_isdn.c @@ -992,7 +992,7 @@ static L3INT zap_isdn_931_34(void *pvt, L2UCHAR *msg, L2INT mlen) } /* TODO: make this more safe with strncat() */ - pos = strlen(zchan->caller_data.dnis.digits); + pos = (int)strlen(zchan->caller_data.dnis.digits); strcat(&zchan->caller_data.dnis.digits[pos], (char *)callednum->Digit); /* update timer */ diff --git a/libs/freetdm/src/ozmod/ozmod_sangoma_boost/ozmod_sangoma_boost.c b/libs/freetdm/src/ozmod/ozmod_sangoma_boost/ozmod_sangoma_boost.c index 0d2b30f8bc..66cc64009a 100644 --- a/libs/freetdm/src/ozmod/ozmod_sangoma_boost/ozmod_sangoma_boost.c +++ b/libs/freetdm/src/ozmod/ozmod_sangoma_boost/ozmod_sangoma_boost.c @@ -68,7 +68,8 @@ static time_t congestion_timeouts[MAX_TRUNK_GROUPS]; */ typedef enum { SFLAG_FREE_REQ_ID = (1 << 0), - SFLAG_SENT_FINAL_RESPONSE = (1 << 1) + SFLAG_SENT_FINAL_MSG = (1 << 1), + SFLAG_SENT_ACK = (1 << 2) } sflag_t; typedef uint16_t sangoma_boost_request_id_t; @@ -506,6 +507,9 @@ static void handle_call_progress(sangomabc_connection_t *mcon, sangomabc_short_e zap_log(ZAP_LOG_CRIT, "START PROGRESS CANT FIND A CHAN %d:%d\n", event->span+1,event->chan+1); + if (zchan) { + zap_set_sflag(zchan, SFLAG_SENT_FINAL_MSG); + } sangomabc_exec_command(mcon, event->span, event->chan, @@ -552,7 +556,13 @@ static void handle_call_start_ack(sangomabc_connection_t *mcon, sangomabc_short_ } } - zap_log(ZAP_LOG_CRIT, "START ACK CANT FIND A CHAN %d:%d\n", event_span, event_chan); + //printf("WTF BAD ACK CSid=%d span=%d chan=%d\n", event->call_setup_id, event->span+1,event->chan+1); + if ((zchan = find_zchan(OUTBOUND_REQUESTS[event->call_setup_id].span, event, 1))) { + //printf("WTF BAD ACK2 %d:%d (%d:%d) CSid=%d xtra_id=%d out=%d state=%s\n", zchan->span_id, zchan->chan_id, event->span+1,event->chan+1, event->call_setup_id, zchan->extra_id, zap_test_flag(zchan, ZAP_CHANNEL_OUTBOUND), zap_channel_state2str(zchan->state)); + } + + zap_set_sflag(zchan, SFLAG_SENT_FINAL_MSG); + zap_log(ZAP_LOG_CRIT, "START ACK CANT FIND A CHAN %d:%d\n", event->span+1,event->chan+1); sangomabc_exec_command(mcon, event->span, event->chan, @@ -581,7 +591,6 @@ static void handle_call_done(zap_span_t *span, sangomabc_connection_t *mcon, san } zap_set_state_r(zchan, ZAP_CHANNEL_STATE_HANGUP_COMPLETE, 0, r); - if (r) { zap_set_sflag(zchan, SFLAG_FREE_REQ_ID); zap_mutex_unlock(zchan->mutex); @@ -669,10 +678,9 @@ static void handle_call_start_nack(zap_span_t *span, sangomabc_connection_t *mco } if (zchan) { - zap_set_sflag_locked(zchan, SFLAG_SENT_FINAL_RESPONSE); + zap_set_sflag_locked(zchan, SFLAG_SENT_FINAL_MSG); } - /* nobody else will do it so we have to do it ourselves */ sangomabc_exec_command(mcon, event->span, @@ -696,7 +704,22 @@ static void handle_call_stop(zap_span_t *span, sangomabc_connection_t *mcon, san int r = 0; zap_mutex_lock(zchan->mutex); - zap_set_state_r(zchan, ZAP_CHANNEL_STATE_TERMINATING, 0, r); + + if (zchan->state == ZAP_CHANNEL_STATE_HANGUP) { + /* racing condition where both sides initiated a hangup + * Do not change current state as channel is already clearing + * itself through local initiated hangup */ + + sangomabc_exec_command(mcon, + zchan->physical_span_id-1, + zchan->physical_chan_id-1, + 0, + SIGBOOST_EVENT_CALL_STOPPED_ACK, + 0); + return; + } else { + zap_set_state_r(zchan, ZAP_CHANNEL_STATE_TERMINATING, 0, r); + } if (r == ZAP_STATE_CHANGE_SUCCESS) { zchan->caller_data.hangup_cause = event->release_cause; @@ -707,23 +730,12 @@ static void handle_call_stop(zap_span_t *span, sangomabc_connection_t *mcon, san } zap_mutex_unlock(zchan->mutex); - if (r) { return; } } /* else we have to do it ourselves.... */ - if (zchan) { - zap_set_sflag_locked(zchan, SFLAG_SENT_FINAL_RESPONSE); - } - - sangomabc_exec_command(mcon, - event->span, - event->chan, - 0, - SIGBOOST_EVENT_CALL_STOPPED_ACK, - 0); - + zap_log(ZAP_LOG_WARNING, "We could not find chan: s%dc%d\n", event->span, event->chan); release_request_id_span_chan(event->span, event->chan); } @@ -1020,8 +1032,18 @@ static __inline__ void state_advance(zap_channel_t *zchan) release_request_id_span_chan(zchan->physical_span_id-1, zchan->physical_chan_id-1); } + if (!zap_test_sflag(zchan, SFLAG_SENT_FINAL_MSG)) { + zap_set_sflag_locked(zchan, SFLAG_SENT_FINAL_MSG); + + sangomabc_exec_command(mcon, + zchan->physical_span_id-1, + zchan->physical_chan_id-1, + 0, + SIGBOOST_EVENT_CALL_STOPPED_ACK, + 0); + } zchan->sflags = 0; - zap_channel_done(zchan); + zap_channel_done(zchan); } break; case ZAP_CHANNEL_STATE_PROGRESS_MEDIA: @@ -1033,12 +1055,15 @@ static __inline__ void state_advance(zap_channel_t *zchan) zap_set_state_locked(zchan, ZAP_CHANNEL_STATE_HANGUP); } } else { - sangomabc_exec_command(mcon, - BOOST_SPAN(zchan), - BOOST_CHAN(zchan), - 0, - SIGBOOST_EVENT_CALL_START_ACK, - 0); + if (!zap_test_sflag(zchan, SFLAG_SENT_ACK)) { + zap_set_sflag(zchan, SFLAG_SENT_ACK); + sangomabc_exec_command(mcon, + zchan->physical_span_id-1, + zchan->physical_chan_id-1, + 0, + SIGBOOST_EVENT_CALL_START_ACK, + 0); + } } } break; @@ -1050,16 +1075,14 @@ static __inline__ void state_advance(zap_channel_t *zchan) zap_set_state_locked(zchan, ZAP_CHANNEL_STATE_HANGUP); } } - } break; case ZAP_CHANNEL_STATE_RESTART: { sig.event_id = ZAP_SIGEVENT_RESTART; status = sangoma_boost_data->signal_cb(&sig); - zap_set_sflag_locked(zchan, SFLAG_SENT_FINAL_RESPONSE); + zap_set_sflag_locked(zchan, SFLAG_SENT_FINAL_MSG); zap_set_state_locked(zchan, ZAP_CHANNEL_STATE_DOWN); - } break; case ZAP_CHANNEL_STATE_UP: @@ -1099,12 +1122,13 @@ static __inline__ void state_advance(zap_channel_t *zchan) break; case ZAP_CHANNEL_STATE_HANGUP: { - if (zap_test_sflag(zchan, SFLAG_SENT_FINAL_RESPONSE)) { - zap_set_state_locked(zchan, ZAP_CHANNEL_STATE_DOWN); + if (zchan->last_state == ZAP_CHANNEL_STATE_TERMINATING || + zap_test_sflag(zchan, SFLAG_SENT_FINAL_MSG)) { + zap_set_state_locked(zchan, ZAP_CHANNEL_STATE_HANGUP_COMPLETE); } else { - - zap_set_sflag_locked(zchan, SFLAG_SENT_FINAL_RESPONSE); + zap_set_sflag_locked(zchan, SFLAG_SENT_FINAL_MSG); if (zap_test_flag(zchan, ZAP_CHANNEL_ANSWERED) || zap_test_flag(zchan, ZAP_CHANNEL_PROGRESS) || zap_test_flag(zchan, ZAP_CHANNEL_MEDIA)) { + sangomabc_exec_command(mcon, BOOST_SPAN(zchan), BOOST_CHAN(zchan), @@ -1127,7 +1151,7 @@ static __inline__ void state_advance(zap_channel_t *zchan) sig.event_id = ZAP_SIGEVENT_STOP; status = sangoma_boost_data->signal_cb(&sig); zap_set_state_locked(zchan, ZAP_CHANNEL_STATE_DOWN); - zap_set_sflag_locked(zchan, SFLAG_SENT_FINAL_RESPONSE); + zap_set_sflag_locked(zchan, SFLAG_SENT_FINAL_MSG); sangomabc_exec_command(mcon, BOOST_SPAN(zchan), BOOST_CHAN(zchan), @@ -1140,15 +1164,6 @@ static __inline__ void state_advance(zap_channel_t *zchan) { sig.event_id = ZAP_SIGEVENT_STOP; status = sangoma_boost_data->signal_cb(&sig); - zap_set_state_locked(zchan, ZAP_CHANNEL_STATE_HANGUP_COMPLETE); - zap_set_sflag_locked(zchan, SFLAG_SENT_FINAL_RESPONSE); - sangomabc_exec_command(mcon, - BOOST_SPAN(zchan), - BOOST_CHAN(zchan), - 0, - SIGBOOST_EVENT_CALL_STOPPED_ACK, - 0); - } break; default: @@ -1619,7 +1634,7 @@ static zap_state_map_t boost_state_map = { ZSD_OUTBOUND, ZSM_UNACCEPTABLE, {ZAP_CHANNEL_STATE_HANGUP, ZAP_CHANNEL_STATE_TERMINATING, ZAP_END}, - {ZAP_CHANNEL_STATE_HANGUP_COMPLETE, ZAP_END} + {ZAP_CHANNEL_STATE_HANGUP_COMPLETE, ZAP_CHANNEL_STATE_HANGUP, ZAP_END} }, { ZSD_OUTBOUND, @@ -1663,7 +1678,7 @@ static zap_state_map_t boost_state_map = { ZSD_INBOUND, ZSM_UNACCEPTABLE, {ZAP_CHANNEL_STATE_HANGUP, ZAP_CHANNEL_STATE_TERMINATING, ZAP_END}, - {ZAP_CHANNEL_STATE_HANGUP_COMPLETE, ZAP_END}, + {ZAP_CHANNEL_STATE_HANGUP_COMPLETE, ZAP_CHANNEL_STATE_HANGUP, ZAP_END}, }, { ZSD_INBOUND, @@ -1675,7 +1690,7 @@ static zap_state_map_t boost_state_map = { ZSD_INBOUND, ZSM_UNACCEPTABLE, {ZAP_CHANNEL_STATE_PROGRESS, ZAP_CHANNEL_STATE_PROGRESS_MEDIA, ZAP_END}, - {ZAP_CHANNEL_STATE_HANGUP, ZAP_CHANNEL_STATE_CANCEL, ZAP_CHANNEL_STATE_TERMINATING, ZAP_CHANNEL_STATE_UP, ZAP_END}, + {ZAP_CHANNEL_STATE_HANGUP, ZAP_CHANNEL_STATE_CANCEL, ZAP_CHANNEL_STATE_TERMINATING, ZAP_CHANNEL_STATE_UP, ZAP_CHANNEL_STATE_PROGRESS_MEDIA, ZAP_END}, }, { ZSD_INBOUND, diff --git a/libs/freetdm/src/ozmod/ozmod_sangoma_boost/sangoma_boost_client.c b/libs/freetdm/src/ozmod/ozmod_sangoma_boost/sangoma_boost_client.c index 111fab6288..1ba67c9834 100644 --- a/libs/freetdm/src/ozmod/ozmod_sangoma_boost/sangoma_boost_client.c +++ b/libs/freetdm/src/ozmod/ozmod_sangoma_boost/sangoma_boost_client.c @@ -38,7 +38,6 @@ #include "openzap.h" #include "sangoma_boost_client.h" - #ifndef HAVE_GETHOSTBYNAME_R extern int gethostbyname_r (const char *__name, struct hostent *__result_buf, @@ -76,16 +75,17 @@ static void sangomabc_print_event_call(sangomabc_connection_t *mcon, sangomabc_e { if (event->event_id == SIGBOOST_EVENT_HEARTBEAT) return; - zap_log(file, func, line, ZAP_LOG_LEVEL_DEBUG, "%s EVENT: %s:(%X) [s%dc%d] CSid=%i Seq=%i Cn=[%s] Cd=[%s] Ci=[%s] Rdnis=[%s]\n", + + zap_log(file, func, line, ZAP_LOG_LEVEL_WARNING, "%s EVENT: %s:(%X) [w%dg%d] CSid=%i Seq=%i Cn=[%s] Cd=[%s] Ci=[%s] Rdnis=[%s]\n", dir ? "TX":"RX", - sangomabc_event_id_name(event->event_id), - event->event_id, - event->span, - event->chan, - event->call_setup_id, - event->fseqno, - strlen(event->calling_name)?event->calling_name:"N/A", - (event->called_number_digits_count ? (char *) event->called_number_digits : "N/A"), + sangomabc_event_id_name(event->event_id), + event->event_id, + event->span+1, + event->chan+1, + event->call_setup_id, + event->fseqno, + strlen(event->calling_name)?event->calling_name:"N/A", + (event->called_number_digits_count ? (char *) event->called_number_digits : "N/A"), (event->calling_number_digits_count ? (char *) event->calling_number_digits : "N/A"), event->isup_in_rdnis); diff --git a/libs/freetdm/src/ozmod/ozmod_wanpipe/ozmod_wanpipe.2008.vcproj b/libs/freetdm/src/ozmod/ozmod_wanpipe/ozmod_wanpipe.2008.vcproj index 5585e5bfdd..fea5e357fe 100644 --- a/libs/freetdm/src/ozmod/ozmod_wanpipe/ozmod_wanpipe.2008.vcproj +++ b/libs/freetdm/src/ozmod/ozmod_wanpipe/ozmod_wanpipe.2008.vcproj @@ -12,6 +12,9 @@ + @@ -93,6 +96,84 @@ Name="VCPostBuildEventTool" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libs/freetdm/src/ozmod/ozmod_zt/ozmod_zt.c b/libs/freetdm/src/ozmod/ozmod_zt/ozmod_zt.c index bbd64352f4..4815fbec51 100644 --- a/libs/freetdm/src/ozmod/ozmod_zt/ozmod_zt.c +++ b/libs/freetdm/src/ozmod/ozmod_zt/ozmod_zt.c @@ -371,8 +371,12 @@ static unsigned zt_open_range(zap_span_t *span, unsigned start, unsigned end, za } if (zchan->type == ZAP_CHAN_TYPE_DQ921) { - if ((ztp.sig_type != ZT_SIG_HDLCRAW) && (ztp.sig_type != ZT_SIG_HDLCFCS)) { - zap_log(ZAP_LOG_ERROR, "failure configuring device %s as OpenZAP device %d:%d fd:%d\n", chanpath, zchan->span_id, zchan->chan_id, sockfd); + if ( + (ztp.sig_type != ZT_SIG_HDLCRAW) && + (ztp.sig_type != ZT_SIG_HDLCFCS) && + (ztp.sig_type != ZT_SIG_HARDHDLC) + ) { + zap_log(ZAP_LOG_ERROR, "Failure configuring device %s as OpenZAP device %d:%d fd:%d, hardware signaling is not HDLC, fix your Zap/DAHDI configuration!\n", chanpath, zchan->span_id, zchan->chan_id, sockfd); close(sockfd); continue; } diff --git a/libs/freetdm/src/ozmod/ozmod_zt/ozmod_zt.h b/libs/freetdm/src/ozmod/ozmod_zt/ozmod_zt.h index 14516f6fe9..f82cf0ff10 100644 --- a/libs/freetdm/src/ozmod/ozmod_zt/ozmod_zt.h +++ b/libs/freetdm/src/ozmod/ozmod_zt/ozmod_zt.h @@ -241,7 +241,8 @@ ZT_SIG_EM = (1 << 6), /* E&M */ ZT_SIG_CLEAR = (1 << 7), ZT_SIG_HDLCRAW = ((1 << 8) | ZT_SIG_CLEAR), ZT_SIG_HDLCFCS = ((1 << 9) | ZT_SIG_HDLCRAW), -ZT_SIG_CAS = (1 << 15) +ZT_SIG_CAS = (1 << 15), +ZT_SIG_HARDHDLC = (1 << 19), } zt_sigtype_t; typedef enum {