Call Record

Sir,

I am using Asterisk 1.4 and i want to record incoming call and i want to give record file name will start with extension no. and add date and time. i know it is possible with monitor but the problem is when i have receive incoming call than i have ring 4 extension simultaneously and i want to generate record file only for the extension who pickup that call. i have use following statement to pickup call when all four extension no body pickup the call than it will transfer to extension no. 16.

exten => s,1,Dial(SIP/21&SIP/23&SIP/18&SIP/14,40,Tt)
exten => s,2,Dial(SIP/16,20,Tt)

Please help how i can do that

Rajeev.

An option might be to rename the file of the recording based on the extension that answers the phone in the h extension. It would look something like:

exten => h, 1, NoOp(the h extension that renames the filename of the recording just made)
exten => h,n,System(rename /var/spool/monitor/${FILENAME_USE} /var/spool/monitor/${NUMBER_OF_PHONE}_${REST_OF_THE_FILENAME})

This is code is not tested but I hope it gives an idea.

Sir,

I have add these line before dial or after dial for eg.

exten => s,1,Dial(SIP/21&SIP/23&SIP/18&SIP/14,40,Tt)
exten => s,2,Dial(SIP/16,20,Tt)
exten => h, 1, NoOp(the h extension that renames the filename of the recording just made)
exten => h,n,System(rename /var/spool/monitor/${FILENAME_USE} /var/spool/monitor/${NUMBER_OF_PHONE}_${REST_OF_THE_FILENAME})

Rajeev.

Sir,

Actully the extension h return the number of calling party. but i want to know the number of extension who pick up the phone.

Please help.

Rajeev.

You probably meant the channel. There need not be an extension, in the Asterisk sense, associated with that channel.

In priciple, you should be able to get the channel from the Call Detail Record, using the ${CDR()} function.

Sir,

Basically i want when a incoming call receive than i have ring multiple extension and like extension 10 and 20 i want to know which extension pick up the call extension 10 or 20.

Rajeev.

I did understand what you wanted to do, although you are using “extension” loosely. What was wrong with my suggestion? I haven’t tried it, but I’m 90% sure that it will work.

I’m assuming that you have the degenerate case where the sip.conf section heading is the same as the Asterisk extension to specifically dial that device.

I think a variable may also get set, with a name similar to bridged channel.

Sir,

Its working thanks a lot.

Rajeev.