aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-07-15 00:00:34 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-07-15 00:00:34 +0000
commit560edcd1346f6ecaf7f39c48bb096bcaf039d5a8 (patch)
tree9d77b8b9b389258f2d1335663107144715facb74 /channels
parent99362a5199f1a61a61858bf47befea15b336be96 (diff)
Merged revisions 130890 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r130890 | tilghman | 2008-07-14 18:59:54 -0500 (Mon, 14 Jul 2008) | 16 lines 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) ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@130891 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_iax2.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index fff9a2702..8fb226c4b 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -5887,20 +5887,17 @@ static int check_access(int callno, struct sockaddr_in *sin, struct iax_ies *ies
/* 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))