From 2c5d8695eb280defc274c618ad4842440877022b Mon Sep 17 00:00:00 2001 From: Mathieu Rene Date: Fri, 10 Apr 2009 19:50:36 +0000 Subject: [PATCH] Add 'omit_redirecting_number' option to libpri (opts param) git-svn-id: http://svn.openzap.org/svn/openzap/trunk@711 a93c3328-9c30-0410-af19-c9cd2b2d52af --- libs/openzap/src/ozmod/ozmod_libpri/ozmod_libpri.c | 11 +++++++++-- libs/openzap/src/ozmod/ozmod_libpri/ozmod_libpri.h | 5 +++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/libs/openzap/src/ozmod/ozmod_libpri/ozmod_libpri.c b/libs/openzap/src/ozmod/ozmod_libpri/ozmod_libpri.c index fff761035a..216782c7c5 100644 --- a/libs/openzap/src/ozmod/ozmod_libpri/ozmod_libpri.c +++ b/libs/openzap/src/ozmod/ozmod_libpri/ozmod_libpri.c @@ -86,6 +86,10 @@ static uint32_t parse_opts(const char *in) if (strstr(in, "omit_display")) { flags |= OZMOD_LIBPRI_OPT_OMIT_DISPLAY_IE; } + + if (strstr(in, "omit_redirecting_number")) { + flags |= OZMOD_LIBPRI_OPT_OMIT_REDIRECTING_NUMBER_IE; + } return flags; } @@ -484,8 +488,11 @@ static __inline__ void state_advance(zap_channel_t *zchan) pri_sr_set_called(sr, zchan->caller_data.ani.digits, dp, 1); pri_sr_set_caller(sr, zchan->caller_data.cid_num.digits, (isdn_data->opts & OZMOD_LIBPRI_OPT_OMIT_DISPLAY_IE ? NULL : zchan->caller_data.cid_name), dp, PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN); - pri_sr_set_redirecting(sr, zchan->caller_data.cid_num.digits, dp, PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN, PRI_REDIR_UNCONDITIONAL); - + + if (!(isdn_data->opts & OZMOD_LIBPRI_OPT_OMIT_REDIRECTING_NUMBER_IE)) { + pri_sr_set_redirecting(sr, zchan->caller_data.cid_num.digits, dp, PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN, PRI_REDIR_UNCONDITIONAL); + } + if (pri_setup(isdn_data->spri.pri, call, sr)) { zchan->caller_data.hangup_cause = ZAP_CAUSE_DESTINATION_OUT_OF_ORDER; zap_set_state_locked(zchan, ZAP_CHANNEL_STATE_HANGUP); diff --git a/libs/openzap/src/ozmod/ozmod_libpri/ozmod_libpri.h b/libs/openzap/src/ozmod/ozmod_libpri/ozmod_libpri.h index ec00cecef5..fd8f45f375 100644 --- a/libs/openzap/src/ozmod/ozmod_libpri/ozmod_libpri.h +++ b/libs/openzap/src/ozmod/ozmod_libpri/ozmod_libpri.h @@ -41,8 +41,9 @@ typedef enum { OZMOD_LIBPRI_OPT_NONE = 0, OZMOD_LIBPRI_OPT_SUGGEST_CHANNEL = (1 << 0), OZMOD_LIBPRI_OPT_OMIT_DISPLAY_IE = (2 << 0), - - OZMOD_LIBPRI_OPT_MAX = (3 << 0) + OZMOD_LIBPRI_OPT_OMIT_REDIRECTING_NUMBER_IE = (3 << 0), + + OZMOD_LIBPRI_OPT_MAX = (4 << 0) } zap_isdn_opts_t; typedef enum {