<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: courier, monaco, monospace, sans-serif">There are several ways to do this, depending upon your constraints. Here are a couple possible solutions:<BR><BR>1) Format Driver (format_sipcall)- Write a format driver similar to format_wav. No need to bridge; just copy over portions for app_dial.c for open, and connect up the read/write functions. You can use in MOH, Playback, Background, etc. apps...many places where recordings are used. To configure, you could use the class, dummy files, or config.<BR><BR>2) Dialer (app_mohdial) - Write a app which dials out, checks for dtmf, and pumps frames. This is fairly simple as well. You only need to copy a small piece from app_dial.c and ast_bridge_call in res_features.c. You can run this app from the dial plan or call it directly (pbx_findapp) in app_queue.<BR><BR>I'd be happy to write either for a small trade.<BR><BR>Justin
Newman<BR><BR>------------------------------<BR><BR>Date: Thu, 22 Mar 2007 19:15:07 -0400<BR>From: Norman Franke <norman@myasd.com><BR>Subject: [asterisk-dev] Bridging Question<BR><BR>(I didn't hear anything on this, so I'll try again.)<BR><BR><BR>I'm attempting to modify app_queue to support a legacy system we <BR>have. Basically, after a timeout (e.g. 3 or 4 rings), I want it to <BR>patch the call to another system (via a Zap channel) that plays a <BR>message specific to the incoming call's extension, e.g. "Welcome to <BR>Foo Bar, Inc, please hold." These files are not stored where Asterisk <BR>can get to them and they are in a proprietary format. We have like <BR>4000 of these, so re-recording isn't an option either.<BR><BR>I figured I could modify app_queue to dial this number and and wait <BR>until that message is done (the other system hangs up) and then go
to <BR>MoH. This works synchronously, e.g. I have to block while bridged. I <BR>want to be able to check for digits being pressed while in this mode <BR>(and do something as a result) and to abort the connection if an <BR>agent frees up (so they don't have to listen to the entire message if <BR>an agent becomes available.)<BR><BR>This can't be done with ast_bridge_call, AFAIK. Calling it in a <BR>thread dumps tons of these:<BR><BR>channel.c:1802 ast_waitfor_nandfds: Thread -1230656592 Blocking 'SIP/ <BR>normanoffice-082001b8', already blocked by thread -1230656592 in <BR>procedure ast_waitfor_nandfds<BR><BR>I assume one can't monitor a channel from two threads.<BR><BR>What's the best way to handle something like this? I looked inside <BR>app_meetme, and there is a LOT of code there to do what is <BR>conceptually very simple. Something like ast_moh_start
that takes <BR>another channel instead of a music channel, and streams that channel <BR>much like MoH would be slick.<BR><BR>Thanks!<BR>Norman<BR></DIV></DIV></DIV></div><br>__________________________________________________<br>Do You Yahoo!?<br>Tired of spam? Yahoo! Mail has the best spam protection around <br>http://mail.yahoo.com </body></html>