Re: [asterisk-users] how to play music when dial fail or time out

2011-05-11 Thread John Wu
Thanks Matt,
can I transform the format in dial plan?

On Wed, May 11, 2011 at 11:24 AM, Matt Riddell li...@venturevoip.comwrote:

 On 11/05/11 3:11 PM, John Wu wrote:

 Hi Enrico
 thanks I do what u said but meet this problem:
 [May 11 11:08:49] WARNING[4545]: file.c:650 ast_openstream_full: File
 fail.wav does not exist in any format
 [May 11 11:08:49] WARNING[4545]: file.c:953 ast_streamfile: Unable to
 open fail.wav (format 0x2 (gsm)): No such file or directory
 [May 11 11:08:49] WARNING[4545]: app_playback.c:471 playback_exec:
 ast_streamfile failed on SIP/IMSI460020656177633- for fail.wav


 When you playback a file in Asterisk you don't provide the extension.

 So you'd do Playback(fail) rather than Playback(fail.wav)

 That way if you have 10 files all called fail (i.e. fail.wav, fail.gsm,
 fail.ulaw, fail.alaw etc etc) it will pick the one which matches the phone
 calls.

 For example in the above example you were making a call in the GSM format
 but it couldn't find a file called fail.wav.gsm so it looked for fail.wav.*
 and couldn't find anything.

 Basically just drop the extension.

 --
 Cheers,

 Matt Riddell
 ___

 http://www.venturevoip.com/news.php (Daily Asterisk News)
 http://www.venturevoip.com/exchange.php (Full ITSP Solution)
 http://www.venturevoip.com/cc.php (Call Centre Solutions)


 --
 _
 -- 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

--
_
-- 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 play music when dial fail or time out

2011-05-11 Thread John Wu
Thanks Matt
the problem is solved.

On Wed, May 11, 2011 at 11:24 AM, Matt Riddell li...@venturevoip.comwrote:

 On 11/05/11 3:11 PM, John Wu wrote:

 Hi Enrico
 thanks I do what u said but meet this problem:
 [May 11 11:08:49] WARNING[4545]: file.c:650 ast_openstream_full: File
 fail.wav does not exist in any format
 [May 11 11:08:49] WARNING[4545]: file.c:953 ast_streamfile: Unable to
 open fail.wav (format 0x2 (gsm)): No such file or directory
 [May 11 11:08:49] WARNING[4545]: app_playback.c:471 playback_exec:
 ast_streamfile failed on SIP/IMSI460020656177633- for fail.wav


 When you playback a file in Asterisk you don't provide the extension.

 So you'd do Playback(fail) rather than Playback(fail.wav)

 That way if you have 10 files all called fail (i.e. fail.wav, fail.gsm,
 fail.ulaw, fail.alaw etc etc) it will pick the one which matches the phone
 calls.

 For example in the above example you were making a call in the GSM format
 but it couldn't find a file called fail.wav.gsm so it looked for fail.wav.*
 and couldn't find anything.

 Basically just drop the extension.

 --
 Cheers,

 Matt Riddell
 ___

 http://www.venturevoip.com/news.php (Daily Asterisk News)
 http://www.venturevoip.com/exchange.php (Full ITSP Solution)
 http://www.venturevoip.com/cc.php (Call Centre Solutions)


 --
 _
 -- 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

--
_
-- 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 play music when dial fail or time out

2011-05-10 Thread John Wu
Hi Enrico
thanks I do what u said but meet this problem:
[May 11 11:08:49] WARNING[4545]: file.c:650 ast_openstream_full: File
fail.wav does not exist in any format
[May 11 11:08:49] WARNING[4545]: file.c:953 ast_streamfile: Unable to open
fail.wav (format 0x2 (gsm)): No such file or directory
[May 11 11:08:49] WARNING[4545]: app_playback.c:471 playback_exec:
ast_streamfile failed on SIP/IMSI460020656177633- for fail.wav

fail.wav is the sound which I want to playback, from the message this file
can not be found,
I put it under /var/lib/asterisk/sounds/

On Mon, May 9, 2011 at 9:37 PM, Enrico Cicconi enrico.cicc...@rdmnet.itwrote:

  Hi,
 have you tried to manage all with dialplane ?

 just an example:

 [incoming]
 **exten = s,1,Dial (SIP/your_called_party,20)
 exten = s,n, Playback(music_message)
 .



 In the first step the call is redirect to the configured called party and
 if without answer (busy, not logged, not answered) ...
 ... in the second step a music is played.

 You can also do other kind of job instead of 'playback' if you need.

 Hoping to have helped you, have a nice day

 Enrico
 www.rdmnet.it

 http://www.rdmnet.it/asterisk/104-asterisk-in-pillole-impostare-il-dialplan.html



 Il 09/05/2011 09:41, John Wu ha scritto:

 Hi all,
 I need to support this feature. When caller dial if the dial fail or no
 answer from the
 called number then play a music. So how to achieve that?

 Thanks!


 --
 _
 -- 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



