[asterisk-commits] tilghman: trunk r130890 - in /trunk: ./ channels/chan_iax2.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jul 14 18:59:54 CDT 2008


Author: tilghman
Date: Mon Jul 14 18:59:54 2008
New Revision: 130890

URL: http://svn.digium.com/view/asterisk?view=rev&rev=130890
Log:
Merged revisions 130889 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r130889 | tilghman | 2008-07-14 18:59:13 -0500 (Mon, 14 Jul 2008) | 8 lines

Override the callerid in all cases when the callerid is set in the user, not
just when a remote callerid is set.  Also, if not set in the user, allow the
remote CallerID to pass through.
(closes issue #12875)
 Reported by: dimas
 Patches: 
       20080714__bug12875.diff.txt uploaded by Corydon76 (license 14)

........

Modified:
    trunk/   (props changed)
    trunk/channels/chan_iax2.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_iax2.c?view=diff&rev=130890&r1=130889&r2=130890
==============================================================================
--- trunk/channels/chan_iax2.c (original)
+++ trunk/channels/chan_iax2.c Mon Jul 14 18:59:54 2008
@@ -5938,20 +5938,17 @@
 		/* And the permitted authentication methods */
 		iaxs[callno]->authmethods = user->authmethods;
 		iaxs[callno]->adsi = user->adsi;
-		/* If they have callerid, override the given caller id.  Always store the ANI */
-		if (!ast_strlen_zero(iaxs[callno]->cid_num) || !ast_strlen_zero(iaxs[callno]->cid_name)) {
-			if (ast_test_flag(user, IAX_HASCALLERID)) {
-				iaxs[callno]->calling_tns = 0;
-				iaxs[callno]->calling_ton = 0;
-				ast_string_field_set(iaxs[callno], cid_num, user->cid_num);
-				ast_string_field_set(iaxs[callno], cid_name, user->cid_name);
-				iaxs[callno]->calling_pres = AST_PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN;
-			}
-			if (ast_strlen_zero(iaxs[callno]->ani))
-				ast_string_field_set(iaxs[callno], ani, user->cid_num);
-		} else {
+		/* If the user has callerid, override the remote caller id. */
+		if (ast_test_flag(user, IAX_HASCALLERID)) {
+			iaxs[callno]->calling_tns = 0;
+			iaxs[callno]->calling_ton = 0;
+			ast_string_field_set(iaxs[callno], cid_num, user->cid_num);
+			ast_string_field_set(iaxs[callno], cid_name, user->cid_name);
+			ast_string_field_set(iaxs[callno], ani, user->cid_num);
+			iaxs[callno]->calling_pres = AST_PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN;
+		} else if (ast_strlen_zero(iaxs[callno]->cid_num) && ast_strlen_zero(iaxs[callno]->cid_name)) {
 			iaxs[callno]->calling_pres = AST_PRES_NUMBER_NOT_AVAILABLE;
-		}
+		} /* else user is allowed to set their own CID settings */
 		if (!ast_strlen_zero(user->accountcode))
 			ast_string_field_set(iaxs[callno], accountcode, user->accountcode);
 		if (!ast_strlen_zero(user->mohinterpret))




More information about the asterisk-commits mailing list