Don't overwrite ANI if it's already sent with IES (imported from 1.2 branch)
authorOlle Johansson <oej@edvina.net>
Mon, 20 Mar 2006 17:39:14 +0000 (17:39 +0000)
committerOlle Johansson <oej@edvina.net>
Mon, 20 Mar 2006 17:39:14 +0000 (17:39 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@13635 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_iax2.c

index 1b16fb9..b312d85 100644 (file)
@@ -5037,7 +5037,8 @@ static int check_access(int callno, struct sockaddr_in *sin, struct iax_ies *ies
                                ast_copy_string(iaxs[callno]->cid_name, user->cid_name, sizeof(iaxs[callno]->cid_name));
                                iaxs[callno]->calling_pres = AST_PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN;
                        }
-                       ast_copy_string(iaxs[callno]->ani, user->cid_num, sizeof(iaxs[callno]->ani));
+                       if (ast_strlen_zero(iaxs[callno]->ani))
+                               ast_copy_string(iaxs[callno]->ani, user->cid_num, sizeof(iaxs[callno]->ani));
                } else {
                        iaxs[callno]->calling_pres = AST_PRES_NUMBER_NOT_AVAILABLE;
                }