--
_
-- 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 play music when dial fail or time out

2011-05-10 Thread John Wu
thanks Dovid.

On Mon, May 9, 2011 at 5:30 PM, Dovid Bender asteriskus...@dovid.netwrote:

  John,

 You want to do it only after it fails ?

 If so you can do something like.

 Exten = _X., 1, Dial(SIP/${EXTEN}@PEER SIP/$%7BEXTEN%7D@%3CPEER%3E,20
 )
 Exten = _X., 2, GotoIf($[${DIALSTATUS} = ANSWER]?10)
 Exten = _X., 4, MusicOnHold()
 Exten = _X., 10, Hangup


 - Original Message -
 *From:* John Wu jwjo...@gmail.com
 *To:* Asterisk Users Mailing List - Non-Commercial 
 Discussionasterisk-users@lists.digium.com
 *Sent:* Monday, May 09, 2011 10:41
 *Subject:* [asterisk-users] how to play music when dial fail or time out

 Hi all,
 I need to support this feature. When caller dial if the dial fail or no
 answer from the
 called number then play a music. So how to achieve that?

 Thanks!

 --

 --
 _
 -- 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


 --
 _
 -- 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

--
_
-- 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 play music when dial fail or time out

2011-05-10 Thread Matt Riddell

On 11/05/11 3:11 PM, John Wu wrote:

Hi Enrico
thanks I do what u said but meet this problem:
[May 11 11:08:49] WARNING[4545]: file.c:650 ast_openstream_full: File
fail.wav does not exist in any format
[May 11 11:08:49] WARNING[4545]: file.c:953 ast_streamfile: Unable to
open fail.wav (format 0x2 (gsm)): No such file or directory
[May 11 11:08:49] WARNING[4545]: app_playback.c:471 playback_exec:
ast_streamfile failed on SIP/IMSI460020656177633- for fail.wav


When you playback a file in Asterisk you don't provide the extension.

So you'd do Playback(fail) rather than Playback(fail.wav)

That way if you have 10 files all called fail (i.e. fail.wav, fail.gsm, 
fail.ulaw, fail.alaw etc etc) it will pick the one which matches the 
phone calls.


For example in the above example you were making a call in the GSM 
format but it couldn't find a file called fail.wav.gsm so it looked for 
fail.wav.* and couldn't find anything.


Basically just drop the extension.

--
Cheers,

Matt Riddell
___

http://www.venturevoip.com/news.php (Daily Asterisk News)
http://www.venturevoip.com/exchange.php (Full ITSP Solution)
http://www.venturevoip.com/cc.php (Call Centre Solutions)

--
_
-- 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


[asterisk-users] how to play music when dial fail or time out

2011-05-09 Thread John Wu
Hi all,
I need to support this feature. When caller dial if the dial fail or no
answer from the
called number then play a music. So how to achieve that?

Thanks!
--
_
-- 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 play music when dial fail or time out

2011-05-09 Thread Dovid Bender
John,

You want to do it only after it fails ?

If so you can do something like.

Exten = _X., 1, Dial(SIP/${EXTEN}@PEER)
Exten = _X., 2, GotoIf($[${DIALSTATUS} = ANSWER]?10)
Exten = _X., 4, MusicOnHold()
Exten = _X., 10, Hangup

  - Original Message - 
  From: John Wu 
  To: Asterisk Users Mailing List - Non-Commercial Discussion 
  Sent: Monday, May 09, 2011 10:41
  Subject: [asterisk-users] how to play music when dial fail or time out


  Hi all,
  I need to support this feature. When caller dial if the dial fail or no 
answer from the
  called number then play a music. So how to achieve that?

  Thanks!



--


  --
  _
  -- 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--
_
-- 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 play music when dial fail or time out

2011-05-09 Thread Enrico Cicconi

Hi,
have you tried to manage all with dialplane ?

just an example:

[incoming]
**exten = s,1,Dial (SIP/your_called_party,20)
exten = s,n, Playback(music_message)
.



In the first step the call is redirect to the configured called party 
and if without answer (busy, not logged, not answered) ...

... in the second step a music is played.

You can also do other kind of job instead of 'playback' if you need.

Hoping to have helped you, have a nice day

Enrico
www.rdmnet.it
http://www.rdmnet.it/asterisk/104-asterisk-in-pillole-impostare-il-dialplan.html



Il 09/05/2011 09:41, John Wu ha scritto:

Hi all,
I need to support this feature. When caller dial if the dial fail or 
no answer from the

called number then play a music. So how to achieve that?

Thanks!


--
_
-- 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


--
_
-- 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