Queue recording calls filename

Greetings,

I’m trying to change the call recording filename, at the moment (and I think it’s the asterisk default) I have this:

What I’d like to know is hot to append the extension that answered that call. So I get to this:

  • First I’d like to ask if this is valid ext${CDR(dst)}
  • How can I override the default filename?

I tried to add this setting to various files, such as: extensions_custom.conf and also tried in extensions_override_freepbx.conf

[ext-queues-custom] exten => 569,n,Set(MONITOR_FILENAME=/var/spool/asterisk/monitor/ext${CDR(dst)}-q${EXTEN}-${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}-${UNIQUEID})

Then I did

Then

This was the output

  '569' =>          1. Macro(user-callerid|)                      [pbx_config]
                    2. Answer()                                   [pbx_config]
                    3. Set(__BLKVM_OVERRIDE=BLKVM/${EXTEN}/${CHANNEL}) [pbx_config]
                    4. Set(__BLKVM_BASE=${EXTEN})                 [pbx_config]
                    5. Set(DB(${BLKVM_OVERRIDE})=TRUE)            [pbx_config]
                    6. Set(_DIAL_OPTIONS=${DIAL_OPTIONS}M(auto-blkvm)) [pbx_config]
                    7. Set(__NODEST=${EXTEN})                     [pbx_config]
                    8. GotoIf($["foo${RGPREFIX}" = "foo"]?REPCID) [pbx_config]
                    9. GotoIf($["${RGPREFIX}" != "${CALLERID(name):0:${LEN(${RGPREFIX})}}"]?REPCID) [pbx_config]
                    10. Noop(Current RGPREFIX is ${RGPREFIX}....stripping from Caller ID) [pbx_config]
                    11. Set(CALLERID(name)=${CALLERID(name):${LEN(${RGPREFIX})}}) [pbx_config]
                    12. Set(_RGPREFIX=)                           [pbx_config]
     [REPCID]       13. Noop(CALLERID(name) is ${CALLERID(name)}) [pbx_config]
                    14. Set(_RGPREFIX=569:)                       [pbx_config]
                    15. Set(CALLERID(name)=${RGPREFIX}${CALLERID(name)}) [pbx_config]
                    16. Set(MONITOR_FILENAME=/var/spool/asterisk/monitor/q${EXTEN}-${STRFTIME(${EPOCH}||%Y%m%d-%H%M%S)}-${UNIQUEID}) [pbx_config]
                    17. Queue(569|t|||30)                         [pbx_config]
                    18. dbDel(${BLKVM_OVERRIDE})                  [pbx_config]
                    19. Set(__NODEST=)                            [pbx_config]
                    20. Goto(ext-queues|569|1)                    [pbx_config]
  '569*' =>         1. Macro(agent-add|569|)                      [pbx_config]
  '569**' =>        1. Macro(agent-del|569|569) [/code]

....

[code][ Context 'ext-queues-custom' created by 'pbx_config' ]
  '569' =>          -2. Set(MONITOR_FILENAME=/var/spool/asterisk/monitor/ext${CDR(dst)}-q${EXTEN}-${STRFTIME(${EPOCH}||%Y%m%d-%H%M%S)}-${UNIQUEID}) [pbx_config]
                    2. Set(MONITOR_FILENAME=/var/spool/asterisk/monitor/ext${CDR(dst)}-q${EXTEN}-${STRFTIME(${EPOCH}||%Y%m%d-%H%M%S)}-${UNIQUEID}) [pbx_config]

Although nothing happens and the default filename still gets written

Thanks in advance

You won’t be able to get the extension in the file name for the recordings. At the point that you are setting the file name, the call has not been answered by an agent yet. You set the filename variable and then you go off to the Queue application, which handles handing off the call to which ever agent it finds.

What I did was this…


exten => 333,1,Macro(queuecall,sales)

[macro-queuecall]
exten => s,1,Answer
exten => s,n,set(CALLERID(name)=[${ARG1}] ${CALLERID(name)})
exten => s,n,Queue(${ARG1},,,,1800)
exten => s,n,Noop(Left queue with ${QUEUESTATUS})
exten => s,n,GotoIf($[ ${LEN(${ARG2})}=0]?bye)
exten => s,n,Voicemail(${ARG2}@aatx,u)
exten => s,n(bye),Set(CDR(userfield)=Left Que ${ARG1} ${QUEUESTATUS})
exten => s,n,hangup
exten => h,1,Set(y=${MEMBERINTERFACE:4})
exten => h,n,System(echo QUEUE=${ARG1} AGENT=${y} TIME=${STRFTIME(${EPOCH},,%Y%m%d.%H%M)} UNIQUEID=${UNIQUEID} >> /var/spool/asterisk/monitor/${UNIQUEID}.TXT)

