Re: [asterisk-users] Callback on busy

2017-01-27 Thread Steve Edwards

On Fri, 27 Jan 2017, Michele Pinassi wrote:


i'm using Asterisk as a media box for a VoIP network based on OpenSIPS.
When an user phone is busy, call was forwarded to an asterisk ext:

; ===
; Voicemail on NOT AVAILABLE
; ===
exten => _VMR_.,1,Noop("from-voip: ${CALLERID(num)} ${EXTEN}")
exten => _VMR_.,n,Set(DID=${EXTEN:4})
exten => _VMR_.,n,Answer()
exten => _VMR_.,n,Wait(1)
exten => _VMR_.,n,GotoIf(${VM_INFO(${DID},exists)}?avail:unavail)
exten => _VMR_.,n(avail),Voicemail(${DID},u)
exten => _VMR_.,n,Hangup()
exten => _VMR_.,n(unavail),Playback(vm-theperson)
exten => _VMR_.,n,SayDigits(${DID});
exten => _VMR_.,n,Playback(vm-isunavail)
exten => _VMR_.,n,Read(digit,vm-tocallback,1,,1,5)
exten => _VMR_.,n,Gotoif($["${digit}" = "2"]?:skip,1,5)
exten => _VMR_.,n,Noop("Add callback for ${DID} from ${CALLERID(num)}")
exten => _VMR_.,n,AGI(callback,${DID},${CALLERID(num)})
exten => _VMR_.,n,Playback(goodbye)
exten => _VMR_.(skip),n,Hangup()

when a vocal message asks to press "2" to add a callback when called
users return free, using an AGI script that create a .call file:



#!/usr/bin/php -q
\n");
fputs($cf,"MaxRetries: 100\n");
fputs($cf,"RetryTime: 30\n");
fputs($cf,"Archive: Yes\n");
fputs($cf,"SetVar: CALLER=$caller\n");
fputs($cf,"SetVar: CALLED=$called\n");
fclose($cf);

?>


0) This is not an AGI script. It does not read the AGI environment from 
STDIN and does not make any AGI requests. You could execute it using the 
system() application and it should execute the same -- maybe a couple of 
nanoseconds faster because Asterisk does not need to create the AGI 
environment or fiddle with file descriptors.


1) You should not create the call file in the spool directory. Doing so 
introduces a 'race condition' where Asterisk could start to read the file 
before your script is finished writing it. You should create the call file 
in another directory on the same file system and 'mv' it to the spool 
directory. /tmp/ or /var/tmp/ are usually suitable. ('mv' is 'atomic' -- 
it happens all at once.)


2) Visit http://www.voip-info.org/wiki/view/Asterisk+auto-dial+out to 
learn more about the call file format.


Think of call files in terms of legs. The first leg uses the 'channel' 
argument to originate the call. If that call is answered, 'leg 2' 
execution continues either in the dialplan at 'context:extension:priority' 
or the 'application:data' is executed.


Visit http://www.voip-info.org/wiki/view/Asterisk+local+channels to learn 
more about local channels. I think the syntax section will be most 
helpful.


I need that Asterisk call CALLED user and, when answered, start calling 
CALLER.


Yes, but the concept of 'answered' is vague if you are using analog 
channels.


Visit http://www.voip-info.org and search for 'asterisk call back' for 
examples of how others have approached this problem.


--
Thanks in advance,
-
Steve Edwards   sedwa...@sedwards.com  Voice: +1-760-468-3867 PST
https://www.linkedin.com/in/steve-edwards-4244281

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

Check out the new Asterisk community forum at: https://community.asterisk.org/

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


Re: [asterisk-users] callback on busy

2012-07-27 Thread pepesz
Thanks a lot !

I will try the suggested solutions :)

Cheers!
pepesz


On Thu, Jul 26, 2012 at 3:02 PM, pepesz pep...@gmail.com wrote:

 Dear all,

 I know the topic comes back like boomerang, but I did not find a nice
 solution.
 Does someone has/knows how to achieve call back on busy otherwise called
 camping?
 If one is calling the extension and it is busy, then caller should get
 something like Press 5 to request call back and after the previous call
 is finished the system should:
 1) call caller
 2) dial callee

 or something similar ;)

 This topic comes back so many times - I'm wonder if there is already a
 function for that implemented in asterisk (my current one is 10.5)
 Thanks in advance.

 pepesz

