Potential bug in agi_VDAD_local_optimize.agi

Discussions about development of VICIDIAL and astGUIclient

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

Potential bug in agi_VDAD_local_optimize.agi

Postby kolian » Tue Jul 13, 2021 12:17 am

I had Answered calls dropped by agi_VDAD_local_optimize.agi. I found a problem and a quick solution.

We are chaining providers in dial plan like that

exten => _91NXXNXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _91NXXNXXXXXX,n,Dial(SIP/provider1/${EXTEN:1},60,tTo)
exten => _91NXXNXXXXXX,n,Dial(SIP/provider2/${EXTEN:1},60,tTo)

I'm not sure if its a correct way or its not recommended with vicidial. Nevertheless, if provider1 fails and call answered by provider2 the agi_VDAD_local_optimize.agi will drop the call due to wrong channel picked by query:

# find the local channel's real channel
my $stmtA = "SELECT dest_channel FROM $cid_channels_recent where (caller_id_name = '$cid_name' or connected_line_name = '$connected_line_name' or caller_id_name = '$connected_line_name' or connected_line_name = '$cid_name') and ( linkedid = '$uniqueid' or dest_uniqueid = '$uniqueid' or uniqueid = '$uniqueid') and call_date > '$SQL2mindate'";

since SIP/provider1 will be in the $cid_channels_recent at earlier time then SIP/provider2 the script will pick the wrong (NON EXISTENT NOW) channel to redirect the call.

easy fix would be to modify query appending 'order by call_date desc' so the LATEST used channel will be picked.

this is
Last Changed Author: mattf
Last Changed Rev: 3478
Last Changed Date: 2021-07-07 18:59:24 -0400 (mié, 07 jul 2021)

Thank you
kolian
 
Posts: 6
Joined: Sat May 15, 2021 1:57 pm

Re: Potential bug in agi_VDAD_local_optimize.agi

Postby mflorell » Tue Jul 13, 2021 6:58 am

With this dialplan entry, you are placing your phone calls twice. Doing this will result in inconsistent logging as well as the issues you are experiencing. If you need to use a failover carrier setup, I would recommend using OpenSIPs instead, since that is what it was designed to do on a conditional basis(Congestion, no-routes, etc...).
mflorell
Site Admin
 
Posts: 17996
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: Potential bug in agi_VDAD_local_optimize.agi

Postby kolian » Tue Jul 13, 2021 4:05 pm

I think it will only call second carrier if CHANNOAVAIL, CONGESTION or BUSY. Thank you for Opensip suggestion, I'm going to look into this but I think its quite an undertaking to set it up.
kolian
 
Posts: 6
Joined: Sat May 15, 2021 1:57 pm


Return to Development

Who is online

Users browsing this forum: No registered users and 4 guests