mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-16 23:08:32 +00:00
Add additional parking events (bug #3620)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5087 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -278,8 +278,8 @@ int ast_park_call(struct ast_channel *chan, struct ast_channel *peer, int timeou
|
|||||||
"CallerIDName: %s\r\n\r\n"
|
"CallerIDName: %s\r\n\r\n"
|
||||||
,pu->parkingnum, pu->chan->name, peer->name
|
,pu->parkingnum, pu->chan->name, peer->name
|
||||||
,(long)pu->start.tv_sec + (long)(pu->parkingtime/1000) - (long)time(NULL)
|
,(long)pu->start.tv_sec + (long)(pu->parkingtime/1000) - (long)time(NULL)
|
||||||
,(pu->chan->cid.cid_num ? pu->chan->cid.cid_num : "")
|
,(pu->chan->cid.cid_num ? pu->chan->cid.cid_num : "<unknown>")
|
||||||
,(pu->chan->cid.cid_name ? pu->chan->cid.cid_name : "")
|
,(pu->chan->cid.cid_name ? pu->chan->cid.cid_name : "<unknown>")
|
||||||
);
|
);
|
||||||
|
|
||||||
if (peer) {
|
if (peer) {
|
||||||
@@ -1135,6 +1135,17 @@ static void *do_parking_thread(void *ignore)
|
|||||||
strncpy(pu->chan->context, pu->context, sizeof(pu->chan->context)-1);
|
strncpy(pu->chan->context, pu->context, sizeof(pu->chan->context)-1);
|
||||||
pu->chan->priority = pu->priority;
|
pu->chan->priority = pu->priority;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
manager_event(EVENT_FLAG_CALL, "ParkedCallTimeOut",
|
||||||
|
"Exten: %d\r\n"
|
||||||
|
"Channel: %s\r\n"
|
||||||
|
"CallerID: %s\r\n"
|
||||||
|
"CallerIDName: %s\r\n\r\n"
|
||||||
|
,pu->parkingnum, pu->chan->name
|
||||||
|
,(pu->chan->cid.cid_num ? pu->chan->cid.cid_num : "<unknown>")
|
||||||
|
,(pu->chan->cid.cid_name ? pu->chan->cid.cid_name : "<unknown>")
|
||||||
|
);
|
||||||
|
|
||||||
if (option_verbose > 1)
|
if (option_verbose > 1)
|
||||||
ast_verbose(VERBOSE_PREFIX_2 "Timeout for %s parked on %d. Returning to %s,%s,%d\n", pu->chan->name, pu->parkingnum, pu->chan->context, pu->chan->exten, pu->chan->priority);
|
ast_verbose(VERBOSE_PREFIX_2 "Timeout for %s parked on %d. Returning to %s,%s,%d\n", pu->chan->name, pu->parkingnum, pu->chan->context, pu->chan->exten, pu->chan->priority);
|
||||||
/* Start up the PBX, or hang them up */
|
/* Start up the PBX, or hang them up */
|
||||||
@@ -1168,6 +1179,17 @@ static void *do_parking_thread(void *ignore)
|
|||||||
/* See if they need servicing */
|
/* See if they need servicing */
|
||||||
f = ast_read(pu->chan);
|
f = ast_read(pu->chan);
|
||||||
if (!f || ((f->frametype == AST_FRAME_CONTROL) && (f->subclass == AST_CONTROL_HANGUP))) {
|
if (!f || ((f->frametype == AST_FRAME_CONTROL) && (f->subclass == AST_CONTROL_HANGUP))) {
|
||||||
|
|
||||||
|
manager_event(EVENT_FLAG_CALL, "ParkedCallGiveUp",
|
||||||
|
"Exten: %d\r\n"
|
||||||
|
"Channel: %s\r\n"
|
||||||
|
"CallerID: %s\r\n"
|
||||||
|
"CallerIDName: %s\r\n\r\n"
|
||||||
|
,pu->parkingnum, pu->chan->name
|
||||||
|
,(pu->chan->cid.cid_num ? pu->chan->cid.cid_num : "<unknown>")
|
||||||
|
,(pu->chan->cid.cid_name ? pu->chan->cid.cid_name : "<unknown>")
|
||||||
|
);
|
||||||
|
|
||||||
/* There's a problem, hang them up*/
|
/* There's a problem, hang them up*/
|
||||||
if (option_verbose > 1)
|
if (option_verbose > 1)
|
||||||
ast_verbose(VERBOSE_PREFIX_2 "%s got tired of being parked\n", pu->chan->name);
|
ast_verbose(VERBOSE_PREFIX_2 "%s got tired of being parked\n", pu->chan->name);
|
||||||
@@ -1289,6 +1311,18 @@ static int park_exec(struct ast_channel *chan, void *data)
|
|||||||
ast_log(LOG_WARNING, "Whoa, failed to remove the extension!\n");
|
ast_log(LOG_WARNING, "Whoa, failed to remove the extension!\n");
|
||||||
} else
|
} else
|
||||||
ast_log(LOG_WARNING, "Whoa, no parking context?\n");
|
ast_log(LOG_WARNING, "Whoa, no parking context?\n");
|
||||||
|
|
||||||
|
manager_event(EVENT_FLAG_CALL, "UnParkedCall",
|
||||||
|
"Exten: %d\r\n"
|
||||||
|
"Channel: %s\r\n"
|
||||||
|
"From: %s\r\n"
|
||||||
|
"CallerID: %s\r\n"
|
||||||
|
"CallerIDName: %s\r\n\r\n"
|
||||||
|
,pu->parkingnum, pu->chan->name, chan->name
|
||||||
|
,(pu->chan->cid.cid_num ? pu->chan->cid.cid_num : "<unknown>")
|
||||||
|
,(pu->chan->cid.cid_name ? pu->chan->cid.cid_name : "<unknown>")
|
||||||
|
);
|
||||||
|
|
||||||
free(pu);
|
free(pu);
|
||||||
}
|
}
|
||||||
/* JK02: it helps to answer the channel if not already up */
|
/* JK02: it helps to answer the channel if not already up */
|
||||||
|
|||||||
Reference in New Issue
Block a user