PDA

Voir la version complète : extensions h, extension failed



stepatchin
22/12/2010, 10h53
bonjour a tous
Avec les deux extentions h et failed je voulais savoir si une personne ne repond pas a mon appel ou bien s'il décroche et racroche sans ecouter mon message et valider le IVR, alors j'ai mis les deux, et j'ai ajouté avec :


exten => h,1,Set(NUMECHEC=$[${NUMECHEC}+1]|g)
exten => failed,1,Set(NUMECHEC=$[${NUMECHEC}+1]|g)


Comme ca au bout de la 3eme fois (a la l'aide d'un gotoif), un rapport est envoyé à la direction.
Mais j'arrive pas :( . Dans ce test, je décroche pas, du coup c'est les deux extentions qui s'acctive et en plus l'incrémentation ne fonctionne pas :


-- Executing [failed@outboundmsg2:1] Set("OutgoingSpoolFailed", "NUMECHEC=|g") in new stack
-- Auto fallthrough, channel 'OutgoingSpoolFailed' status is 'UNKNOWN'
-- Executing [h@outboundmsg2:1] Set("OutgoingSpoolFailed", "NUMECHEC=|g") in new stack

Je ne sais pas trop pk cette façon ne marche pas

cedricscha
22/12/2010, 11h46
essaie de mettre des noop dans ton dialplan comme cela tu verras deja ce que contienne tes variables

stepatchin
22/12/2010, 11h54
j'ai mis des NoOp et ca donne ca :



-- Executing [h@outboundmsg2:1] Set("SIP/6000-00000024", "NUMECHEC=") in new stack
-- Executing [h@outboundmsg2:2] NoOp("SIP/6000-00000024", "") in new stack


Il n'y a rien dedant :( . Je doute du syntaxe de l'incrémentation que j'ai trouvé sur voip-info

cedricscha
22/12/2010, 11h58
il manquerai pas l'initialisation de ta variable par hasard ?

stepatchin
22/12/2010, 12h09
dans le extensions_custum, j'ai ajouté une partie global



[global]
NUMECHEC=0


Ca devrait suffir ?? ou bien je dois mettre ca dans le fichier extensions.conf ??

cedricscha
22/12/2010, 12h51
essaie deja en ecrivant juste, cela fonctionnera mieux.....



dans le extensions_custum, j'ai ajouté une partie global



[globals]
NUMECHEC=0


Ca devrait suffir ?? ou bien je dois mettre ca dans le fichier extensions.conf ??

ensuite fais un test avec un noop avant toutes autres opérations, pour voir si cela à été pris en compte.

stepatchin
22/12/2010, 13h01
c bizzare le "s" aprés global, mais bon j'ai essayé et ca na rien donné



-- Attempting call on SIP/6000 for s@outboundmsg2:1 (Retry 1)
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
-- Executing [failed@outboundmsg2:1] Set("OutgoingSpoolFailed", "NUMECHEC=") in new stack
-- Executing [failed@outboundmsg2:2] NoOp("OutgoingSpoolFailed", "") in new stack
-- Auto fallthrough, channel 'OutgoingSpoolFailed' status is 'UNKNOWN'


Je voulais savoir aussi pk l'extension h fonctionne alors que le destinataire n'a pas décrocher ??

cedricscha
22/12/2010, 13h09
c bizzare le "s" aprés global, mais bon j'ai essayé et ca na rien donné



-- Attempting call on SIP/6000 for s@outboundmsg2:1 (Retry 1)
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
-- Executing [failed@outboundmsg2:1] Set("OutgoingSpoolFailed", "NUMECHEC=") in new stack
-- Executing [failed@outboundmsg2:2] NoOp("OutgoingSpoolFailed", "") in new stack
-- Auto fallthrough, channel 'OutgoingSpoolFailed' status is 'UNKNOWN'


Je voulais savoir aussi pk l'extension h fonctionne alors que le destinataire n'a pas décrocher ??


selon l'extrait que tu donne, ce n'est pas h qui s'execute, mais failed.

fais voir un core show globals


essaie de déclarer ta variable juste avant l'opération, fais des tests avec diverses variables et des noop.

