Projet

Général

Profil

Anomalie #1533

Mis à jour par François Poulain il y a plus de 7 ans

J'ai configuré l'appel à un script AGI dans le dialplan (à reporter pour chaque téléphone concerné)"



@@exten = 80,n,AGI(dtc.agi)



Puis le script suivant a été développé :



<pre>

#!/bin/bash



declare -a array

while read -e ARG && [ "$ARG" ] ; do

array=(` echo $ARG | sed -e 's/://'`)

export ${array[0]}="${array[1]}"

done



newcaller=$(echo $agi_callerid | sed -e 's/^0\([0-9]\{9\}\)$/33\1/g')

if test "$newcaller" != "$agi_callerid" ; then

agi_callerid=$newcaller

fi



callerid=$(grep ":$agi_callerid\$" /etc/asterisk/phone.csv | sed -e 's/:.*//g')



if test -z "$callerid" ; then

echo "SET CALLERID \"$agi_callerid\"<$agi_callerid>"

else

echo "SET CALLERID \"$callerid\"<$agi_callerid>"

fi



</pre>



Le fichier phone.csv contient une association clef/valeur entre nom et téléphone.

Retour