From 1815d4d06fa016ec41035bab205c4592364726e6 Mon Sep 17 00:00:00 2001 From: Christopher Rienzo Date: Tue, 7 Feb 2012 16:29:15 +0000 Subject: [PATCH 01/12] use correct #includes for posix timer API --- src/mod/timers/mod_posix_timer/mod_posix_timer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mod/timers/mod_posix_timer/mod_posix_timer.c b/src/mod/timers/mod_posix_timer/mod_posix_timer.c index f5b9a61a1f..1ba3e23015 100644 --- a/src/mod/timers/mod_posix_timer/mod_posix_timer.c +++ b/src/mod/timers/mod_posix_timer/mod_posix_timer.c @@ -28,8 +28,8 @@ * */ #include -#include -#include +#include +#include SWITCH_MODULE_LOAD_FUNCTION(mod_posix_timer_load); SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_posix_timer_shutdown); From 8f05f098cf04baf80d9c504f0090500a83d216a0 Mon Sep 17 00:00:00 2001 From: Christopher Rienzo Date: Tue, 7 Feb 2012 16:45:54 +0000 Subject: [PATCH 02/12] use union sigval instead of sigval_t for mod_posix_timer --- src/mod/timers/mod_posix_timer/mod_posix_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/timers/mod_posix_timer/mod_posix_timer.c b/src/mod/timers/mod_posix_timer/mod_posix_timer.c index 1ba3e23015..425e98c93d 100644 --- a/src/mod/timers/mod_posix_timer/mod_posix_timer.c +++ b/src/mod/timers/mod_posix_timer/mod_posix_timer.c @@ -59,7 +59,7 @@ static struct { /** * Notified by POSIX timer of a tick */ -static void posix_timer_notify(sigval_t data) +static void posix_timer_notify(union sigval data) { interval_timer_t *it = (interval_timer_t *)data.sival_ptr; switch_mutex_lock(it->mutex); From 9b02315282a639f2985f8085071367298c8521de Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 7 Feb 2012 11:10:42 -0600 Subject: [PATCH 03/12] add presence-disable-early sofia option to send non-specifc presence messages w/o special case for early --- src/mod/endpoints/mod_sofia/mod_sofia.h | 1 + src/mod/endpoints/mod_sofia/sofia.c | 12 ++++++++++++ src/mod/endpoints/mod_sofia/sofia_presence.c | 8 +++++++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.h b/src/mod/endpoints/mod_sofia/mod_sofia.h index 1860c08290..0a2f672df6 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.h +++ b/src/mod/endpoints/mod_sofia/mod_sofia.h @@ -262,6 +262,7 @@ typedef enum { PFLAG_SHUTDOWN, PFLAG_PRESENCE_MAP, PFLAG_OPTIONS_RESPOND_503_ON_BUSY, + PFLAG_PRESENCE_DISABLE_EARLY, /* No new flags below this line */ PFLAG_MAX } PFLAGS; diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 3dd28d7f60..0668eedf57 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -3035,6 +3035,12 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile) } else { sofia_clear_pflag(profile, PFLAG_T38_PASSTHRU); } + } else if (!strcasecmp(var, "presence-disable-early")) { + if (switch_true(val)) { + sofia_set_pflag(profile, PFLAG_PRESENCE_DISABLE_EARLY); + } else { + sofia_clear_pflag(profile, PFLAG_PRESENCE_DISABLE_EARLY); + } } else if (!strcasecmp(var, "ignore-183nosdp")) { if (switch_true(val)) { sofia_set_pflag(profile, PFLAG_IGNORE_183NOSDP); @@ -3809,6 +3815,12 @@ switch_status_t config_sofia(int reload, char *profile_name) } else { sofia_clear_pflag(profile, PFLAG_T38_PASSTHRU); } + } else if (!strcasecmp(var, "presence-disable-early")) { + if (switch_true(val)) { + sofia_set_pflag(profile, PFLAG_PRESENCE_DISABLE_EARLY); + } else { + sofia_clear_pflag(profile, PFLAG_PRESENCE_DISABLE_EARLY); + } } else if (!strcasecmp(var, "ignore-183nosdp")) { if (switch_true(val)) { sofia_set_pflag(profile, PFLAG_IGNORE_183NOSDP); diff --git a/src/mod/endpoints/mod_sofia/sofia_presence.c b/src/mod/endpoints/mod_sofia/sofia_presence.c index 75c663ef07..683903fc66 100644 --- a/src/mod/endpoints/mod_sofia/sofia_presence.c +++ b/src/mod/endpoints/mod_sofia/sofia_presence.c @@ -2499,11 +2499,17 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char * if (!strcasecmp(astate, "answered")) { astate = "confirmed"; } - + if (!strcasecmp(astate, "hangup")) { astate = "terminated"; } + if (!sofia_test_pflag(profile, PFLAG_PRESENCE_DISABLE_EARLY)) { + if (!strcasecmp(astate, "ringing") || !strcasecmp(astate, "early")) { + astate = "confirmed"; + } + } + if (is_dialog) { if (!strcasecmp(astate, "ringing")) { From a14c46c38cf492b5f106e39a22674b4f7fd954c8 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 7 Feb 2012 11:25:23 -0600 Subject: [PATCH 04/12] FS-3886 --resolve --- src/switch_event.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/switch_event.c b/src/switch_event.c index 7e8a8676ba..25bab3185a 100644 --- a/src/switch_event.c +++ b/src/switch_event.c @@ -85,6 +85,7 @@ static switch_mutex_t *EVENT_QUEUE_MUTEX = NULL; static switch_hash_t *CUSTOM_HASH = NULL; static int THREAD_COUNT = 0; static int SYSTEM_RUNNING = 0; +static uint64_t EVENT_SEQUENCE_NR = 0; #ifdef SWITCH_EVENT_RECYCLE static switch_queue_t *EVENT_RECYCLE_QUEUE = NULL; static switch_queue_t *EVENT_HEADER_RECYCLE_QUEUE = NULL; @@ -1740,6 +1741,10 @@ SWITCH_DECLARE(void) switch_event_prep_for_delivery_detailed(const char *file, c switch_size_t retsize; switch_time_t ts = switch_micro_time_now(); + switch_mutex_lock(EVENT_QUEUE_MUTEX); + EVENT_SEQUENCE_NR++; + switch_mutex_unlock(EVENT_QUEUE_MUTEX); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Event-Name", switch_event_name(event->event_id)); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Core-UUID", switch_core_get_uuid()); @@ -1757,6 +1762,7 @@ SWITCH_DECLARE(void) switch_event_prep_for_delivery_detailed(const char *file, c switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Event-Calling-File", switch_cut_path(file)); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Event-Calling-Function", func); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Event-Calling-Line-Number", "%d", line); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Event-Sequence", "%" SWITCH_UINT64_T_FMT, (uint64_t) EVENT_SEQUENCE_NR); } From b6ec1271940d744dd99beb7b806be6a667cc1f13 Mon Sep 17 00:00:00 2001 From: Stefan Knoblich Date: Tue, 7 Feb 2012 16:44:55 +0100 Subject: [PATCH 05/12] [ftmod_misdn] Extend misdn_event_types[] and use a helper macro. Add missing mISDN event/message types (e.g. MPH_INFORMATION_IND) and use a helper macro (MISDN_EVENT_TYPE) to define the entries, like we already do for misdn_control_types[]. Signed-off-by: Stefan Knoblich --- .../src/ftmod/ftmod_misdn/ftmod_misdn.c | 33 ++++++++++++------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c b/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c index 9673549f79..e78facf287 100644 --- a/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c +++ b/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c @@ -96,18 +96,27 @@ const static struct { const int id; const char *name; } misdn_event_types[] = { - { PH_DATA_REQ, "PH_DATA_REQ" }, - { PH_DATA_IND, "PH_DATA_IND" }, - { PH_DATA_CNF, "PH_DATA_CNF" }, - { PH_CONTROL_REQ, "PH_CONTROL_REQ" }, - { PH_CONTROL_IND, "PH_CONTROL_IND" }, - { PH_CONTROL_CNF, "PH_CONTROL_CNF" }, - { PH_ACTIVATE_REQ, "PH_ACTIVATE_REQ" }, - { PH_ACTIVATE_IND, "PH_ACTIVATE_IND" }, - { PH_ACTIVATE_CNF, "PH_ACTIVATE_CNF" }, - { PH_DEACTIVATE_REQ, "PH_DEACTIVATE_REQ" }, - { PH_DEACTIVATE_IND, "PH_DEACTIVATE_IND" }, - { PH_DEACTIVATE_CNF, "PH_DEACTIVATE_CNF" }, +#define MISDN_EVENT_TYPE(x) { x, #x } + MISDN_EVENT_TYPE(PH_DATA_REQ), + MISDN_EVENT_TYPE(PH_DATA_IND), + MISDN_EVENT_TYPE(PH_DATA_CNF), + MISDN_EVENT_TYPE(PH_DATA_E_IND), + MISDN_EVENT_TYPE(PH_CONTROL_REQ), + MISDN_EVENT_TYPE(PH_CONTROL_IND), + MISDN_EVENT_TYPE(PH_CONTROL_CNF), + MISDN_EVENT_TYPE(PH_ACTIVATE_REQ), + MISDN_EVENT_TYPE(PH_ACTIVATE_IND), + MISDN_EVENT_TYPE(PH_ACTIVATE_CNF), + MISDN_EVENT_TYPE(PH_DEACTIVATE_REQ), + MISDN_EVENT_TYPE(PH_DEACTIVATE_IND), + MISDN_EVENT_TYPE(PH_DEACTIVATE_CNF), + MISDN_EVENT_TYPE(MPH_ACTIVATE_REQ), + MISDN_EVENT_TYPE(MPH_ACTIVATE_IND), + MISDN_EVENT_TYPE(MPH_DEACTIVATE_REQ), + MISDN_EVENT_TYPE(MPH_DEACTIVATE_IND), + MISDN_EVENT_TYPE(MPH_INFORMATION_REQ), + MISDN_EVENT_TYPE(MPH_INFORMATION_IND), +#undef MISDN_EVENT_TYPE }; static const char *misdn_event2str(const int event) From 9e0928a7ea2bc718e7204d846c05d37056e3a4f0 Mon Sep 17 00:00:00 2001 From: Stefan Knoblich Date: Tue, 7 Feb 2012 16:49:31 +0100 Subject: [PATCH 06/12] [ftmod_misdn] Undefine MISDN_CONTROL_TYPE helper macro after use. No reason to keep it around for longer. Signed-off-by: Stefan Knoblich --- libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c b/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c index e78facf287..dcba43512e 100644 --- a/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c +++ b/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c @@ -137,6 +137,7 @@ const static struct { } misdn_control_types[] = { #define MISDN_CONTROL_TYPE(x) { x, #x } MISDN_CONTROL_TYPE(DTMF_HFC_COEF), +#undef MISDN_CONTROL_TYPE }; #if 0 /* unused for now */ From fd3ebc7ae3c83b9c4ca0d6b9dec135076daf7da4 Mon Sep 17 00:00:00 2001 From: Stefan Knoblich Date: Tue, 7 Feb 2012 18:22:30 +0100 Subject: [PATCH 07/12] [ftmod_misdn] Handle MPH_INFORMATION_IND during channel activation. Add MISDN_MSG_DATA() helper macro for easy access to mISDN message payload. Add forward declaration of misdn_handle_mph_information_ind() and use it in misdn_activate_channel(). Signed-off-by: Stefan Knoblich --- libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c b/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c index dcba43512e..239ec400f7 100644 --- a/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c +++ b/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c @@ -91,6 +91,7 @@ typedef enum { #define MISDN_IS_RAW(x) (x & MISDN_CAPS_RAW) #define MISDN_IS_HDLC(x) (x & MISDN_CAPS_HDLC) +#define MISDN_MSG_DATA(x) ((void *)((unsigned char *)(x) + MISDN_HEADER_LEN)) const static struct { const int id; @@ -199,6 +200,7 @@ struct misdn_chan_private { #define ftdm_span_io_private(x) ((x)->io_data) static ftdm_status_t misdn_handle_incoming(ftdm_channel_t *ftdmchan, const char *rbuf, const int size); +static int misdn_handle_mph_information_ind(ftdm_channel_t *chan, const struct mISDNhead *hh, const void *data, const int data_len); /*********************************************************************************** * mISDN interface functions @@ -461,6 +463,11 @@ static ftdm_status_t misdn_activate_channel(ftdm_channel_t *chan, int activate) ftdm_log_chan(chan, FTDM_LOG_DEBUG, "mISDN got '%s' echo while waiting for %s confirmation (id: %#x)\n", misdn_event2str(hh->prim), (activate) ? "activation" : "deactivation", hh->id); break; + case MPH_INFORMATION_IND: + ftdm_log_chan(chan, FTDM_LOG_DEBUG, "mISDN ignoring event '%s (%#x)' while waiting for %s confirmation\n", + misdn_event2str(hh->prim), hh->prim, (activate) ? "activation" : "deactivation"); + misdn_handle_mph_information_ind(chan, hh, MISDN_MSG_DATA(buf), retval - MISDN_HEADER_LEN); + break; default: /* other messages, ignore */ ftdm_log_chan(chan, FTDM_LOG_DEBUG, "mISDN ignoring event '%s' while waiting for %s confirmation\n", misdn_event2str(hh->prim), (activate) ? "activation" : "deactivation"); From 452c13573d7c7a37fa8d877b51a07e4448d68ccd Mon Sep 17 00:00:00 2001 From: Stefan Knoblich Date: Tue, 7 Feb 2012 18:24:12 +0100 Subject: [PATCH 08/12] [ftmod_misdn] Include mISDN message primitive id in channel activation log messages. Signed-off-by: Stefan Knoblich --- libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c b/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c index 239ec400f7..643e6daeb8 100644 --- a/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c +++ b/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c @@ -444,8 +444,8 @@ static ftdm_status_t misdn_activate_channel(ftdm_channel_t *chan, int activate) return FTDM_FAIL; } //#ifdef MISDN_DEBUG_EVENTS - ftdm_log_chan(chan, FTDM_LOG_DEBUG, "mISDN got event '%s' while waiting for %s confirmation\n", - misdn_event2str(hh->prim), (activate) ? "activation" : "deactivation"); + ftdm_log_chan(chan, FTDM_LOG_DEBUG, "mISDN got event '%s (%#x)' while waiting for %s confirmation\n", + misdn_event2str(hh->prim), hh->prim, (activate) ? "activation" : "deactivation"); //#endif switch (hh->prim) { case PH_ACTIVATE_IND: /* success (or not): save last response, */ @@ -469,8 +469,8 @@ static ftdm_status_t misdn_activate_channel(ftdm_channel_t *chan, int activate) misdn_handle_mph_information_ind(chan, hh, MISDN_MSG_DATA(buf), retval - MISDN_HEADER_LEN); break; default: /* other messages, ignore */ - ftdm_log_chan(chan, FTDM_LOG_DEBUG, "mISDN ignoring event '%s' while waiting for %s confirmation\n", - misdn_event2str(hh->prim), (activate) ? "activation" : "deactivation"); + ftdm_log_chan(chan, FTDM_LOG_DEBUG, "mISDN ignoring event '%s (%#x)' while waiting for %s confirmation\n", + misdn_event2str(hh->prim), hh->prim, (activate) ? "activation" : "deactivation"); break; } } From 810f0d4eaa4c9fc072fe8777a99086f2024d805a Mon Sep 17 00:00:00 2001 From: Stefan Knoblich Date: Tue, 7 Feb 2012 18:25:29 +0100 Subject: [PATCH 09/12] [ftmod_misdn] Make misdn_handle_mph_information_ind() cope with hfcsusb-style MPH_INFORMATION_IND messages. Only two mISDN hardware drivers emit MPH_INFORMATION_IND messages and both use a different payload: - hfcsusb (HFC-based USB dongle) sends a set of ph_info + ph_info_ch structures which contain the complete state information of the port (including internal hw-specific state and flags). - hfcmulti which sends a single integer, a single L1_SIGNAL_* event. We now try to guess the type of message from the payload length. The hfcmulti signals are converted to FreeTDM alarm flags; the hfcsusb state/flags are defined in kernel internal hw-specific headers and are ignored ATM (todo). Signed-off-by: Stefan Knoblich --- .../src/ftmod/ftmod_misdn/ftmod_misdn.c | 118 ++++++++++++------ 1 file changed, 78 insertions(+), 40 deletions(-) diff --git a/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c b/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c index 643e6daeb8..306f884c05 100644 --- a/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c +++ b/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c @@ -622,50 +622,88 @@ static int misdn_handle_ph_control_ind(ftdm_channel_t *chan, const struct mISDNh static int misdn_handle_mph_information_ind(ftdm_channel_t *chan, const struct mISDNhead *hh, const void *data, const int data_len) { struct misdn_chan_private *priv = ftdm_chan_io_private(chan); - int alarm_flags, value; - if (data_len < sizeof(value)) { - ftdm_log_chan_msg(chan, FTDM_LOG_ERROR, "mISDN MPH_INFORMATION_IND message is too short\n"); + /* + * mISDN has some inconsistency issues here. + * + * There are only two drivers that emit MPH_INFORMATION_IND messages, + * hfcsusb and hfcmulti. The former sends a set of ph_info and ph_info_ch structures, + * while the latter just sends an int containing the current L1_SIGNAL_* event id. + * + * The flags and state information in the ph_info and ph_info_ch structures + * are defined in kernel internal hw-specific headers (mISDNhw.h). + * + * Use the payload size to guess the type of message. + */ + if (data_len >= sizeof(struct ph_info)) { + /* complete port status, hfcsusb sends this */ + struct ph_info *info = (struct ph_info *)data; + struct ph_info_ch *bch_info = NULL; + + if (data_len < (sizeof(*info) + info->dch.num_bch * sizeof(*bch_info))) { + ftdm_log_chan_msg(chan, FTDM_LOG_ERROR, "mISDN MPH_INFORMATION_IND message is too short\n"); + return FTDM_FAIL; + } + bch_info = &info->bch[0]; + + ftdm_log_chan(chan, FTDM_LOG_DEBUG, "mISDN port state:\n\tD-Chan state:\t%hu\n\tD-Chan flags:\t%#x\n\tD-Chan proto:\t%hu\n\tD-Chan active:\t%s\n", + info->dch.state, info->dch.ch.Flags, info->dch.ch.protocol, info->dch.ch.Flags & (1 << 6) ? "yes" : "no"); + + /* TODO: try to translate this to a usable set of alarm flags */ + + } else if (data_len == sizeof(int)) { + /* alarm info, sent by hfcmulti */ + int value = *(int *)data; + int alarm_flags = chan->alarm_flags; + + if (data_len < sizeof(value)) { + ftdm_log_chan_msg(chan, FTDM_LOG_ERROR, "mISDN MPH_INFORMATION_IND message is too short\n"); + return FTDM_FAIL; + } + + switch (value) { + case L1_SIGNAL_LOS_ON: + alarm_flags |= FTDM_ALARM_RED; + break; + case L1_SIGNAL_LOS_OFF: + alarm_flags &= ~FTDM_ALARM_RED; + break; + case L1_SIGNAL_AIS_ON: + alarm_flags |= FTDM_ALARM_AIS; + break; + case L1_SIGNAL_AIS_OFF: + alarm_flags &= ~FTDM_ALARM_AIS; + break; + case L1_SIGNAL_RDI_ON: + alarm_flags |= FTDM_ALARM_YELLOW; + break; + case L1_SIGNAL_RDI_OFF: + alarm_flags &= ~FTDM_ALARM_YELLOW; + break; + case L1_SIGNAL_SLIP_RX: + priv->slip_rx_cnt++; + break; + case L1_SIGNAL_SLIP_TX: + priv->slip_tx_cnt++; + break; + default: + ftdm_log_chan(chan, FTDM_LOG_ERROR, "mISDN unknown MPH_INFORMATION_IND signal: %#04x\n", + value); + return FTDM_FAIL; + } + + /* check whether alarm status has changed, update channel flags if it has */ + if ((value = (alarm_flags ^ chan->alarm_flags))) { + ftdm_log_chan(chan, FTDM_LOG_DEBUG, "mISDN alarm flags have changed %#x -> %#x\n", + chan->alarm_flags, alarm_flags); + chan->alarm_flags ^= value; + } + } else { + ftdm_log_chan(chan, FTDM_LOG_ERROR, "mISDN sent MPH_INFORMATION_IND message with unknown size %d\n", + data_len); return FTDM_FAIL; } - value = *(int *)data; - alarm_flags = chan->alarm_flags; - switch (value) { - case L1_SIGNAL_LOS_ON: - alarm_flags |= FTDM_ALARM_RED; - break; - case L1_SIGNAL_LOS_OFF: - alarm_flags &= ~FTDM_ALARM_RED; - break; - case L1_SIGNAL_AIS_ON: - alarm_flags |= FTDM_ALARM_AIS; - break; - case L1_SIGNAL_AIS_OFF: - alarm_flags &= ~FTDM_ALARM_AIS; - break; - case L1_SIGNAL_RDI_ON: - alarm_flags |= FTDM_ALARM_YELLOW; - break; - case L1_SIGNAL_RDI_OFF: - alarm_flags &= ~FTDM_ALARM_YELLOW; - break; - case L1_SIGNAL_SLIP_RX: - priv->slip_rx_cnt++; - break; - case L1_SIGNAL_SLIP_TX: - priv->slip_tx_cnt++; - break; - default: - ftdm_log_chan(chan, FTDM_LOG_ERROR, "mISDN unknown MPH_INFORMATION_IND message: %d\n", - value); - return FTDM_FAIL; - } - if ((value = (alarm_flags ^ chan->alarm_flags))) { - ftdm_log_chan(chan, FTDM_LOG_DEBUG, "mISDN alarm flags have changed %#x -> %#x\n", - chan->alarm_flags, alarm_flags); - chan->alarm_flags ^= value; - } return FTDM_SUCCESS; } From 4bb1ab0113c371f1aaa29981f9b19f7b75fbb919 Mon Sep 17 00:00:00 2001 From: Stefan Knoblich Date: Tue, 7 Feb 2012 18:38:09 +0100 Subject: [PATCH 10/12] [ftmod_misdn] Add some TODO items at the top of ftmod_misdn.c. Signed-off-by: Stefan Knoblich --- libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c b/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c index 306f884c05..06caeef7ae 100644 --- a/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c +++ b/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c @@ -25,6 +25,15 @@ * NOTE: This is intended as a Layer 1 interface only, signaling * is handled by other modules (e.g. ftmod_libpri or ftmod_isdn). */ +/* + * TODO: + * - Use a fifo and PH_DATA_CNF for b-channel write polling (drop timerfd) + * + * - Disable L1 idle deactivation on BRI PTMP with IMGL1HOLD ioctl(? optional) + * + * - Add hfcsusb specific state + flag defines and try to do something useful with + * it in misdn_handle_mph_information_ind(). + */ #include #include From 18289fa0131c18753996dc99a09d5590c206dc8f Mon Sep 17 00:00:00 2001 From: Michael S Collins Date: Tue, 7 Feb 2012 10:22:35 -0800 Subject: [PATCH 11/12] mod_voicemail: Change vm_announce_cid to be true/false and utilize vm_play_phone_number_macro --- conf/lang/en/vm/sounds.xml | 12 ++++++++++-- src/mod/applications/mod_voicemail/mod_voicemail.c | 8 ++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/conf/lang/en/vm/sounds.xml b/conf/lang/en/vm/sounds.xml index 976fcde32d..449ad55f2d 100644 --- a/conf/lang/en/vm/sounds.xml +++ b/conf/lang/en/vm/sounds.xml @@ -315,7 +315,7 @@ - + @@ -331,9 +331,17 @@ + + + + + - + + + + diff --git a/src/mod/applications/mod_voicemail/mod_voicemail.c b/src/mod/applications/mod_voicemail/mod_voicemail.c index 8461f480bc..df68f28166 100644 --- a/src/mod/applications/mod_voicemail/mod_voicemail.c +++ b/src/mod/applications/mod_voicemail/mod_voicemail.c @@ -1544,8 +1544,6 @@ static switch_status_t listen_file(switch_core_session_t *session, vm_profile_t char cid_buf[1024] = ""; if (switch_channel_ready(channel)) { - const char *vm_announce_cid = NULL; - switch_snprintf(cid_buf, sizeof(cid_buf), "%s|%s", cbt->cid_number, cbt->cid_name); msg.from = __FILE__; @@ -1556,10 +1554,8 @@ static switch_status_t listen_file(switch_core_session_t *session, vm_profile_t cid_buf, switch_channel_get_name(channel)); switch_core_session_receive_message(session, &msg); - if (!zstr(cbt->cid_number) && (vm_announce_cid = switch_channel_get_variable(channel, "vm_announce_cid"))) { - switch_ivr_play_file(session, NULL, vm_announce_cid, NULL); - switch_ivr_sleep(session, 500, SWITCH_TRUE, NULL); - switch_ivr_say(session, cbt->cid_number, NULL, "name_spelled", "pronounced", NULL, NULL); + if (!zstr(cbt->cid_number) && (switch_true(switch_channel_get_variable(channel, "vm_announce_cid")))) { + TRY_CODE(switch_ivr_phrase_macro(session, VM_SAY_PHONE_NUMBER_MACRO, cbt->cid_number, NULL, NULL)); } args.input_callback = cancel_on_dtmf; From 9a8524924ab682aca46411bdbdc5ba9c90a55179 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 7 Feb 2012 13:03:55 -0600 Subject: [PATCH 12/12] FS-3889 --resolve --- src/mod/applications/mod_spandsp/mod_spandsp_fax.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mod/applications/mod_spandsp/mod_spandsp_fax.c b/src/mod/applications/mod_spandsp/mod_spandsp_fax.c index f1d56a92c5..7cb0982591 100644 --- a/src/mod/applications/mod_spandsp/mod_spandsp_fax.c +++ b/src/mod/applications/mod_spandsp/mod_spandsp_fax.c @@ -341,6 +341,7 @@ static int phase_b_handler(t30_state_t *s, void *user_data, int result) /* Fire event */ if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, pvt->app_mode == FUNCTION_TX ? SPANDSP_EVENT_TXFAXNEGOCIATERESULT : SPANDSP_EVENT_RXFAXNEGOCIATERESULT) == SWITCH_STATUS_SUCCESS) { + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "uuid", switch_core_session_get_uuid(session)); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-transfer-rate", fax_transfer_rate); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-ecm-used", (t30_stats.error_correcting_mode) ? "on" : "off"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-local-station-id", local_ident); @@ -437,6 +438,7 @@ static int phase_d_handler(t30_state_t *s, void *user_data, int msg) switch_channel_execute_on(channel, "execute_on_fax_phase_d"); if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, pvt->app_mode == FUNCTION_TX ? SPANDSP_EVENT_TXFAXPAGERESULT : SPANDSP_EVENT_RXFAXPAGERESULT) == SWITCH_STATUS_SUCCESS) { + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "uuid", switch_core_session_get_uuid(session)); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-document-transferred-pages", fax_document_transferred_pages); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-image-resolution", fax_image_resolution); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-image-size", fax_image_size);