Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] Dial and start music on hold after timeout


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
jean.aunis at prescom.fr
Guest





PostPosted: Mon Aug 22, 2016 10:37 am    Post subject: [asterisk-users] Dial and start music on hold after timeout Reply with quote

Hello,

I am searching a way to dial a SIP peer, and if it does not answer
within 20 seconds, play an announcement to the caller. This means that
the caller would hear a ring tone for 20 seconds, and only then hear the
announcement if the callee did not answer.

I know it is possible to do this with ARI, but in this particular case I
do not want to use ARI. I would like to do this purely with dialplan and
AGI scripts, but I cannot find a way. I have read about the "m" option
of Dial application, but it starts the announcement immediately, whereas
I would like to start it after 20 seconds of timeout.

Does anybody have an idea ?

Best regards,

Jean Aunis


--
_____________________________________________________________________
-- 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
Back to top
johnkiniston at gmail.com
Guest





PostPosted: Mon Aug 22, 2016 10:42 am    Post subject: [asterisk-users] Dial and start music on hold after timeout Reply with quote

This seems like the obvious answer but maybe I'm misunderstanding the question.


exten => s,1,Dial(SIP/alice,20)

 same =>   n,Playback(myannouncement)

 same =>   n,NoOP(Whatever else you want to do goes here)


On Mon, Aug 22, 2016 at 8:36 AM, Jean Aunis <jean.aunis@prescom.fr (jean.aunis@prescom.fr)> wrote:
Quote:
Hello,

I am searching a way to dial a SIP peer, and if it does not answer within 20 seconds, play an announcement to the caller. This means that the caller would hear a ring tone for 20 seconds, and only then hear the announcement if the callee did not answer.

I know it is possible to do this with ARI, but in this particular case I do not want to use ARI. I would like to do this purely with dialplan and AGI scripts, but I cannot find a way. I have read about the "m" option of Dial application, but it starts the announcement immediately, whereas I would like to start it after 20 seconds of timeout.

Does anybody have an idea ?

Best regards,

Jean Aunis


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



--
A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.
---Heinlein
Back to top
jean.aunis at prescom.fr
Guest





PostPosted: Mon Aug 22, 2016 10:45 am    Post subject: [asterisk-users] Dial and start music on hold after timeout Reply with quote

Sorry, I forgot to write that the SIP peer must keep ringing while the announcement is being played.

Le 22/08/2016 17:42, John Kiniston a crit:

Quote:
This seems like the obvious answer but maybe I'm misunderstanding the question.


exten => s,1,Dial(SIP/alice,20)

same => n,Playback(myannouncement)

same => n,NoOP(Whatever else you want to do goes here)


On Mon, Aug 22, 2016 at 8:36 AM, Jean Aunis <jean.aunis@prescom.fr (jean.aunis@prescom.fr)> wrote:
Quote:
Hello,

I am searching a way to dial a SIP peer, and if it does not answer within 20 seconds, play an announcement to the caller. This means that the caller would hear a ring tone for 20 seconds, and only then hear the announcement if the callee did not answer.

I know it is possible to do this with ARI, but in this particular case I do not want to use ARI. I would like to do this purely with dialplan and AGI scripts, but I cannot find a way. I have read about the "m" option of Dial application, but it starts the announcement immediately, whereas I would like to start it after 20 seconds of timeout.

Does anybody have an idea ?

Best regards,

Jean Aunis


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



--
A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.
---Heinlein



Back to top
johnkiniston at gmail.com
Guest





PostPosted: Mon Aug 22, 2016 10:59 am    Post subject: [asterisk-users] Dial and start music on hold after timeout Reply with quote

You could try using RetryDial() instead of Dial, It supports playing an announcement.



On Mon, Aug 22, 2016 at 8:45 AM, Jean Aunis <jean.aunis@prescom.fr (jean.aunis@prescom.fr)> wrote:
Quote:

