<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1264" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Sorry, to repost - but I left a "/*" comment - here
it is again</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Paul</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>--- chan_sip.c.save
2003-10-20 21:51:52.000000000 +1000<BR>+++ chan_sip.c 2003-10-21
09:26:41.000000000 +1000<BR>@@ -959,7 +959,9
@@<BR>
return 0;<BR>
}<BR> switch(event)
{<BR>+
/* Incoming and outging affects the inUse counter
*/<BR>
case
DEC_IN_USE:<BR>+
case
DEC_OUT_USE:<BR>
if ( u->inUse > 0 )
{<BR>
u->inUse--;<BR>
} else {<BR>@@ -967,6 +969,7
@@<BR>
}<BR>
break;<BR>
case
INC_IN_USE:<BR>+
case
INC_OUT_USE:<BR>
if (u->incominglimit > 0 )
{<BR>
if (u->inUse >= u->incominglimit)
{<BR>
ast_log(LOG_ERROR, "Call from user '%s'<BR>rejected due to usage limit of %d\n",
u->name, u->incominglimit);<BR>@@ -977,6 +980,8
@@<BR>
u->inUse++;<BR>
ast_log(LOG_DEBUG, "Call from user '%s' is %d out of %d\<BR>n", u->name,
u->inUse,
u->incominglimit);<BR>
break;<BR>+
/* Commented out - don't want to limit outgoing
*/<BR>+
/*<BR>
case
DEC_OUT_USE:<BR>
if ( u->outUse > 0 )
{<BR>
u->outUse--;<BR>@@ -994,6 +999,7
@@<BR>
}<BR>
u->outUse++;<BR>
break;<BR>+
*/<BR>
default:<BR>
ast_log(LOG_ERROR, "find_user(%s,%d) called with no
even<BR>t!\n",u->name,event);<BR>
}<BR>@@ -1086,6 +1092,12
@@<BR>
INVITE, but do set an autodestruct just in ca<BR>se.
*/<BR>
needdestroy =
0;<BR>
sip_scheddestroy(p,
15000);<BR>+
/* channel still up - reverse dec of inuse count<BR>er
*/<BR>+
if ( p->outgoing )
{<BR>+
find_user(p,
INC_OUT_USE);<BR>+
} else
{<BR>+
find_user(p,
INC_IN_USE);<BR>+
}<BR>
} else
{<BR>
char
*res;<BR>
if (ast->hangupcause && ((res =
hangup_cause2sip<BR>(ast->hangupcause)))) {<BR>@@ -4708,6 +4720,14
@@<BR>
if
(p->owner)<BR>
ast_queue_control(p->owner, AST_<BR>CONTROL_BUSY,
0);<BR>
break;<BR>+
case
487:<BR>+
/* channel now destroyed - dec the inuse<BR> counter
*/<BR>+
if ( p->outgoing )
{<BR>+
find_user(p,
DEC_OUT_USE);<BR>+
} else
{<BR>+
find_user(p,
DEC_IN_USE);<BR>+
}<BR>+
break;<BR>
case 486: /* Busy here
*/<BR>
case 600: /* Busy everywhere
*/<BR>
if (p->owner)<BR></FONT></DIV></BODY></HTML>