URA de Pesquisa de Satisfacao

Ola, preciso de uma ajuda, estou tentando implementar uma ura de pesquisa de satisfação, fiz toda criação se disco direto funciona mas no problema esta que não consigo transferir nada para essa ura.Segue a configuração que usei dentro de /etc/asterisk/extensions_custom.conf

exten = 1001,1,Goto(pesquisa,s,1)

[pesquisa]
exten =_s,1,Set(TIMEOUT(digit)=2)
exten =_s,n,Set(TIMEOUT(response)=4)
exten =_s,n,NoOp( Entrada na PESQUISA: DE [${CALLERID(num)}] no CANAL [${CHANNEL}] no CONTEXTO [${CONTEXT}] DATA [${STRFTIME(${EPOCH},%d%m%Y-%H%M%S)}] )
exten =_s,n,wait(1)
exten =_s,n(pergunta1),Read(RESP1,BemVindo,1,)
exten =_s,n,Gotoif($["${RESP1}" : “[1-3]”]?valido:invalido)
exten =_s,n(valido),SayDigits(${RESP1})
exten =_s,n,Goto(pergunta2)
exten =_s,n(invalido),NoOP( ----------\\\\\ Cliente Digitou Numero invalido //////////---------- )
exten =_s,n,PlayBack(invalid)
exten =_s,n,Goto(pergunta1)

exten =_s,n(pergunta2),Read(RESP2,BemVindo,1,)
exten =_s,n,Gotoif($["${RESP2}" : “[1-3]”]?valido2:invalido2)
exten =_s,n(valido2),SayDigits(${RESP2})
exten =_s,n,Goto(mysql)
exten =_s,n(invalido2),NoOP( ----------\\\\\ Cliente Digitou Numero invalido //////////---------- )
exten =_s,n,PlayBack(invalid)
exten =_s,n,Goto(pergunta2)

exten =_s,n(mysql),MYSQL(Connect connid 127.0.0.1 ****** ******** asteriskcdrdb)
exten =_s,n,MYSQL(Query resultid ${connid} INSERT INTO pesquisa (resposta1, resposta2, data, codigo, operador) VALUES (${RESP1},${RESP2},Now(),${UNIQUEID},${CALLERID(num)}))
exten =_s,n,MYSQL(Disconnect ${connid})
exten =_s,n,Playback(BemVindo)
exten =_s,n,Hangup

Hello @manzke89,

Remove the _ from the s extension.
Furthermore, I would have replace the s extension with the _X. extension.

Thank you,

Daniel Friedman
Trixton LTD.

Several problems:

  1. Dialplan format is wrong, you need => not =
  2. You probably need to change _s to just an s. Do not change to _X.
  3. Remove the exten = 1001 line and add a Custom Destination with a Goto String of pesquisa,s,1.
  4. If you need a dialable feature code, create a Misc Application with 1001 to the custom destination.
2 Likes

Feito as alteracoes, mesmo asism continua com o mesmo problema:

[2017-10-30 14:32:31] VERBOSE[1634][C-000002e3] res_agi.c: Launched AGI Script /var/lib/asterisk/agi-bin/attendedtransfer-rec-restart.php
[2017-10-30 14:32:32] VERBOSE[1634][C-000002e3] res_agi.c: <SIP/201-000003d4>AGI Script attendedtransfer-rec-restart.php completed, returning 0
[2017-10-30 14:32:32] VERBOSE[1634][C-000002e3] pbx.c: Executing [[email protected]:6] Hangup(“SIP/201-000003d4”, “”) in new stack
[2017-10-30 14:32:32] VERBOSE[1634][C-000002e3] app_macro.c: Spawn extension (macro-hangupcall, s, 6) exited non-zero on ‘SIP/201-000003d4’ in macro ‘hangupcall’

My problem is at the time of the transfer, direct dialing works normally.

Hello @manzke89,

When do you want to transfer the call to the survey?

Thank you,

Daniel Friedman
Trixton LTD.

At the end of the call

Ok a transferência funcionou. Agora estou com outro problema, não esta gravando o o ramal de quem transferiu a ligação.

Hello @manzke89,

You can use a hangup-handler to trigger your survey. Create a custom context that your calls will hit in order to register the hangup handler or add it to the macro-hangupcall-custom context.

An example for a hangup handler context:

[cdr-hangup-handler]
exten => s,1,Goto(pesquisa,s,1)
exten => s,n,Return()

How to set the hangup handler event (for internal calls or outbound calls):

[from-internal-custom]
exten => _X.,1,Set(CHANNEL(hangup_handler_push)=cdr-hangup-handler,s,1)

You can read more about hangup handlers here:
https://wiki.asterisk.org/wiki/display/AST/Hangup+Handlers

Thank you,

Daniel Friedman
Trixton LTD.

That’s thinking outside the box, attempting to interact with a caller after they hang up. Adding _X. to from-internal-custom is equally unwise.

Como posso passar essa informação?

Para informar o ramal de quem transferiu a ligação?