Sorry, I forgot to write that the SIP peer must keep ringing while the announcement is being played.

Le 22/08/2016 à 17:42, John Kiniston a écrit :

Quote:
This seems like the obvious answer but maybe I'm misunderstanding the question.


exten => s,1,Dial(SIP/alice,20)

 same =>   n,Playback(myannouncement)

 same =>   n,NoOP(Whatever else you want to do goes here)


On Mon, Aug 22, 2016 at 8:36 AM, Jean Aunis <jean.aunis@prescom.fr (jean.aunis@prescom.fr)> wrote:
Quote:
Hello,

I am searching a way to dial a SIP peer, and if it does not answer within 20 seconds, play an announcement to the caller. This means that the caller would hear a ring tone for 20 seconds, and only then hear the announcement if the callee did not answer.

I know it is possible to do this with ARI, but in this particular case I do not want to use ARI. I would like to do this purely with dialplan and AGI scripts, but I cannot find a way. I have read about the "m" option of Dial application, but it starts the announcement immediately, whereas I would like to start it after 20 seconds of timeout.

Does anybody have an idea ?

Best regards,

Jean Aunis


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



--
A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.
---Heinlein








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



--
A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.
---Heinlein
Back to top
jean.aunis at prescom.fr
Guest





PostPosted: Mon Aug 22, 2016 11:19 am    Post subject: [asterisk-users] Dial and start music on hold after timeout Reply with quote

Thank you for the idea. The problem with RetryDial, is that it will cancel the first call, play the announce and then dial the SIP peer once again, so the telephone will display a missed call. I would prefer to do everything in a single call.

Le 22/08/2016 17:57, John Kiniston a crit:

Quote:
You could try using RetryDial() instead of Dial, It supports playing an announcement.



On Mon, Aug 22, 2016 at 8:45 AM, Jean Aunis <jean.aunis@prescom.fr (jean.aunis@prescom.fr)> wrote:
Quote:

Sorry, I forgot to write that the SIP peer must keep ringing while the announcement is being played.

Le 22/08/2016 17:42, John Kiniston a crit:

Quote:
This seems like the obvious answer but maybe I'm misunderstanding the question.


exten => s,1,Dial(SIP/alice,20)

same => n,Playback(myannouncement)

same => n,NoOP(Whatever else you want to do goes here)


On Mon, Aug 22, 2016 at 8:36 AM, Jean Aunis <jean.aunis@prescom.fr (jean.aunis@prescom.fr)> wrote:
Quote:
Hello,

I am searching a way to dial a SIP peer, and if it does not answer within 20 seconds, play an announcement to the caller. This means that the caller would hear a ring tone for 20 seconds, and only then hear the announcement if the callee did not answer.

I know it is possible to do this with ARI, but in this particular case I do not want to use ARI. I would like to do this purely with dialplan and AGI scripts, but I cannot find a way. I have read about the "m" option of Dial application, but it starts the announcement immediately, whereas I would like to start it after 20 seconds of timeout.

Does anybody have an idea ?

Best regards,

Jean Aunis


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



--
A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.
---Heinlein








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



--
A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.
---Heinlein



Back to top
isrlgb at gmail.com
Guest





PostPosted: Tue Aug 23, 2016 6:52 am    Post subject: [asterisk-users] Dial and start music on hold after timeout Reply with quote

You could m and make a moh file that has ringing the first 30 sec and then the anouncment
בתאריך 22 באוג׳ 2016 7:19 PM,‏ "Jean Aunis" <jean.aunis@prescom.fr (jean.aunis@prescom.fr)> כתב:
Quote:

Thank you for the idea. The problem with RetryDial, is that it will cancel the first call, play the announce and then dial the SIP peer once again, so the telephone will display a missed call. I would prefer to do everything in a single call.

Le 22/08/2016 à 17:57, John Kiniston a écrit :

Quote:
You could try using RetryDial() instead of Dial, It supports playing an announcement.



