From 473fd0ce89c964586c0e1a473723641a84d71aa5 Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Wed, 3 Aug 2011 11:53:40 -0400 Subject: [PATCH] freetdm: ISDN - allow reception of NOTIFY msg --- .../ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_hndl.c | 10 +++++++--- .../ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_rcv.c | 3 ++- .../ftmod_sangoma_isdn/ftmod_sangoma_isdn_trace.c | 10 +++++++++- .../ftmod_sangoma_isdn/ftmod_sangoma_isdn_trace.h | 5 +++++ 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_hndl.c b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_hndl.c index 308e0abac4..e95a582a45 100644 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_hndl.c +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_hndl.c @@ -361,8 +361,9 @@ void sngisdn_process_cnst_ind (sngisdn_event_data_t *sngisdn_event) (evntType == MI_CALLPROC)?"PROCEED": (evntType == MI_PROGRESS)?"PROGRESS": (evntType == MI_SETUPACK)?"SETUP ACK": - (evntType == MI_INFO)?"INFO":"UNKNOWN", - suId, suInstId, spInstId, ces); + (evntType == MI_NOTIFY)?"NOTIFY": + (evntType == MI_INFO)?"INFO":"UNKNOWN", + suId, suInstId, spInstId, ces); switch(evntType) { case MI_CALLPROC: @@ -493,7 +494,10 @@ void sngisdn_process_cnst_ind (sngisdn_event_data_t *sngisdn_event) break; } } - + break; + case MI_NOTIFY: + ftdm_log_chan(ftdmchan, FTDM_LOG_DEBUG, "Processing NOTIFY (suId:%u suInstId:%u spInstId:%u)\n", suId, suInstId, spInstId); + /* Do nothing */ break; default: ftdm_log_chan_msg(ftdmchan, FTDM_LOG_WARNING, "Unhandled STATUS event\n"); diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_rcv.c b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_rcv.c index df791ef3cb..3788a9c25b 100644 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_rcv.c +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_stack_rcv.c @@ -168,7 +168,8 @@ void sngisdn_rcv_cnst_ind (int16_t suId, uint32_t suInstId, uint32_t spInstId, C (evntType == MI_CALLPROC)?"PROCEED": (evntType == MI_PROGRESS)?"PROGRESS": (evntType == MI_SETUPACK)?"SETUP ACK": - (evntType == MI_INFO)?"INFO":"UNKNOWN", + (evntType == MI_NOTIFY)?"NOTIFY": + (evntType == MI_INFO)?"INFO":"UNKNOWN", suId, suInstId, spInstId, ces); sngisdn_event = ftdm_malloc(sizeof(*sngisdn_event)); diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_trace.c b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_trace.c index abb6577924..467ac7f9d8 100644 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_trace.c +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_trace.c @@ -737,8 +737,16 @@ uint32_t sngisdn_decode_ie(char *str, uint32_t *str_len, uint8_t current_codeset calling_subaddr_string, (j-1), get_code_2_str(type, dcodQ931TypeOfSubaddressTable), type); } break; - case PROT_Q931_IE_REDIRECTION_NUMBER: case PROT_Q931_IE_NOTIFICATION_IND: + { + uint8_t desc; + + desc = get_bits(OCTET(3),1,7); + *str_len += sprintf(&str[*str_len], "%s (%d)\n", + get_code_2_str(desc, dcodQ931NotificationIndTable), desc); + } + break; + case PROT_Q931_IE_REDIRECTION_NUMBER: case PROT_Q931_IE_DATE_TIME: case PROT_Q931_IE_INFORMATION_REQUEST: case PROT_Q931_IE_SIGNAL: diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_trace.h b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_trace.h index 37b799d007..b09bcbd33a 100644 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_trace.h +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn_trace.h @@ -591,4 +591,9 @@ struct code2str dcodQ931AssocInfoTable[] = { { -1, "Invalid"}, }; + +struct code2str dcodQ931NotificationIndTable[] = { + { 0x71, "Call Information/event"}, + { -1, "Invalid"}, +}; #endif /* __FTMOD_SANGOMA_ISDN_TRACE_H__ */