[asterisk-users] how to load our own .wav sound files in the dial plans for playback

2012-09-08 Thread upendra
Hi,

i am trying to add my own sound file in the asterisk dial plan extension
for playback option , i dont no where to put the file and how to give the
path in extension file and all so is need that the sound file should be
convert in asterisk as .wav file???


regards
Upendra
--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] how to load our own .wav sound files in the dial plans for playback

2012-09-08 Thread Steve Edwards

On Sat, 8 Sep 2012, upendra wrote:

i am trying to add my own sound file in the asterisk dial plan extension 
for playback option , i dont no where to put the file and how to give 
the path in extension file and all so is need that the sound file should 
be convert in asterisk as .wav file???


A command similar to:

sox\
${INPUT}\
--bits 16\
--channels 1\
--encoding signed-integer\
--rate 8k\
${OUTPUT}

will convert the file to a format Asterisk will be happy with.

When you specify a file to be played, for example, using 'playback()', you 
specify the file's path. If you don't specify an absolute path, the path 
is relative to the directory set in asterisk.conf.


One last 'oops' I still do is forgetting that Asterisk likes to choose the 
'file type' (even if you only have .wav) so don't specify it.


So, for example, if you had a file named 'my-first-wave-file.wav' in a 
sub-directory of Asterisk's 'sounds' directory named 'upendra' you could 
play the file with either:


playback(upendra/my-first-wave-file)
playback(/var/lib/asterisk/sounds/upendra/my-first-wave-file)

www.voip-info.org is an excellent (if somewhat dated) resource for 
Asterisk questions. I'm sure asterisk.org and ATFOT.pdf are also 
excellent resources. I started with voip-info.org, so it's my 'go to' 
resource.


--
Thanks in advance,
-
Steve Edwards   sedwa...@sedwards.com  Voice: +1-760-468-3867 PST
Newline  Fax: +1-760-731-3000

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
  http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] One leg in a conference and adjusting stream volume of other leg

2012-09-08 Thread Markus

Matthew, Johan, everyone,

I got it to work! :)  (With the help of a guy I hired via freelancer.com)

Time to share something with the community, so here are the pieces you 
need to create an open conference, where the users will be in the same 
conference, and at the same time will listen to an individual MP3 stream 
in the background, depending on which extension a user dials. Also, the 
volume of the stream is adjustable for each user separately via DTMF 
1+2, and the speech in the conference is also adjustable individually 
via DTMF 4+5 and 7+8 (this is plain ConfBridge, no magic there).


Extensions 01 or 02 is what the user dials. If dialed 01, user will 
listen to stream 1, if dialed 02, user will listen to stream 2, but both 
users will be in the same conference and will not hear each others 
music, but only each others speech.



extensions.conf:

[macro-mohvolumeup]
exten = _.,1,NoOp(Increasing MOH volume...)
exten = _.,n,NoOp(...for extension ${sipexten} )
exten = _.,n,System(/var/lib/asterisk/agi-bin/mohvolume.php ${sipexten} up)

[macro-mohvolumedown]
exten = _.,1,NoOp(Decreasing MOH volume...)
exten = _.,n,NoOp(...for extension ${sipexten} )
exten = _.,n,System(/var/lib/asterisk/agi-bin/mohvolume.php ${sipexten} 
down)



[radio-chatfire]
exten = go-conference,1,Answer()
exten = go-conference,n,NoOp(MOH class is ${mohclass})
exten = go-conference,n,System(/var/lib/asterisk/agi-bin/playmoh.php 
${sipexten} ${mohclass})
exten = 
go-conference,n,ConfBridge(11*48*79*32,,chatfire-public,chatfire-public-menu)


