Summary: | ASTERISK-30307: unreal: Local Channel Not Optimizing | ||
Reporter: | Đặng Lợi (loidang) | Labels: | |
Date Opened: | 2022-11-11 01:51:42.000-0600 | Date Closed: | 2022-12-02 12:00:01.000-0600 |
Priority: | Minor | Regression? | |
Status: | Closed/Complete | Components: | Channels/chan_local |
Versions: | 18.7.1 | Frequency of Occurrence | Occasional |
Related Issues: | |||
Environment: | Amazon Linux 2 Centos7 | Attachments: | ( 0) no_optimization.txt ( 1) optimized.txt |
Description: | Hi all, I'm using following scenarios to establish a 2 parties call
1. Caller channel held by ControlPlayback() 2. Outgoing spool file created to connect to the callee channel with Local ;2 channel, and when callee answers, do the bridge() to the held caller channel with Local ;1 channel. Things work as expected, except sometimes the Local channels created for processing the callee were not optimizing. I can reproduce the issue, and attached the debug log for both (optimized and not optimizing) cases. Try diving into the log myself but the only difference I can point out is the presence of merging of 2 bridges into 1 when the optimization happens, otherwise, 2 bridges exist until the end of call, so as the Local channels. I'm aware that there are usages that prevent Local channel optimization listed on the wiki and likely that I do not fall into it. So any enlightenment on what i was doing wrong would be appreciated. Regards, Loi Dang --- FAILED - Nov 9 07:07:45 bridge1: 4af0a403-5498-4541-b6f9-cb85951927a3 - Local/bd3b52eb-1398-451b-9fb7-7fc3630493b1@api_ivr_leg1-000000ea;2 - PJSIP/kamailio-000000ae (callee channel) bridge2: e8f6bad8-f952-4e77-97ad-4053441a0204 - Local/bd3b52eb-1398-451b-9fb7-7fc3630493b1@api_ivr_leg1-000000ea;1 - PJSIP/tssbc1_vendor-000000ad (caller channel) --- WORKING - Nov 9 09:50:00 bridge1: b41ecfa7-31ce-4245-8d09-f5cdfbe01c93 - Local/b6dcafa4-1587-4514-8eca-11d984752ac9@api_ivr_leg1-00000018;2 - PJSIP/kamailio-00000143 (callee channel) bridge2: 71519064-208b-486e-b8cc-b825af89560e - Local/b6dcafa4-1587-4514-8eca-11d984752ac9@api_ivr_leg1-00000018;1 - PJSIP/tssbc1_vendor-00000142 (caller channel) | ||
Comments: | By: Asterisk Team (asteriskteam) 2022-11-11 01:51:48.577-0600 Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution. Please note that log messages and other files should not be sent to the Sangoma Asterisk Team unless explicitly asked for. All files should be placed on this issue in a sanitized fashion as needed. A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report. Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process]. Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur. Please note that by submitting data, code, or documentation to Sangoma through JIRA, you accept the Terms of Use present at [https://www.asterisk.org/terms-of-use/|https://www.asterisk.org/terms-of-use/]. By: Joshua C. Colp (jcolp) 2022-11-14 05:14:58.925-0600 Nothing stands out in the logs. Can you provide specific reproduction instructions/scripts that we can loop and see if we can reproduce? As well, what kind of environment is this run in - virtualized? By: Đặng Lợi (loidang) 2022-11-16 01:58:59.437-0600 Hi Joshua, sharing my dialplan setup, used with complex AGI script for querying databases, but asterisk's part could be seen as follows: 1. caller will be put in infinite playback loop [caller] exten => _X.,1,Ringing() exten => _X.,n,agi(agi://127.0.0.1/dial) ; AGI EXEC GOTO onpause,1 exten => onpause,1(startpause),ControlPlayback(what_ever.gsm,,,,) exten => onpause,n,Goto(startpause) 2. Callee channels (1 SIP and 2 Locals) are then triggered by outgoing spool file $> cat /var/spool/asterisk/outgoing/apicall.2999ab31-1370-40b3-b691-48fa5ede1186 Channel: Local/2999ab31-1370-40b3-b691-48fa5ede1186@api_ivr_leg1 Extension: 2999ab31-1370-40b3-b691-48fa5ede1186 WaitTime: 360 RetryTime: 5 MaxRetries: 0 Context: api_ivr_leg2 Priority: 1 Set: txnId=2999ab31-1370-40b3-b691-48fa5ede1186 [api_ivr_leg1] exten => _X.,1,agi(agi://127.0.0.1/dial) ; AGI EXEC GOTO attempt,1 exten => attempt,1,Dial(PJSIP/outgoing@kamailio,15,itb(api_ivr_leg1^callee_handler^1)) ; kamailio is used for distributing ; for executing MixMonitor on the SIP channel instead of Local exten => callee_handler,1,agi(agi://127.0.0.1/callee_predial) exten => callee_handler,n,Return() [api_ivr_leg2] ; script that query caller channel name and do the `EXEC BRIDGE` exten => _X.,1,agi(agi://127.0.0.1/dial) Note that some asterisk variables i used were interpreted for simplicity Actually I used above setup for merely all calls without a problem, the optimization mostly happens until a new client come to town, i can easily reproduce the issue with that client for gathering debug log but i'm unable to point out what caused it. I'm using Amazon Linux 2 Centos7 and asterisk 18.7.1. Regards By: Joshua C. Colp (jcolp) 2022-11-16 03:23:58.255-0600 Please try to come up with drop-in dialplan and AGI that reproduces this issue we can use. We have wasted quite a lot of time in the past trying to recreate an environment and setup and reproduce things based on details like you've provided, only to determine that further details and specifics were left out that inevitably allowed us to reproduce. That's not time we ever get back so when issues like this occur it is strongly preferred that the user actually provides what they've used that causes it. As well 18.7.1 is a year old version of Asterisk at this point, it's possible some change may have changed conditions for this issue and so this needs to be reproduced on the latest as well. By: Đặng Lợi (loidang) 2022-11-16 04:49:05.590-0600 Hi Joshua, noted on those, drop-in dialplan could be already found with VERBOSE log that contain the pbx.c. For the AGI log, i'll come back with the agi log enabled later. And will check with the latest tag to see if the issue persists. Thanks for responding quickly. By: Asterisk Team (asteriskteam) 2022-12-02 12:00:00.630-0600 Suspended due to lack of activity. This issue will be automatically re-opened if the reporter posts a comment. If you are not the reporter and would like this re-opened please create a new issue instead. If the new issue is related to this one a link will be created during the triage process. Further information on issue tracker usage can be found in the Asterisk Issue Guidlines [1]. [1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines |