Askozia Forums
February 09, 2012, 01:38:04 am *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: "failover provider" fails  (Read 516 times)
EdZa
Newbie
*

Karma: 0
Posts: 3


View Profile
« on: April 28, 2010, 06:40:41 pm »

example from askozia 2.0rc3
Quote

<provider>
  <name>1-TERRASIP</name>
  <dialpattern>7495!</dialpattern>
  <dialpattern>7499!</dialpattern>
  <dialpattern>7812!</dialpattern>
  <failover>SIP-PROVIDER-COMTUBE</failover>
  <uniqid>SIP-PROVIDER-TERRASIP-CENTR</uniqid>
</provider>
<provider>
  <name>5-COMTUBE</name>
  <dialpattern>79!</dialpattern>
  <dialpattern>7!</dialpattern>
  <uniqid>SIP-PROVIDER-COMTUBE</uniqid>
</provider>
log
---
Apr 28 22:45:08 asterisk[2469]: VERBOSE[2989]: == Using SIP RTP CoS mark 5
Apr 28 22:45:08 asterisk[2469]: VERBOSE[2989]: == Using SIP VRTP CoS mark 6
Apr 28 22:45:08 asterisk[2469]: VERBOSE[2989]: -- Called 74957212121@SIP-PROVIDER-TERRASIP-CENTR
Apr 28 22:45:09 asterisk[2469]: VERBOSE[2498]: -- Got SIP response 603 "Declined" back from 193.47.84.4
Apr 28 22:45:09 asterisk[2469]: VERBOSE[2989]: -- SIP/SIP-PROVIDER-TERRASIP-CENTR-00000005 is busy
Apr 28 22:45:09 asterisk[2469]: VERBOSE[2989]: == Everyone is busy/congested at this time (1:1/0/0)
Apr 28 22:45:09 asterisk[2469]: VERBOSE[2989]: -- Executing [74957212121@SIP-PHONE-21204598304bd881d98da84:5] NoOp("SIP/103-00000004", "DIALSTATUS = BUSY") in new stack
Apr 28 22:45:09 asterisk[2469]: VERBOSE[2989]: -- Executing [74957212121@SIP-PHONE-21204598304bd881d98da84:6] Goto("SIP/103-00000004", "SIP-PROVIDER-TERRASIP-CENTR-BUSY,1") in new stack
Apr 28 22:45:09 asterisk[2469]: VERBOSE[2989]: -- Goto (SIP-PHONE-21204598304bd881d98da84,SIP-PROVIDER-TERRASIP-CENTR-BUSY,1)
Apr 28 22:45:09 asterisk[2469]: VERBOSE[2989]: -- Executing [SIP-PROVIDER-TERRASIP-CENTR-BUSY@SIP-PHONE-21204598304bd881d98da84:1] Hangup("SIP/103-00000004", "") in new stack
Apr 28 22:45:09 asterisk[2469]: VERBOSE[2989]: == Spawn extension (SIP-PHONE-21204598304bd881d98da84, SIP-PROVIDER-TERRASIP-CENTR-BUSY, 1) exited non-zero on 'SIP/103-00000004'
---


Why, after "Got SIP response 603" Declined "back from xxx" is not working failover provider ?
I think in this case the call should be transferred to failover provider.  Smiley
 
Logged
josepedro
Newbie
*

Karma: 3
Posts: 17


View Profile
« Reply #1 on: June 07, 2010, 10:56:29 am »

You should check your provider. "Declined" is not a very good response from your provider. Did you check this provider individually to see if you can have outgoing calls without any problem just using this provider? You have to do this first and make sure that is working fine before using this provider as a failover provider.
Logged
josepedro
Newbie
*

Karma: 3
Posts: 17


View Profile
« Reply #2 on: June 07, 2010, 11:27:15 am »

I have been testing the failover provider feature in ASKOZIA 2.0.1 and it works fine, but you have to be aware of knowing how and when does ASKOZIA 2.x jump to a failover provider.

