<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<title>Re: [asterisk-users] Play a file while transfering a call</title>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="City"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="place"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
 /* List Definitions */
 @list l0
        {mso-list-id:789627;
        mso-list-type:hybrid;
        mso-list-template-ids:1749157368 720795010 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Arial;
        mso-fareast-font-family:"Times New Roman";}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=blue>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Yes, MOH requires a static configuration,
but there is virtually no limit to the number of classes you can define.  You
can also have single or multiple files in each class.  You could set up a
database assigning a class to extensions or groups of extensions and set the
class before dialing based on that.  For example:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><font
size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:navy'><span style='mso-list:Ignore'>-<font size=1 face="Times New Roman"><span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></font></span></span></font><![endif]><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>exten
=&gt; s,1,set(ONHOLD=$DB(HoldClass/${EXTEN})<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><font
size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:navy'><span style='mso-list:Ignore'>-<font size=1 face="Times New Roman"><span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></font></span></span></font><![endif]><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>exten
=&gt; s,2,SetMusicOnHold(${ONHOLD})<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><font
size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:navy'><span style='mso-list:Ignore'>-<font size=1 face="Times New Roman"><span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></font></span></span></font><![endif]><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>exten
=&gt; s,3,Dial&#8230;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-left:.25in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-left:.25in'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>This
would read the Asterisk database to see which class the exten had recorded, set
the class to it and activate when needed.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
asterisk-users-bounces@lists.digium.com
[mailto:asterisk-users-bounces@lists.digium.com] <b><span style='font-weight:
bold'>On Behalf Of </span></b>Julien Chavanton<br>
<b><span style='font-weight:bold'>Sent:</span></b> Friday, June 26, 2009 11:07
AM<br>
<b><span style='font-weight:bold'>To:</span></b> Asterisk Users Mailing List -
Non-Commercial Discussion; Asterisk Users Mailing List - Non-Commercial
Discussion<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [asterisk-users] Play
a file while transfering a call</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<div id=idOWAReplyText6751>

<div>

<p class=MsoNormal><font size=2 color=black face=Verdana><span
style='font-size:10.0pt;font-family:Verdana;color:black'>Optaining the name of
the file to play dynamicaly is not a problem, the limition is that musiconhold
require a static configuration in a config file. I was looking for a way to
specify/select the file to play from the Dialplan.</span></font><o:p></o:p></p>

</div>

</div>

<div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabIndex=-1>

</span></font></div>

</div>

<div>

<p class=MsoNormal style='margin-bottom:12.0pt'><b><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
asterisk-users-bounces@lists.digium.com on behalf of Danny Nicholas<br>
<b><span style='font-weight:bold'>Sent:</span></b> Thu 04/06/2009 2:26 PM<br>
<b><span style='font-weight:bold'>To:</span></b> 'Asterisk Users Mailing List -
Non-Commercial Discussion'<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [asterisk-users] Play
a file while transfering a call</span></font><o:p></o:p></p>

</div>

</div>

<div>

<p><font size=2 face="Times New Roman"><span style='font-size:10.0pt'>You could
call an AGI to read a database based on the caller/extension and<br>
play any number of MOH files.<br>
<br>
-----Original Message-----<br>
From: asterisk-users-bounces@lists.digium.com<br>
[<a href="mailto:asterisk-users-bounces@lists.digium.com">mailto:asterisk-users-bounces@lists.digium.com</a>]
On Behalf Of Philipp<br>
Kempgen<br>
Sent: Thursday, June 04, 2009 1:54 AM<br>
To: Asterisk Users Mailing List - Non-Commercial Discussion<br>
Subject: Re: [asterisk-users] Play a file while transfering a call<br>
<br>
Julien Chavanton schrieb:<br>
<br>
&gt; I need to be able to play different files when calling different numbers<br>
dynamicaly from the dial-plan, this solution will still require the creation<br>
of multiple static entry in&nbsp; &quot;musiconhold.conf&quot;<br>
&gt;&nbsp;<br>
&gt; For example, if it was possible to specify one file from the &quot;Dial
CMD&quot; in<br>
the dial plan, it would be easy to acheive.<br>
<br>
How about multiple music classes in musiconhold.conf and<br>
Set(CHANNEL(musicclass)=foobar) in the dialplan then?<br>
<br>
<br>
&nbsp;&nbsp;&nbsp; Philipp Kempgen<br>
--<br>
AMOOMA GmbH - Bachstr. 126 - 56566 <st1:City w:st="on"><st1:place w:st="on">Neuwied</st1:place></st1:City>&nbsp;
-&gt;&nbsp; <a href="http://www.amooma.de/">http://www.amooma.de</a><br>
Geschäftsführer: Stefan Wintermeyer, Handelsregister: <st1:City w:st="on"><st1:place
 w:st="on">Neuwied</st1:place></st1:City> B14998<br>
Asterisk: <a href="http://the-asterisk-book.com/">http://the-asterisk-book.com</a>
- <a href="http://das-asterisk-buch.de/">http://das-asterisk-buch.de</a><br>
Videos of the AMOOCON VoIP conference 2009 -&gt;&nbsp; <a
href="http://www.amoocon.de/">http://www.amoocon.de</a><br>
--<br>
<br>
_______________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com/">http://www.api-digital.com</a>
--<br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
&nbsp;&nbsp; <a href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
<br>
<br>
_______________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com/">http://www.api-digital.com</a>
--<br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
&nbsp;&nbsp; <a href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</a></span></font><o:p></o:p></p>

</div>

</div>

</body>

</html>