From 9f7b1269b7e839ea3328d0faeb21632b5c20b172 Mon Sep 17 00:00:00 2001
From: Jeremy McNamara <jj@nufone.net>
Date: Thu, 24 Jul 2003 17:01:41 +0000
Subject: [PATCH] deal with no callerid name

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1209 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 channels/h323/chan_h323.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/channels/h323/chan_h323.c b/channels/h323/chan_h323.c
index 017a164361..de18ea6f27 100755
--- a/channels/h323/chan_h323.c
+++ b/channels/h323/chan_h323.c
@@ -1009,8 +1009,11 @@ int setup_incoming_call(call_details_t cd)
 			if (strlen(user->callerid)) 
 				strncpy(p->callerid, user->callerid, sizeof(p->callerid) - 1);
 			else
-				sprintf(p->callerid, "%s <%s>", p->cd.call_source_aliases, p->cd.call_source_e164); 
-	
+				if (!strlen(p->cd.call_source_aliases)) 
+					sprintf(p->callerid, "Unknown Name <%s>", p->cd.call_source_e164); 
+				else
+					sprintf(p->callerid, "%s <%s>", p->cd.call_source_aliases, p->cd.call_source_e164); 
+
 			if (strlen(p->cd.call_dest_e164)) {
 				strncpy(p->exten, cd.call_dest_e164, sizeof(p->exten)-1);
 			} else {
-- 
GitLab