I'm already making calls from file, but I want to put TtM(MyMacro)
dial options. The call file haves these properties:
$callFileOptions = "Channel: SIP/Algar_AMD/$phoneNumber
\nCallerid: $phoneNumber
\nMaxRetries: 0
\nRetryTime: 1
\nWaitTime: 30
\nContext: from-internal
\nExtension: $internalExtension
\nPriority: 1";
This configuration will make external call first and when answered it will be transferred to internal extension.
I've tried to change the Channel
property to SIP/Algar_AMD/$phoneNumber,300,TtM(MyMacro)
, SIP/Algar_AMD/$phoneNumber,,TtM(MyMacro)
and SIP/Algar_AMD/$phoneNumber|TtM(MyMacro)
, but to no avail.
MyMacro will execute the AMD application to detect machine/human answer.
Got it!
My macro at extensions_custom.conf is this
[macro-AsteriskMachineDetection]
exten => s,1,BackGround(en/silence/05);
same => n,AMD(3500,630,600,5000,110,50,5,750,5000);
same => n,NoOp(AMDSTATUS = ${AMDSTATUS} - NUMBER = ${CALLERID(number)} - CAUSE = ${AMDCAUSE});
same => n,GotoIf($[${AMDSTATUS}=MACHINE]?machine:human);
same => n(machine),Macro(hangupcall,);
same => n(human),Dial(Local/${EXT_DEST});
and I've changed the callfile configuration to this:
$callFileOptions = "Channel: SIP/Algar_AMD/$phoneNumber
\nCallerid: $phoneNumber
\nMaxRetries: 0
\nRetryTime: 1
\nWaitTime: 30
\nContext: from-internal
\nExtension: $internalExtension
\nSetvar: EXT_DEST=$internalExtension
\nApplication: Macro
\nData: AsteriskMachineDetection
\nPriority: 1";
Edit:
$callFileOptions = "Channel: SIP/Algar_AMD/$phoneNumber
\nCallerid: $phoneNumber
\nMaxRetries: 0
\nRetryTime: 1
\nWaitTime: 30
\nSetvar: EXT_DEST=$internalExtension
\nApplication: Macro
\nData: AsteriskMachineDetection
\nPriority: 1";