As soon as you configure 2 providers and you can see that ASKOZIA generates the following code for the "outgoing provider" of your main provider (the first outgoing option, not the failover option) in the /etc/asterisk/extensions.conf configuration file:
Code:
; outgoing provider : sylcomgsm2015
[SIP-PROVIDER-17914080404a89b80e4508c]
exten => _2.,1,NoOp(outgoing call to provider: sylcomgsm2015)
exten => _2.,n,Set(ORIGEXTENSION=${EXTEN})
exten => _2.,n,NoOp(original extension = ${ORIGEXTENSION})
exten => _2.,n,Dial(SIP/${EXTEN}@SIP-PROVIDER-17914080404a89b80e4508c,,To)
exten => _2.,n,NoOp(DIALSTATUS = ${DIALSTATUS})
exten => _2.,n,Goto(SIP-PROVIDER-17914080404a89b80e4508c-${DIALSTATUS},1)
exten => SIP-PROVIDER-17914080404a89b80e4508c-NOANSWER,1,Hangup()
exten => SIP-PROVIDER-17914080404a89b80e4508c-CANCEL,1,Hangup()
exten => SIP-PROVIDER-17914080404a89b80e4508c-BUSY,1,Hangup()
exten => SIP-PROVIDER-17914080404a89b80e4508c-CONGESTION,1,NoOp(Failover needed, now using : Gateway RDSI)
exten => SIP-PROVIDER-17914080404a89b80e4508c-CONGESTION,n,Goto(IAX-PROVIDER-12629461584b203ac38302e,${ORIGEXTENSION},1)
exten => SIP-PROVIDER-17914080404a89b80e4508c-CHANUNAVAIL,1,NoOp(Failover needed, now using : Gateway RDSI)
exten => SIP-PROVIDER-17914080404a89b80e4508c-CHANUNAVAIL,n,Goto(IAX-PROVIDER-12629461584b203ac38302e,${ORIGEXTENSION},1)

And as you can see ASKOZIA 2.x recognizes the following SIP codes that it gets in the DIALSTATUS variable: NOANSWER, CANCEL, BUSY, CONGESTION or CHANUNAVAIL. If your provider generates any other SIP code, ASKOZIA will not process it and failover will not happen. Also, as you can see, ASKOZIA 2.x only does failover on CONGESTION and CHANUNAVAIL SIP codes, so even if your provider generates a BUSY SIP code, which is very common, ASKOZIA 2.x will not jump to a failover provider. As you can see in the code, this works this way by design. If you want to know why, you would have to ask Michael - the designer of the system.

In fact, I was a little surprised with this code, especially with the BUSY SIP code behaviour. I expected ASKOZIA 2.x to jump to the failover provider on "BUSY", but it does not. You can use any provider as a failover provider but on your main provider you have to make sure that when you have a call or several calls, or the link is down so you cannot make any more calls using the main provider, this provider has to return a SIP code telling ASKOZIA that it is either CONGESTED or that the CHANNEL IS UNAVAILABLE for failover to work properly.
Logged
giovanni.v
Hero Member
*****

Karma: 51
Posts: 666


View Profile
« Reply #3 on: June 07, 2010, 11:45:53 am »

In fact, I was a little surprised with this code, especially with the BUSY SIP code behaviour. I expected ASKOZIA 2.x to jump to the failover provider on "BUSY", but it does not.

Sure anything can be done in a better way... but this one isn't wrong at all; going to a failover route on BUSY will be really wrong... do you want to dial again when the called number is busy??
The SIP provider must return the correct code for any specific failure and asterisk report/take an action according, if that doesn't happen any decision can be the wrong one.
Logged
josepedro
Newbie
*

Karma: 3
Posts: 17


View Profile
« Reply #4 on: June 07, 2010, 08:02:48 pm »

OK, I can see your point here Giovanni. Then the failover design in ASKOZIA 2.x is absolutely correct, but you have to make sure your provider returns the right SIP code or it will became useless.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.197 seconds with 19 queries.