From 6b7255789093d657ab5b2d9382a8b4309d85d13c Mon Sep 17 00:00:00 2001
From: "Kevin P. Fleming" <kpfleming@digium.com>
Date: Wed, 6 Jul 2005 14:47:25 +0000
Subject: [PATCH] ensure that AGENTBYCALLERID is set for agents being reloaded
 from persistent storage

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

diff --git a/channels/chan_agent.c b/channels/chan_agent.c
index 4a0780bffb..464ef64ea3 100755
--- a/channels/chan_agent.c
+++ b/channels/chan_agent.c
@@ -2122,9 +2122,10 @@ static void reload_agents(void)
 			agent_chan = strsep(&parse, ";");
 			agent_callerid = strsep(&parse, ";");
 			ast_copy_string(cur_agent->loginchan, agent_chan, sizeof(cur_agent->loginchan));
-			if (agent_callerid)
+			if (agent_callerid) {
 				ast_copy_string(cur_agent->logincallerid, agent_callerid, sizeof(cur_agent->logincallerid));
-			else
+				set_agentbycallerid(cur_agent);
+			} else
 				cur_agent->logincallerid[0] = '\0';
 			if (cur_agent->loginstart == 0)
 				time(&cur_agent->loginstart);
-- 
GitLab