pour le globals voir ici (http://www.voip-info.org/wiki/view/Asterisk+Dialplan+Globals)

stepatchin
22/12/2010, 14h04
Merci pour le lien pour globals, mais la commande c pas plutot "dialplan show globals" ???
j'ai fais des modifications suivantes pour deux tentatives la premiere j'ai pas repondu et la deuxieme j'ai racroché avant le IVR :


exten => h,1,SetGlobalVar(NUMECHEC=0)
exten => h,n,NoOp(${NUMECHEC})
exten => failed,n,NoOp(${NUMECHEC})



-- Attempting call on SIP/6000 for s@outboundmsg2:1 (Retry 1)
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
-- Attempting call on SIP/6000 for s@outboundmsg2:1 (Retry 2)
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
-- Executing [s@outboundmsg2:1] Set("SIP/6000-00000029", "TIMEOUT(digit)=5") in new stack
-- Digit timeout set to 5.000
-- Executing [s@outboundmsg2:2] Set("SIP/6000-00000029", "TIMEOUT(response)=10") in new stack
-- Response timeout set to 10.000
-- Executing [s@outboundmsg2:3] Answer("SIP/6000-00000029", "") in new stack
-- Executing [s@outboundmsg2:4] Wait("SIP/6000-00000029", "1") in new stack
== Spawn extension (outboundmsg2, s, 4) exited non-zero on 'SIP/6000-00000029'
== Spawn extension (outboundmsg2, h, 1) exited non-zero on 'SIP/6000-00000029'


et le dialplan show globals


localhost*CLI> dialplan show globals
FORCEDOUTCID_1=
OUTKEEPCID_1=
OUTDISABLE_1=off
OUTPREFIX_1=
OUTFAIL_1=
OUTMAXCHANS_1=
OUTCID_1=
OUT_1=DAHDI/g0
ASTCHANDAHDI=1
ASTVERSION=1.6.2.14
AMPDBPASS=fpbx
AMPDBUSER=freepbx
AMPDBNAME=asterisk
AMPDBHOST=localhost
AMPDBENGINE=mysql
AMPMGRPASS=amp111
AMPMGRUSER=admin
CWINUSEBUSY=true
ASTLOGDIR=/var/log/asterisk
ASTRUNDIR=/var/run/asterisk
ASTSPOOLDIR=/var/spool/asterisk
ASTAGIDIR=/var/lib/asterisk/agi-bin
ASTVARLIBDIR=/var/lib/asterisk
ASTMODDIR=/usr/lib/asterisk/modules
ASTETCDIR=/etc/asterisk
MIXMON_POST=
MIXMON_DIR=
MIXMON_FORMAT=wav
TRANSFER_CONTEXT=from-internal-xfer
VMX_LOOPS=1
VMX_REPEAT=1
VMX_TIMEOUT=2
VMX_OPTS_DOVM=
VMX_OPTS_LOOP=
VMX_OPTS_TIMEOUT=
VMX_LOOPDEST_PRI=1
VMX_LOOPDEST_EXT=dovm
VMX_LOOPDEST_CONTEXT=
VMX_TIMEDEST_PRI=1
VMX_TIMEDEST_EXT=dovm
VMX_TIMEDEST_CONTEXT=
VMX_PRI=1
VMX_CONTEXT=from-internal
ALLOW_SIP_ANON=no
TONEZONE=us
TIMEFORMAT=kM
VM_DDTYPE=u
VM_GAIN=
VM_OPTS=
VM_PREFIX=*
RECORDING_STATE=ENABLED
DIALOUTIDS=1
DIRECTORY_OPTS=
REGDAYS=mon-fri
REGTIME=7:55-17:05
IN_OVERRIDE=forcereghours
AFTER_INCOMING=
DIRECTORY=last
RINGTIMER=15
RECORDEXTEN=""
PARKNOTIFY=SIP/200
OPERATOR_XTN=
OPERATOR=
NULL=""
INCOMING=group-all
FAX_RX_FROM=noreply@mydomain.tld
FAX_RX_EMAIL=noreply@mydomain.tld
FAX_RX=system
FAX=
DIAL_OUT=9
TRUNK_OPTIONS=
DIAL_OPTIONS=tr
CALLFILENAME=""
INTERCOMCODE=nointercom



ca na pas marché, je sais pa vraiment comment je vais m'ensortir avec ca

cedricscha
22/12/2010, 14h22
non, c'est bien un core show globals.

ensuite :

si je mets une variable dans le contexte globals, lorsque je check avec core show globals elle apparait.

essaie donc déjà comme cela. et valide que cela fonctionne

stepatchin
22/12/2010, 14h30
j'ai bien une partie globals dans l'extensions_custum, je reload asterisk, et dés que je lance core show globals ca donne ca :



localhost*CLI> core show globals
No such command 'core show globals' (type 'core show help core show globals' for other possible commands)

cedricscha
22/12/2010, 14h37
ben alors la.....

perso, quand je lance la commande, j'ai ce résultat-ci :


*CLI> core show globals
XIVO_GROUP_MEMBER_SUBROUTINE=xivo-subrfeatures-groupmember
.../...
XIVO_AGENTBYUSERID_41=9003

-- 27 variables


si tu fais de l'autocompletion dans la CLI ? cela ne te trouve pas la commande ?

stepatchin
22/12/2010, 14h43
j'ai que ca :



ocalhost*CLI> core show
application applications calls channel channels
channeltype channeltypes codec codecs config
file function functions help hint
hints image license profile settings
switches sysinfo taskprocessors threads translation
uptime version warranty


S'il y a d'autres moyens pour incrémenter une variable si le correspendant ne repond pas a mon auto call ou qu'il récroche avant le choix, je vais changer, perso j'ai trouver que ca

cedricscha
22/12/2010, 14h57
ben moi j'ai cela :


*CLI> core show
application applications audio channel channels channeltype channeltypes codec
codecs config device2extenstate file function functions globals hints
image license profile switches threads translation uptime version
video warranty


surement la version de l'asterisk qui change..... tu dois etre en 1.6, j'en ai pas sous la main pour tester.

Pour ton probleme si tu ne trouve pas le moyen de rajouter une variable dans le contexte globals, tu peux aussi le faire avec la base de donnee d'asterisk.

stepatchin
22/12/2010, 15h02
si ca peut marcher, base de donnée ou non , l'essenciel est que je puisse comptabiliser les échecs et renvoyer un rapport a la direction, comme ca quelque'un va se faire tapper sur les doigts
sinon pour la base de données, je fais un truc comme ca



exten => h,1,MYSQL(Connect connid localhost login password db)
exten => h,2,MYSQL(Query resultid ${connid} UPDATE liste SET reponse='3' WHERE numero='${CDR(accountcode)}'
exten => failed,1,MYSQL(Connect connid localhost login password db)
exten => failed,2,MYSQL(Query resultid ${connid} UPDATE liste SET reponse='3' WHERE numero='${CDR(accountcode)}'


?????????????

stepatchin
22/12/2010, 15h05
Sinon je peux toujours mettre a jour asterisk pour passer du 1.6.2 au 1.8 ??

cedricscha
22/12/2010, 15h18
en l'occurance je suis en 1.4......

tu peux faire deja qqch comme cela :




exten = 1234,1,NoOp(Test Database Asterisk)
exten = 1234,n,Set(DB(Echec/Appel)=0)
exten = 1234,n,NoOp(Valeur Database = ${DB(Echec/Appel)})
exten = 1234,n(Boucle),Set(DB(Echec/Appel)= $[${DB(Echec/Appel)} + 1])
exten = 1234,n,NoOp(Valeur Database = ${DB(Echec/Appel)})
exten = 1234,n,GotoIf($[${DB(Echec/Appel)} = 3]?Suite:Boucle)
exten = 1234,n(suite),NoOp(Fin du Test = ${DB(Echec/Appel)})

stepatchin
22/12/2010, 15h18
falait peu etre ajouter la variable global que je voulais dans globals_custum.conf ??

cedricscha
22/12/2010, 15h19
Peut etre, test et tu verras bien....

stepatchin
22/12/2010, 15h32
j'ai essaye le fichier globals_custum mais ca na pas marché
sinon j'ai essayer ton dialplan et ca donne ca



-- Attempting call on SIP/6000 for s@outboundmsg2:1 (Retry 2)
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
-- Executing [failed@outboundmsg2:1] NoOp("OutgoingSpoolFailed", "Test Database Asterisk") in new stack
-- Executing [failed@outboundmsg2:2] Set("OutgoingSpoolFailed", "DB(Echec/Appel)=0") in new stack
-- Executing [failed@outboundmsg2:3] NoOp("OutgoingSpoolFailed", "Valeur Database = 0") in new stack
-- Executing [failed@outboundmsg2:4] Set("OutgoingSpoolFailed", "DB(Echec/Appel)= 1") in new stack
-- Executing [failed@outboundmsg2:5] NoOp("OutgoingSpoolFailed", "Valeur Database = 1") in new stack
-- Executing [failed@outboundmsg2:6] GotoIf("OutgoingSpoolFailed", "0?Suite:Boucle") in new stack
-- Goto (outboundmsg2,failed,4)
-- Executing [failed@outboundmsg2:4] Set("OutgoingSpoolFailed", "DB(Echec/Appel)= 2") in new stack
-- Executing [failed@outboundmsg2:5] NoOp("OutgoingSpoolFailed", "Valeur Database = 2") in new stack
-- Executing [failed@outboundmsg2:6] GotoIf("OutgoingSpoolFailed", "0?Suite:Boucle") in new stack
-- Goto (outboundmsg2,failed,4)
-- Executing [failed@outboundmsg2:4] Set("OutgoingSpoolFailed", "DB(Echec/Appel)= 3") in new stack
-- Executing [failed@outboundmsg2:5] NoOp("OutgoingSpoolFailed", "Valeur Database = 3") in new stack
-- Executing [failed@outboundmsg2:6] GotoIf("OutgoingSpoolFailed", "1?Suite:Boucle") in new stack
== Spawn extension (outboundmsg2, failed, 6) exited non-zero on 'OutgoingSpoolFailed'


l'incrémentation se fait sur un seul appel, je vais essayer de changer ca

stepatchin
22/12/2010, 15h38
J'ai essayer de faire un truc plus simple tout bete meme, genre



exten = h, i, system(echo -e "echec")
exten = failed, i, system(echo -e "echec")

et aprés dans le script principal je compte le nombre d'echec et au bout du troisieme arreter tout et renvoyer le rapport
mais si je fais un test pour une personne qui décroche pas j'ai deux echec au lieu d'un seul, comme si l'extension h execute sa commande alors qu'il y a pas de raccrochage

cedricscha
22/12/2010, 16h32
Y'a forcement un hangup, sinon ton appel ne ferait que sonner et ne raccrocherai jamais.....

stepatchin
22/12/2010, 16h37
bah dans la fichier .call



echo "Channel: SIP/6000"> $name_file
echo "MaxRetries: 2">> $name_file
echo "RetryTime: 10">> $name_file
echo "WaitTime: 30">> $name_file
echo "Context: outboundmsg1">> $name_file
echo "Extension: s">> $name_file
echo "Priority: 1">> $name_file
echo "Set: Mavariable=$2">> $name_file

J'ai mis des limites pour la sonnerie "WaitTime" du coup il sonne 30 secondes puis racroche.

stepatchin
24/12/2010, 14h17
Y'a forcement un hangup, sinon ton appel ne ferait que sonner et ne raccrocherai jamais.....

j'ai contaté ca après plusieurs test :
si j'écris seulement ca à la fin du contexte


exten => h,1,system(echo -e "resultat : Déplacement refusé" >> /tmp/ConvertFile/retour.txt)

et que je ne répond pas a un appel, ca donne ca . Trois tentatives d'appel non aboutit et l'extension h ne s'est pas acctiver


-- Attempting call on SIP/6000 for s@outboundmsg1:1 (Retry 1)
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
-- Attempting call on SIP/6000 for s@outboundmsg1:1 (Retry 2)
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
-- Attempting call on SIP/6000 for s@outboundmsg1:1 (Retry 3)
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5

alors que si je rajoute une extension Failed


exten => h,1,system(echo -e "resultat : Déplacement refusé" >> /tmp/ConvertFile/retour.txt)
exten => failed,1,system(echo -e "resultat : Déplacement refusé" >> /tmp/ConvertFile/retour.txt)

les deux extensions s'active pour appel non aboutit


-- Attempting call on SIP/6000 for s@outboundmsg1:1 (Retry 1)
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
-- Executing [failed@outboundmsg1:1] System("OutgoingSpoolFailed", "echo -e "resultat : Déplacement refusé" >> /tmp/ConvertFile/retour.txt") in new stack
-- Auto fallthrough, channel 'OutgoingSpoolFailed' status is 'UNKNOWN'
-- Executing [h@outboundmsg1:1] System("OutgoingSpoolFailed", "echo -e "resultat : Déplacement refusé" >> /tmp/ConvertFile/retour.txt") in new stack


Je comprend pas , l'extension h s'active comme elle veut ?????