David Backeberg
2008-May-03 15:18 UTC
[asterisk-users] toggling recordings on / off using MeetMe()
Hi there: I'm using Asterisk to run a call center in a way that probably wasn't intended. Due to restrictions imposed by our proprietary Intertel phone system, our call center only runs partly on Asterisk. We have agents sit in a MeetMe() conference room, as the only members, listening to hold music. When an inbound customer call arrives, that call gets patched over the Intertel, onto a Zaptel channel, and we route them to an open conference room. Agent hears the chime noise indicating a customer has arrived, hold music stops, and then we want recording to begin. This worked great in Asterisk 1.2 using MixMonitor(). We would do the typical record each side of the call, and when customer hangs up, soxmix the sides into a single sound file. We're migrating to Asterisk 1.4.19.1. I first tried using our same dialplan and scripts, but we get nasty echo in the conference rooms if we're recording using MixMonitor(). Comment out the MixMonitor(), and call sounds great, with no echo. Weird. I don't know whether this is a known bug with MixMonitor() or some quirk of the way we're using it. What I do know is that if I record using MeetMe(), the recording starts and records just fine, with no echo problems. The problem then comes with the way we're using MeetMe(), in a way that probably wasn't ever intended. You can invoke MeetMe() without the 'r' argument, to not start recordings, while the agent sits on hold awaiting the first customer. Then, on your extension.conf pertaining to the customer side of the conference, you can add the 'r' flag to begin recording when the customer joins the conference. When the customer hangs up, there's no built-in flag to MeetMe() or MeetMeAdmin() to toggle-off the recording. In our usage, the recording happily continues, recording silence, and will resume recording the next conversation, etc into one giant file. Not at all what we're looking for. So then I reviewed app_meetme.c, looking at the best way to add a flag I could invoke, perhaps from MeetMeAdmin() that would toggle off the recording. I saw there's already a flag called MEETME_RECORD_TERMINATE, which when set, will be processed by recordthread(), and will stop the recording. I could add a flag, like 'Q' to admin_exec() which could call a small function that would set the MEETME_RECORD_TERMINATE flag and clear the recording file and format variables. It doesn't look difficult to modify app_meetme.c to meet the usage I was hoping for, but I thought I'd do a brain dump to the list, and let people who know the code better tell me how boneheaded, innovative, misinformed, or creative this approach would be. Should I instead pursue a fix for whatever is creating echo when using MixMonitor(), is there a better way to do recording considering my particular usage? Should I try old versions of 1.4, and see if the echo is some recent regression in the MixMonitor() code? Thanks for any suggestions, (and of course thanks for an incredible open-source product) David Backeberg
Al Baker
2008-May-05 08:21 UTC
[asterisk-users] Help Please - Asterisk MYSQL interface seems to be eating data
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#3333ff">
<font color="#000000"><span class="postbody">I
would appreciate any and
all advice on what
appears to be a BUG (or a brainfart on my part) with the MySQL add-on
for Asterisk this is of FEDORA 8 fully patched with Asterisk Addons
1-4-6 with the Asterisk 1.4.18.1
<br>
<br>
It appears that the interface “<font
color="#3366ff">eats”</font> the
first field requested from
a table. If <font color="#3366ff">only One Field</font> is
Requested
from the Table , that field is
eaten ENTIRELY by Asterisk. If <font color="#3333ff">several
fields</font>
are requested, the <font color="#3333ff">First
Field Is Eaten</font> and<font color="#3333ff"> the
remaining filed are
returned</font>, but place in the
WRONG <font color="#3333ff">Variable</font> since the 1tst
fileld data
was eaten. In the DIALPLAN
below I have tried 3 Different ways to approach this. <br>
<br>
Extension <font color="#3333ff">9999</font> – Get only ONE
(<font
color="#3333ff">1</font>) field from Table
<br>
<br>
Extension <font color="#3333ff">8888</font> – Get THREE(3)
fields from
the Table
</span></font><font color="#000000"><span
class="postbody">and Quote
Them.<br>
<br>
</span></font><font color="#000000"><span
class="postbody">Extension <font
color="#3333ff">7777</font> - Get THREE(3) fields from the
Table <br>
<br>
I have show the Output from the Asterisk CL for each, which clearly
show that SOMETHING is not <br>
right. Maybe the Software, maybe the person using the software :)
<br>
<br>
Here is the <font color="#3333ff">Table</font> in the
Database.
<br>
<br>
mysql> select * from agent;
<br>
<br>
+----------+---------+--------+------------+---------------------+
<br>
<br>
| id | cust_id |
status |
phone | tlce |
<br>
<br>
+----------+---------+--------+------------+---------------------+
<br>
| 00000001 | NAMB | free | 1234567890 | 2008-04-17 02:32:02 | <br>
<br>
| 00000002 | NAMB | free | 2234567890 | 2008-04-17 02:32:02 | <br>
<br>
| 00000003 | NAMB | free | 3234567890 | 2008-04-17 02:32:02 | <br>
<br>
| 00000004 | NAMB | free | 4234567890 | 2008-04-17 02:32:02 | <br>
+----------+---------+--------+------------+---------------------+
<br>
<br>
4 rows in set (0.00 sec)
<br>
<br>
<br>
Here is the <u><b><font color="#3333ff">DIALPLAN
</font></b></u><br>
<br>
exten => 7777,1,MYSQL(Connect connid localhost ivr ivrxxx dtc)
<br>
<br>
exten => 7777,n,MYSQL(<font color="#3333ff">Query resultid
${connid}
<b><font color="#3333ff">SELECT\ cust_id\, \ status\,\
tlce\ from\
agent\ where\ phone=\'1234567890\'</font></b></font>)
<br>
<br>
exten => 7777,n,MYSQL(Fetch fetchid ${resultid} <font
color="#3333ff">custid mystatus mytlce</font>)
<br>
<br>
exten => 7777,n,NoOp(<font color="#3333ff">CUSTID is
${custid}
MYSTATUS is ${mystatus} MYTLCE is ${mytlce}</font>)
<br>
<br>
exten => 7777,n,NoOp(FETCHID is ${fetchid} RESULUT ID is ..
${resultid} CONNID is ${connid})
<br>
<br>
exten => 7777,n,MYSQL(Clear ${resultid})
<br>
<br>
exten => 7777,n,MYSQL(Disconnect ${connid})
<br>
<br>
exten => 7777,n,HANGUP
<br>
<br>
<br>
<br>
exten => 8888,1,MYSQL(Query resultid ${connid} SELECT\ 'cust_id'\, \
'status'\,\ 'tlce'\ from\ agent\ where\
phone=\'1234567890\')
<br>
<br>
exten => 8888,n,MYSQL(Fetch fetchid ${resultid} custid mystatus
mytlce)
<br>
<br>
exten => 8888,n,NoOp(CUSTID is ${custid} MYSTATUS is ${mystatus}
MYTLCE is ${mytlce})
<br>
<br>
exten => 8888,n,NoOp(FETCHID is ${fetchid} RESULUT ID is ..
${resultid} CONNID is ${connid})
<br>
<br>
exten => 8888,n,MYSQL(Clear ${resultid})
<br>
<br>
exten => 8888,n,MYSQL(Disconnect ${connid})
<br>
<br>
exten => 8888,n,HANGUP
<br>
<br>
<br>
exten => 9999,1,MYSQL(Connect connid localhost ivr ivrxxx dtc)
<br>
<br>
exten => 9999,n,MYSQL(<font color="#3333ff">Query resultid
${connid}
SELECT\ 'cust_id'\ from\ agent\ where\
phone=\'1234567890\'</font>)
<br>
<br>
exten => 9999,n,MYSQL(<font color="#3333ff">Fetch fetchid
${resultid} custid</font>)
<br>
<br>
exten => 9999,n,NoOp(<font color="#3333ff">CUSTID is
${custid}</font>)
<br>
<br>
exten => 9999,n,NoOp(FETCHID is ${fetchid} RESULUT ID is ..
${resultid} CONNID is ${connid})
<br>
<br>
exten => 9999,n,MYSQL(Clear ${resultid})
<br>
<br>
exten => 9999,n,MYSQL(Disconnect ${connid})
<br>
<br>
exten => 9999,n,HANGUP
<br>
<br>
<br>
<br>
<br>
Here is the <u><b><font color="#cc33cc">Asterisk CLI
Output
</font></b></u><br>
<br>
dial 9999
<br>
<br>
== Console is full duplex
<br>
<br>
*CLI> -- Executing [9999@default:1] MYSQL("OSS/dsp", "Connect
connid
localhost ivr ivrxxx dtc") in new stack
<br>
<br>
-- Executing [9999@default:2] MYSQL("OSS/dsp", <font
color="#cc33cc">"Query
resultid 5
SELECT cust_id from agent where phone='1234567890'"</font>)
in new
stack
<br>
<br>
-- Executing [9999@default:3] MYSQL("OSS/dsp", <font
color="#cc33cc">"Fetch
fetchid 6 custid"</font>) in new stack
<br>
<br>
-- Executing [9999@default:4] NoOp(<font
color="#cc33cc">"OSS/dsp",
"CUSTID is "</font>) in new stack
<br>
<br>
-- Executing [9999@default:5] NoOp("OSS/dsp", <font
color="#cc33cc">"FETCHID
is 1 RESULUT ID is .. 6 CONNID is 5"</font>) in new stack
<br>
<br>
-- Executing [9999@default:6] MYSQL("OSS/dsp", "Clear 6") in
new stack
<br>
<br>
-- Executing [9999@default:7] MYSQL("OSS/dsp", "Disconnect
5") in new
stack
<br>
<br>
-- Executing [9999@default:8] Hangup("OSS/dsp", "") in new
stack
<br>
<br>
== Spawn extension (default, 9999, 8) exited non-zero on 'OSS/dsp'
<br>
<br>
<< Hangup on console <br>
<br>
*CLI> dial 8888
<br>
<br>
== Console is full duplex
<br>
<br>
*CLI> -- Executing [8888@default:1] MYSQL("OSS/dsp", "Connect
connid
localhost ivr ivrxxx dtc") in new stack
<br>
<br>
-- Executing [8888@default:2] MYSQL("OSS/dsp", <font
color="#cc33cc">"Query
resultid 5
SELECT cust_id, status, tlce from agent where
phone='1234567890'"</font>)
in
new stack
<br>
<br>
-- Executing [8888@default:3] MYSQL("OSS/dsp",<font
color="#cc33cc">
"Fetch fetchid 6 custid mystatus mytlce"</font>) in new stack
<br>
<br>
-- Executing [8888@default:4] NoOp("OSS/dsp", "<font
color="#cc33cc">CUSTID
is <b><font color="#ff0000">free</font></b>
MYSTATUS is <font
color="#ff0000">2008-04-17 02:32:02</font> MYTLCE is
"</font>) in new
stack
<br>
<br>
-- Executing [8888@default:5] NoOp("OSS/dsp", "<font
color="#993399">FETCHID
is 1 RESULUT ID is .. 6 CONNID is 5</font>") in new stack
<br>
<br>
-- Executing [8888@default:6] MYSQL("OSS/dsp", "Clear 6") in
new stack
<br>
<br>
-- Executing [8888@default:7] MYSQL("OSS/dsp", "Disconnect
5") in new
stack
<br>
<br>
-- Executing [8888@default:8] Hangup("OSS/dsp", "") in new
stack
<br>
<br>
== Spawn extension (default, 8888, 8) exited non-zero on 'OSS/dsp'
<br>
<br>
<< Hangup on console >
<br>
<br>
OK – Have I done something <b><font color="#3333ff">really
dumb </font></b>or
is this a<font color="#3333ff"> BUG </font>?
<br>
Thank VERY MUCH for any and ALL Help</span></font>
</body>
</html>
David Backeberg
2008-May-05 20:27 UTC
[asterisk-users] toggling recordings on / off using MeetMe()
I went through with modifying app_meetme.c to allow toggle on / toggle
off of recordings
This patch is against app/app_meetme.c, from asterisk-1.4.19.1
If it would be more helpful to provide a patch against a different
version, please let me know. Find patch attached.
These are changes to
admin_exec()
which handles instructions to the MeetMeAdmin() command
and descrip3
which is the actual text block dumped when you query the MeetMeAdmin() command
This is my first patch against Asterisk, and I hope it will be useful
to others. I sure would have used it if somebody had already built
this into MeetMe().
Is there a different mailing list where patches against Asterisk are
more commonly disseminated?
Theory is that Agents stay on for hours, listening to hold music
in-between customers. Customers come and go, toggling on recording
while they're present, and toggling it off when they hangup. There's
logic in my real dialplans to do complicated stuff with agi-bin to
give descriptive names to the recordings, update a database backend,
etc.
Here's an example of how to use it...
extensions.conf:
[Agent_extensions]
exten => s,1,Answer
exten => s,2,Wait(1)
exten => s,3,MeetMe(1234|Mp1)
exten => s,4,HangUp
exten => h,1,MeetMeAdmin(1234|K) ; destroy room if Agent hangs up,
even if customer on line
exten => h,2,HangUp
[Customer_extensions]
exten => s,1,Answer
exten => s,2,Wait(1)
exten => s,3,set_variable(${MEETME_RECORDINGFILE},foobar)
exten => s,4,set_variable(${MEETME_RECORDINGFORMAT},wav)
exten => s,5,MeetMe(1234|Mp1r) ; notice the argument 'r', meaning
start recording
exten => s,6,HangUp
exten => h,1,MeetMeAdmin(1234|Q) ; notice the argument 'Q', which
stops recordings if you apply my patch
exten => h,2,HangUp
Happy Asterisking!
David Backeberg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: toggle_off_recordings.patch
Type: application/octet-stream
Size: 1742 bytes
Desc: not available
Url :
http://lists.digium.com/pipermail/asterisk-users/attachments/20080505/0411a4c6/attachment.obj