Load Balancing outgoing sip trunk

Discussion in 'General' started by alfalfa82, Nov 11, 2009.

  1. alfalfa82

    Aug 20, 2009
    Likes Received:

    I found online a simple way of cascading trunks, the problem that i have is that this method is very simple, and because of this when a trunk is busy or not available it dose not proceed to the next trunk automatically and just reject the call:

    from extensions_custom.conf

    exten => _506.,1,GotoIf(${DB_EXISTS(provider/next)}?4)
    exten => _506.,2,Set(DB(provider/next)=102)
    exten => _506.,3,Goto(1)
    exten => _506.,4,GoSub(${DB_RESULT},1)
    exten => _506.,5,Dial(SIP/${DB_RESULT}/${EXTEN:3}

    exten => 102,1,Set(DB(provider/next)=104)
    exten => 102,n,Return

    exten => 104,1,Set(DB(provider/next)=110)
    exten => 104,n,Return

    exten => 110,1,Set(DB(provider/next)=114)
    exten => 110,n,Return

    exten => 114,1,Set(DB(provider/next)=118)
    exten => 114,n,Return

    exten => 118,1,Set(DB(provider/next)=102)
    exten => 118,n,Return

    each trunk is one channel.

    as you can see a very simple way of cascading trunks, it is working perfectly i just need to add to this, that if a trunk is not avaiable for any reason(it is occupied, not connected or not registered) try the next one, and the next one and the next one, try until you find one that is working. how do i do it?


Share This Page