Asterisk call-limit some times not work


I am having a strange issue. outgoinglimit on sip peer is set to 2 but some users have somehow managed to breach this restriction intentionally or unintentionally and are able to initiate more that 2 calls at a time.

i have searched alot on google but found only 2 reasons

1- using sip realtime peers (we are not using this)
2- some bug in chan_sip.c source code update_call_counter function. (check this link:

from point 2 above it seems this is a bug in source code but it happened last month only once during the course of 4 years.
but i tested alot by making test calls but there is no issue with outgoinglimit.

i have following questions:

  • I wonder how someone has breached this call limit.
  • are there any sip.conf parameters that can affect outgoinglimit.
  • what else I can do to guarantee limiting simultaneous outgoing calls.
  • why it happened one in 4 years? what could be wrong.

any help will be highly appreciated.


Nasir Javaid

Once in four years could be a rare race condition (a bug that only happens if two things happen at almost the same time), or it could be soft memory error (e.g. alpha particle strike). Either way, it won’t get fixed on a four year old Asterisk.

If the locking logic isn’t quite right when manipulationg the call count, there might be a small number of machine instructions in which things can go wrong. That might represent a time window in the low 100s of nano-seconds, for each time that someone actually tried to exceed the limit.