[HELP] Monitor() command & queue problem

Monitor command would record only the first few miliseconds of the conversation, and not the whole call (as if a hangup would occur just after the agent answers the call) if:

  1. There is a queue
  2. Agent logs in and is available at a certain extension
  3. The extension where the agent is available uses Monitor() command (that doesn’t work properly)

What could be the reason for that? (please see the attached conf files - I am using Asterisk 1.2):

Queue definition:

[AbraxasQueue]
strategy=roundrobin
wrapuptime=0
timeout=20
queue-thereare=queue-thereare
music=default
queue-reporthold=queue-reporthold
maxlen=0
queue-youarenext=queue-youarenext
queue-thankyou=queue-thankyou
periodic-announce=queue-periodic-announce 
queue-callswaiting=queue-callswaiting
retry=5
queue-lessthan=queue-less-than
queue-holdtime=queue-holdtime
announce-holdtime=yes
queue-seconds=queue-seconds
announce-frequency=60
queue-minutes=queue-minutes
autofill=yes
autopause=no
member => Agent/9000,0
member => ...

Extension at which the agents are available:

exten => _1000.,1,Answer()
exten => _1000.,n,Monitor(wav,${CALLERIDNUM}_${UNIQUEID}_${TIMESTAMP},mb)
exten => _1000.,n,Dial(SIP/To1000,20,tr)
exten => _1000.,n,StopMonitor()
exten => _1000.,n,HangUp()

Agents definition:

[general]
persistentagents=yes

[agents]
ackcall=no
wrapuptime=0
musiconhold => default

group=1
agent => 9000,,Abraxas Operater 0
agent => ...

Thanks for any suggestions one might have.

Could we get the output from a verbose CLI.

Of course. This is what happens (step by step) - the problematic part is in BOLD:

The beginning:

    -- Executing Answer("SIP/sip.abraxas.si-b7608c38", "") in new stack
    -- Executing PlayTones("SIP/sip.abraxas.si-b7608c38", "ring") in new stack
    -- Executing Wait("SIP/sip.abraxas.si-b7608c38", "5") in new stack
    -- Executing StopPlayTones("SIP/sip.abraxas.si-b7608c38", "") in new stack

Call enters the queue and goes to the first available agent:

    -- Executing Queue("SIP/sip.abraxas.si-b7608c38", "AbraxasQueue|tT|||240") in new stack
    -- Started music on hold, class 'default', on channel 'SIP/sip.abraxas.si-b7608c38'
    -- outgoing agentcall, to agent '9000', on 'Local/1000@to-sip-538c,1'
    -- Called Agent/9000
    -- Executing Answer("Local/1000@to-sip-538c,2", "") in new stack
    -- Agent/9000 answered SIP/sip.abraxas.si-b7608c38
    -- Stopped music on hold on SIP/sip.abraxas.si-b7608c38

Monitoring begins:

    -- Executing Monitor("Local/1000@to-sip-538c,2", "wav|blazziherl_1138868844.325_20060202-092724|mb") in new stack
    -- Executing Dial("Local/1000@to-sip-538c,2", "SIP/To1000|20|tr") in new stack
    -- Called To1000
    -- SIP/To1000-2976 is ringing

[b]Agent answers the call, but the extension gets spawn the next moment (client can still talk to the agent perfectly fine though) therefore the monitoring stops (but it shouldn’t!), eventhough the call is still active:

-- SIP/To1000-2976 answered Local/1000@to-sip-538c,2 == Spawn extension (to-sip, 1000, 3) exited non-zero on 'Local/1000@to-sip-538c,2' [/b]

A few minutes later the call really ends (as the agent/client hangs up):

  == Spawn extension (from-sip, 991, 5) exited non-zero on 'SIP/sip.abraxas.si-b7608c38'
    -- Unregistered SIP 'To1000'
    -- Registered SIP 'To1000' at 111.111.111.50 port 5060 expires 1800
    -- Saved useragent "WOSISIP 1.0" for peer To1000