mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 18:55:19 +00:00 
			
		
		
		
	Merged revisions 149201 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r149201 | mmichelson | 2008-10-14 17:41:13 -0500 (Tue, 14 Oct 2008) | 20 lines Merged revisions 149200 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r149200 | mmichelson | 2008-10-14 17:40:42 -0500 (Tue, 14 Oct 2008) | 12 lines Update the queue with the correct number of calls and whether the call was completed within the service level when a transfer takes place. This way, we do not "break" the leastrecent and fewestcalls strategies by not logging a call until after the transferred call has ended. (closes issue #13395) Reported by: Marquis Patches: app_queue.c.transfer.patch uploaded by Marquis (license 32) ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@149203 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
		| @@ -3075,6 +3075,7 @@ struct queue_transfer_ds { | ||||
| 	struct queue_ent *qe; | ||||
| 	struct member *member; | ||||
| 	int starttime; | ||||
| 	int callcompletedinsl; | ||||
| }; | ||||
|  | ||||
| static void queue_transfer_destroy(void *data) | ||||
| @@ -3106,11 +3107,14 @@ static void queue_transfer_fixup(void *data, struct ast_channel *old_chan, struc | ||||
| 	struct queue_ent *qe = qtds->qe; | ||||
| 	struct member *member = qtds->member; | ||||
| 	int callstart = qtds->starttime; | ||||
| 	int callcompletedinsl = qtds->callcompletedinsl; | ||||
| 	struct ast_datastore *datastore; | ||||
|  | ||||
| 	ast_queue_log(qe->parent->name, qe->chan->uniqueid, member->membername, "TRANSFER", "%s|%s|%ld|%ld|%d", | ||||
| 				new_chan->exten, new_chan->context, (long) (callstart - qe->start), | ||||
| 				(long) (time(NULL) - callstart), qe->opos); | ||||
|  | ||||
| 	update_queue(qe->parent, member, callcompletedinsl); | ||||
| 	 | ||||
| 	if (!(datastore = ast_channel_datastore_find(new_chan, &queue_transfer_info, NULL))) { | ||||
| 		ast_log(LOG_WARNING, "Can't find the queue_transfer datastore.\n"); | ||||
| @@ -3134,7 +3138,7 @@ static int attended_transfer_occurred(struct ast_channel *chan) | ||||
|  | ||||
| /*! \brief create a datastore for storing relevant info to log attended transfers in the queue_log | ||||
|  */ | ||||
| static void setup_transfer_datastore(struct queue_ent *qe, struct member *member, int starttime) | ||||
| static void setup_transfer_datastore(struct queue_ent *qe, struct member *member, int starttime, int callcompletedinsl) | ||||
| { | ||||
| 	struct ast_datastore *ds; | ||||
| 	struct queue_transfer_ds *qtds = ast_calloc(1, sizeof(*qtds)); | ||||
| @@ -3155,6 +3159,7 @@ static void setup_transfer_datastore(struct queue_ent *qe, struct member *member | ||||
| 	/* This member is refcounted in try_calling, so no need to add it here, too */ | ||||
| 	qtds->member = member; | ||||
| 	qtds->starttime = starttime; | ||||
| 	qtds->callcompletedinsl = callcompletedinsl; | ||||
| 	ds->data = qtds; | ||||
| 	ast_channel_datastore_add(qe->chan, ds); | ||||
| 	ast_channel_unlock(qe->chan); | ||||
| @@ -3830,7 +3835,7 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce | ||||
| 		ast_copy_string(oldcontext, qe->chan->context, sizeof(oldcontext)); | ||||
| 		ast_copy_string(oldexten, qe->chan->exten, sizeof(oldexten)); | ||||
| 		time(&callstart); | ||||
| 		setup_transfer_datastore(qe, member, callstart); | ||||
| 		setup_transfer_datastore(qe, member, callstart, callcompletedinsl); | ||||
| 		bridge = ast_bridge_call(qe->chan,peer, &bridge_config); | ||||
|  | ||||
| 		/* If the queue member did an attended transfer, then the TRANSFER already was logged in the queue_log | ||||
| @@ -3859,11 +3864,11 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce | ||||
| 				ast_datastore_free(transfer_ds); | ||||
| 			} | ||||
| 			ast_channel_unlock(qe->chan); | ||||
| 			update_queue(qe->parent, member, callcompletedinsl); | ||||
| 		} | ||||
|  | ||||
| 		if (bridge != AST_PBX_NO_HANGUP_PEER) | ||||
| 			ast_hangup(peer); | ||||
| 		update_queue(qe->parent, member, callcompletedinsl); | ||||
| 		res = bridge ? bridge : 1; | ||||
| 		ao2_ref(member, -1); | ||||
| 	} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user