On Mon, Aug 22, 2016 at 8:45 AM, Jean Aunis <jean.aunis@prescom.fr (jean.aunis@prescom.fr)> wrote:
Quote:

Sorry, I forgot to write that the SIP peer must keep ringing while the announcement is being played.

Le 22/08/2016 à 17:42, John Kiniston a écrit :

Quote:
This seems like the obvious answer but maybe I'm misunderstanding the question.


exten => s,1,Dial(SIP/alice,20)

 same =>   n,Playback(myannouncement)

 same =>   n,NoOP(Whatever else you want to do goes here)


On Mon, Aug 22, 2016 at 8:36 AM, Jean Aunis <jean.aunis@prescom.fr (jean.aunis@prescom.fr)> wrote:
Quote:
Hello,

I am searching a way to dial a SIP peer, and if it does not answer within 20 seconds, play an announcement to the caller. This means that the caller would hear a ring tone for 20 seconds, and only then hear the announcement if the callee did not answer.

I know it is possible to do this with ARI, but in this particular case I do not want to use ARI. I would like to do this purely with dialplan and AGI scripts, but I cannot find a way. I have read about the "m" option of Dial application, but it starts the announcement immediately, whereas I would like to start it after 20 seconds of timeout.

Does anybody have an idea ?

Best regards,

Jean Aunis


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



--
A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.
---Heinlein








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



--
A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.
---Heinlein






--
_____________________________________________________________________
-- 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
Back to top
dduffett at digium.com
Guest





PostPosted: Tue Aug 23, 2016 9:08 am    Post subject: [asterisk-users] Dial and start music on hold after timeout Reply with quote

How about:

exten => s,1,Dial(SIP/alice&LOCAL/555@delayed-announce,40)



[delayed-announce]
exten =>  555,1,Wait(20)
same => n,Playback(myannouncement,noanswer)

same => n,NoOP(Whatever else you want to do goes here)



The 'noanswer' option on the Playback means that SIP/alice should continue to ring for the remaining 20 of the 40 seconds, as the Playback will not answer (terminate) the call.


Don't forget AstriCon this year - www.astricon.net


On 23 August 2016 at 12:52, Israel Gottlieb <isrlgb@gmail.com (isrlgb@gmail.com)> wrote:
Quote:

You could m and make a moh file that has ringing the first 30 sec and then the anouncment
בתאריך 22 באוג׳ 2016 7:19 PM,‏ "Jean Aunis" <jean.aunis@prescom.fr (jean.aunis@prescom.fr)> כתב:
Quote:

Thank you for the idea. The problem with RetryDial, is that it will cancel the first call, play the announce and then dial the SIP peer once again, so the telephone will display a missed call. I would prefer to do everything in a single call.

Le 22/08/2016 à 17:57, John Kiniston a écrit :

Quote:
You could try using RetryDial() instead of Dial, It supports playing an announcement.



On Mon, Aug 22, 2016 at 8:45 AM, Jean Aunis <jean.aunis@prescom.fr (jean.aunis@prescom.fr)> wrote:
Quote:

Sorry, I forgot to write that the SIP peer must keep ringing while the announcement is being played.

Le 22/08/2016 à 17:42, John Kiniston a écrit :

Quote:
This seems like the obvious answer but maybe I'm misunderstanding the question.


exten => s,1,Dial(SIP/alice,20)

 same =>   n,Playback(myannouncement)

 same =>   n,NoOP(Whatever else you want to do goes here)


On Mon, Aug 22, 2016 at 8:36 AM, Jean Aunis <jean.aunis@prescom.fr (jean.aunis@prescom.fr)> wrote:
Quote:
Hello,

I am searching a way to dial a SIP peer, and if it does not answer within 20 seconds, play an announcement to the caller. This means that the caller would hear a ring tone for 20 seconds, and only then hear the announcement if the callee did not answer.

