From: Russell Bryant Date: Tue, 31 May 2005 03:22:34 +0000 (+0000) Subject: fix distinctive ring for queue members (bug #3978) X-Git-Tag: 1.0.11.1~106 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91f97408564c4a5140de8df479b3404fde5fe9b1;p=thirdparty%2Fasterisk.git fix distinctive ring for queue members (bug #3978) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/v1-0@5795 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_queue.c b/apps/app_queue.c index b3a9c6f910..929a5c15f4 100755 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -548,6 +548,8 @@ static void hanguptree(struct localuser *outgoing, struct ast_channel *exception static int ring_entry(struct queue_ent *qe, struct localuser *tmp, int *busies) { int res; + struct ast_var_t *current, *newvar; + struct varshead *headp, *newheadp; if (qe->parent->wrapuptime && (time(NULL) - tmp->lastcall < qe->parent->wrapuptime)) { ast_log(LOG_DEBUG, "Wrapuptime not yet expired for %s/%s\n", tmp->tech, tmp->numsubst); if (qe->chan->cdr) @@ -568,6 +570,26 @@ static int ring_entry(struct queue_ent *qe, struct localuser *tmp, int *busies) (*busies)++; return 0; } + /* If creating a SIP channel, look for a variable called */ + /* VXML_URL in the calling channel and copy it to the */ + /* new channel. */ + + /* Check for ALERT_INFO in the SetVar list. This is for */ + /* SIP distinctive ring as per the RFC. For Cisco 7960s, */ + /* SetVar(ALERT_INFO=) where x is an integer value 1-5. */ + /* However, the RFC says it should be a URL. -km- */ + headp=&qe->chan->varshead; + AST_LIST_TRAVERSE(headp,current,entries) { + if (!strcasecmp(ast_var_name(current),"VXML_URL") || + !strcasecmp(ast_var_name(current), "ALERT_INFO") || + !strcasecmp(ast_var_name(current), "OSPTOKEN") || + !strcasecmp(ast_var_name(current), "OSPHANDLE")) + { + newvar=ast_var_assign(ast_var_name(current),ast_var_value(current)); + newheadp=&tmp->chan->varshead; + AST_LIST_INSERT_HEAD(newheadp,newvar,entries); + } + } tmp->chan->appl = "AppQueue"; tmp->chan->data = "(Outgoing Line)"; tmp->chan->whentohangup = 0;