Page 1 of 1

In-Group Manual Dial bug

PostPosted: Wed Oct 30, 2019 5:16 pm
by dspaan
We are using the In-Group Manual Dial feature to call leads that have been called before to modify some data without actually calling the client.

This was working fine before until we updated to SVN 3029.

The weird thing is that this only seems to happen to certain users in combination with certain ingroups.
What happens is that the user goes to his call log, clicks a client that was called before, selects No-call dial (ENABLED) and selects an ingroup related to the campaign. When clicking Dial Now nothing happens, the agent gets stuck but seems to be INCALL and can only logout and back in again to continue.

When we make a copy of this user and try to repliacte the issue it works everytime without problems!

When add a different ingroup to the campaign and the problem users uses that ingroup to simulate the inbound call it works just fine.

So it looks like a combination of the user with a certain ingroup creates this problem. But i can't figure out which setting/feature could be causing this. I compared working ingroups vs not working ingroups but they are copies of eachother and all settings are the same. Even the user is copied but the copied user does not have these problems. Very strange! Any ideas?

Re: In-Group Manual Dial bug

PostPosted: Wed Oct 30, 2019 8:58 pm
by mflorell
Any errors in your Browser console when this happens?

Re: In-Group Manual Dial bug

PostPosted: Thu Oct 31, 2019 2:28 am
by dspaan
Hi Mat,

I see some errors but i do not think they are related. Also yesterday we kept getting inbound calls in the queue which would show up on top of the agent screen (red text) but didn't get to the agent. Today when i testing this is not happening anymore.

Image

Re: In-Group Manual Dial bug

PostPosted: Fri Nov 15, 2019 6:04 am
by airflux
Hi,
I'm having a similar problem but on an older version (svn 2659, Version 2.14b0.5).

When the agent try to do an in-group manual dial, sometimes works, sometimes not, in my case the key is the length of the In-Group ID.

In asterisk console the extension dialed (830588888...) appears to be truncated on the last part:

Code: Select all
[Nov 15 11:48:52]     -- Executing [830588888888888849980number-dialed@default:1] Answer("Local/830588888888888849980number-dialed@default-00000169;2", "") in new stack
[Nov 15 11:48:52]        > Channel Local/830588888888888849980number-dialed@default-00000169;1 was answered
[Nov 15 11:48:52]     -- Executing [8305888888888888090009*ingroup-id**1284924**number-dialed*6666*6666**1*860006@default:1] Answer("Local/830588888888888849980number-dialed@default-00000169;1", "") in new stack
[Nov 15 11:48:52]     -- Executing [8305888888888888090009*ingroup-id**1284924**number-dialed*6666*6666**1*860006@default:2] Wait("Local/830588888888888849980number-dialed@default-00000169;1", "0") in new stack
[Nov 15 11:48:52]     -- Executing [8305888888888888090009*ingroup-id**1284924**number-dialed*6666*6666**1*860006@default:3] Dial("Local/830588888888888849980number-dialed@default-00000169;1", "IAX2/ASTloop:iax-password@127.0.0.1:40569/90009*ingroup-id**1284924**number-dialed*6666*6666**1*860006,,To") in new stack


The Vicidial agent conference on the last part of the exten (8305888888888888090009*ingroup-id**1284924**number-dialed*6666*6666**1*860006@default:1) should be "8600065", but in this case is "860006", I suppose due to the max length of something. 9980, before number-dialed, is my dial prefix. With a shorter In-Group ID the problem disappears.

The max length of the exten "8305888888888888090009*ingroup-id**1284924**number-dialed*6666*6666**1*860006" seems to be 79 characters.

Edit#1
The originate command contains the full exten on cmd_line_b, so.. is asterisk truncating it?

