0

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.

1 Answers1

0

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";
  • 1
    Not sure what you got. You have asked to add Tt options - both not works in this example and M will work very different way too. You also can't provide context and application in one call, asterisk will chose single one random depend of builded version. – arheops Jan 19 '23 at 15:40
  • Sorry @arheops, my bad.. The mail option I wanted to put in was `Macro`, but I just copied/pasted and forgot to delete `Tt`. And about the context, I'll remove it, but it still working, luckily for me hahah Thank you – Rubens Gasparotto Filho Jan 25 '23 at 23:47