I know it is possible to do this with ARI, but in this particular case I do not want to use ARI. I would like to do this purely with dialplan and AGI scripts, but I cannot find a way. I have read about the "m" option of Dial application, but it starts the announcement immediately, whereas I would like to start it after 20 seconds of timeout.

Does anybody have an idea ?

Best regards,

Jean Aunis


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



--
A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.
---Heinlein








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



--
A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.
---Heinlein






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

Join the Asterisk Community at the 13th AstriCon, September 27-29, 2016
      http://www.asterisk.org/community/astricon-user-conference

New to Asterisk? Start here:
      https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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




--

David Duffett
Digium, Inc. · Director, Worldwide Asterisk Community
6 Landscape Close · Weston on the Green · Bicester · Oxfordshire OX25 3SX · UK
direct/fax: +1 256 428 6119 · mobile: +44 7722 442236
twitter: dduffett · linkedin: www.linkedin.com/in/davidduffett 
Check us out at: http://digium.com · http://asterisk.org  
Back to top
jean.aunis at prescom.fr
Guest





PostPosted: Tue Aug 23, 2016 11:19 am    Post subject: [asterisk-users] Dial and start music on hold after timeout Reply with quote

Thank you, I just tried your suggestion. Strangely, the announcement is played only if I try to dial a SIP peer which is not available (not registered to be more precise). If the SIP peer is available, I only get the ring tone, and never hear the announcement. Here is the dialplan (I had to add an Answer() before the Dial, otherwise the announcement is never played, even in the first case) :
exten = 007,1,Answer()
same  = n,Dial(SIP/foo&Local/s@playme,40)

[playme]
exten = s,1,Ringing()
same  = n,Wait(10)
same  = n,Playback(/var/lib/asterisk/sounddir/announce,noanswer) When it is working, I can see the following output in the CLI, which is not there otherwise :
-- SIP/xxxxxxxxx requested media update control 26, passing it to Local/s@playme-000005be;1

Otherwise, no error message, Asterisk tells he is playing the announcement but I don't hear it.

Best regards

Jean Aunis

Le 23/08/2016 à 16:07, David Duffett a écrit :

Quote:
How about:

exten => s,1,Dial(SIP/alice&LOCAL/555@delayed-announce,40)



[delayed-announce]
exten =>  555,1,Wait(20)
same => n,Playback(myannouncement,noanswer)

same => n,NoOP(Whatever else you want to do goes here)



The 'noanswer' option on the Playback means that SIP/alice should continue to ring for the remaining 20 of the 40 seconds, as the Playback will not answer (terminate) the call.


Don't forget AstriCon this year - www.astricon.net


On 23 August 2016 at 12:52, Israel Gottlieb <isrlgb@gmail.com (isrlgb@gmail.com)> wrote:
Quote:

You could m and make a moh file that has ringing the first 30 sec and then the anouncment
בתאריך 22 באוג׳ 2016 7:19 PM,‏ "Jean Aunis" <jean.aunis@prescom.fr (jean.aunis@prescom.fr)> כתב:
Quote:

Thank you for the idea. The problem with RetryDial, is that it will cancel the first call, play the announce and then dial the SIP peer once again, so the telephone will display a missed call. I would prefer to do everything in a single call.

Le 22/08/2016 à 17:57, John Kiniston a écrit :

Quote:
You could try using RetryDial() instead of Dial, It supports playing an announcement.



On Mon, Aug 22, 2016 at 8:45 AM, Jean Aunis <jean.aunis@prescom.fr (jean.aunis@prescom.fr)> wrote:
Quote:

Sorry, I forgot to write that the SIP peer must keep ringing while the announcement is being played.

Le 22/08/2016 à 17:42, John Kiniston a écrit :

Quote:
This seems like the obvious answer but maybe I'm misunderstanding the question.


exten => s,1,Dial(SIP/alice,20)

 same =>   n,Playback(myannouncement)

 same =>   n,NoOP(Whatever else you want to do goes here)