; chat, stream 1
exten = 01,1,NoOp(Dial)
exten = 01,n,Set(__sipexten=${CHANNEL})
exten = 01,n,Set(__DYNAMIC_FEATURES=mohvolumeup#mohvolumedown)
exten = 01,n,Set(__mohclass=chatfire-1)
exten = 01,n,NoOp(MOH class is ${mohclass})
exten = 01,n,Dial(Local/go-conference@radio-chatfire,,)

; chat, stream 2
exten = 02,1,NoOp(Dial)
exten = 02,n,Set(__sipexten=${CHANNEL})
exten = 02,n,Set(__DYNAMIC_FEATURES=mohvolumeup#mohvolumedown)
exten = 02,n,Set(__mohclass=chatfire-2)
exten = 02,n,NoOp(MOH class is ${mohclass})
exten = 02,n,Dial(Local/go-conference@radio-chatfire,,)

exten = 5,1,Answer()
exten = 5,n,Set(VOLUME(TX,p)=-3)
exten = 5,n,NoOp(MOH class final is ${mohclass_final})
exten = 5,n,MusicOnHold(${mohclass_final})


[whisper-chatfire]
exten = do_chanspy,1,NoOp()
exten = do_chanspy,n,Set(DB(moh_${sipexten}/channel)=${CHANNEL})
exten = do_chanspy,n,ChanSpy(${sipexten},${chanspyoption})
exten = do_chanspy,n,Hangup()

exten = do_moh,1,NoOp(Dial)
exten = do_moh,n,Set(__mohclass_final=${mohclass_play})
exten = do_moh,n,Dial(Local/5@radio-chatfire)


manager.conf:

[general]
enabled=yes
port=5038
bindaddr=127.0.0.1

[manager]
secret=kk
allow=0.0.0.0/0.0.0.0
read = 
all,system,call,log,verbose,agent,user,config,dtmf,reporting,cdr,dialplan,originate

write = all,system,call,agent,user,config,command,reporting,originate


features.conf:

[applicationmap]
mohvolumeup = 1,self/caller,Macro,mohvolumeup
mohvolumedown = 2,self/caller,Macro,mohvolumedown


confbridge.conf:

[chatfire-public-menu]
type=menu
4=increase_listening_volume
5=decrease_listening_volume
7=increase_talking_volume
8=decrease_talking_volume

[chatfire-public]
type=user
announce_user_count=yes
dsp_drop_silence=yes


musiconhold.conf:

[chatfire-1]
mode=custom
application=/var/lib/asterisk/mohstream-chatfire-1.sh

[chatfire-2]
mode=custom
application=/var/lib/asterisk/mohstream-chatfire-2.sh



/var/lib/asterisk/agi-bin/playmoh.php:

#!/usr/bin/php -q
?php

$sipexten = $argv[1];
$mohclass_play = $argv[2];

$wrets = ;
$amiusername = 'manager';
$amisecret   = 'kk';

 ob_implicit_flush(true);

$chanspyoption = qWEws;
// Some of these options dont seem to exist, but whatever, it works :)

 ob_implicit_flush(true);
 $socket = fsockopen(127.0.0.1,5038, $errno, $errstr, 0);

 $wrets = fread($socket,30);
 fputs($socket, Action: Login\r\n);
 fputs($socket, UserName: $amiusername\r\n);
 fputs($socket, Events: off\r\n);
 fputs($socket, Secret: $amisecret\r\n\r\n);
 fputs($socket, Action: Originate\r\n);
 fputs($socket, Channel: Local/do_chanspy@whisper-chatfire\r\n);
 fputs($socket, Exten: do_moh\r\n);
 fputs($socket, Context: whisper-chatfire\r\n);
 fputs($socket, Priority: 1\r\n);
 fputs($socket, Variable: chanspyoption=$chanspyoption\r\n);
 fputs($socket, Variable: sipexten=$sipexten\r\n);
 fputs($socket, Variable: mohclass_play=$mohclass_play\r\n\r\n);
 fputs($socket, Action: Logoff\r\n\r\n);
 while (!feof($socket)) {
  $wrets .= fread($socket,8192 );
 }
fclose($socket);

?


/var/lib/asterisk/agi-bin/mohvolume.php:

#!/usr/bin/php -q
?php

$sipexten = $argv[1];
$command = $argv[2];

if ($command == up) {
$dtmftone = *;
} elseif ($command == down) {
$dtmftone=#;
}

$wrets = ;
$amiusername = 'manager';
$amisecret   = 'kk';

 ob_implicit_flush(true);
 $socket = fsockopen(127.0.0.1,5038, $errno, $errstr, 0);
 $wrets = fread($socket,30);
 //AMI Login
 fputs($socket, Action: Login\r\n);
 

Re: [asterisk-users] Calls from talkonaut to pstn Phone

2012-09-08 Thread Darin Iv
...@siena.edu, McHugh, Kim
 kmch...@siena.edu
 Message-ID:
 de01b7d81028c145884d624c2d361f710137ddee3...@mb-2.siena.edu
 Content-Type: text/plain; charset=us-ascii

 We have a Rolm 9751 connecter to our asterisk box via a straight T1.  The
 Rolm cannot do PRI.  Has anyone figured out how to configure this link
 (probably on the Rolm side) to pass caller ID? Any Help or suggestions,
 aside from forklifting the Rolm, would be appreciated.

 Thanks,

 Edward Kohler
 Network Technician
 101Hines Hall
 Siena College
 515 Loudon Rd.
 Loudonville, NY 12211
 518-783-2391
 Fax 518-783-2590
 ekoh...@siena.edumailto:ekoh...@siena.edu

 Siena College is a learning community advancing the ideals of a liberal
 arts education, rooted in its identity as a Franciscan and Catholic
 institution.

 CONFIDENTIALITY NOTICE: This e-mail, including any attachments, is for the
 sole use of the intended recipient(s) and may contain confidential and
 privileged information. Any unauthorized review, use, disclosure, or
 distribution is prohibited. If you received this e-mail and are not the
 intended recipient, please inform the sender by e-mail reply and destroy
 all copies of the original message.

 -- next part --
 An HTML attachment was scrubbed...
 URL: 
 http://lists.digium.com/pipermail/asterisk-users/attachments/20120907/a318f4fa/attachment-0001.htm
 

 --

 Message: 3
 Date: Sat, 8 Sep 2012 14:19:51 +0530
 From: upendra uppi...@gmail.com
 Subject: [asterisk-users] how to load our own .wav sound files in the
 dialplans for playback
 To: Asterisk Users Mailing List - Non-Commercial Discussion
 asterisk-users@lists.digium.com
 Message-ID:
 CAFogui8j2Ny3wChAu-t29PyPT=CnZqpedtAJzDn3R=
 lrc+a...@mail.gmail.com
 Content-Type: text/plain; charset=iso-8859-1

 Hi,

 i am trying to add my own sound file in the asterisk dial plan extension
 for playback option , i dont no where to put the file and how to give the
 path in extension file and all so is need that the sound file should be
 convert in asterisk as .wav file???


 regards
 Upendra
 -- next part --
 An HTML attachment was scrubbed...
 URL: 
 http://lists.digium.com/pipermail/asterisk-users/attachments/20120908/7c81ae11/attachment-0001.htm
 

 --

 ___
 --Bandwidth and Colocation Provided by http://www.api-digital.com--

 AstriCon 2010 - October 26-28 Washington, DC
 Register Now: http://www.astricon.net/

 asterisk-users mailing list
 To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users

 End of asterisk-users Digest, Vol 98, Issue 10
 **

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users