[asterisk-commits] pcadach: branch pcadach/chan_h323-live r43037 - /team/pcadach/chan_h323-live/...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sat Sep 16 13:06:02 MST 2006


Author: pcadach
Date: Sat Sep 16 15:06:02 2006
New Revision: 43037

URL: http://svn.digium.com/view/asterisk?rev=43037&view=rev
Log:
Pass redirection reason on outgoing PRI calls

Modified:
    team/pcadach/chan_h323-live/channels/chan_zap.c

Modified: team/pcadach/chan_h323-live/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/pcadach/chan_h323-live/channels/chan_zap.c?rev=43037&r1=43036&r2=43037&view=diff
==============================================================================
--- team/pcadach/chan_h323-live/channels/chan_zap.c (original)
+++ team/pcadach/chan_h323-live/channels/chan_zap.c Sat Sep 16 15:06:02 2006
@@ -2067,6 +2067,8 @@
 		int prilocaldialplan;
 		int ldp_strip;
 		int exclusive;
+		const char *rr_str;
+		int redirect_reason;
 
 		c = strchr(dest, '/');
 		if (c)
@@ -2173,7 +2175,20 @@
 		}
 		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 */



More information about the asterisk-commits mailing list