On Mon, Aug 22, 2016 at 8:36 AM, Jean Aunis <jean.aunis@prescom.fr (jean.aunis@prescom.fr)> wrote:
Quote:
Hello,

I am searching a way to dial a SIP peer, and if it does not answer within 20 seconds, play an announcement to the caller. This means that the caller would hear a ring tone for 20 seconds, and only then hear the announcement if the callee did not answer.

I know it is possible to do this with ARI, but in this particular case I do not want to use ARI. I would like to do this purely with dialplan and AGI scripts, but I cannot find a way. I have read about the "m" option of Dial application, but it starts the announcement immediately, whereas I would like to start it after 20 seconds of timeout.

Does anybody have an idea ?

Best regards,

Jean Aunis


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



--
A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.
---Heinlein








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



--
A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.
---Heinlein






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

Join the Asterisk Community at the 13th AstriCon, September 27-29, 2016
      http://www.asterisk.org/community/astricon-user-conference

New to Asterisk? Start here:
      https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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




--

David Duffett
Digium, Inc. · Director, Worldwide Asterisk Community
6 Landscape Close · Weston on the Green · Bicester · Oxfordshire OX25 3SX · UK
direct/fax: +1 256 428 6119 · mobile: +44 7722 442236
twitter: dduffett · linkedin: www.linkedin.com/in/davidduffett 
Check us out at: http://digium.com · http://asterisk.org  








Back to top
johnkiniston at gmail.com
Guest





PostPosted: Tue Aug 23, 2016 1:43 pm    Post subject: [asterisk-users] Dial and start music on hold after timeout Reply with quote

Damn, I was going to suggest trying a Queue with a single member using the 'r' option to play ringing instead of MOH and using an announcement but the queue will stop ringing your agent while it plays the announcement.


It'd go right back to ringing after the announcement however.


On Mon, Aug 22, 2016 at 8:45 AM, Jean Aunis <jean.aunis@prescom.fr (jean.aunis@prescom.fr)> wrote:
Quote:

Sorry, I forgot to write that the SIP peer must keep ringing while the announcement is being played.

Le 22/08/2016 à 17:42, John Kiniston a écrit :

Quote:
This seems like the obvious answer but maybe I'm misunderstanding the question.


exten => s,1,Dial(SIP/alice,20)

 same =>   n,Playback(myannouncement)

 same =>   n,NoOP(Whatever else you want to do goes here)


On Mon, Aug 22, 2016 at 8:36 AM, Jean Aunis <jean.aunis@prescom.fr (jean.aunis@prescom.fr)> wrote:
Quote:
Hello,

I am searching a way to dial a SIP peer, and if it does not answer within 20 seconds, play an announcement to the caller. This means that the caller would hear a ring tone for 20 seconds, and only then hear the announcement if the callee did not answer.

I know it is possible to do this with ARI, but in this particular case I do not want to use ARI. I would like to do this purely with dialplan and AGI scripts, but I cannot find a way. I have read about the "m" option of Dial application, but it starts the announcement immediately, whereas I would like to start it after 20 seconds of timeout.

Does anybody have an idea ?

Best regards,

Jean Aunis


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



--
A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.
---Heinlein








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



--
A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.
---Heinlein
Back to top
isrlgb at gmail.com
Guest





PostPosted: Tue Aug 23, 2016 1:54 pm    Post subject: [asterisk-users] Dial and start music on hold after timeout Reply with quote

Maybe try progress() instead of answer ()
בתאריך 23 באוג׳ 2016 7:19 PM,‏ "Jean Aunis" <jean.aunis@prescom.fr (jean.aunis@prescom.fr)> כתב:
Quote:

