Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Thu Apr 25, 2024 12:18 pm
VoIP Billing solution


All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: How does the failover work?
PostPosted: Thu Oct 18, 2007 5:25 am 
Offline

Joined: Thu Aug 23, 2007 8:31 pm
Posts: 38
Location: Vancouver, BC, Canada
I have two trunks configured in my sip.conf:
Trunk1: DV6042882288 (Local provider, 2 channels only)
Trunk2: VoipStunt (Unlimited channels)

In A2B, I setup these two trunks accordingly. Also, set the failover trunk of DV6042882288 to VOIPSTUNT.

Then I started to testing:
1. Use PhoneA call *. Because of I use LCD so my * decided to callback use DV6042882288 trunk.
2. PhoneA answer, dial another local phone-PhoneB, PhoneB answer, then I kept them on the conversation. So now all the channels of trunk DV6042882288 are occupied.
3. Then I tried to use PhoneC dial * to trigger another callback. This failed as follow:
Quote:
== Parsing '/etc/asterisk/manager.conf': Found
== Manager 'myasterisk' logged on from 127.0.0.1
-- Got SIP response 480 "Temporarily Unavailable (Call limit)" back from 209.17.160.129
> Channel SIP/DV6042882288-091c2cd8 was never answered.
[Oct 17 22:06:50] NOTICE[3901]: cdr.c:434 ast_cdr_free: CDR on channel 'SIP/DV6042882288-091c2cd8' not posted
== Manager 'myasterisk' logged off from 127.0.0.1


I don't know why the second callback failed. Why does A2B still try to use DV6042882288 rather than the failover trunk - VOIPSTUNT - to call PhoneC back?

Please help. Thanks.


Here is the log:
Quote:
[2007-10-17 22:05:59] : TRY TO FIND PENDING CALLBACK
** Number of PENDING callbacks 0 **

[2007-10-17 22:06:09] : TRY TO FIND PENDING CALLBACK
** Number of PENDING callbacks 1 **
UPDATE cc_callback_spool SET status='PROCESSING' WHERE id='59'

WE ARE IN THE PARENT PROCESS -> CHILD PID = 3880 -> RECORD ID = 59

WE ARE IN THE CHILD PROCESS
SQL =SELECT id, server_ip, manager_host, manager_username, manager_secret, lasttime_used FROM cc_server_manager WHERE id_group='1' ORDER BY lasttime_used ASC LIMIT 1 OFFSET 0

[2007-10-17 22:06:09]
[
[2007-10-17 22:06:09]]
::>>> IO::Socket::INET=GLOB(0x9ea71a0)
[
[2007-10-17 22:06:17]]Response - Success - Message - Originate successfully queued
[
[2007-10-17 22:06:17]]

## SUCCESS CALLBACK -> (SIP/DV6042882281/7783229158, 1000, a2billing-callback, 1)
UPDATE cc_callback_spool SET status='SENT', manager_result='Success-Originate successfully queued', num_attempt='1', last_attempt_time=now(), id_server='1' WHERE id='59'[
[2007-10-17 22:06:17]]
[
[2007-10-17 22:06:17]]
[END SELECT]

[2007-10-17 22:06:20] : TRY TO FIND PENDING CALLBACK
** Number of PENDING callbacks 0 **

[2007-10-17 22:06:30] : TRY TO FIND PENDING CALLBACK
** Number of PENDING callbacks 0 **

[2007-10-17 22:06:40] : TRY TO FIND PENDING CALLBACK
** Number of PENDING callbacks 0 **

[2007-10-17 22:06:50] : TRY TO FIND PENDING CALLBACK
** Number of PENDING callbacks 1 **
UPDATE cc_callback_spool SET status='PROCESSING' WHERE id='60'

WE ARE IN THE CHILD PROCESS
SQL =SELECT id, server_ip, manager_host, manager_username, manager_secret, lasttime_used FROM cc_server_manager WHERE id_group='1' ORDER BY lasttime_used ASC LIMIT 1 OFFSET 0

[2007-10-17 22:06:50]
[
[2007-10-17 22:06:50]]
::>>> IO::Socket::INET=GLOB(0x9d25ae4)
[
[2007-10-17 22:06:50]]Response - Error - Message - Originate failed
[
[2007-10-17 22:06:50]]

## CALLBACK FAIL
UPDATE cc_callback_spool SET status='ERROR', manager_result='Error-Originate failed', num_attempt='1', last_attempt_time=now(), id_server='1' WHERE id='60'[
[2007-10-17 22:06:50]]
UPDATE cc_server_manager SET lasttime_used=current_timestamp WHERE id ='1'[
[2007-10-17 22:06:50]]
[END SELECT]

WE ARE IN THE PARENT PROCESS -> CHILD PID = 3899 -> RECORD ID = 60

[2007-10-17 22:07:01] : TRY TO FIND PENDING CALLBACK
** Number of PENDING callbacks 0 **


Last edited by dynaguy on Wed Oct 24, 2007 10:37 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 18, 2007 7:11 pm 
Offline

