From 790c1ab527cec6b3bf0ff50dad137ddc249fc87f Mon Sep 17 00:00:00 2001 From: Abel `00z' Camarillo <00z@the00z.org> Date: Wed, 25 Jun 2008 22:02:25 -0500 Subject: [PATCH] Optimized query, support for edificio by `nombre' extraction. --- csv_gen.sh | 109 ++++++++++++++++++++++++++++++++----------------------------- 1 file changed, 57 insertions(+), 52 deletions(-) rewrite csv_gen.sh (61%) diff --git a/csv_gen.sh b/csv_gen.sh dissimilarity index 61% index 1230b47..21fb5c2 100755 --- a/csv_gen.sh +++ b/csv_gen.sh @@ -1,52 +1,57 @@ -#!/bin/bash -# An script to generate a csv. -DEBUG='echo' -GET="/home/the00z/neuroservices/tarificador/get" -TMP=`getopt -o h --long help -- "$@"` - -eval set -- "$TMP" - -while true -do - case "$1" in - h|help) - echo "Ayuda." - exit 1 - ;; - --) - shift - break - ;; - esac -done - -if [ -z "$@" ] -then - echo "I need an argument at least to work" -fi - -for EDIFICIO in $@ -do - -eval 'time' "'$GET'" > "$EDIFICIO.csv" < "$EDIFICIO.csv" <edificio_extension.edificio_id and + edificio_extension.extension_id<=>extension.id and + extension.id<=>extension_llamada.extension_id and + extension_llamada.llamada_id<=>llamada.id + and llamada.d_context regexp '^(cs-|in|celu)' + and llamada.cuenta != '' + and llamada.disposition regexp '^answered' + and llamada.last_app regexp 'dial' + and llamada.d_context not regexp 'interno' + and llamada.bill_sec != '0' + and llamada.destino regexp '^9' + and extension.numero !='' + order + by llamada.start +END + + if [ "$?" != "0" ]; then exit "$?";fi +done -- 2.11.4.GIT