Thank you, I just tried your suggestion. Strangely, the announcement is played only if I try to dial a SIP peer which is not available (not registered to be more precise). If the SIP peer is available, I only get the ring tone, and never hear the announcement. Here is the dialplan (I had to add an Answer() before the Dial, otherwise the announcement is never played, even in the first case) :
exten = 007,1,Answer()
same  = n,Dial(SIP/foo&Local/s@playme,40)

[playme]
exten = s,1,Ringing()
same  = n,Wait(10)
same  = n,Playback(/var/lib/asterisk/sounddir/announce,noanswer) When it is working, I can see the following output in the CLI, which is not there otherwise :
-- SIP/xxxxxxxxx requested media update control 26, passing it to Local/s@playme-000005be;1

Otherwise, no error message, Asterisk tells he is playing the announcement but I don't hear it.

Best regards

Jean Aunis

Le 23/08/2016 à 16:07, David Duffett a écrit :

Quote:
How about:

exten => s,1,Dial(SIP/alice&LOCAL/555@delayed-announce,40)



[delayed-announce]
exten =>  555,1,Wait(20)
same => n,Playback(myannouncement,noanswer)

same => n,NoOP(Whatever else you want to do goes here)



The 'noanswer' option on the Playback means that SIP/alice should continue to ring for the remaining 20 of the 40 seconds, as the Playback will not answer (terminate) the call.


Don't forget AstriCon this year - www.astricon.net


On 23 August 2016 at 12:52, Israel Gottlieb <isrlgb@gmail.com (isrlgb@gmail.com)> wrote:
Quote:

You could m and make a moh file that has ringing the first 30 sec and then the anouncment
בתאריך 22 באוג׳ 2016 7:19 PM,‏ "Jean Aunis" <jean.aunis@prescom.fr (jean.aunis@prescom.fr)> כתב:
Quote:

Thank you for the idea. The problem with RetryDial, is that it will cancel the first call, play the announce and then dial the SIP peer once again, so the telephone will display a missed call. I would prefer to do everything in a single call.

Le 22/08/2016 à 17:57, John Kiniston a écrit :

Quote:
You could try using RetryDial() instead of Dial, It supports playing an announcement.



On Mon, Aug 22, 2016 at 8:45 AM, Jean Aunis <jean.aunis@prescom.fr (jean.aunis@prescom.fr)> wrote:
Quote:

Sorry, I forgot to write that the SIP peer must keep ringing while the announcement is being played.

Le 22/08/2016 à 17:42, John Kiniston a écrit :

Quote:
This seems like the obvious answer but maybe I'm misunderstanding the question.


exten => s,1,Dial(SIP/alice,20)

 same =>   n,Playback(myannouncement)

 same =>   n,NoOP(Whatever else you want to do goes here)


On Mon, Aug 22, 2016 at 8:36 AM, Jean Aunis <jean.aunis@prescom.fr (jean.aunis@prescom.fr)> wrote:
Quote:
Hello,

I am searching a way to dial a SIP peer, and if it does not answer within 20 seconds, play an announcement to the caller. This means that the caller would hear a ring tone for 20 seconds, and only then hear the announcement if the callee did not answer.

I know it is possible to do this with ARI, but in this particular case I do not want to use ARI. I would like to do this purely with dialplan and AGI scripts, but I cannot find a way. I have read about the "m" option of Dial application, but it starts the announcement immediately, whereas I would like to start it after 20 seconds of timeout.

Does anybody have an idea ?

Best regards,

Jean Aunis


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



--
A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.
---Heinlein








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



--
A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.
---Heinlein






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

Join the Asterisk Community at the 13th AstriCon, September 27-29, 2016
      http://www.asterisk.org/community/astricon-user-conference

New to Asterisk? Start here:
      https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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




--

David Duffett
Digium, Inc. · Director, Worldwide Asterisk Community
6 Landscape Close · Weston on the Green · Bicester · Oxfordshire OX25 3SX · UK
direct/fax: +1 [url=tel:256%20428%206119]256 428 6119[/url] · mobile: +44 7722 442236
twitter: dduffett · linkedin: www.linkedin.com/in/davidduffett 
Check us out at: http://digium.com · http://asterisk.org  











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