Joined: Thu Aug 23, 2007 8:31 pm
Posts: 38
Location: Vancouver, BC, Canada
I searched here for "failover" and found lots posts. I read them all and still have no clue. :wall:

I just tried another test. I changed the "secret=xxxxxx" in my sip.conf(just for trunk DV6042882288) to a wrong password so basically this trunk will fail when try to dial out. Then I try to trigger the callback. Failed to callback with this:
Quote:
== Parsing '/etc/asterisk/manager.conf': Found
== Manager 'myasterisk' logged on from 127.0.0.1
[Oct 18 12:00:44] WARNING[2093]: chan_sip.c:12021 handle_response_invite: Received response: "Forbidden" from '"123456" <sip:[email protected]>;tag=as24ad03d8'
> Channel SIP/DV6042882288-08f71498 was never answered.
[Oct 18 12:00:44] NOTICE[2673]: cdr.c:434 ast_cdr_free: CDR on channel 'SIP/DV6042882288-08f71498' not posted
== Manager 'myasterisk' logged off from 127.0.0.1


The manager just log off without trying to dail with the failover trunk!

:help: :help:


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 19, 2007 6:46 pm 
Offline

Joined: Thu Aug 23, 2007 8:31 pm
Posts: 38
Location: Vancouver, BC, Canada
Just another thought... Is this provider related?

Anyone?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 19, 2007 9:10 pm 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
dynaguy wrote:
Is this provider related?
Quote:
Received response: "Forbidden" from '"123456" <sip:[email protected]>;tag=as24ad03d8'
Yes this looks to be related to your carrier sending 480 Forbidden, which is quite understandable given you are deliberately supplying a bad password.

Exactly the same code is used for failover on callback legs as is used in standard mode, see function rate_engine_performcall in Class.RateEngine.php. Set A2B's debug level to 3 and read through the output in tandem with the source and you should be able to see where the reality differs from your expectations.

As the code stands failover is only attempted when Asterisk's dialstatus variable returns "CHANUNAVAIL" or "CONGESTION". A future improvement might be to use hangupcause, which should give more information about the reason for failure.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 24, 2007 10:23 pm 
Offline

Joined: Thu Aug 23, 2007 8:31 pm
Posts: 38
Location: Vancouver, BC, Canada
Still couldn't solve the problem. :(

Yesterday I setup another server. On this server I checked out from SVN(version 398) and the installation is as smooth as before.

But I can't add trunk! :oops:

Now I see on the "Add trunk" page of the the SVN version, it shows more options to handle failover, which I think it maybe a good thing. But after fill out all information and click the confirm button, no trunk was added.

I understand that the SVN version is still under development. Could anyone tell me if you success with the failover trunk setting with 1.3.0 please?

Or, where can I get 1.3.1?


[edit] Solved the trunk adding problem. There is a script to update the DB which I forgot... :oops:

I'll test the failover and report back.

Added after 2 hours 39 minutes:

===============================================
Interesting test result for failover trunk.
I just tested on the SVN (398) version.

Conditions:
1. Use LCD for CID callback
2. Trunk DV604 at $0.01/min. (Note: this trunk is limited to max 2 channels by the provider)
3. Trunk VOIPSTUNT at $0.02/min with unlimited channels

TEST-1:
On trunk setting, limited DV604 MAXUSE to 0
Callback1: 1st leg uses DV604, 2nd leg jump to VOIPSTUNT, keep this callback in session then start Callback2
Callback2: both legs use VOIPSTUNT

TEST-2:
On trunk setting, limited DV604 MAXUSE to 1
Callback1: Both legs use DV604, keep this callback in session then start Callback2
Callback2: Both legs use VOIPSTUNT

TEST-3:
On trunk setting, limited DV604 MAXUSE to 2
Callback1: both leg uses DV604, keep this callback in session then start Callback2
Callback2: Callback triggered, manager logged in then logged off, callback failed as my first post. Asterisk gives a 480 error from my provider(see my first post for the error messege)

Questions:
1. When Asterisk give out a 480, A2B should jump to the failover trunk, right?
2. The MAXUSE setting number is not meaningful. It should add 1 then it would make sense, right?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 14, 2008 12:24 am 
Offline

Joined: Mon Jun 19, 2006 5:14 pm
Posts: 218
Can the first leg of callback actually failover to another trunk?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 15, 2008 5:01 pm 
Offline
User avatar

Joined: Mon Apr 30, 2007 6:43 am
Posts: 1060
Location: Canada
For the moment, the answer is no.

We have been brainstorming about this for a while and the only solution seems to be to drop the asterisk originate command at once. It is not very flexible when you need to use fail over trunk for the 1st leg. The are many other alternatives and we are trying test some of them.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 19, 2008 3:33 pm 
Offline

Joined: Mon Jun 19, 2006 5:14 pm
Posts: 218
thanks.

I had to do something so I used a local trunk into the regular asterisk dialplan then used "DIALSTATUS" to determine if the trunk should failover or just return back to the AGI


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 
Hosted Voice Broadcast


All times are UTC


Who is online

Users browsing this forum: No registered users and 23 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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group