[Asterisk-Users] Is a BUG ? Hints and incominglimit
Paradise Dove
pardove at gmail.com
Tue Nov 29 13:35:04 MST 2005
> Yes with version 1.2. I have tried already with call-limit and the same.
i agree with you, it seems to be a bug which i've submited before (bug
#5281) but it's now closed by bug marshals!!!!!
by reading chan_sip.c u will find out that in function
update_call_counter() it first tries to update the call counter
(call-limit) prop. of user strcuture of the extension.
u = find_user(name, 1);
if (u) {
inuse = &u->inUse;
call_limit = &u->call_limit;
p = NULL;
} else {
/* Try to find peer */
if (!p)
p = find_peer(fup->peername, NULL, 1);
...
and then in function sip_devicestate() it changes the state of the
extension according to peer (call-limit) prop. of the extension.
if ((p = find_peer(host, NULL, 1))) {
if (p->addr.sin_addr.s_addr || p->defaddr.sin_addr.s_addr) {
/* we have an address for the peer */
/* if qualify is turned on, check the status */
if (p->maxms && (p->lastms > p->maxms)) {
res = AST_DEVICE_UNAVAILABLE;
} else {
/* qualify is not on, or the peer is responding properly */
/* check call limit */
if (p->call_limit && (p->inUse == p->call_limit))
res = AST_DEVICE_BUSY;
else if (p->call_limit && p->inUse)
res = AST_DEVICE_INUSE;
else if (p->call_limit)
res = AST_DEVICE_NOT_INUSE;
else
res = AST_DEVICE_UNKNOWN;
}
....
So, if your sip user is defined as friend it will be detected as user
in function update_call_counter and also detected as peer in function
sip_devicestate which doesn't sense the call-limit of friends. if
change the type of your sip user to "peer" you will see that hints
works fine.
another way to find this bug is to run the command "sip show inuse" on
CLI when some sip extensions are in a call. you will see that just the
user counter of sip "friend"s are updated.
Paradise Dove
On 11/29/05, Alvaro Parres <aparres at gmail.com> wrote:
>
>
> On 11/28/05, Kevin Hanson <tuxpert at comcast.net> wrote:
> > Alvaro Parres wrote:
> >
> > > Hi list...
> > >
> > > I have been testing the hint extension. And i detect
> > > that when i have in the sip.fg of the extension the
> > > incominiglimit=X (any number) the hint doesn't work all the
> > > time show the extesion as idle.
> > >
> > >
> > > If this is a bug or not ??
> > >
> > > Thanks.
> > >
> > >
> >
> >------------------------------------------------------------------------
> > >
> > >_______________________________________________
> > >
> > >
> > What version of Asterisk? 1.2 deprecated incominglimit in favor of
> > call-limit.
> >
> > Cheers,
> > Kevin
> > _______________________________________________
> > --Bandwidth and Colocation provided by Easynews.com --
> >
> > Asterisk-Users mailing list
> > To UNSUBSCRIBE or update options visit:
> >
> http://lists.digium.com/mailman/listinfo/asterisk-users
> >
>
>
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
>
> Asterisk-Users mailing list
> To UNSUBSCRIBE or update options visit:
>
> http://lists.digium.com/mailman/listinfo/asterisk-users
>
>
>
More information about the asterisk-users
mailing list