--
_
-- 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] callback on busy

2012-07-26 Thread Danny Nicholas
The inherent problem with this is that it either requires a brute force
solution or a queue and call solution.  The brute Force solution would
be something like this:

[callee-is-busy]

Exten = s,1,playback(callbackmsg)

Exten = s,n,wait(3)

Exten = s,n,playback(vm-goodbye)

Exten = s,n,hangup()

Exten = 5,1,agi(writecallback.sh,$(CALLERID(num)},${EXTEN})

Exten = 5,n,playback(vm-goodbye)

Exten = 5,n,hangup()

Exten = I,1,playback(invalid-selection)

Exten = I,n,goto(callee-is-busy,s,1)

 

Writecallback.sh

#!/bin/sh

Echo Channel: DAHDI/g1/$1  retcall.txt

Echo CallerID: $2  retcall.txt

Echo Maxtries: 50  retcall.txt

Echo WaitTime: 60  retcall.txt

Echo retryTime: 15  retcall.txt

Echo Context: default  retcall.txt

Mv retcall.txt /var/spool/asterisk/outgoing

 

The queue and call solution would involve using a shell to monitor the
extension using AMI or asterisk -rx core show channels verbose to see when
the line became available, then launching the call using the
writecallback.sh above.

 

Here is a link to a wait for available solution -
http://www.voip-info.org/wiki/view/Asterisk+tips+campon

 

From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of pepesz
Sent: Thursday, July 26, 2012 8:03 AM
To: asterisk-users@lists.digium.com
Subject: [asterisk-users] callback on busy

 

Dear all,

I know the topic comes back like boomerang, but I did not find a nice
solution.
Does someone has/knows how to achieve call back on busy otherwise called
camping?
If one is calling the extension and it is busy, then caller should get
something like Press 5 to request call back and after the previous call is
finished the system should:
1) call caller
2) dial callee

or something similar ;)

This topic comes back so many times - I'm wonder if there is already a
function for that implemented in asterisk (my current one is 10.5)
Thanks in advance. 

pepesz

--
_
-- 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] callback on busy

2012-07-26 Thread Richard Mudgett
 I know the topic comes back like boomerang , but I did not find a
 nice solution.
 Does someone has/knows how to achieve call back on busy otherwise
 called camping?
 If one is calling the extension and it is busy, then caller should
 get something like Press 5 to request call back and after the
 previous call is finished the system should:
 1) call caller
 2) dial callee
 
 or something similar ;)
 
 This topic comes back so many times - I'm wonder if there is already
 a function for that implemented in asterisk (my current one is 10.5)
 Thanks in advance.

You want call completion which has been in Asterisk since v1.8:

https://wiki.asterisk.org/wiki/display/AST/Call+Completion+Supplementary+Services+%28CCSS%29

Richard

--
_
-- 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] callback on busy

2012-07-26 Thread Duncan Turnbull

On 27/07/2012, at 3:42 AM, Richard Mudgett rmudg...@digium.com wrote:

 I know the topic comes back like boomerang , but I did not find a
 nice solution.
 Does someone has/knows how to achieve call back on busy otherwise
 called camping?
 If one is calling the extension and it is busy, then caller should
 get something like Press 5 to request call back and after the
 previous call is finished the system should:
 1) call caller
 2) dial callee
 
 or something similar ;)
 
 This topic comes back so many times - I'm wonder if there is already
 a function for that implemented in asterisk (my current one is 10.5)
 Thanks in advance.
 
 You want call completion which has been in Asterisk since v1.8:
 
 https://wiki.asterisk.org/wiki/display/AST/Call+Completion+Supplementary+Services+%28CCSS%29
 

This is what I am guessing FreePBX uses to do it too

http://www.freepbx.org/trac/ticket/778


 Richard
 
 --
 _
 -- 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] callback on busy

