[asterisk-dev] Problems with MixMonitor not ending when call hungup

John Lange john at johnlange.ca
Wed Jun 4 10:41:32 CDT 2008


We have a problem where we are trying to rename a MixMonitor file at the
end of a queue call to reflect DID of the agent who answered the call.

The problem is, the MixMonitor file is not closed when the call is
hungup, rather it stays open until all of the "h" extensions are
finished. Even with an explicit call to StopMixMonitor the file remains
open.

The dialplan looks like this:

exten => s,1,Set(MONITOR_FILENAME=Q_${CDR(src)}_${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)})
exten => s,n,Queue(acctsmgmt|ti||||queue-mgmt)
exten => h,1,StopMixMonitor()
exten => h,2,DEADAGI(queue-mgmt) ; AGENTDID is set in the agi script
exten => h,3,Set(RECFILE=Q${CDR(src)}_${AGENTDID}_${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}.WAV)
exten => h,4,System(/bin/mv ${MONITOR_FILENAME}.WAV ${RECFILE})

Here is the console log.

  == Spawn extension (acctsmgmt, s, 2) exited non-zero on 'Zap/2-1'
    -- Executing [h at acctsmgmt:1] StopMixMonitor("Zap/2-1", "") in new stack
    -- Executing [h at acctsmgmt:2] DeadAGI("Zap/2-1", "queue-mgmt") in new stack
    -- Launched AGI Script /var/lib/asterisk/agi-bin/queue-mgmt
    -- AGI Script queue-mgmt completed, returning 0
    -- Executing [h at acctsmgmt:3] Set("Zap/2-1", "RECFILE=Q3060000000_2041111111_20080604-102150.WAV") in new stack
    -- Executing [h at acctsmgmt:4] System("Zap/2-1", "/bin/mv Q_3060000000_20080604-101955.WAV Q3060000000_2041111111_20080604-102150.WAV") in new stack
  == End MixMonitor Recording Zap/2-1
    -- Hungup 'Zap/2-1'

As you can see, the StopMixMonitor command doesn't end recording and the
"== End MixMonitor Recording Zap/2-1" doesn't happen until all the "h"
extensions are completed.

Shouldn't "End MixMonitor" be called before the first "h" extension?

Is there a reason why this is done this way and is there a workaround?

-- 
John Lange
www.johnlange.ca





More information about the asterisk-dev mailing list