Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

load-balancing problem

BKhan
2012-09-25
2013-05-09
  • BKhan
    BKhan
    2012-09-25

    Hi
    I am new in opensips. This is my opensips table

    mysql> select * from load_balancer;
    +---+-------+------------+-------+--------+---------+
    | id | group_id | dst_uri          | resources | probe_mode | description |
    +---+-------+------------+-------+--------+---------+
    |  1 |        1 | sip:10.111.5.241 | all=10    |          0 |             |
    |  2 |        2 | sip:10.111.5.243 | all=10    |          0 |             |
    +---+-------+------------+-------+--------+---------+

    I also configured opensips.cfg file as

    if ( load_balance("1","all") ) {
    #     xlog("==================> Destination is $du\n");
         t_on_failure("1");
         t_relay();
         exit;
    }

    if ( load_balance("2","all") ) {
        t_on_failure("1");
    #    xlog("==================> New destination is $du\n");
        t_relay();
      } else {
        t_reply("500","Error");
      }

    when i restart opensips service  i got an error

    ep 26 07:17:16 localhost opensips: CRITICAL:core:yyerror: parse error in config file, line 213, column 1-3: syntax error
    Sep 26 07:17:16 localhost opensips: CRITICAL:core:yyerror: parse error in config file, line 213, column 1-3:
    Sep 26 07:17:16 localhost opensips: ERROR:core:main: bad config file (2 errors)

     
  • Hi,

    post line 213 from your script +5 line before and after that line.

    Regards,
    Bogdan

     
  • BKhan
    BKhan
    2012-09-26

    Thanks Bogdan for replying.

    The issue is in these lines. These are 213 and below. Above 9 lines are comment. If i comment these lines service properly restart. Please check this syntax . I cant understand where is issue.

     
  • BKhan
    BKhan
    2012-09-26

    Issue has been resolved.
    Issue was that i should write this code in route. I was miss placing the code.
    But after this an issue also creates that my users which exists in opensips's  subscriber table are not getting registered.
    When i comment this code they got registered.
    Please guide.

    ####### Routing Logic ########
    route{

     
  • BKhan
    BKhan
    2012-09-26

    This Issue also has been resolved.
    I put this code in
    If(is_method("INVITE"))
    {
    ############### Here ############
    }
    But  another issue that i have two asterisk machines. when i shutdowm one machine it should go to second not call failed.
    Please tell about it