Hi, im trying to prevent asterisk from sending SIP 200 OK when call is recognized as machine/robot. I made it so call goes to test-in context and creates local channel so caller side still remains in ringing status while callee side can pickup phone and AMD can perform its test. It determined that it’s a machine (no SIP 200 OK reached callee side) until when i execute Hangup(34) it sends SIP 200 OK to callee side (miliseconds before BYE). How to prevent it? I want to send SIP 503 or 603 when call is detected as machine.
[test-in]
exten => _+[123456789]X.,1,Verbose(1,----->KPT in: exten: ${EXTEN})
same => n,Dial(Local/${EXTEN}@amd-check,30) ; Dial the Local channel
same => n,Hangup()
exten => _[123456789]X.,1,Verbose(1,----->KPT in: exten: ${EXTEN})
same => n,Dial(Local/${EXTEN}@amd-check,30) ; Dial the Local channel
same => n,Hangup()
[amd-check]
exten => _+[123456789]X.,1,NoOp(Intermediary context for AMD)
same => n,Dial(PJSIP/KPT${EXTEN}@Opensips_5060,30,U(amd-handler^s^1)) ; Dial the callee and handle with amd-handler on answer
same => n,Return()
exten => _[123456789]X.,1,NoOp(Intermediary context for AMD)
same => n,Dial(PJSIP/KPT${EXTEN}@Opensips_5060,30,U(amd-handler^s^1)) ; Dial the callee and handle with amd-handler on answer
same => n,Return()
[amd-handler]
exten => s,1,NoOp(Call answered, performing AMD)
same => n,AMD() ; Run Answering Machine Detection
same => n,GotoIf($[${AMDSTATUS}=HUMAN]?human:machine)
same => n(machine),Verbose(1, ${ARG1} We've got a machine detected...!)
same => n,Hangup(34)
same => n,Return()
same => n(human),Verbose(1, ${ARG1} We've got a human on the line!)
same => n,Bridge() ; Bridge the intermediary call to the original caller
same => n,Return()