Hello, I've been working on a proof of concept application for Asterisk that involves delivering an inbound call to a group of users on cell phones. This has ended up using the queue and agent features of asterisk. Everything works right now, but there is some refining that I still need to do before I am ready to present the solution. Is there a way, when using the "ackcall" feature for agents w/ the "AgentCallbackLogin" command to have the system say "You have an caller waiting, please press # to accept this call, or simply hang up"? Right now, the call is placed to the agent, and once they pick up they hear silence while Asterisk waits for them to press the # key. Once the # key is pressed, the "announce = " file is played (per the queue definition). In looking at the source to chan_agent.c this functionality does not appear to exist. -- Vice President of N2Net, a New Age Consulting Service, Inc. Company http://www.n2net.net Where everything clicks into place! KP-216-121-ST
This has been discussed a lot. -----Original Message----- From: asterisk-users-admin@lists.digium.com [mailto:asterisk-users-admin@lists.digium.com] On Behalf Of Greg Boehnlein Sent: Saturday, February 21, 2004 1:33 AM To: asterisk-users@lists.digium.com Subject: [Asterisk-Users] Agents / ackcall Hello, I've been working on a proof of concept application for Asterisk that involves delivering an inbound call to a group of users on cell phones. This has ended up using the queue and agent features of asterisk. Everything works right now, but there is some refining that I still need to do before I am ready to present the solution. Is there a way, when using the "ackcall" feature for agents w/ the "AgentCallbackLogin" command to have the system say "You have an caller waiting, please press # to accept this call, or simply hang up"? Right now, the call is placed to the agent, and once they pick up they hear silence while Asterisk waits for them to press the # key. Once the # key is pressed, the "announce = " file is played (per the queue definition). In looking at the source to chan_agent.c this functionality does not appear to exist. -- Vice President of N2Net, a New Age Consulting Service, Inc. Company http://www.n2net.net Where everything clicks into place! KP-216-121-ST _______________________________________________ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
As in, everyone uses the method you talk about (including me) the problem is still that you can not play a text file first, only after hitting # If you made a patch that would let me play an audio file prompting them to hit # to accept the call, that would be awesome. :) I know myself and MANY others that would definitely be interested in this. I've already talked to Digium and they said this will be a feature/option in the future but no set date at this time. -----Original Message----- From: asterisk-users-admin@lists.digium.com [mailto:asterisk-users-admin@lists.digium.com] On Behalf Of Greg Boehnlein Sent: Saturday, February 21, 2004 8:35 AM To: asterisk-users@lists.digium.com Subject: RE: [Asterisk-Users] Agents / ackcall On Sat, 21 Feb 2004, Matthew B Marlowe wrote:> This has been discussed a lot.In what context? In the context that I'm totally wrong and it can do it, so I should check the Wiki and Documentation kind of discussed alot? Or, the chan_agent.c should be updated cause this is a good idea kind and no one has gotten around to doing it kind of context? Hehehe.. ;)> -----Original Message----- > From: asterisk-users-admin@lists.digium.com > [mailto:asterisk-users-admin@lists.digium.com] On Behalf Of Greg > Boehnlein > Sent: Saturday, February 21, 2004 1:33 AM > To: asterisk-users@lists.digium.com > Subject: [Asterisk-Users] Agents / ackcall > > Hello, > I've been working on a proof of concept application for Asterisk > > that involves delivering an inbound call to a group of users on cell > phones. This has ended up using the queue and agent features of > asterisk. > Everything works right now, but there is some refining that I stillneed> > to do before I am ready to present the solution. > > Is there a way, when using the "ackcall" feature for agents w/ the > "AgentCallbackLogin" command to have the system say "You have ancaller> waiting, please press # to accept this call, or simply hang up"? > > Right now, the call is placed to the agent, and once they pick up they> hear silence while Asterisk waits for them to press the # key. Oncethe> # > key is pressed, the "announce = " file is played (per the queue > definition). > > In looking at the source to chan_agent.c this functionality does not > appear to exist. > >-- Vice President of N2Net, a New Age Consulting Service, Inc. Company http://www.n2net.net Where everything clicks into place! KP-216-121-ST _______________________________________________ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
I wish I knew how to code, but I don't. If you ever get this working I'm highly interested. You can probably send a patch to http://bugs.digium.com I'd assume. -----Original Message----- From: asterisk-users-admin@lists.digium.com [mailto:asterisk-users-admin@lists.digium.com] On Behalf Of Greg Boehnlein Sent: Saturday, February 21, 2004 9:17 AM To: asterisk-users@lists.digium.com Subject: RE: [Asterisk-Users] Agents / ackcall On Sat, 21 Feb 2004, Greg Boehnlein wrote:> On Sat, 21 Feb 2004, Matthew B Marlowe wrote: > > > This has been discussed a lot. > > In what context? In the context that I'm totally wrong and it can doit,> so I should check the Wiki and Documentation kind of discussed alot? > > Or, the chan_agent.c should be updated cause this is a good idea kindand> no one has gotten around to doing it kind of context? > > Hehehe.. ;)In any case, I got impatient.. After all I have the source, so I should just fix (ahem more like break) it myself, right? :) I added the following patch in an effort to get something to work, but it isn't quite working the way I expected; --- ./channels/chan_agent.c.gjb 2004-02-21 09:07:32.000000000 -0500 +++ ./channels/chan_agent.c 2004-02-21 08:59:41.000000000 -0500 @@ -307,10 +307,13 @@ p->acknowledged = 0; } } + if (f && (f->frametype == AST_FRAME_CONTROL) && (f->subclass =AST_CONTROL_ANSWER)) { /* TC */ if (p->ackcall) { - if (option_verbose > 2) + ast_verbose(VERBOSE_PREFIX_3 "Playing pre-login announcement\n", p->chan->name); + ast_streamfile(p->chan, "all-your-base", p->chan->language); + if (option_verbose > 2) ast_verbose(VERBOSE_PREFIX_3 "%s answered, waiting for '#' to acknowledge\n", p->chan->name); /* Don't pass answer along */ ast_frfree(f); The result of this is the following on the console; -- outgoing agentcall, to agent '216410xxxx', on 'Local/216410xxxx@default-b639,1' -- Executing Dial("Local/216410xxxx@default-b639,2", "Zap/g1/216410xxxx") in new stack -- Called 216410xxxx -- Called g1/216410xxxx -- Zap/1-1 is ringing -- Agent/216410xxxx is ringing -- Zap/1-1 answered Local/216410xxxx@default-b639,2 == Spawn extension (default, 216410xxxx, 1) exited non-zero on 'Local/216410xxxx@default-b639,2' -- Playing pre-login announcement -- Playing 'all-your-base' (language 'en') -- Zap/1-1 answered, waiting for '#' to acknowledge Feb 21 09:11:39 NOTICE[393235]: channel.c:1097 ast_read: Dropping incompatible voice frame on Zap/1-1 of format GSM since our native format has changed to UNKN Feb 21 09:11:39 WARNING[393235]: chan_zap.c:3750 zt_write: Cannot handle frames in 2 format Feb 21 09:11:39 WARNING[393235]: file.c:521 ast_readaudio_callback: Failed to write frame -- Hungup 'Zap/1-1' -- The agent gets the call, and hears a click and then the channel drops. Any suggestions? -- Vice President of N2Net, a New Age Consulting Service, Inc. Company http://www.n2net.net Where everything clicks into place! KP-216-121-ST _______________________________________________ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Im getting patching file chan_agent.c Hunk #1 FAILED at 281. 1 out of 1 hunk FAILED -- saving rejects to file chan_agent.c.rej [root@pbx channels]# I just save what you wrote to a file and run patch orig patchedfile Right? -----Original Message----- From: asterisk-users-admin@lists.digium.com [mailto:asterisk-users-admin@lists.digium.com] On Behalf Of Greg Boehnlein Sent: Saturday, February 21, 2004 4:03 PM To: asterisk-users@lists.digium.com Subject: RE: [Asterisk-Users] Agents / ackcall On Sat, 21 Feb 2004, Greg Boehnlein wrote:> On Sat, 21 Feb 2004, Matthew B Marlowe wrote: > > > I wish I knew how to code, but I don't. If you ever get thisworking> > I'm highly interested. You can probably send a patch to > > http://bugs.digium.com I'd assume. > > 1. Record an "agent-preack-announce.gsm" file and slap it into > /var/lib/asterisk/sounds/ > 2. Apply this patch to chan_agent.cOhh.. I forgot to change the "all-your-base" to "agent-preack-announce" so do that in the Patch file, or else your agents will be like "WTF? All your base what?"> --- asterisk/channels/chan_agent.c.gjb 2004-02-2113:55:35.000000000 -0500> +++ asterisk/channels/chan_agent.c 2004-02-21 13:52:59.000000000-0500> @@ -281,7 +281,8 @@ > } > static struct ast_frame *agent_read(struct ast_channel *ast) > { > - struct agent_pvt *p = ast->pvt->pvt; > + int res = -1; > + struct agent_pvt *p = ast->pvt->pvt; > struct ast_frame *f = NULL; > static struct ast_frame null_frame = { AST_FRAME_NULL, }; > static struct ast_frame answer_frame = { AST_FRAME_CONTROL,AST_CONTROL_ANSWER };> @@ -308,9 +309,22 @@ > } > } > if (f && (f->frametype == AST_FRAME_CONTROL) && (f->subclass =AST_CONTROL_ANSWER)) { > + > /* TC */ > if (p->ackcall) { > - if (option_verbose > 2) > + ast_stopstream(p->chan);> + res = ast_streamfile(p->chan, "all-your-base",p->chan->language);> + if (!res)> + res = ast_waitstream(p->chan, "");> + else > + { > + > + ast_verbose(VERBOSE_PREFIX_3 "ast_streamfilefailed on %s\n", p->chan->name);> + res = 0;> + } > + ast_stopstream(p->chan);> + > + if (option_verbose > 2) > ast_verbose(VERBOSE_PREFIX_3 "%sanswered, waiting for '#' to acknowledge\n", p->chan->name);> /* Don't pass answer along */ > ast_frfree(f); > > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > http://lists.digium.com/mailman/listinfo/asterisk-users > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >-- Vice President of N2Net, a New Age Consulting Service, Inc. Company http://www.n2net.net Where everything clicks into place! KP-216-121-ST _______________________________________________ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
I have the latest as well. Not sure why it's not working. -----Original Message----- From: asterisk-users-admin@lists.digium.com [mailto:asterisk-users-admin@lists.digium.com] On Behalf Of Greg Boehnlein Sent: Sunday, February 22, 2004 12:23 AM To: asterisk-users@lists.digium.com Subject: RE: [Asterisk-Users] Agents / ackcall On Sat, 21 Feb 2004, Matthew B Marlowe wrote:> Im getting > > patching file chan_agent.c > Hunk #1 FAILED at 281. > 1 out of 1 hunk FAILED -- saving rejects to file chan_agent.c.rej > [root@pbx channels]# > > > I just save what you wrote to a file and run patch orig patchedfile > > Right?Should work. My patch is based on a comparison diff of today's CVS version of chan_agent.c.> -----Original Message----- > From: asterisk-users-admin@lists.digium.com > [mailto:asterisk-users-admin@lists.digium.com] On Behalf Of Greg > Boehnlein > Sent: Saturday, February 21, 2004 4:03 PM > To: asterisk-users@lists.digium.com > Subject: RE: [Asterisk-Users] Agents / ackcall > > On Sat, 21 Feb 2004, Greg Boehnlein wrote: > > > On Sat, 21 Feb 2004, Matthew B Marlowe wrote: > > > > > I wish I knew how to code, but I don't. If you ever get this > working > > > I'm highly interested. You can probably send a patch to > > > http://bugs.digium.com I'd assume. > > > > 1. Record an "agent-preack-announce.gsm" file and slap it into > > /var/lib/asterisk/sounds/ > > 2. Apply this patch to chan_agent.c > > Ohh.. I forgot to change the "all-your-base" to"agent-preack-announce"> so > do that in the Patch file, or else your agents will be like "WTF? All > your > base what?" > > > --- asterisk/channels/chan_agent.c.gjb 2004-02-21 > 13:55:35.000000000 -0500 > > +++ asterisk/channels/chan_agent.c 2004-02-21 13:52:59.000000000 > -0500 > > @@ -281,7 +281,8 @@ > > } > > static struct ast_frame *agent_read(struct ast_channel *ast) > > { > > - struct agent_pvt *p = ast->pvt->pvt; > > + int res = -1; > > + struct agent_pvt *p = ast->pvt->pvt; > > struct ast_frame *f = NULL; > > static struct ast_frame null_frame = { AST_FRAME_NULL, }; > > static struct ast_frame answer_frame = { AST_FRAME_CONTROL, > AST_CONTROL_ANSWER }; > > @@ -308,9 +309,22 @@ > > } > > } > > if (f && (f->frametype == AST_FRAME_CONTROL) && (f->subclass => AST_CONTROL_ANSWER)) { > > + > > /* TC */ > > if (p->ackcall) { > > - if (option_verbose > 2) > > + ast_stopstream(p->chan); > > > + res = ast_streamfile(p->chan, "all-your-base", > p->chan->language); > > > + if (!res) > > > + res = ast_waitstream(p->chan, ""); > > > + else > > + { > > + > > + ast_verbose(VERBOSE_PREFIX_3 "ast_streamfile > failed on %s\n", p->chan->name); > > + res = 0; > > > + } > > + ast_stopstream(p->chan); > > > + > > + if (option_verbose > 2) > > ast_verbose(VERBOSE_PREFIX_3 "%s > answered, waiting for '#' to acknowledge\n", p->chan->name); > > /* Don't pass answer along */ > > ast_frfree(f); > > > > _______________________________________________ > > Asterisk-Users mailing list > > Asterisk-Users@lists.digium.com > > http://lists.digium.com/mailman/listinfo/asterisk-users > > To UNSUBSCRIBE or update options visit: > > http://lists.digium.com/mailman/listinfo/asterisk-users > > > >-- Vice President of N2Net, a New Age Consulting Service, Inc. Company http://www.n2net.net Where everything clicks into place! KP-216-121-ST _______________________________________________ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Submit it to http://bugs.digium.com as a feature -----Original Message----- From: asterisk-users-admin@lists.digium.com [mailto:asterisk-users-admin@lists.digium.com] On Behalf Of Greg Boehnlein Sent: Sunday, February 22, 2004 8:08 PM To: asterisk-users@lists.digium.com Subject: RE: [Asterisk-Users] Agents / ackcall On Sun, 22 Feb 2004, Matthew B Marlowe wrote:> I have the latest as well. Not sure why it's not working.I've updated the patch to add support for customer preackannounce messages, coinfigureable in the agents.conf file. The latest patch can be downloaded from: http://www.nacs.net/~damin/agent-preack-announce.patch To use it you will need to do the following: 1. Download the patch and stick in in /usr/src/asterisk 2. Apply the patch; [root@asterisk]# cd /usr/src/asterisk [root@asterisk asterisk]# patch -p1 < agent-preack-announce.patch patching file channels/chan_agent.c 3. Issue a "make install" to rebuild chan_agent.so (or just "make" and copy channels/chan_aget.so to /usr/lib/asterisk/modules) 4. Add a "preackannounce=filename" (do NOT add the .gsm extension) to your agents.config file Example: [agents] preackannounce=all-your-base agent => 102,1,Xlite Soft Phone Works for me so far. Comments appreciated! :) _______________________________________________ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
You should make the preackannounce option in the queue.conf file so you can set a different sound for each queue. "call from tech support, press # to accept" "call from sales, press # to accept" (although this works great for me) -----Original Message----- From: asterisk-users-admin@lists.digium.com [mailto:asterisk-users-admin@lists.digium.com] On Behalf Of Greg Boehnlein Sent: Sunday, February 22, 2004 8:08 PM To: asterisk-users@lists.digium.com Subject: RE: [Asterisk-Users] Agents / ackcall On Sun, 22 Feb 2004, Matthew B Marlowe wrote:> I have the latest as well. Not sure why it's not working.I've updated the patch to add support for customer preackannounce messages, coinfigureable in the agents.conf file. The latest patch can be downloaded from: http://www.nacs.net/~damin/agent-preack-announce.patch To use it you will need to do the following: 1. Download the patch and stick in in /usr/src/asterisk 2. Apply the patch; [root@asterisk]# cd /usr/src/asterisk [root@asterisk asterisk]# patch -p1 < agent-preack-announce.patch patching file channels/chan_agent.c 3. Issue a "make install" to rebuild chan_agent.so (or just "make" and copy channels/chan_aget.so to /usr/lib/asterisk/modules) 4. Add a "preackannounce=filename" (do NOT add the .gsm extension) to your agents.config file Example: [agents] preackannounce=all-your-base agent => 102,1,Xlite Soft Phone Works for me so far. Comments appreciated! :) _______________________________________________ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Well, good job. I just implemented it and it works. So I'm happy. -----Original Message----- From: asterisk-users-admin@lists.digium.com [mailto:asterisk-users-admin@lists.digium.com] On Behalf Of Greg Boehnlein Sent: Sunday, February 22, 2004 8:43 PM To: asterisk-users@lists.digium.com Subject: RE: [Asterisk-Users] Agents / ackcall On Sun, 22 Feb 2004, Matthew B Marlowe wrote:> You should make the preackannounce option in the queue.conf file so > you can set a different sound for each queue. > > "call from tech support, press # to accept" > > "call from sales, press # to accept" > > (although this works great for me)I thought about that, and to be sure, this patch is a hack. There are several things that could be improved: 1. It could be integrated with the queue system to allow for per-queue announcements, but this is more than just a trivial patch. 2. Right now, the agent is forced to listen to the entire .gsm file before hitting "#" as this patch has no interrupt features. #1 is hard because the app_queue code is an Application, while chan_agent is actually a channel. The code that actually handles the streaming of the file is in the channel code. I don't know enough about Asterisk Architecture or design philosphy to know wether what I'm doing is breaking protocol, but since it is open source, people are free to comment and expand on it, or write something better. -- Vice President of N2Net, a New Age Consulting Service, Inc. Company http://www.n2net.net Where everything clicks into place! KP-216-121-ST _______________________________________________ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users