Summary:ASTERISK-09797: A permanent INVITE that gets BUSY a SIP user
Reporter:Iñaki Baz Castillo (ibc)Labels:
Date Opened:2007-07-03 02:59:13Date Closed:2011-06-07 14:03:02
Versions:Frequency of
Description:I have a queue (with no agents) all of the members using SJphone for Windows and configured with "call-limit=1".

Sometimes one of them (not always the same user) can't receive calls.

For example, I capture the error now that it's occurring to a SIP username "lluc-softphone" with extension 209:

asterisk*CLI> dial 209
-- Executing [209@desde-usuarios:1] Dial("OSS/dsp", "SIP/lluc-softphone|600|wtWT") in new stack
[Jul  3 10:01:22] ERROR[30342]: chan_sip.c:3060 update_call_counter: Call to peer 'lluc-softphone' rejected due to usage limit of 1
   -- Couldn't call lluc-softphone
 == Everyone is busy/congested at this time (0:0/0/0)
 == Auto fallthrough, channel 'OSS/dsp' status is 'CHANUNAVAIL'

But that's not true, in fact:

asterisk*CLI> show channels
Channel              Location             State   Application(Data)
0 active channels
0 active call

The queue where SJphone users are members is called "interactiva" and the most strange thing is the following:

asterisk*CLI> queue show interactiva
interactiva  has 0 calls (max unlimited) in 'rrmemory' strategy (8s holdtime), W:0, C:16, A:3, SL:0.0% within 0s
     SIP/wadrian-softphone (Not in use) has taken 5 calls (last was 1308 secs ago)
     SIP/lluc-softphone (Busy) has taken no calls yet
     SIP/goni-softphone (Unavailable) has taken no calls yet
     SIP/jose-softphone (Unavailable) has taken no calls yet
     SIP/pep-softphone (Unavailable) has taken 5 calls (last was 331311 secs ago)
     SIP/todiaz-softphone (Not in use) has taken 6 calls (last was 331572 secs ago)
  No Callers

As you see SIP/lluc-softphone appears as BUSY.

And more strange:

asterisk*CLI> sip show channels
Peer             User/ANR    Call ID      Seq (Tx/Rx)  Form  Hold     Last Message    (None)      2084351917@  00101/45278  unkn  No       Rx: REGISTER     (None)      DE39D9DA-0F  00101/00090  unkn  No       Rx: REGISTER     (None)      0D7FEDFE-97  00101/00028  unkn  No       Rx: REGISTER     (None)      C05B1336-1D  00101/00096  unkn  No       Rx: REGISTER     (None)      974C923B-50  00101/00076  unkn  No       Rx: OPTIONS     (None)      4518C18D-AC  00101/00259  unkn  No       Rx: OPTIONS     (None)      9F38E4D6-6A  00101/00276  unkn  No       Rx: OPTIONS     (None)      CC7C13B8-1D  00101/00279  unkn  No       Rx: OPTIONS     (None)      C1E4F0BA-E6  00101/00225  unkn  No       Rx: OPTIONS     (None)      E9F8FCE8-93  00101/00055  unkn  No       Rx: OPTIONS     lluc-softp  7d6f737c67c  00102/00000  unkn  No       Init: INVITE
11 active SIP channels

As you can see, there is a permanent INVITE SIP channel with the user "lluc-softphone".

Tshi issue occurs sometimes with differents users, but always SJphone softphones. Any idea?

If you need more help please ask me and I'll try to get it the next time it occurs.
Comments:By: Iñaki Baz Castillo (ibc) 2007-07-03 03:18:10

I forgot to say that the only "solution" to amke the SIP user "free" to dial or receive calls is by restarting Asterisk. Because of it I tagged this issue as "major" severity.

By: Eliel Sardanons (eliel) 2007-07-04 09:49:05

Please try to reproduce this bugs in this way:
Call a phone with call-limit=1.
Within this phone call, put onHold the callee, and recover the call from the onHold state and hangup.
If I am not wrong the called phone (with call-limit=1) will stay in busy state, even if the call has been hangup.

phone1 (call-limit=1)
phone2 (client no call-limit)

phone2 --[ call ]-> phone1
phone1 --[ put on hold ]-> phone2
phone1 --[ recover the call (stop on hold) ]-> phone2
phone1 or phone2 --[ hangup ]--

phone1 should stay in BUSY state. (*inuse = 1)

I think this is the problem, I am trying to find a solution. (and I found this is reproducible in asterisk 1.2 too).

By: Iñaki Baz Castillo (ibc) 2007-07-04 09:56:45

Thanks, I'll try to reproduce your proposal tomorrow and tell here the result.

By: Eliel Sardanons (eliel) 2007-07-04 10:56:17

The problem is that when we put the call onHold changes from an outoging call to an incoming call, and update_call_counter() is decrementing the inuse for a "peer" and should decrement the inuse for the "user".

By: Eliel Sardanons (eliel) 2007-07-04 11:28:30

on sip.conf try:


By: Paul W (kwakwaversal) 2007-07-04 15:51:11

Try removing the hyphen from the username "lluc-softphone", the device states aren't updated correctly when the username contains a hyphen - I found that out the hard way. Took me > 2 weeks to figure out why members were being stuck in "in use" state when they weren't.

By: Iñaki Baz Castillo (ibc) 2007-07-05 04:12:47

* eliel:
I've tryied to reproduce your steps:
phone1 (call-limit=1)
phone2 (client no call-limit)

phone2 --[ call ]-> phone1
phone1 --[ put on hold ]-> phone2
phone1 --[ recover the call (stop on hold) ]-> phone2
phone1 or phone2 --[ hangup ]--

phone1 should stay in BUSY state. (*inuse = 1)
But I get no error, phone1 leaves free of channels, and there is not a strange and permanent INVITE in "sip show channels". And I've tryied to to set the SIP user (phone1 = "ibc-softphone") into a Queue and call the queue with no error after that.

* eliel (again):
I had set "limitonpeers=yes" but I'm sure that it does nothing. For example, a "type=friend" SIP user just can do one outbound call, the second one is rejected, so can't understand the meaning of "limitonpeers=yes".

* kwakwaversal:
Have you reported that bug about the "hyphen" in usernames? if it's true I think is very important. I'll try to change some usernames of the queue, thanks.

By: Paul W (kwakwaversal) 2007-07-05 04:34:49

I believe its a known problem, I can't remember which bug I was reading but I'm sure oej pointing it out to that particular thread.

By: Iñaki Baz Castillo (ibc) 2007-07-05 04:42:43

* kwakwaversal:
Do you know if the bug occurs too with "_" symbol?

By: Joshua C. Colp (jcolp) 2007-07-05 08:20:47

Please upgrade to 1.4.6, there were fixes put in to solve the hanging SIP dialogs with INVITE issue.

By: Paul W (kwakwaversal) 2007-07-05 08:43:16

ibc, I replaced the hyphens with underscores and everything has been fine since.

By: Iñaki Baz Castillo (ibc) 2007-07-05 08:57:14

I've repalced hyphens with underscores and upgraded to 1.4.6. If the bug occurs again I'll report it here.

Thanks to all.

By: Joshua C. Colp (jcolp) 2007-07-05 09:16:45

Alrighty if both suggestions don't work feel free to reopen this bug.