2006-01-05 Thread Giovanni Miano
www.voip-info.org/tiki-index.php?page=Asterisk+auto-dial+outCheers,Giovanni Miano2006/1/5, Hill, John 
[EMAIL PROTECTED]:
I was looking for a way to catch the zap busy return and do a redial.I would dial out on a zap channel. If the call is busy it would then hangupthe zap channel and ask if I wanted to redial press 1 to redial or hangup
to quit.On the 1 it would hangup the extension redial the number and call back theextension after x number of tries. If the number still was busy then itplays a message that it was busy would I like to continue or quit.
Thanks--John Hill--This mail was scanned by AntiVir Milter.This product is licensed for non-commercial use.See www.antivir.de for details.
___--Bandwidth and Colocation provided by Easynews.com --Asterisk-Users mailing listTo UNSUBSCRIBE or update options visit:
 http://lists.digium.com/mailman/listinfo/asterisk-users-- Giovanni Miano
___
--Bandwidth and Colocation provided by Easynews.com --

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


RE: [Asterisk-Users] callback on busy

2006-01-05 Thread John Hill



I looked at this. 
Iguess I willuse dialstatus busy and create a 
.call file And see what happens.
Thanks
--john

  
  
  From: [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED] On Behalf Of Giovanni 
  MianoSent: Thursday, January 05, 2006 4:05 PMTo: 
  Asterisk Users Mailing List - Non-Commercial DiscussionSubject: Re: 
  [Asterisk-Users] callback on busy
  www.voip-info.org/tiki-index.php?page=Asterisk+auto-dial+outCheers,Giovanni 
  Miano
  2006/1/5, Hill, John  [EMAIL PROTECTED]:
  I 
was looking for a way to catch the zap busy return and do a redial.I 
would dial out on a zap channel. If the call is busy it would then 
hangupthe zap channel and ask if I wanted to redial "press 1 to redial 
or hangup to quit".On the 1 it would hangup the extension redial the 
number and call back theextension after x number of tries. If the number 
still was busy then itplays a message that it was busy would I like to 
continue or quit. Thanks--John 
Hill--This mail was scanned by AntiVir 
Milter.This product is licensed for non-commercial use.See www.antivir.de for details. 
___--Bandwidth and 
Colocation provided by Easynews.com 
--Asterisk-Users mailing listTo UNSUBSCRIBE or update options 
visit:  http://lists.digium.com/mailman/listinfo/asterisk-users-- Giovanni Miano -- This mail was scanned by AntiVir 
  Milter. This product is licensed for non-commercial use. See www.antivir.de 
  for details.

--
This mail was scanned by AntiVir Milter.
This product is licensed for non-commercial use.
See www.antivir.de for details.___
--Bandwidth and Colocation provided by Easynews.com --

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


Re: [Asterisk-Users] callback on busy

2005-03-02 Thread Paradise Dove
consider this scenario:
A Calls B
B transfers A to C
C (is busy or does not answer) so A backs to B


On Tue, 1 Mar 2005 23:07:17 +0330, Paradise Dove [EMAIL PROTECTED] wrote:
 consider this scenario:
 A Calls B
 B transfers A to C
 C (is busy or does not answer) so B backs to A
 
 On Tue, 1 Mar 2005 14:25:33 -0500, C F [EMAIL PROTECTED] wrote:
  use retrydial.
  in the cli type show application retrydial
  have fun.
 
 
  On Tue, 1 Mar 2005 22:17:35 +0330, Paradise Dove [EMAIL PROTECTED] wrote:
   hi,
   is there anyway to implement callback on busy and callback on no 
   answer
   on asterisk? has anybody done this before?
   thanks,
   Paradise Dove
   ___
   Asterisk-Users mailing list
   Asterisk-Users@lists.digium.com
   http://lists.digium.com/mailman/listinfo/asterisk-users
   To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users
  
 

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


Re: [Asterisk-Users] callback on busy

2005-03-02 Thread C F
I havn't tried this but you could try making use of the ${RDNIS}
variable in the dial plan, and see if it works for you.


On Wed, 2 Mar 2005 16:28:21 +0330, Paradise Dove [EMAIL PROTECTED] wrote:
 consider this scenario:
 A Calls B
 B transfers A to C
 C (is busy or does not answer) so A backs to B
 
 On Tue, 1 Mar 2005 23:07:17 +0330, Paradise Dove [EMAIL PROTECTED] wrote:
  consider this scenario:
  A Calls B
  B transfers A to C
  C (is busy or does not answer) so B backs to A
 
  On Tue, 1 Mar 2005 14:25:33 -0500, C F [EMAIL PROTECTED] wrote:
   use retrydial.
   in the cli type show application retrydial
   have fun.
  
  
   On Tue, 1 Mar 2005 22:17:35 +0330, Paradise Dove [EMAIL PROTECTED] 
   wrote:
