asteriskamddialplan

Asterisk Dial Command with M or U option mute call


I'm trying to use AMD with a DAHDI trunk.

I put my macro on default Dial, but this mute the call.

How can i execute AMD?

If my code is correct, how can i enable sound (no muted call)?

thanks in advance.

[macro-amd-detect]
exten=> s,1,Answer()
exten=> s,n,NoOp("AMD Detect Invocado")
exten=> s,n,AMD()
exten=> s,n,NoOp(${AMDSTATUS})

[macro-dialout-trunk]
exten => s,n,Dial(${OUT_${DIAL_TRUNK}}/${OUTNUM},${TRUNK_RING_TIMER},M(amd-detect))

Solution

  • You should understand how asterisk channels works.

    It have two leg.

    One leg is calling one(A), other one(B) can go to dialplan and/or caller.

    When leg A reported answered, it go B and bridged

    What do in-call-macro. It delay bridging, instead execute your operations(yes, can be any including AMD). When operations ends it check status and bridge, unless you setuped exit variable MACRO_RESULT

    MACRO_RESULT - If set, this action will be taken after the macro finished executing.
    
        ABORT - Hangup both legs of the call
        CONGESTION - Behave as if line congestion was encountered
        BUSY - Behave as if a busy signal was encountered
        CONTINUE - Hangup the called party and allow the calling party to continue dialplan execution at the next priority
        GOTO:[[<CONTEXT>^]<EXTEN>^]<PRIORITY> - Transfer the call to the specified destination.
    

    So you have two options

    Most of diallers use second option, becuase it is simpler to monitor.

    You can read opensource diallers code like vicidial or wombat. You also can license someone core.

    PS There are REALLY alot of issues in write your own core.