Mixmonitor help

I have a problem passing answered extension value to wav2mp3 script. Can anybody help me?

exten => 1234,1,MixMonitor(file.wav|b|wav2mp3 ^{CDR(dstchannel)})
exten => 1234,2,Dial(SIP/500&SIP/501)

How do i know who answered call? 500 or 501? Does anybody have any idea how to do it?

Maybe I’m wrong or there’s much more simple way, but the first my idea is to use Dial macro:

exten => 1234,1,Dial(SIP/500&SIP/501||M(mixmonitorstartmacro))

Shame on me. i tried Dial M option earlier, but it seems i have done something wrong :open_mouth: Now everything works fine. Thank’s for advice :bulb:

Etheryting works, but i have another problem. After i use Dial Macro, call is recorded, but atfer attended trasfer recording stop.

exten => XXX,1,Dial(SIP/500&SIP/503,30,trM(mixin))

[macro-mixin]

exten => s,1,MixMonitor(file.wav||wav2mp3 ${CHANNEL:4:3})
exten => s,2,Set(AUDIOHOOK_INHERIT(MixMonitor)=yes)

Maybe there is another way to pass called channel value to mixmonitor command which will be executed when mix monitor recording stop?