Join the Asterisk Community at the 13th AstriCon, September 27-29, 2016
      http://www.asterisk.org/community/astricon-user-conference

New to Asterisk? Start here:
      https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
jean.aunis at prescom.fr
Guest





PostPosted: Wed Aug 24, 2016 2:27 am    Post subject: [asterisk-users] Dial and start music on hold after timeout Reply with quote

Using Progress didn't solve the problem. If I cannot find another way, I will use your solution of recording the ring tone.
Le 23/08/2016 à 20:53, Israel Gottlieb a écrit :

Quote:

Maybe try progress() instead of answer ()
בתאריך 23 באוג׳ 2016 7:19 PM,‏ "Jean Aunis" <jean.aunis@prescom.fr (jean.aunis@prescom.fr)> כתב:
Quote:

Thank you, I just tried your suggestion. Strangely, the announcement is played only if I try to dial a SIP peer which is not available (not registered to be more precise). If the SIP peer is available, I only get the ring tone, and never hear the announcement. Here is the dialplan (I had to add an Answer() before the Dial, otherwise the announcement is never played, even in the first case) :
exten = 007,1,Answer()
same  = n,Dial(SIP/foo&Local/s@playme,40)

[playme]
exten = s,1,Ringing()
same  = n,Wait(10)
same  = n,Playback(/var/lib/asterisk/sounddir/announce,noanswer) When it is working, I can see the following output in the CLI, which is not there otherwise :
-- SIP/xxxxxxxxx requested media update control 26, passing it to Local/s@playme-000005be;1

Otherwise, no error message, Asterisk tells he is playing the announcement but I don't hear it.

Best regards

Jean Aunis



Back to top
dduffett at digium.com
Guest





PostPosted: Wed Aug 24, 2016 2:52 am    Post subject: [asterisk-users] Dial and start music on hold after timeout Reply with quote

Yes, sorry, my idea was too simplistic, as it did not take into account that the caller would already be hearing the ringing and therefore the announcement would need to be somehow mixed with that ringing...

On 24 August 2016 at 08:27, Jean Aunis <jean.aunis@prescom.fr (jean.aunis@prescom.fr)> wrote:
Quote:

Using Progress didn't solve the problem. If I cannot find another way, I will use your solution of recording the ring tone.
Le 23/08/2016 à 20:53, Israel Gottlieb a écrit :

Quote:

Maybe try progress() instead of answer ()
בתאריך 23 באוג׳ 2016 7:19 PM,‏ "Jean Aunis" <jean.aunis@prescom.fr (jean.aunis@prescom.fr)> כתב:
Quote:

Thank you, I just tried your suggestion. Strangely, the announcement is played only if I try to dial a SIP peer which is not available (not registered to be more precise). If the SIP peer is available, I only get the ring tone, and never hear the announcement. Here is the dialplan (I had to add an Answer() before the Dial, otherwise the announcement is never played, even in the first case) :
exten = 007,1,Answer()
same  = n,Dial(SIP/foo&Local/s@playme,40)

[playme]
exten = s,1,Ringing()
same  = n,Wait(10)
same  = n,Playback(/var/lib/asterisk/sounddir/announce,noanswer) When it is working, I can see the following output in the CLI, which is not there otherwise :
-- SIP/xxxxxxxxx requested media update control 26, passing it to Local/s@playme-000005be;1

Otherwise, no error message, Asterisk tells he is playing the announcement but I don't hear it.

Best regards

Jean Aunis






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

Join the Asterisk Community at the 13th AstriCon, September 27-29, 2016
      http://www.asterisk.org/community/astricon-user-conference

New to Asterisk? Start here:
      https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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




--

