Setting to Limit SIP channels


We have 3 accounts with ViaTalk, which gives us 6 channels total. Unfortunately, we often go over our 6 channels limit, which causes ViaTalk to lock our account and not allow any outgoing calls until we contact ViaTalk and have them prune our SIP channels.

Is there a setting to limit the amount of channels, or some way to have Asterisk check to see how many SIP channels are available? I would like to route outgoing calls to our POTS lines if the SIP channels are unavailable.


Do they reject anything over 6? Like once you are on 6 they start blocking calls or do they wait till you hit 7 and block your account? If they block at 6, Dial should fail with congestion and you can pick up in the dialplan going to your real lines.

Do you make all your calls over SIP, even local calls? Local calls generally would be cheaper on the real anyway.

I believe it is on the seventh channel in use they start blocking. The problem is once it hits that blocked state, it won’t clear unless we open a support ticket and have them prune our SIP channels. I’ve tried “SIP reload”, restarting Asterisk and restarting the entire server. The only thing that will clear the block is a SIP prune on their side.

So let me make sure I understand… You have the 6 channels, and basically you have 6 calls going on… Now when you hang up the do hang up, they dont get stuck right? So you have 6 different peopel on the line and when 7 hits they block you and essentially your phone system is dead…?

Ok, one thing you could probably do is set a variable before DIAL and then set it again after dial, adding to the number of calls on SIP that way it keeps a count of how many SIP channels are going out that direction. I think theres another way but the variable should work.

exten => s,1,SetVar(SIPCOUNT=$[${SIPCOUNT} + 1]) ; increment


exten => s,1,SetVar(SIPCOUNT=$[${SIPCOUNT} - 1])

then you would need a gotoif statement even before the increment if you post the context that shows your dial statement (without any passwords) I will re-write it to show you.

One other question though, what is the asterisk version? 1.2 uses a slightly different variable method in the dialplan.

We are using Asterisk 1.2

Ok, are you going to try and implment the variables and GotoIf statement?

rodasta , my trouble is the same, have you resolve???
i[ve try with variables, maybe i have[t implemented correctly

Sorry it took so long to get back… here is the portion of our extensions.conf:

ignorepat=> 9
exten=> _9XNXXNXXXXXX,1,Dial(SIP/${EXTEN:1}@viatalk,30,t)
exten=> _9XNXXNXXXXXX,2,Hangup
exten=> _9XNXXNXXXXXX,101,Dial(ZAP/g1/1${EXTEN:1})
exten=> _9XNXXNXXXXXX,102,Hangup

exten=> _9NXXXXXX,1,Dial(SIP/${EXTEN:1}@viatalk,30,t)
exten=> _9NXXXXXX,2,Hangup
exten=> _9NXXXXXX,101,Dial(ZAP/g1/${EXTEN:1})
exten=> _9NXXXXXX,102,Hangup[/code]

We handle all the passwords and such in the sip.conf with a register statement.