diff options
author | Mark Spencer <markster@digium.com> | 2005-10-18 20:58:16 +0000 |
---|---|---|
committer | Mark Spencer <markster@digium.com> | 2005-10-18 20:58:16 +0000 |
commit | dbdd193e12e2aa3afcacef64927dab69533f6d07 (patch) | |
tree | 256231d011de23609d4af04829e4ded470e7aab1 /apps/app_queue.c | |
parent | a3df4cdda20620054133c024637b2d9ab875ff9d (diff) |
Fix segfault in app queue when no cdr exists for the calling channel (bug #5462)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6824 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_queue.c')
-rwxr-xr-x | apps/app_queue.c | 8 |
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); } |