The call is saved out under the unique id. After the call has completed, I use the hang up to build a text file saved under the name of the uniqueid.txt and it contains the Queue name, Agent, and Date/Time.

Thanks for the answer mazzic

Sorry for the following noob questions :smile:

[ul]
[]In what file do I use that code?[/]

[]exten => 333,1,Macro(queuecall,sales)
In this line “queuecall” and “sales” are only variable names? This is, let’s suppose I want to enable this script in queue number 569, should it be: exten => 333,1,Macro(queuecall,569)
“queuecall” has to be exactly queuecall or is just an alias?
[/
]

[]What’s the meaning of 333?[/]

[/ul]

Thanks

This line goes in your main context for your phones in the extensions.conf.

The [Macro-queuecall] is a macro, similar to a context. Put it in your extensions.conf as well.

In the first item in the Macro() statements is the name of the Macro that you will be executing, in this case its called queuecall. The second item is an arguement to the macro. In this case you have your queue named 569. I didn’t want my queues to be numbers, so I gave them names. That way the sales queue is sales. I can add any number of extensions to dial to get to the same sales queue…

The 333, was just the extension that would be dialed on the phone to get to my sales queue.

In the statement Macro(queuecall,569), the queuecall has to match the name that is in the line [macro-queuecall].
So you could change it, but change it in both places.

No problem. There is definately lots that I don’t know. I’m glad to help others when I can.

[quote=“mazzic”]This line goes in your main context for your phones in the extensions.conf.

The [Macro-queuecall] is a macro, similar to a context. Put it in your extensions.conf as well.

In the first item in the Macro() statements is the name of the Macro that you will be executing, in this case its called queuecall. The second item is an arguement to the macro. In this case you have your queue named 569. I didn’t want my queues to be numbers, so I gave them names. That way the sales queue is sales. I can add any number of extensions to dial to get to the same sales queue…

The 333, was just the extension that would be dialed on the phone to get to my sales queue.

In the statement Macro(queuecall,569), the queuecall has to match the name that is in the line [macro-queuecall].
So you could change it, but change it in both places.

No problem. There is definately lots that I don’t know. I’m glad to help others when I can.[/quote]

Thanks for de detailed explanation :stuck_out_tongue:

I’ll try it

Sorry for digging up my thread :smiley:

I was reallocated to another task and I didn’t had the chance to try this code, however, now I’m back to asterisk :smile:

I inserted that code in /etc/asterisk/extensions_override_freepbx.conf

In this file I only have this written:

exten => 569,1,Macro(DummyAgentCall,569:) [macro-DummyAgentCall] exten => s,1,Answer exten => s,n,set(CALLERID(name)=[${ARG1}] ${CALLERID(name)}) exten => s,n,Queue(${ARG1},,,,1800) exten => s,n,Noop(Left queue with ${QUEUESTATUS}) exten => s,n,GotoIf($[ ${LEN(${ARG2})}=0]?bye) exten => s,n,Voicemail(${ARG2}@aatx,u) exten => s,n(bye),Set(CDR(userfield)=Left Que ${ARG1} ${QUEUESTATUS}) exten => s,n,hangup exten => h,1,Set(y=${MEMBERINTERFACE:4}) exten => h,n,System(echo QUEUE=${ARG1} AGENT=${y} TIME=${STRFTIME(${EPOCH},,%Y%m%d.%H%M)} UNIQUEID=${UNIQUEID} >> /var/spool/asterisk/monitor/${UNIQUEID}.TXT)

In FreePBX Administration web interface, I configured a queue with these settings:

[quote]
Queue: 569
Queue Name: Dummy
Queue Password: (empty)
CID name prefix: 569:
call recording: wav[/quote]

I did “asterisk -rx reload”

Asterisk creates the wav recording file, however it doesn’t create the .txt file as in [macro-DummyAgentCall]

Can someone please help me, again :blush: ?