script to kick meet channel with one part ( case use on-hook

Any and all non-support discussions

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

script to kick meet channel with one part ( case use on-hook

Postby berrayahkamel » Sat Aug 07, 2021 2:44 pm

Hi
unfortenly if you use on-hook in order the have phone ring when receive call we must hangup call both time : in agent interface and in the softphone ( or webphone ) , if you mised you can"t rercive call correctly ( no ringing corretly ut you receive as a seconde call )

so after many reseach I can't find a way , so I creat a small and easy script in perl to kill all meet channels after the channels be singl ( one part ) for more 5 seconde , you can change the script for your way , juts one thing if you parke the call you lost it ( bacause the park call put the call in meet with one part )

I put the script in crontab to execute every minute but in the script we have loop every seconde to check if wehave a meet with singl chanel .

below the script name : meetkick.pl

#!/usr/bin/perl

print "hello script done by kamel.berrayah@gmail.com \n";

# asterisk -rx"meetme list " | grep 0001 | awk '{print $1}'
# you can use : watch -n 1 perl meetkick.pl or put it in crontab

for($i=1;$i<=60;$i++){


print `/usr/sbin/asterisk -rx'meetme list ' ` . "\n";
$resultat = `/usr/sbin/asterisk -rx'meetme list ' | grep 0001 `;


my @lignes = split /\n/, $resultat;

foreach my $uneLigne (@lignes) {

#print "$uneLigne\n";


$uneLigne=~ tr/ //s; # delete the double spaces

my ( $meetid ,$Parties , $Marked ,$time, $Creation, $Locked ) = split / /,$uneLigne ;

my ( $heure , $minute , $seconde ) = split /:/ ,$time ;

print "$uneLigne\n";

if($seconde > 5){
print "super a 5 \n";
$cmd = "/usr/sbin/asterisk -rx'meetme kick " . $meetid . " all '" ;
system($cmd) ;
} # fin if



}# fin de la boucle - end the loop lignes

sleep(1);

} # fin de la grande boucle execution chaque seconde / end the big loop ( every seconde )



------------

in crontab add

### kill singel conference
* * * * * /usr/bin/perl /usr/share/astguiclient/meetkick.pl

enjoy : :D :D :D :D :D :D
berrayahkamel
 
Posts: 10
Joined: Tue Apr 21, 2020 3:22 pm

Re: script to kick meet channel with one part ( case use on-

Postby williamconley » Thu Aug 26, 2021 6:36 pm

you appear to be using perl to execute bash scripts instead of just running bash commands. Interesting approach. I generally do the same ... but with php. lol

While this approach may get close to resolving the issue, it could still leave some calls in the lurch, as it were, and generate a call during that "script sleep" time.

Perhaps you should consider altering the Vicidial OnHook routine to detect if the agent is still on the line, and if so just drop the call into the agent's session instead.

Admittedly, this would remove the "choice" to reject a call by merely not answering it.

Next up: find the routine that runs when the client hangs up (shows the "customer hung up" image on the agent screen) and terminate the agent call if the agent is an OnHook agent?

We played with this a bit during creation of a "Manual Dial for OnHook agents" feature for a client. But that puts you squarely in the Javascript/AJAX world. Sorry. 8-)

Although, the routine that sends the signal to the agent screen to change that image ... may be interceptable and used to kill the call in the vicidial_manager table pre-emptively, no waiting for Javascript.
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20018
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)


Return to General Discussion

Who is online

Users browsing this forum: Google [Bot] and 61 guests