Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Sun Apr 05, 2020 1:07 pm
Hosted Voice Broadcast


All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: callback after hangup
PostPosted: Sun Oct 19, 2008 11:44 am 
Offline

Joined: Sun Aug 17, 2008 1:52 pm
Posts: 93
hi guys,

I have setup a callback and it works fine, but i want a very quick call-back system. if a caller calls a number, it won't answer or hangup the call and if user hold the line for ten seconds the callback will be failed because his number is busy of course.

what i want to do is to send the callback request only when he hangs up.
how can we do that?

thanks


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 30, 2008 4:27 pm 
Offline

Joined: Fri Jan 18, 2008 9:54 pm
Posts: 135
Hi,

Can u plz describe a scenario of what you want to happen..


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 30, 2008 8:49 pm 
Offline

Joined: Sun Aug 17, 2008 1:52 pm
Posts: 93
I want callback initiate after user HANG-UP, not while holding the line because the call back will fail when he's on call with us.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 31, 2008 12:37 am 
Offline
User avatar

Joined: Mon Apr 30, 2007 6:43 am
Posts: 1060
Location: Canada
Hello Hellbound,

I have tried to do that several months ago, but the line status detected by a2billing does not seem to be accurate. I gave up on it until next time.

I wish you better luck.

Cheers

Abdoulaye Siby


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 31, 2008 9:52 am 
Offline

Joined: Fri Jan 18, 2008 9:54 pm
Posts: 135
Hello,

Beauty lies in simplicity..!

Simplicity here is to consider the dialplan rather than the php code.

Arrange your CID-CALLBACK context to look similar to this :

Code:

[a2billing-cid-callback]
exten => _X.,1,Ringing
exten => _X.,n,WAIT(10)
exten => _X.,n,Hangup
exten => h,1,DeadAGI(a2billing.php|1|cid-callback|)




The system will wait for 10 seconds, within which the caller can hang up to trigger the hangup extension (h) and the system will call him back.

If he kept holding the line for more than ten seconds, the system will automatically hang up and will not call him back (punished for bad behavior!)


Hope this helps..!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 31, 2008 1:32 pm 
Offline
User avatar

Joined: Mon Apr 30, 2007 6:43 am
Posts: 1060
Location: Canada
It's elegant indeed. I will try this out. I always assumed that Asterisk deletes all the channel variables are after hangup. But after careful re-examination, I have noticed that there are more than one hangup functions and that if called from extension.conf, it might not clear the variables until there is nothing to execute.

Good thinking swift.

Cheers

Added after 24 minutes:

**** UPDATE ****
The above solution offered by Swift works, I have tested it on Asterisk 1.4.17. BTW, you don't have to add Wait(10). You can play some early media (if supported by your customers network) that will tell them to hangup. That's what did. If supported, the early media will play the audio file to the customer without answering the line.

P.S.: Dude ... you rock. I am going to implement this in all the callbacks that I have and that I will configure in the future.

Kudos and Cheers


Last edited by asiby on Sat Nov 20, 2010 6:22 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 31, 2008 3:00 pm 
Offline

Joined: Fri Jan 18, 2008 9:54 pm
Posts: 135
Thanks Asiby.. Glad you liked it. You are like a mentor to me!

Just a bit of explanation here..

The Hangup() function, totally stops the execution and might (like you mentioned) be clearing all channel variables. Any code placed after the Hangup() function, will not be executed (unless off course you jump to it with GoTo)..

In our case, this will happen if the caller kept the line open for more than 10 seconds..

But if he canceled the call from his side, the Hangup() function will not be executed, and the dialplan will stop where it was (the delay loop).

For this, Asterisk has a special extension (not function).. The (h) extension... useful if the user canceled the call while you were busy with some processing and you still have some clean up tasks..


Regards, 8)


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 01, 2008 2:14 am 
Offline
User avatar

Joined: Mon Apr 30, 2007 6:43 am
Posts: 1060
Location: Canada
Thank for the explanation. We have tried the script several time now and it works great.


Top
 Profile  
 
 Post subject: Re: callback after hangup
PostPosted: Sat Nov 20, 2010 1:38 am 
Offline

Joined: Fri Jan 18, 2008 9:54 pm
Posts: 135
Thanks Jellen,

It is good to know that such an old post is still being viewed and is still useful. !

Regards,


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 
Auto Dialer Software


All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


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 post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group