Hello, I am using Queue application with multiple agents in each queue. I want to set the CDR(userfield) for each cdr based on the agent answering the call. Is it possible to do this? Thanks
Since userfield is a variable, that would be a qualified yes. Here's how I use it in my dialplan - exten => NXXXXXX,1,noop(Answer()) - exten => NXXXXXX,n,Verbose (Dial DAHDI g1 ${EXTEN}) - exten => NXXXXXX,n,Dial(DAHDI/g1/${EXTEN},60,miKkTtg) - exten => NXXXXXX,n,Set(CDR(userfield)=${CDR(userfield)} -Hangupcause:${HANGUPCAUSE}) - exten => NXXXXXX,n,Hangup(${HANGUP_CAUSE}) How I envision what you're asking: - exten => s,n,Set(CDR(userfield)=${CDR(userfield)} -Agent:${AGENT}) -- Danny Nicholas -- -----Original Message----- From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Deep D Sent: Friday, January 22, 2010 8:23 AM To: asterisk-users at lists.digium.com Subject: [asterisk-users] Set CDR userfield for Queues Hello, I am using Queue application with multiple agents in each queue. I want to set the CDR(userfield) for each cdr based on the agent answering the call. Is it possible to do this? Thanks -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
William Stillwell (Lists)
2010-Jan-22 14:42 UTC
[asterisk-users] Set CDR userfield for Queues
Let me know if you figure it out, I am interested in this as well. Right now I have a cron job that executes this every 5 minutes.. UPDATE cdr SET userfield = MID( dstchannel, 1 , LOCATE( '-', dstchannel )-1) WHERE disposition = 'ANSWERED' AND LOCATE( '-', dstchannel ) > 0 and lastapp = 'Queue' and userfield <> '' -----Original Message----- From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Deep D Sent: Friday, January 22, 2010 9:23 AM To: asterisk-users at lists.digium.com Subject: [asterisk-users] Set CDR userfield for Queues Hello, I am using Queue application with multiple agents in each queue. I want to set the CDR(userfield) for each cdr based on the agent answering the call. Is it possible to do this? Thanks -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
I just added a line with 'h'extension. My dialplan is like this [mycontext] exten => s,1,Queue(6000) exten => h,1,Set(CDR(userfield)=${MEMBERINTERFACE}) On Sat, Jan 23, 2010 at 12:14 AM, William Stillwell (Lists) <william.stillwell-lists at ablebody.net> wrote:> "setinterfacevar=yes" > > Needs to be under each queue > > What does your dialplan end up looking like? > > I would like to add to mine, and stop running a cron job.. > > exten => 5000,1,Answer > exten => 5000,n,Queue(5000|rn) > exten => 5000,n,VoiceMail(5000,u) > exten => 5000,n,Hangup > > > -----Original Message----- > From: asterisk-users-bounces at lists.digium.com > [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Deep D > Sent: Friday, January 22, 2010 1:15 PM > To: Asterisk Users Mailing List - Non-Commercial Discussion > Subject: Re: [asterisk-users] Set CDR userfield for Queues > > The 'h' extension worked. Thanks. > > The other option of 'memebermacro' did not work. ?On the asterisk > console I could see that the macro is executed and cdr userfield is > set when agent answers the call, but the userfield doesn't show up in > the generated cdr. > > Also I had one more question. Doesn't "setinterfacevar=yes" work when > it is declared in the general section? I had to declare it for each > queues. > > > > On Fri, Jan 22, 2010 at 10:37 PM, Carlos Chavez <cursor at telecomabmex.com> > wrote: >> On Fri, 2010-01-22 at 20:25 +0530, Deep D wrote: >>> I want to do something like this >>> exten = 1234,n,Queue(6000,c) >>> exten = 1234,n,Set(CDR(userfield)=${Agent}) ? ;; where Agent is the >>> agent who answered the call >>> exten = 1234,n,Hangup >>> >> ? ? ? ?Actually because the user will hangup within the Queue application > you >> cannot do that. ?You will have to use the h extension to make the change >> to the userfield. ?Something like this: >> >> h,1,Set(CDR(userfield)=${MEMBERINTERFACE}) >> >> ? ? ? ?Make sure you have setinterfacevar=yes in your queue.conf so that >> variable is created when the user is connected to the agent. ?Another >> possibility is to run a macro by using "membermacro=somemacro" and set >> the userfield within that macro. ?I think that option is only available >> on Asterisk 1.6.X and not for older ones though. ?You can also run an >> AGI script (you can set it as an option in the Queue commando) that will >> set the userfield as this AGI is run just before the call is bridged to >> the agent but the ${MEMBERINTERFACE} is already set. >> >> >> -- >> Telecomunicaciones Abiertas de M?xico S.A. de C.V. >> Carlos Ch?vez Prats >> Director de Tecnolog?a >> +52-55-91169161 ext 2001 >> >> -- >> _____________________________________________________________________ >> -- Bandwidth and Colocation Provided by http://www.api-digital.com -- >> >> asterisk-users mailing list >> To UNSUBSCRIBE or update options visit: >> ? http://lists.digium.com/mailman/listinfo/asterisk-users >> > > -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > ? http://lists.digium.com/mailman/listinfo/asterisk-users > > > > -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > ? http://lists.digium.com/mailman/listinfo/asterisk-users >
Thereis an option with log queue stored into database. You can do an cross join from cdr and queue log using callid. With this solution you can track your call over your asterisk system. I wrote about this in old post and submit an complete solution. Regards, On Sun, Jan 24, 2010 at 1:14 PM, William Stillwell (Lists) <william.stillwell-lists at ablebody.net> wrote:> Yeah, after hours of trying Friday, I got working by a macro.. I didn't like > the outcome using a context, the macro cdr records looked cleaner. > > > [macro-queue] > > exten => s,1,Answer() > exten => s,n,Queue(${ARG1}|rn) > exten => s,n,Set(MEMBERINTERFACE='NOANSWER') > exten => s,n,VoiceMail(${ARG1},u) > exten => s,n,Hangup() > exten => h,1,Set(CDR(userfield)=${MEMBERINTERFACE}) > > > Which is called from: > > exten => _?????,1,Macro(queue,${EXTEN}) > > > > > -----Original Message----- > From: asterisk-users-bounces at lists.digium.com > [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Deep D > Sent: Friday, January 22, 2010 11:28 PM > To: Asterisk Users Mailing List - Non-Commercial Discussion > Subject: Re: [asterisk-users] Set CDR userfield for Queues > > I just added a line with 'h'extension. > > My dialplan is like this > > [mycontext] > exten => s,1,Queue(6000) > > exten => h,1,Set(CDR(userfield)=${MEMBERINTERFACE}) > > On Sat, Jan 23, 2010 at 12:14 AM, William Stillwell (Lists) > <william.stillwell-lists at ablebody.net> wrote: >> "setinterfacevar=yes" >> >> Needs to be under each queue >> >> What does your dialplan end up looking like? >> >> I would like to add to mine, and stop running a cron job.. >> >> exten => 5000,1,Answer >> exten => 5000,n,Queue(5000|rn) >> exten => 5000,n,VoiceMail(5000,u) >> exten => 5000,n,Hangup >> >> >> -----Original Message----- >> From: asterisk-users-bounces at lists.digium.com >> [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Deep D >> Sent: Friday, January 22, 2010 1:15 PM >> To: Asterisk Users Mailing List - Non-Commercial Discussion >> Subject: Re: [asterisk-users] Set CDR userfield for Queues >> >> The 'h' extension worked. Thanks. >> >> The other option of 'memebermacro' did not work. ?On the asterisk >> console I could see that the macro is executed and cdr userfield is >> set when agent answers the call, but the userfield doesn't show up in >> the generated cdr. >> >> Also I had one more question. Doesn't "setinterfacevar=yes" work when >> it is declared in the general section? I had to declare it for each >> queues. >> >> >> >> On Fri, Jan 22, 2010 at 10:37 PM, Carlos Chavez <cursor at telecomabmex.com> >> wrote: >>> On Fri, 2010-01-22 at 20:25 +0530, Deep D wrote: >>>> I want to do something like this >>>> exten = 1234,n,Queue(6000,c) >>>> exten = 1234,n,Set(CDR(userfield)=${Agent}) ? ;; where Agent is the >>>> agent who answered the call >>>> exten = 1234,n,Hangup >>>> >>> ? ? ? ?Actually because the user will hangup within the Queue application >> you >>> cannot do that. ?You will have to use the h extension to make the change >>> to the userfield. ?Something like this: >>> >>> h,1,Set(CDR(userfield)=${MEMBERINTERFACE}) >>> >>> ? ? ? ?Make sure you have setinterfacevar=yes in your queue.conf so that >>> variable is created when the user is connected to the agent. ?Another >>> possibility is to run a macro by using "membermacro=somemacro" and set >>> the userfield within that macro. ?I think that option is only available >>> on Asterisk 1.6.X and not for older ones though. ?You can also run an >>> AGI script (you can set it as an option in the Queue commando) that will >>> set the userfield as this AGI is run just before the call is bridged to >>> the agent but the ${MEMBERINTERFACE} is already set. >>> >>> >>> -- >>> Telecomunicaciones Abiertas de M?xico S.A. de C.V. >>> Carlos Ch?vez Prats >>> Director de Tecnolog?a >>> +52-55-91169161 ext 2001 >>> >>> -- >>> _____________________________________________________________________ >>> -- Bandwidth and Colocation Provided by http://www.api-digital.com -- >>> >>> asterisk-users mailing list >>> To UNSUBSCRIBE or update options visit: >>> ? http://lists.digium.com/mailman/listinfo/asterisk-users >>> >> >> -- >> _____________________________________________________________________ >> -- Bandwidth and Colocation Provided by http://www.api-digital.com -- >> >> asterisk-users mailing list >> To UNSUBSCRIBE or update options visit: >> ? http://lists.digium.com/mailman/listinfo/asterisk-users >> >> >> >> -- >> _____________________________________________________________________ >> -- Bandwidth and Colocation Provided by http://www.api-digital.com -- >> >> asterisk-users mailing list >> To UNSUBSCRIBE or update options visit: >> ? http://lists.digium.com/mailman/listinfo/asterisk-users >> > > -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > ? http://lists.digium.com/mailman/listinfo/asterisk-users > > > > -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > ? http://lists.digium.com/mailman/listinfo/asterisk-users >-- --------------------------------------------------------------------------------- Luis Morales Consultor de Tecnologia Cel: +(58)412-2352745 --------------------------------------------------------------------------------- "Empieza por hacer lo necesario, luego lo que es posible... y de pronto estar?s haciendo lo imposible" Leonardo Da'Vinci ---------------------------------------------------------------------------------
Yes, over asterisk 1.4.x you need put an cron or deamon to load queue log into database. I suggest check on the list for more details. Regards, On Mon, Feb 1, 2010 at 8:51 AM, William Stillwell (Lists) <william.stillwell-lists at ablebody.net> wrote:> 1.4.x doesn't natively support logging the queue to to mysql, and can't find > any way without batching it from the /var/log/asterisk/queue > > > > > -----Original Message----- > From: asterisk-users-bounces at lists.digium.com > [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Luis Morales > Sent: Saturday, January 30, 2010 8:38 AM > To: Asterisk Users Mailing List - Non-Commercial Discussion > Subject: Re: [asterisk-users] Set CDR userfield for Queues > > Thereis an option with log queue stored into database. You can do an > cross join from cdr and queue log using callid. With this solution you > can track your call over your asterisk system. > > I wrote about this in old post and submit an complete solution. > > Regards, > > On Sun, Jan 24, 2010 at 1:14 PM, William Stillwell (Lists) > <william.stillwell-lists at ablebody.net> wrote: >> Yeah, after hours of trying Friday, I got working by a macro.. I didn't > like >> the outcome using a context, the macro cdr records looked cleaner. >> >> >> [macro-queue] >> >> exten => s,1,Answer() >> exten => s,n,Queue(${ARG1}|rn) >> exten => s,n,Set(MEMBERINTERFACE='NOANSWER') >> exten => s,n,VoiceMail(${ARG1},u) >> exten => s,n,Hangup() >> exten => h,1,Set(CDR(userfield)=${MEMBERINTERFACE}) >> >> >> Which is called from: >> >> exten => _?????,1,Macro(queue,${EXTEN}) >> >> >> >> >> -----Original Message----- >> From: asterisk-users-bounces at lists.digium.com >> [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Deep D >> Sent: Friday, January 22, 2010 11:28 PM >> To: Asterisk Users Mailing List - Non-Commercial Discussion >> Subject: Re: [asterisk-users] Set CDR userfield for Queues >> >> I just added a line with 'h'extension. >> >> My dialplan is like this >> >> [mycontext] >> exten => s,1,Queue(6000) >> >> exten => h,1,Set(CDR(userfield)=${MEMBERINTERFACE}) >> >> On Sat, Jan 23, 2010 at 12:14 AM, William Stillwell (Lists) >> <william.stillwell-lists at ablebody.net> wrote: >>> "setinterfacevar=yes" >>> >>> Needs to be under each queue >>> >>> What does your dialplan end up looking like? >>> >>> I would like to add to mine, and stop running a cron job.. >>> >>> exten => 5000,1,Answer >>> exten => 5000,n,Queue(5000|rn) >>> exten => 5000,n,VoiceMail(5000,u) >>> exten => 5000,n,Hangup >>> >>> >>> -----Original Message----- >>> From: asterisk-users-bounces at lists.digium.com >>> [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Deep D >>> Sent: Friday, January 22, 2010 1:15 PM >>> To: Asterisk Users Mailing List - Non-Commercial Discussion >>> Subject: Re: [asterisk-users] Set CDR userfield for Queues >>> >>> The 'h' extension worked. Thanks. >>> >>> The other option of 'memebermacro' did not work. ?On the asterisk >>> console I could see that the macro is executed and cdr userfield is >>> set when agent answers the call, but the userfield doesn't show up in >>> the generated cdr. >>> >>> Also I had one more question. Doesn't "setinterfacevar=yes" work when >>> it is declared in the general section? I had to declare it for each >>> queues. >>> >>> >>> >>> On Fri, Jan 22, 2010 at 10:37 PM, Carlos Chavez <cursor at telecomabmex.com> >>> wrote: >>>> On Fri, 2010-01-22 at 20:25 +0530, Deep D wrote: >>>>> I want to do something like this >>>>> exten = 1234,n,Queue(6000,c) >>>>> exten = 1234,n,Set(CDR(userfield)=${Agent}) ? ;; where Agent is the >>>>> agent who answered the call >>>>> exten = 1234,n,Hangup >>>>> >>>> ? ? ? ?Actually because the user will hangup within the Queue > application >>> you >>>> cannot do that. ?You will have to use the h extension to make the change >>>> to the userfield. ?Something like this: >>>> >>>> h,1,Set(CDR(userfield)=${MEMBERINTERFACE}) >>>> >>>> ? ? ? ?Make sure you have setinterfacevar=yes in your queue.conf so that >>>> variable is created when the user is connected to the agent. ?Another >>>> possibility is to run a macro by using "membermacro=somemacro" and set >>>> the userfield within that macro. ?I think that option is only available >>>> on Asterisk 1.6.X and not for older ones though. ?You can also run an >>>> AGI script (you can set it as an option in the Queue commando) that will >>>> set the userfield as this AGI is run just before the call is bridged to >>>> the agent but the ${MEMBERINTERFACE} is already set. >>>> >>>> >>>> -- >>>> Telecomunicaciones Abiertas de M?xico S.A. de C.V. >>>> Carlos Ch?vez Prats >>>> Director de Tecnolog?a >>>> +52-55-91169161 ext 2001 >>>> >>>> -- >>>> _____________________________________________________________________ >>>> -- Bandwidth and Colocation Provided by http://www.api-digital.com -- >>>> >>>> asterisk-users mailing list >>>> To UNSUBSCRIBE or update options visit: >>>> ? http://lists.digium.com/mailman/listinfo/asterisk-users >>>> >>> >>> -- >>> _____________________________________________________________________ >>> -- Bandwidth and Colocation Provided by http://www.api-digital.com -- >>> >>> asterisk-users mailing list >>> To UNSUBSCRIBE or update options visit: >>> ? http://lists.digium.com/mailman/listinfo/asterisk-users >>> >>> >>> >>> -- >>> _____________________________________________________________________ >>> -- Bandwidth and Colocation Provided by http://www.api-digital.com -- >>> >>> asterisk-users mailing list >>> To UNSUBSCRIBE or update options visit: >>> ? http://lists.digium.com/mailman/listinfo/asterisk-users >>> >> >> -- >> _____________________________________________________________________ >> -- Bandwidth and Colocation Provided by http://www.api-digital.com -- >> >> asterisk-users mailing list >> To UNSUBSCRIBE or update options visit: >> ? http://lists.digium.com/mailman/listinfo/asterisk-users >> >> >> >> -- >> _____________________________________________________________________ >> -- Bandwidth and Colocation Provided by http://www.api-digital.com -- >> >> asterisk-users mailing list >> To UNSUBSCRIBE or update options visit: >> ? http://lists.digium.com/mailman/listinfo/asterisk-users >> > > > > -- > ---------------------------------------------------------------------------- > ----- > Luis Morales > Consultor de Tecnologia > Cel: +(58)412-2352745 > ---------------------------------------------------------------------------- > ----- > "Empieza por hacer lo necesario, luego lo que es posible... y de > pronto estar?s haciendo lo imposible" > > Leonardo Da'Vinci > ---------------------------------------------------------------------------- > ----- > > -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > ? http://lists.digium.com/mailman/listinfo/asterisk-users > > > > -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > ? http://lists.digium.com/mailman/listinfo/asterisk-users >-- --------------------------------------------------------------------------------- Luis Morales Consultor de Tecnologia Cel: +(58)412-2352745 --------------------------------------------------------------------------------- "Empieza por hacer lo necesario, luego lo que es posible... y de pronto estar?s haciendo lo imposible" Leonardo Da'Vinci ---------------------------------------------------------------------------------