From bcf34ec28a9070ae87bff95ce0c387ec7522d516 Mon Sep 17 00:00:00 2001 From: Sukru Senli Date: Thu, 4 Jul 2019 20:10:15 +0200 Subject: [PATCH] voice-client: adapt voice.asterisk to incoming calls ending up in call_line context --- voice-client/files/usr/libexec/rpcd/voice.asterisk | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/voice-client/files/usr/libexec/rpcd/voice.asterisk b/voice-client/files/usr/libexec/rpcd/voice.asterisk index f9f17635f..833623ab8 100755 --- a/voice-client/files/usr/libexec/rpcd/voice.asterisk +++ b/voice-client/files/usr/libexec/rpcd/voice.asterisk @@ -104,11 +104,13 @@ case "$1" in from="$(echo $line | cut -d',' -f2)" to="$(echo $line | cut -d',' -f3)" callok=0 - uci show voice_client | grep user | grep -wq "$from" && callok=1 - uci show voice_client | grep user | grep -wq "$to" && callok=1 + uci show voice_client | grep user | grep -wq "$from\|$to" && callok=1 [ $callok -eq 0 ] && continue account="$(echo $line | cut -d',' -f4)" - uci show voice_client | grep sip_service_provider | grep -wq "$account" || continue + actok=0 + uci show voice_client | grep sip_service_provider | grep -wq "$account" && actok=1 + [ "$account" == "call_line" ] && actok=1 + [ $actok -eq 0 ] && continue timestart="$(echo $line | awk -F',' '{print $(NF-8)}')" timend="$(echo $line | awk -F',' '{print $(NF-6)}')" startdate=$(date -u -d "$timestart" +"%s")