Hello,
I’m new to Asterisk and I’m having trouble to manage an IVR for a survey after the hang up.
I have Asterisk 16.11.1 and FreePBX 15.0.16.75.
I managed to let it work when I set it as custom destination from FreePBX, but now I would like the following instructions should be executed when an operator hangs up:
[macro-survey]
exten => s,1,answer()
;this asks the first question (based on your recording) and stores them in variable
exten => s,n(question1),Read(answer1,enter-ext-of-person,1,1,2)
exten => s,n,GotoIf([ {answer1} < 4 ]?question2:question1)
;this asks the first question (based on your recording) and stores them in variable
exten => s,n(question2),Read(answer2,enter-ext-of-person,1,1,2)
exten => s,n,GotoIf([ {answer2} < 4 ]?finish:question1)
;this line puts the two answers together and separates them with a | symbol.
exten => s,n(finish),set(answer={answer1}|{answer2})
;this saves the answers into the CDR field of “userfield”
exten => s,n,Set(CDR(userfield)=${answer})
exten => s,n,hangup()
This context is saved into /etc/asterisk/extensions_override_freepbx.conf that should override the
/etc/asterisk/extensions_additional.conf behaviour.
I’ve tried to put the following into the [ext-local] dialplan:
exten => s,n,Set(CHANNEL(hangup_handler_push)=macro-survey,s,1);
or
exten => h,1,Goto(macro-survey,s,1)
But it doesn’t seem to work.
Can you help me? Thank you.