|
From: | Guillermo Tamborero - iProject |
Subject: | [Linphone-developers] Hotkeys to execute Shell / Bash commands Pause, Streaming, hang up, pick up |
Date: | Fri, 25 Oct 2013 16:42:23 +0200 |
User-agent: | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 |
Hi! I have been working on some scripts that I would like to share ;) We have done a LAMP CRM system + asterisk + linphonecsh commands. The Hotkeys to execute Shell / Bash commands are (works with icewm): Pick Up call, Hang up call, Swap between a Streaming running call and a Paused call. It could be great to publish these commands on linphone developers PAGE! These scripts are working incredible for us! Cheers, FILE: /home/.icewm/keys key "Ctrl+1" linphonecsh init key "Ctrl+2" linphonecsh register --host asterisk --username YOURUSERNAME --password YOURPASSWORD key "Ctrl+0" linphonecsh exit key "Ctrl+Up" /home/guillermo/pickup key "Ctrl+Down" /home/guillermo/hangup key "Ctrl+s" /home/guillermo/swap FILE: home/.icewm/startup linphonecsh init sleep 4 linphonecsh register --host asterisk --username YOURUSERNAME --password YOURPASSWORD FILE: home/pickup # Pickup calls linphonecsh linphonecsh generic calls | grep -E 'IncomingReceived' | awk '{ print $1 " " $5 " " $6 " " }' | tr -d '|' >hanguparchive # grep search incoming calls awk -v qt="'" '{ # Vars definition estado1=$2; id1=$1; system ("linphonecsh generic " qt "answer " id1 qt ); }' hanguparchive FILE: home/hangup # Hangup calls linphonecsh linphonecsh generic calls | grep -E 'StreamsRunning' | awk '{ print $1 " " $5 " " $6 " " }' | tr -d '|' >hangdownarchive awk -v qt="'" '{ # Vars definition estado1=$2; id1=$1; system ("linphonecsh generic " qt "terminate " id1 qt ); }' hangdownarchive FILE: home/swap # SWAP PAUSED and STREAMING CALLS linphonecsh generic calls | grep -E 'Paused|StreamsRunning' | awk '{ print $1 " " $5 " " $6 " " }' | tr -d '\n' | tr -d '|' >callsarchive awk -v qt="'" '{ # Var definitions (estado = status) estado1=$2; estado2=$4; id1=$1; id2=$3; # Si hay 2 llamadas activas: if ((estado1)&&(estado2)) { # case 1: status1 Active (or running) and 2 paused if ((estado1=="StreamsRunning")&&(estado2=="Paused")){ system ("linphonecsh generic " qt "pause " id1 qt ); #system ("sleep 0.4"); system ("linphonecsh generic " qt "resume " id2 qt ); } # case 2: status1 Paused and 2 Running if ((estado1=="Paused")&&(estado2=="StreamsRunning")){ system ("linphonecsh generic " qt "pause " id2 qt ); #system ("sleep 0.4"); system ("linphonecsh generic " qt "resume " id1 qt ); } # case 3: both calls in paused if ((estado1=="Paused")&&(estado2=="Paused")){ system ("linphonecsh generic " qt "resume " id1 qt ); } # case 4: both calls are active if ((estado1=="StreamsRunning")&&(estado2=="StreamsRunning")){ system ("linphonecsh generic " qt "pause " id2 qt ); } # Only one call running }else{ if (estado1=="Paused"){ system ("linphonecsh generic " qt "resume " id1 qt ); } if (estado1=="StreamsRunning"){ system ("linphonecsh generic " qt "pause " id1 qt ); } } }' callsarchive --
![]() |
linphonecsh hotkeys.zip
Description: Zip compressed data
[Prev in Thread] | Current Thread | [Next in Thread] |