Has anyone here implemented "Ring back when free" in Asterisk? The way it works in the UK is as follows: 1. A calls B. B is engaged (busy). 2. A hears "The number you called is busy. To use ringback, press 5" 3. A presses 5, and hears "Your ringback request has been accepted". 4. A hangs up. 5. Later, B hangs up. The system then calls A (if A is now busy, it waits until A is clear again). 6. If/when A answers, the system calls B on A's behalf and A hears ringing. Any implementation has to cater for the fact that when B is busy, he could be either the calling or the called party on his current call. If he is the calling party, he will execute 'h' when he clears, but if he is the called party, he won't be in the dialplan to execute 'h', so we need some other way to invoke the ringback (step 5). Thoughts? Cheers Tony -- Tony Mountifield Work: tony at softins.co.uk - http://www.softins.co.uk Play: tony at mountifield.org - http://tony.mountifield.org
Thinking out loud: write a asterisk call file (when the calling user presses 5) which keeps on trying to connect the two. On Fri, 2008-04-04 at 10:35 +0000, Tony Mountifield wrote:> Has anyone here implemented "Ring back when free" in Asterisk? > > The way it works in the UK is as follows: > > 1. A calls B. B is engaged (busy). > 2. A hears "The number you called is busy. To use ringback, press 5" > 3. A presses 5, and hears "Your ringback request has been accepted". > 4. A hangs up. > 5. Later, B hangs up. The system then calls A (if A is now busy, it > waits until A is clear again). > 6. If/when A answers, the system calls B on A's behalf and A hears ringing. > > Any implementation has to cater for the fact that when B is busy, he > could be either the calling or the called party on his current call. > If he is the calling party, he will execute 'h' when he clears, but > if he is the called party, he won't be in the dialplan to execute 'h', > so we need some other way to invoke the ringback (step 5). > > Thoughts? > > Cheers > Tony-- Faraz R Khan Chief Architect Emergen Consulting Pvt Ltd +92.21.111.111.320 x200 www.emergen.biz
On 10:35, Fri 04 Apr 08, Tony Mountifield wrote:> Has anyone here implemented "Ring back when free" in Asterisk? > > The way it works in the UK is as follows: > > 1. A calls B. B is engaged (busy). > 2. A hears "The number you called is busy. To use ringback, press 5" > 3. A presses 5, and hears "Your ringback request has been accepted". > 4. A hangs up. > 5. Later, B hangs up. The system then calls A (if A is now busy, it > waits until A is clear again). > 6. If/when A answers, the system calls B on A's behalf and A hears ringing. > > Any implementation has to cater for the fact that when B is busy, he > could be either the calling or the called party on his current call. > If he is the calling party, he will execute 'h' when he clears, but > if he is the called party, he won't be in the dialplan to execute 'h', > so we need some other way to invoke the ringback (step 5). > > Thoughts?Have a look at this: http://bugs.digium.com/view.php?id=10689 -- Michiel van Baak michiel at vanbaak.eu http://michiel.vanbaak.eu GnuPG key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x71C946BD "Why is it drug addicts and computer aficionados are both called users?"
Hey Tony, in the pbx space that feature is called "camp on" I have no idea why - just thought I'd let you know. Regards, Dean Collins Cognation Pty Ltd dean at cognation.net +1-212-203-4357 +61-2-9016-5642 (Sydney in-dial).> -----Original Message----- > From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users- > bounces at lists.digium.com] On Behalf Of Tony Mountifield > Sent: Friday, 4 April 2008 6:35 AM > To: asterisk-users at lists.digium.com > Subject: [asterisk-users] Ring back when free? > > Has anyone here implemented "Ring back when free" in Asterisk? > > The way it works in the UK is as follows: > > 1. A calls B. B is engaged (busy). > 2. A hears "The number you called is busy. To use ringback, press 5" > 3. A presses 5, and hears "Your ringback request has been accepted". > 4. A hangs up. > 5. Later, B hangs up. The system then calls A (if A is now busy, it > waits until A is clear again). > 6. If/when A answers, the system calls B on A's behalf and A hearsringing.> > Any implementation has to cater for the fact that when B is busy, he > could be either the calling or the called party on his current call. > If he is the calling party, he will execute 'h' when he clears, but > if he is the called party, he won't be in the dialplan to execute 'h', > so we need some other way to invoke the ringback (step 5). > > Thoughts? > > Cheers > Tony > -- > Tony Mountifield > Work: tony at softins.co.uk - http://www.softins.co.uk > Play: tony at mountifield.org - http://tony.mountifield.org > > _______________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users
"core show application retrydial" You need to do a "core show applications" and look at what apps are included with Asterisk. Tony Mountifield wrote:> Has anyone here implemented "Ring back when free" in Asterisk? > > The way it works in the UK is as follows: > > 1. A calls B. B is engaged (busy). > 2. A hears "The number you called is busy. To use ringback, press 5" > 3. A presses 5, and hears "Your ringback request has been accepted". > 4. A hangs up. > 5. Later, B hangs up. The system then calls A (if A is now busy, it > waits until A is clear again). > 6. If/when A answers, the system calls B on A's behalf and A hears ringing. > > Any implementation has to cater for the fact that when B is busy, he > could be either the calling or the called party on his current call. > If he is the calling party, he will execute 'h' when he clears, but > if he is the called party, he won't be in the dialplan to execute 'h', > so we need some other way to invoke the ringback (step 5). > > Thoughts? > > Cheers > Tony-- Consulting for Asterisk, Polycom, Sangoma, Digium, Cisco, LAN, WAN, QoS, T-1, PRI, Frame Relay, Linux, and network design. Based near Birmingham, AL. Now accepting clients worldwide.
Yehavi Bourvine +972-8-9489444
2008-Apr-06 07:02 UTC
[asterisk-users] Ring back when free?
> Has anyone here implemented "Ring back when free" in Asterisk?Here is what I do; the dialplan enclosed is in AEL2 format, but you can get the idea. When a call is originated I save the called and callee numbers in a database. If the user gets busy he/she hangs up and dial *41. I then retreive the last number they dialled and place a flag in the database that someone is camping on it. The H extension checks this flag and if found generates a .call file. First, I have a macro to save the for each extension who is the last they called and the last who called them: // Save the calling and called numbers in To and From and in the database so // they can be used by *41 and *42. This way the h extension can acecss this // database for all destinations. macro Save_From_to ( ) { // To and From are used in the dialplan, since we might change ${EXTEN} Set(_To=${MACRO_EXTEN}); Set(_From=${CALLERID(num)}); NoOp("===== ${From} -> ${To}); // Save them in database for later use. // Save the caller number at the called extension for *42 usage. Set(DB(${To}/LastCaller)=${From}); // Where we called for *41 Set(DB(${From}/LastCalled)=${To}); }; This macro is called at the beginning of the "normal" dialplan. Now, the *41 which registers the "camp-on" using the data saved above: // *41: Camp on the last extension dialled *41 => { Set(tmp=${DB(${CALLERID(num)}/LastCalled)}); // Save it so when the other side hangs it will see it and dial us. Set(DB(${tmp}/CallBack)=${CALLERID(num)}); // Say the number to caller so he can verify... SayDigits(${tmp}); Hangup(); }; And now the H extension for handling it: // The Hangup extension which is called when the call is hanged. See whether // we have some waiting callback waiting on this extension. h => { ResetCDR(w); // To make the CDR correct. NoOp(${From}); // We have to check the two sides of the call: Those who camp on the calling and // those who camp on the called. Set(tmp=${DB(${From}/CallBack)}); // The calling. if("${tmp}" != "") { // Something is there. DBdel(${From}/CallBack); // And delete it... // Create the callfile and then move it to the spool directory to make the call. System(echo Channel: SIP/${tmp} > /tmp/test.tmp${From}) ; System(echo WaitTime: 20 >> /tmp/test.tmp${From}); System(echo Extension: ${From} >> /tmp/test.tmp${From}); System(echo CallerID: Callback \\\<${tmp}\\\> >> /tmp/te st.tmp${From}); System(mv /tmp/test.tmp${From} /var/spool/asterisk/outgo ing/); }; Set(tmp=${DB(${To}/CallBack)}); // The called if("${tmp}" != "") { // Something is there DBdel(${To}/CallBack); // And delete it... // Create the callfile and then move it to the spool directory to make the call. System(echo Channel: SIP/${tmp} > /tmp/test.tmp${To}); System(echo WaitTime: 20 >> /tmp/test.tmp${To}); System(echo Extension: ${To} >> /tmp/test.tmp${To}); System(echo CallerID: Callback \\\<${tmp}\\\> >> /tmp/te st.tmp${To}); System(mv /tmp/test.tmp${To} /var/spool/asterisk/outgoin g/); }; }; Good luck! __Yehavi: