[asterisk-dev] Reverse decrement of call counter

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Thu Nov 15 08:23:39 CST 2007


On Thursday 15 November 2007 03:56:26 Rizwan Hisham wrote:
> As you can see in the code which i mentioned in my last email that for
> decrementing the call-limit value they are actually incrementing it, and
> some how it is called reverse decrementing. I need to know What is the
> reason for doing that. Under what circumstances this IF condition gets
> executed?

An annotation of the code reveals its history.  If the code has grown stale,
then certainly it could be removed.

http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?view=annotate

> Since nobody has answered my questions lately, i need to know y. Am i
> asking too difficult questions or too vague questions?

You're asking the wrong questions.  What you're essentially asking is why
someone who wrote the code, who rarely has the time to respond to posts
on any list, let alone this one, wrote a particular comment almost 4 years
ago and expecting a reply.

My best guess is that the code was detecting whether the call counter was
incremented in the first place, since it was going to be decremented later,
and incrementing it to account for that unconditional decrement.  It has
probably been fixed since, and this code is artifact of the old
implementation.

If removing that code fixes the issue, I think the matter is closed.  Post a
patch to the bugtracker and be done with it.

-- 
Tilghman



More information about the asterisk-dev mailing list