[OpenSIPS-Users] Gateway failover special setup (t_check_status question)

Max Mühlbronner mm at 42com.com
Fri Jan 20 08:38:41 EST 2017


Hi,



Actually this is very similar to what i tried before. But i just assumed 
that it is not being executed (no 408 in the trace, and no log entries 
at that moment). Now i checked again and i can see several xlog entries. 
(408 gateway timeout...) , just wasn't patient enough.


         if (use_next_gw()) {
                 if( t_check_status("444") || !goes_to_gw("1") ) {
                         t_on_failure("2");
                         t_relay("0x08");
                         exit;
                 }

                 #Timeout fix #3814
                 if (t_check_status("408") && t_local_replied("all")) {
                         xlog("L_ERR", "408 gateway timeout fix test - 
rU: $rU ci: $ci");
                 }

...

         # end of gw list / failover
         t_reply("503", "Service Unavailable");
         exit;



Thanks very much, i will try but this now.


BR

Max M.


On 20.01.2017 13:57, Bogdan-Andrei Iancu wrote:
> Hi Max,
>
> Something like:
>
>      if( (t_check_status("444") || (t_check_status("408") && 
> t_local_replied("all")) ) || !goes_to_gw("1") ) {
>
> Do failover if 444 reply or if 408 without any reply received 
> (internal 408).
>
> Regards,
>
> Bogdan-Andrei Iancu
> OpenSIPS Founder and Developer
> http://www.opensips-solutions.com
>
> On 01/20/2017 01:21 PM, Max Mühlbronner wrote:
>> Hi,
>>
>>
>> my scenario is a special setup where we are checking for the reply 
>> code (t_check_status) and only do a failover to the next gateway when 
>> there is a 444 reply or gateway type is not "1".
>>
>> ...
>>
>>         if (use_next_gw()) {
>>                 if( t_check_status("444") || !goes_to_gw("1") ) {
>>                         t_on_failure("2");
>>                         t_relay();
>>                         exit;
>>                 }
>>
>>
>> The problem is, there are multiple gateways in a carrier/gatewaylist 
>> (gateway type 1) which are not responding (t1 timer hits and invite 
>> is re-transmitted) and there is no failover after the first gateway 
>> anymore. Is there anything i am missing, is it even possible to do 
>> failover only for the 444 reply while at the same time still doing a 
>> failover in case of Timeout-based failover ? (t1/t2 timers)
>>
>>
>> I didn't try yet, but is something like !t_check_status("\d") 
>> feasible? E.g. doing a failover if there is no t_check_status 
>> (checking regular expression for !digits?) but i guess it does not 
>> work that way?
>>
>>
>>         if (use_next_gw()) {
>>                 if( t_check_status("444") || !goes_to_gw("1") ) {
>>                         t_on_failure("2");
>>                         t_relay();
>>                         exit;
>>                 }
>>
>>                 if(!t_check_status("\d")) {
>>
>>                         t_on_failure("2");
>>                         t_relay();
>>                         exit;
>>
>>                  }
>>
>>     ...
>>
>>
>>
>> BR
>>
>


-- 
Max Mühlbronner
42com Telecommunication GmbH
Straße der Pariser Kommune 12-16
10243 Berlin
E-Mail: mm at 42com.com
Web: www.42com.com

Firmenangaben/Company information:
Handelsregister/Commercial register: Amtsgericht Berlin HRB 99071 B
Umsatzsteuer-ID/VAT-ID: DE223812306
Geschäftsführer/CEO: Thomas Reinig, Alexander Reinig

Diese E-Mail enthält Informationen von 42com Telecommunication GmbH. 
Diese sind möglicherweise vertraulich und ausschließlich für den 
Adressaten bestimmt.
Sollten Sie diese elektronische Nachricht irrtümlicherweise erhalten 
haben, so informieren Sie uns bitte unverzüglich telefonisch oder per 
E-Mail.
This message is intended only for the use of the individual or entity to 
which it is addressed.
If you have received this message by mistake, please notify us immediately.



More information about the Users mailing list