aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_queue.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-10-18 20:58:16 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-10-18 20:58:16 +0000
commite282c8dcea4600b556243330609b192be81e542b (patch)
tree256231d011de23609d4af04829e4ded470e7aab1 /apps/app_queue.c
parent3f7ec7e31040dbf0d0287d5faa1bea6817f807d0 (diff)
Fix segfault in app queue when no cdr exists for the calling channel (bug #5462)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6824 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_queue.c')
-rwxr-xr-xapps/app_queue.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index e1d7373c4..7a0991414 100755
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -2188,8 +2188,14 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce
which = peer;
if (monitorfilename)
ast_monitor_start(which, qe->parent->monfmt, monitorfilename, 1 );
- else
+ else if (qe->chan->cdr)
ast_monitor_start(which, qe->parent->monfmt, qe->chan->cdr->uniqueid, 1 );
+ else {
+ /* Last ditch effort -- no CDR, make up something */
+ char tmpid[256];
+ snprintf(tmpid, sizeof(tmpid), "chan-%x", rand());
+ ast_monitor_start(which, qe->parent->monfmt, tmpid, 1 );
+ }
if (qe->parent->monjoin)
ast_monitor_setjoinfiles(which, 1);
}