hi,
is there anyway to implement callback on busy and callback on no 
answer
on asterisk? has anybody done this before?
thanks,
Paradise Dove
___
Asterisk-Users mailing list
Asterisk-Users@lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users
   
  
 
 ___
 Asterisk-Users mailing list
 Asterisk-Users@lists.digium.com
 http://lists.digium.com/mailman/listinfo/asterisk-users
 To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users

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


Re: [Asterisk-Users] callback on busy

2005-03-01 Thread C F
use retrydial.
in the cli type show application retrydial
have fun.


On Tue, 1 Mar 2005 22:17:35 +0330, Paradise Dove [EMAIL PROTECTED] wrote:
 hi,
 is there anyway to implement callback on busy and callback on no answer
 on asterisk? has anybody done this before?
 thanks,
 Paradise Dove
 ___
 Asterisk-Users mailing list
 Asterisk-Users@lists.digium.com
 http://lists.digium.com/mailman/listinfo/asterisk-users
 To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users

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


Re: [Asterisk-Users] callback on busy

2005-03-01 Thread Eric Wieling
C F wrote:
use retrydial.
in the cli type show application retrydial
have fun.
This is only available in CVS-HEAD, not 1.0.x stable.
___
Asterisk-Users mailing list
Asterisk-Users@lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [Asterisk-Users] callback on busy

2005-03-01 Thread Paradise Dove
consider this scenario:
A Calls B
B transfers A to C
C (is busy or does not answer) so B backs to A


On Tue, 1 Mar 2005 14:25:33 -0500, C F [EMAIL PROTECTED] wrote:
 use retrydial.
 in the cli type show application retrydial
 have fun.
 
 
 On Tue, 1 Mar 2005 22:17:35 +0330, Paradise Dove [EMAIL PROTECTED] wrote:
  hi,
  is there anyway to implement callback on busy and callback on no answer
  on asterisk? has anybody done this before?
  thanks,
  Paradise Dove
  ___
  Asterisk-Users mailing list
  Asterisk-Users@lists.digium.com
  http://lists.digium.com/mailman/listinfo/asterisk-users
  To UNSUBSCRIBE or update options visit:
 http://lists.digium.com/mailman/listinfo/asterisk-users
 

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


Re: [Asterisk-Users] callback on busy

2005-03-01 Thread Wojciech Tryc
Yes, it's relatively easy
Contact me privately, if you need a hand
W
- Original Message - 
From: Paradise Dove [EMAIL PROTECTED]
To: Asterisk Users Mailing List - Non-Commercial Discussion 
asterisk-users@lists.digium.com
Sent: Tuesday, March 01, 2005 1:47 PM
Subject: [Asterisk-Users] callback on busy


hi,
is there anyway to implement callback on busy and callback on no 
answer
on asterisk? has anybody done this before?
thanks,
Paradise Dove
___
Asterisk-Users mailing list
Asterisk-Users@lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users

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


Re: [Asterisk-Users] callback on busy

2005-02-04 Thread Andrew Thompson
Bartosz Jozwiak wrote:
Hello everybody,
I would like to implement callback function.
When I call a person and his extension is busy I can press, for example, 5
and get a callback when his phone is not busy anymore.
When I create a call file and copy it to spool call folder
asterisk makes a call. One problem is that when extension is still busy
my phone rings and I get busy tone of the person who I am trying to reach.
Is there another way to do it ? Or do I need to check first if channel 
is free or
still busy ? Can anybody give me some hints ?
Are you passing the Dial line in your .call file?
Try building a context that has your logic in it, and directing the call 
file to it, after setting some appropriate parameters.

You should be able to discern from Dial() why you can't get ahold of the 
other party. Once you do, test for that case as a part of your logic. If 
the case still exists, write a new .call file and exit. If the case no 
longer exists, connect to the original caller and be done. (Assuming you 
are not on the phone now, as well!)

Seems like I read that you could date a .call file a little bit of time 
in the future and asterisk would wait to run it until then. This would 
be a way for you to buy some time between tries. If I'm just making this 
up, use cron to straighten it out.

--
Andrew Thompson
http://aktzero.com/
http://dev.asteriskdocs.org/
___
Asterisk-Users mailing list
Asterisk-Users@lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users