David Duffett
Digium, Inc. · Director, Worldwide Asterisk Community
6 Landscape Close · Weston on the Green · Bicester · Oxfordshire OX25 3SX · UK
direct/fax: +1 256 428 6119 · mobile: +44 7722 442236
twitter: dduffett · linkedin: www.linkedin.com/in/davidduffett 
Check us out at: http://digium.com · http://asterisk.org  
Back to top
venefax at gmail.com
Guest





PostPosted: Wed Aug 24, 2016 5:40 am    Post subject: [asterisk-users] Dial and start music on hold after timeout Reply with quote

​I have the same exact issue. I cannot push any sounds or even Playtones to the caller, unless the channel is answered, which is not possible for billing reasons.

I am also using the Local channel & Dial(PJSIP/...).

I think this is a bug in Asterisk 13. The Dial function has not answered yet, so the Local channel should be able to play anything to the caller, without answering, in parallel with Dial.

Should I open a JIRA ticket?
Back to top
isrlgb at gmail.com
Guest





PostPosted: Wed Aug 24, 2016 6:02 am    Post subject: [asterisk-users] Dial and start music on hold after timeout Reply with quote

Are you sending progress?
בתאריך 24 באוג׳ 2016 13:40,‏ "Saint Michael" <venefax@gmail.com (venefax@gmail.com)> כתב:
Quote:
​I have the same exact issue. I cannot push any sounds or even Playtones to the caller, unless the channel is answered, which is not possible for billing reasons.

I am also using the Local channel & Dial(PJSIP/...).

I think this is a bug in Asterisk 13. The Dial function has not answered yet, so the Local channel should be able to play anything to the caller, without answering, in parallel with Dial.

Should I open a JIRA ticket?





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

Join the Asterisk Community at the 13th AstriCon, September 27-29, 2016
      http://www.asterisk.org/community/astricon-user-conference

New to Asterisk? Start here:
      https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
mjordan at digium.com
Guest





PostPosted: Thu Aug 25, 2016 4:15 pm    Post subject: [asterisk-users] Dial and start music on hold after timeout Reply with quote

On Wed, Aug 24, 2016 at 6:02 AM, Israel Gottlieb <isrlgb@gmail.com> wrote:
Quote:
Are you sending progress?


בתאריך 24 באוג׳ 2016 13:40,‏ "Saint Michael" <venefax@gmail.com> כתב:
Quote:

I have the same exact issue. I cannot push any sounds or even Playtones to
the caller, unless the channel is answered, which is not possible for
billing reasons.
I am also using the Local channel & Dial(PJSIP/...).
I think this is a bug in Asterisk 13. The Dial function has not answered
yet, so the Local channel should be able to play anything to the caller,
without answering, in parallel with Dial.
Should I open a JIRA ticket?


This behavior is exactly the same as it has always been. As Richard
mentioned in your other thread, there is no bug here [1]. You have
multiple options:

(1) Indicating Ringing in the dialplan. Depending on your
configuration, Asterisk will generate a 180 and pass it back to the
caller, causing them to ring or it will generate a 183 and play a
ringing tone back to the caller itself.

(2) Indicate Progress in the dialplan. This will send back a 183 to
the caller and, if possible, will send sound from Asterisk to the
caller. You then have multiple options here:
(2a) If Asterisk has the ability to perform early bridging with an
outbound channel, it will. If not, it won't - and it won't mix the
early media from multiple outbound channels.
(2b) You can play media back yourself using MoH or one of the other
sound generation applications.

(3) Wait for one of your outbound channels to pass a 180 back, and
allow that to cause the inbound channel to ring.

[1] http://lists.digium.com/pipermail/asterisk-users/2016-August/289781.html

--
Matthew Jordan
Digium, Inc. | CTO
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: http://digium.com & http://asterisk.org

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

Join the Asterisk Community at the 13th AstriCon, September 27-29, 2016
http://www.asterisk.org/community/astricon-user-conference

New to Asterisk? Start here:
https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services