[asterisk-bugs] [JIRA] (ASTERISK-29020) Regression: Fix for app_queue: track masquerades in app_queue to avoid leaked stasis subscriptions broke queue log

Kevin Harwell (JIRA) noreply at issues.asterisk.org
Tue Aug 18 10:56:43 CDT 2020


    [ https://issues.asterisk.org/jira/browse/ASTERISK-29020?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=251682#comment-251682 ] 

Kevin Harwell edited comment on ASTERISK-29020 at 8/18/20 10:56 AM:
--------------------------------------------------------------------

This is my workaround until the case is resolved. It's probably inadequate as I did not check the events emitted by AMI for proper ids.

Edit: Removed inline patch

Unfortunately we cannot accept patches in comments. It can however be attached as a file after accepting the license agreement [1]. Or even better submitted to gerrit for inclusion [2].

[1] https://issues.asterisk.org/jira/secure/DigiumLicense.jspa
[2] https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process



was (Author: garlew):
This is my workaround until the case is resolved. It's probably inadequate as I did not check the events emitted by AMI for proper ids.
{code}
diff --git a/asterisk/apps/app_queue.c b/asterisk/apps/app_queue.c
index 5d2721b..6625bbc 100644
--- a/asterisk/apps/app_queue.c
+++ b/asterisk/apps/app_queue.c
@@ -5737,6 +5737,8 @@ struct local_optimization {
  */
 struct queue_stasis_data {
 	AST_DECLARE_STRING_FIELDS(
+		/*! The unique ID of the caller's channel. */
+		AST_STRING_FIELD(original_uniqueid);
 		/*! The unique ID of the caller's channel. */
 		AST_STRING_FIELD(caller_uniqueid);
 		/*! The unique ID of the queue member's channel */
@@ -5821,6 +5823,7 @@ static struct queue_stasis_data *queue_stasis_data_alloc(struct queue_ent *qe,
 	}
 
 	ast_string_field_set(queue_data, caller_uniqueid, ast_channel_uniqueid(qe->chan));
+	ast_string_field_set(queue_data, original_uniqueid, ast_channel_uniqueid(qe->chan));
 	ast_string_field_set(queue_data, member_uniqueid, ast_channel_uniqueid(peer));
 	queue_data->queue = queue_ref(qe->parent);
 	queue_data->starttime = starttime;
@@ -5872,7 +5875,7 @@ static void log_attended_transfer(struct queue_stasis_data *queue_data,
 		return;
 	}
 
-	ast_queue_log(queue_data->queue->name, queue_data->caller_uniqueid, queue_data->member->membername, "ATTENDEDTRANSFER", "%s|%ld|%ld|%d",
+	ast_queue_log(queue_data->queue->name, queue_data->original_uniqueid, queue_data->member->membername, "ATTENDEDTRANSFER", "%s|%ld|%ld|%d",
 			ast_str_buffer(transfer_str),
 			(long) (queue_data->starttime - queue_data->holdstart),
 			(long) (time(NULL) - queue_data->starttime), queue_data->caller_pos);

{code}

> Regression: Fix for app_queue: track masquerades in app_queue to avoid leaked stasis subscriptions broke queue log
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: ASTERISK-29020
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-29020
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Applications/app_queue
>    Affects Versions: 13.35.0
>            Reporter: Grzegorz Garlewicz
>            Assignee: Unassigned
>
> {code}handle_masquerade{code}'s
> {code}ast_string_field_set(queue_data, caller_uniqueid, new_channel_id);{code}
> makes all subsequent entries in the queue_log use the new uniqueid which is not in any way associated to the original one.
> This way you can no longer rely on the log entries.
> {code}
> 1596621010|1596620945.17555|Consultant|NONE|ENTERQUEUE||209899255|1
> 1596621016|1596620945.17555|Consultant|Sip/3873|CONNECT|6|1596621010.17570|5
> 1596621065|1596621064.17580|Specialist|NONE|ENTERQUEUE||3873|2
> 1596621066|1596621064.17580|Consultant|Sip/3873|ATTENDEDTRANSFER|APP|Queue|6|50|1
> {code}
> the last entry used to have original uniqueid



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list