summaryrefslogtreecommitdiff
path: root/channels/chan_zap.c
diff options
context:
space:
mode:
authorMatthew Fredrickson <creslin@digium.com>2006-09-19 21:07:49 +0000
committerMatthew Fredrickson <creslin@digium.com>2006-09-19 21:07:49 +0000
commit33ddb536631cb9b46dc63923dbf79ead8db89186 (patch)
treecf83670bfa579bddec4a254d9f6fc45e2a8a7829 /channels/chan_zap.c
parentfc60c151d3c49897088c148ea01304701b40c2a2 (diff)
Various updates from PCadach's chan_h323-live branch
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43294 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_zap.c')
-rw-r--r--channels/chan_zap.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index b10cd6bcc..303b52015 100644
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -2070,6 +2070,8 @@ static int zt_call(struct ast_channel *ast, char *rdest, int timeout)
int prilocaldialplan;
int ldp_strip;
int exclusive;
+ const char *rr_str;
+ int redirect_reason;
c = strchr(dest, '/');
if (c)
@@ -2176,7 +2178,20 @@ static int zt_call(struct ast_channel *ast, char *rdest, int timeout)
}
pri_sr_set_caller(sr, l ? (l + ldp_strip) : NULL, n, prilocaldialplan,
p->use_callingpres ? ast->cid.cid_pres : (l ? PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN : PRES_NUMBER_NOT_AVAILABLE));
- pri_sr_set_redirecting(sr, ast->cid.cid_rdnis, p->pri->localdialplan - 1, PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN, PRI_REDIR_UNCONDITIONAL);
+ if ((rr_str = pbx_builtin_getvar_helper(ast, "PRIREDIRECTREASON"))) {
+ if (!strcasecmp(rr_str, "UNKNOWN"))
+ redirect_reason = 0;
+ else if (!strcasecmp(rr_str, "BUSY"))
+ redirect_reason = 1;
+ else if (!strcasecmp(rr_str, "NO_REPLY"))
+ redirect_reason = 2;
+ else if (!strcasecmp(rr_str, "UNCONDITIONAL"))
+ redirect_reason = 15;
+ else
+ redirect_reason = PRI_REDIR_UNCONDITIONAL;
+ } else
+ redirect_reason = PRI_REDIR_UNCONDITIONAL;
+ pri_sr_set_redirecting(sr, ast->cid.cid_rdnis, p->pri->localdialplan - 1, PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN, redirect_reason);
#ifdef SUPPORT_USERUSER
/* User-user info */