[asterisk-users] ${UNIQUEID} variable and queue log issues on 1.4.22

Miguel Molina
Wed, 25 Mar 2009 00:39:30 -0000

Hello list,

I don't know if anybody faced this issue, but I finally found a
workaround. I am using an external program with an AMI connection to
originate outbound calls to Local/ channels, and on the dialplan context
I dial outside with the corresponding trunk according to the prefix of
the dialed number. The problem here was CDR, more precisely the
uniqueid. Reading these mail lists I learned that when a Local channel
finds a Dial instruction on the dialplan, and when the new requested
channel is answered then a masquerading begins, so the new dialed
channel becomes the active and the Local/ one becomes inactive as a
<zombie>. This was putting problems for me because when I record calls,
I use the following sentence:

exten => s,n,MixMonitor(${UNIQUEID}.gsm,b)

Instead of the workarounded right one for me:

exten => s,n,MixMonitor(${CDR(uniqueid)}.gsm,b)

Does anyone know why the ${UNIQUEID} variable is not updated on the
masquerading process while ${CDR(uniqueid)} is? Is this a bug or is a
correct behavior?

I faced another issue too, when the answered call gets queued, the queue
log results in this:

1237931601|1237931598.374076|prueba_outbound|NONE|ENTERQUEUE||3555555
1237931601|1237931598.374076|prueba_outbound|Agent/1000|CONNECT|0|1237931601.374079
1237931601|1237931598.374076|prueba_outbound|Agent/1000|TRANSFER|s|marcador-prueba_outbound|0|0

This queue log behavior renders the information unusable, because the
queued call could not be tracked anymore. The dialplan was this:

[marcador-prueba_outbound]
exten => s,1,Answer()
exten => s,n,MixMonitor(${CDR(uniqueid)}.gsm,b)
exten => s,n,Queue(prueba_outbound,ht)
exten => s,n,Hangup()

So I introduced a little Wait() to help asterisk finish the masquerading
process before queueing the call, to the bogus transfer event does not
occur inside the queue application:

[outbound-context]
exten => s,1,Answer()
*exten => s,n,Wait(0.5) ;(WORKAROUND FOR QUEUE_LOG BUG)*
exten => s,n,MixMonitor(${CDR(uniqueid)}.gsm,b)
exten => s,n,Queue(prueba_outbound,ht)
exten => s,n,Hangup()

This produces the correct events in the queue log:

1237932417|1237932415.374509|prueba_outbound|NONE|ENTERQUEUE||53555555
1237932417|1237932415.374509|prueba_outbound|Agent/1000|CONNECT|0|1237932417.374512
1237932424|1237932415.374509|prueba_outbound|Agent/1000|COMPLETEAGENT|0|7|1

This kind of problems seems very weird to me. Should I post bug notes
about this issues?

Any comments welcome.

Thanks in advance,

--
Ing. Miguel Molina
Grupo de Tecnolog?a
Millenium Phone Center
PBX: (+57 1)6500800 ext. 1201
Fax: (+57 1)6500816
M?vil: (+57)3138873587

-------------- next part --------------
An HTML attachment was scrubbed...