Code: Select all
2019-11-15 12:08:18|/usr/share/astguiclient/AST_send_action_child.pl --PATHlogs=%2Fvar%2Flog%2Fastguiclient --telnet_host=172.16.76.17 --telnet_port=5038 --ASTmgrUSERNAME=cron --ASTmgrSECRET=SECRET_PWD --ASTmgrUSERNAMEsend=sendcron --man_id=2990231 --action=Originate --cmd_line_b=Exten%3A%208305888888888888090009%2AIN%5FGROUPID%2A%2A1284924%2A%2number_dialed%2A6666%2A6666%2A%2A1%2A8600065 --cmd_line_c=Context%3A%20default --cmd_line_d=Channel%3A%20Local%2F830588888888888849980number_dialed%40default --cmd_line_e=Priority%3A%201 --cmd_line_f=Callerid%3A%20%22Y1151208180001284924%22%20%3CDial-In-Group-CID%3E --cmd_line_g=Timeout%3A%2040000  Y1151208180001284924  |


I'll do some test on the lastest SVN version as soon as possible.

Edit #2.
The scary part. I think to have got the point.
In the channel.h source code https://github.com/asterisk/asterisk/blob/master/include/asterisk/channel.h#L135 there is the following directive:
#define AST_MAX_EXTENSION 80 /*!< Max length of an extension */
so the maximum extension length is 80 characters, 79 because the last is the string termination character.

On the last SVN version, the file vdc_db_query.php generates this long exten:
Code: Select all
$loop_ingroup_dial_prefix = '8305888888888888';
...
$Ndialstring = "$loop_ingroup_dial_prefix$dial_wait_seconds$Ndialstring";
...
$dial_ingroup_dialstring = "90009*$dial_ingroup" . "**$lead_id" . "**$agent_dialed_number" . "*$user" . "*$user" . "**1*$conf_exten";
$Ndialstring = "$loop_ingroup_dial_prefix$dial_wait_seconds$dial_ingroup_dialstring";

so, if all I suppose is correct, the workaround is to use short agent username and short in-group id to avoid to reach the max exten length limitation.
Editing the Vicidial code, maybe using a shorter $loop_ingroup_dial_prefix could help, now is 17 characters long ('8305888888888888').

Re: In-Group Manual Dial bug

PostPosted: Sun Nov 17, 2019 10:15 pm
by mflorell
This actually ended up being a lot simpler to fix than I thought it was going to be. I only had to modify the inbound AGI script to check the vicidial_manager table for the Originate command of the dial in-group call, and if the extension is longer in the vicidial_manager record, replace the extension that the AGI script sees from the channel and continue on.

Please upgrade to the latest svn_trunk revision(at least 3169) and let me know if this fixes your issue.

For the Issue Tracker ticket, go here:
http://www.vicidial.org/VICIDIALmantis/view.php?id=1193

Re: In-Group Manual Dial bug

PostPosted: Mon Nov 18, 2019 7:06 am
by airflux
Hi Matt,
now it works like a charm.

Thank you very much.

Re: In-Group Manual Dial bug

PostPosted: Mon Nov 18, 2019 9:42 am
by dspaan
Thanks airflux for finding the cause and thanks to Matt for fixing it in the SVN trunk!

Re: In-Group Manual Dial bug

PostPosted: Thu Nov 21, 2019 9:50 am
by airflux
Hi Matt,
I having new problems with in-group manual dial, depending on the agent username length again, but I'm not using the last SVN code, I've just patched my older agi-VDAD_ALL_inbound.agi script.
Weird things appening, sometime the agent doesn't listen the callee and there is a strange hangup (disposition page are not shown) on the GUI but the call is active on the callee, sometime the callee goes in a 3-way call with another agent.

Could be the query that choose the bad originate command for the CLOSER extension override while there are other agents doing manual dials?
Code: Select all
$stmtA = "SELECT cmd_line_b FROM vicidial_manager where callerid='$callerid' and action='Originate' and cmd_line_b LIKE \"Exten: 8305888888888888_90009%\" order by man_id desc limit 1

Re: In-Group Manual Dial bug

PostPosted: Thu Nov 21, 2019 10:29 am
by mflorell
Can you post the agiout logfile output for the calls that had issues?