[Home]

Summary:ASTERISK-08560: hints on SIP-accounts don't work
Reporter:sebb (sebb)Labels:
Date Opened:2007-01-11 17:21:40.000-0600Date Closed:2007-05-16 05:12:09
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Channels/chan_sip/Subscriptions
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) bender-verbosedebug.txt
( 1) chan_sip.c.enable-states.diff
( 2) cstadlmann-extensions.conf
( 3) cstadlmann-sip.conf
( 4) cstadlmann-verbosedebug.txt
( 5) debug-bug-8800
( 6) verbosedebug.txt
Description:When I create a hint for an extension, the status (with "core show hints") is always "Idle", if the phone has a call or not. I tried it on two different machines and had the same problem.

I tried Asterisk 1.4.0 and Asterisk SVN-trunk-r50469.

With asterisk 1.2 that works without any problems.

****** ADDITIONAL INFORMATION ******

dialplan:

[default]
exten => 101,hint,SIP/101
exten => 102,hint,SIP/102

[local-in]
exten => _[1-9]!,1,dial(SIP/${EXTEN}






*CLI> core show channels
Channel              Location             State   Application(Data)
SIP/101-081e36d8     (None)               Up      Bridged Call(SIP/102-081df770)
SIP/102-081df770     101@local-in:1       Up      Dial(SIP/101)
2 active channels
1 active call

*CLI> sip show channels
Peer             User/ANR    Call ID      Seq (Tx/Rx)  Form  Hold     Last Message
192.168.1.254    101         6090051b6cb  00102/00000  alaw  No       Tx: ACK
192.168.1.249    102         3c267f94b4a  00101/00002  ulaw  No       Rx: ACK
2 active SIP channels

*CLI> core show hints

   -= Registered Asterisk Dial Plan Hints =-
                   102@default             : SIP/102               State:Idle            Watchers  0
                   101@default             : SIP/101               State:Idle            Watchers  0
----------------
- 2 hints registered




*CLI> sip show settings


Global Settings:
----------------
 SIP Port:               5060
 Bindaddress:            0.0.0.0
 Videosupport:           No
 AutoCreatePeer:         No
 MatchAuthUsername:      No
 Allow unknown access:   Yes
 Allow subscriptions:    Yes
 Allow overlap dialing:  No
 Promsic. redir:         No
 SIP domain support:     No
 Call to non-local dom.: Yes
 URI user is phone no:   No
 Our auth realm          asterisk
 Realm. auth:            No
 Always auth rejects:    No
 Call limit peers only:  No
 User Agent:             Asterisk PBX SVN-trunk-r50469
 MWI checking interval:  10 secs
 Reg. context:           (not set)
 Caller ID:              asterisk
 From: Domain:
 Record SIP history:     Off
 Call Events:            Off
 IP ToS SIP:             CS0
 IP ToS RTP audio:       CS0
 IP ToS RTP video:       CS0
 T38 fax pt UDPTL:       No
 RFC2833 Compensation:   No
 Jitterbuffer enabled:   No
 Jitterbuffer forced:    No
 Jitterbuffer max size:  -1
 Jitterbuffer resync:    -1
 Jitterbuffer impl:
 Jitterbuffer log:       No
 SIP realtime:           Disabled

Global Signalling Settings:
---------------------------
 Codecs:                 none
 T1 minimum:             100
 Relax DTMF:             No
 Compact SIP headers:    No
 RTP Keepalive:          0 (Disabled)
 RTP Timeout:            0 (Disabled)
 RTP Hold Timeout:       0 (Disabled)
 MWI NOTIFY mime type:   application/simple-message-summary
 DNS SRV lookup:         Yes
 Pedantic SIP support:   No
 Reg. min duration       60 secs
 Reg. max duration:      3600 secs
 Reg. default duration:  120 secs
 Outbound reg. timeout:  20 secs
 Outbound reg. attempts: 0
 Notify ringing state:   Yes
 Notify hold state:      No
 SIP Transfer mode:      open
 Max Call Bitrate:       384 kbps
 Auto-Framing:           No

Default Settings:
-----------------
 Context:                default
 Nat:                    RFC3581
 DTMF:                   rfc2833
 Qualify:                0
 Use ClientCode:         No
 Progress inband:        Never
 Language:               (Defaults to English)
 MOH Interpret:          default
 MOH Suggest:
 Voice Mail Extension:   asterisk


*CLI> sip show peer 101


 * Name       : 101
 Secret       : <Set>
 MD5Secret    : <Not set>
 Context      : local-in
 Subscr.Cont. : <Not set>
 Language     :
 AMA flags    : Unknown
 Transfer mode: open
 CallingPres  : Presentation Allowed, Not Screened
 Callgroup    :
 Pickupgroup  :
 Mailbox      : 101
 VM Extension : asterisk
 LastMsgsSent : 0/2
 Call limit   : 0
 Dynamic      : Yes
 Callerid     : "" <>
 MaxCallBR    : 384 kbps
 Expire       : 3557
 Insecure     : no
 Nat          : RFC3581
 ACL          : No
 T38 pt UDPTL : No
 CanReinvite  : No
 PromiscRedir : No
 User=Phone   : No
 Video Support: No
 Trust RPID   : No
 Send RPID    : No
 Subscriptions: Yes
 Overlap dial : No
 DTMFmode     : rfc2833
 LastMsg      : 0
 ToHost       :
 Addr->IP     : 192.168.1.254 Port 1111
 Defaddr->IP  : 0.0.0.0 Port 5060
 Def. Username: 101
 SIP Options  : (none)
 Codecs       : 0x8 (alaw)
 Codec Order  : (alaw:20)
 Auto-Framing:  No
 Status       : Unmonitored
 Useragent    :
 Reg. Contact : sip:101@192.168.1.254:1111;line=gv8x1x75



*CLI> core show version
Asterisk SVN-trunk-r50469 built by root @ marvin on a i686 running Linux on 2007-01-11 22:39:21 UTC
Comments:By: Serge Vecher (serge-v) 2007-01-12 09:03:56.000-0600

As per bug guidelines, you need to attach a SIP debug trace illustrating the problem. Please do the following:
1) Prepare test environment (reduce the amount of unrelated traffic on the server);
2) Make sure your logger.conf has the following line:
  console => notice,warning,error,debug
3) restart Asterisk with the following command:
  'asterisk -Tvvvvvdddddngc | tee /tmp/verbosedebug.txt'
4) Enable SIP transaction logging with the following CLI commands:
set debug 4
set verbose 4
sip debug
5) Trim startup information and attach verbosedebug.txt to the issue.

By: sebb (sebb) 2007-01-12 09:32:04.000-0600

Here is the debug output. I didn't attach it because
1) I'm not sure if it's really a sip-related problem or a problem with device-states in the core-app.
2) it was always reproducible, even on different systems.

By: Serge Vecher (serge-v) 2007-01-12 11:21:51.000-0600

As you can from this line:

[Jan 12 16:29:23] NOTICE[10757]: chan_sip.c:14542 handle_request_subscribe: Got SUBSCRIBE for extension 102@local-in from 192.168.1.254, but there is no hint for that extension.

it is looking for a hint in local-in context. I think you hint subscription lines need to specify the context, as in:
exten => 101,hint,SIP/101@local-in

By: deti (deti) 2007-01-12 13:53:40.000-0600

see also bug ASTERISK-7238:
possible solution
- set call-limit to something >0
- set general config flag limitonpeers=yes

By: sebb (sebb) 2007-01-14 10:16:33.000-0600

deti: neither call-limit=5 nor limitonpeers=yes helps.

serge-v: I think that doesn't make sense, a SIP-account is not associated to a context. It just tries to lookup the extension first in the context given at the entry given in sip.conf (in this case [local-in], after that in [default]. Neverthenless I tried it, when I put a

exten => 101,hint,SIP/101@local-in
exten => 102,hint,SIP/102@local-in

in extension.conf, I get

102@default             : SIP/102@local-in      State:Unavailable
101@default             : SIP/101@local-in      State:Unavailable

By: Joshua C. Colp (jcolp) 2007-01-15 13:07:55.000-0600

Here murf, give this a looksie.

By: Tomislav Parcina (parcina) 2007-01-17 08:38:20.000-0600

I can confirm that I have the same problem. Configuratin that works on Asterisk 1.2 doesn't work on Asterisk 1.4
Hopefuly murf will solve this one.

By: fix_the_monitoring_issue (n0-1) 2007-01-17 12:02:12.000-0600

Same problem here, hints aren't working (tested on mips and x86 both times using 1.4.0). Please fix this soon, I have people sitting in my back forcing me to alternatively downgrade :-(

By: netscout (netscout) 2007-01-19 06:09:32.000-0600

Same error here still with the newest SVN Branch in 1.2 asll is working fine.

regards rene

By: bladerunner (bladerunner) 2007-01-23 04:41:07.000-0600

For me the solution with setting "call-limit" and "limitonpeers" seems to work at least with 2 phones (SNOM360, GXP2000)

By: Tomislav Parcina (parcina) 2007-01-23 08:06:12.000-0600

Can you be more specific?
You have edited sip.conf to look like this?

sip.conf
[general]
call-limit=1
limitonpeers = yes

If that is the case, than this isn't solution. And I don't think that this is the way that Asterisk should work. This defenately has to be changed.

By: bladerunner (bladerunner) 2007-01-23 08:56:07.000-0600

not exactly, my sip conf:

[general]
; some more options
allowsubscribe=yes
notifyringing=yes
notifyhold=yes
useclientcode=yes
limitonpeers=yes
;some more options

[20]
type=friend
context=phones
;some more phone-setup
subscribecontext=phones
call-limit=4

this works for me

By: deti (deti) 2007-01-23 09:08:24.000-0600

Well the problem you face when you just want to monitor device states with version 1.4 you need to set a call-limit, otherwise the call counters never get updated. In comparison to version 1.2 call counters were updated independent of call-limits. The new behavior is explained in the code:

"Test if we need to check call limits, in order to avoid realtime lookups if we do not need it"

IMHO there should be some way to get back the old behavior either by disabling the new call-limit checks or by introducing a configuration option.

You can find my patch chan_sip.c.enable-states.diff against trunk 1.4 r50673 which restores the behavior of version 1.2. Feel free to discuss about it.

By: Steve Murphy (murf) 2007-01-23 09:13:19.000-0600

Hmmm. I see conflicting reports here! There has been some changes to the sip channel code that involves device state. And most of it is driven by the realtime stuff. If we left it the same, realtime would be bogged down unacceptably by a torrent of devicestate information.

So, if you want devicestate related notifications, ya gotta 'turn it on' in the configuration files. As far as call-limit:

; You will get more detailed reports (busy etc) if you have a call limit set
; for a device. When the call limit is filled, we will indicate busy. Note that
; you need at least 2 in order to be able to do attended transfers.
;

Also:

; Note: Subscriptions does not work if you have a realtime dialplan and use the
; realtime switch.
;

And:

;allowsubscribe=no              ; Disable support for subscriptions. (Default is yes)
;subscribecontext = default     ; Set a specific context for SUBSCRIBE requests
                               ; Useful to limit subscriptions to local extensions
                               ; Settable per peer/user also

And:

;limitonpeers = yes             ; Apply call limits on peers only. This will improve
                               ; status notification when you are using type=friend
                               ; Inbound calls, that really apply to the user part
                               ; of a friend will now be added to and compared with
                               ; the peer limit instead of applying two call limits,
                               ; one for the peer and one for the user.

Hope this helps. Let's see if we can sort this all out!

By: netscout (netscout) 2007-01-23 10:57:46.000-0600

mm ok,
but in my case i use realtime oracle where the sip clients are stored.
and i want that each client can make 2 calls but when the client is using 1 line i want that for incoming calls a busy state coz the client is at the phone.
so what i have to change in * 1.4 ??

regards rene

By: netscout (netscout) 2007-01-24 01:57:02.000-0600

i tried the workarounds etc nothing is working for me ;(
i have the sip users in a realtime database and the hints in the extensions.conf
but it only recognize the idle no ringing,in use or busy state

By: Olle Johansson (oej) 2007-01-24 02:44:27.000-0600

netscout: Hints and realtime is not really designed to work together. Since realtime users are not stored in memory, we don't store any call data for them. You need to use groupcount to enforce a call limit if you use realtime.

By: netscout (netscout) 2007-01-24 02:47:49.000-0600

mmm well but in the 1.2 * it is working so why not in the 1.4 * ??
and how can i workaround it with the groupcount?

i tried to configure a callgroup but still no hinting.
when i register with my phone i saw it changing status from unavailable to idle but then no new status changes will occur such as ringing, in use or so.



By: Steven Sokol (ssokol) 2007-01-28 14:19:40.000-0600

Just as an FYI - this also breaks Manager applications which depend on ExtensionStatus messages.  SIP does not appear to be generating ExtensionStatus for any SIP channels.

By: Florent BARBIER (flo_turc) 2007-01-29 20:36:45.000-0600

murf : please note that Branch SVN-trunk-r50821M is working fine. The cli trace give this :

[Jan 29 22:27:19] DEBUG[10608]: chan_sip.c:3093 update_call_counter: Updating call counter for outgoing call
[Jan 29 22:27:19] DEBUG[10608]: chan_sip.c:3163 update_call_counter: Call to peer '201' is 1 out of 4
[Jan 29 22:27:19] DEBUG[10608]: devicestate.c:387 __ast_device_state_changed_literal: Notification of state change to be queued on device/channel SIP/201
[Jan 29 22:27:19] DEBUG[10608]: devicestate.c:245 ast_device_state: No provider found, checking channel drivers for SIP - 201
[Jan 29 22:27:19] DEBUG[10608]: chan_sip.c:15322 sip_devicestate: Checking device state for peer 201
[Jan 29 22:27:19] DEBUG[10608]: devicestate.c:371 do_state_change: Changing state for SIP/201 - state 6 (Ringing)
[Jan 29 22:27:19] DEBUG[10608]: devicestate.c:245 ast_device_state: No provider found, checking channel drivers for SIP - 201
[Jan 29 22:27:19] DEBUG[10608]: chan_sip.c:15322 sip_devicestate: Checking device state for peer 201
[Jan 29 22:27:19] DEBUG[10608]: devicestate.c:245 ast_device_state: No provider found, checking channel drivers for SIP - 201
[Jan 29 22:27:19] DEBUG[10608]: chan_sip.c:15322 sip_devicestate: Checking device state for peer 201
Extension Changed 201 new state Ringing for Notify User 204
[Jan 29 22:27:19] DEBUG[10608]: devicestate.c:245 ast_device_state: No provider found, checking channel drivers for SIP - 201
[Jan 29 22:27:19] DEBUG[10608]: chan_sip.c:15322 sip_devicestate: Checking device state for peer 201
Extension Changed 201 new state Ringing for Notify User 202
[Jan 29 22:27:19] DEBUG[10608]: app_queue.c:568 changethread: Device 'SIP/201' changed to state '6' (Ringing) but we don't care because they're not a member of any queue.

Please have look now on a trace from an Asterisk SVN-trunk-r51353 that don't work :

[Jan 30 03:29:38] DEBUG[28124]: chan_sip.c:3119 update_call_counter: Updating call counter for outgoing call
[Jan 30 03:29:38] DEBUG[28124]: chan_sip.c:3189 update_call_counter: Call to peer '10' is 1 out of 4
[Jan 30 03:29:38] DEBUG[28124]: devicestate.c:387 __ast_device_state_changed_literal: Notification of state change to be queued on device/channel SIP/10

As you can see, branch 50821 gave some warning from provider but work and the 51353 don't and don't work. I've tried to understand the hint process in the c files without success.

By: netscout (netscout) 2007-02-01 02:16:54.000-0600

yes i confirm that.
so there is a fix for that or some devs can have a look?
coz i need this hint function for our softclient.

regards rene

By: Olle Johansson (oej) 2007-02-01 14:31:08.000-0600

Please retest with latest 1.4 from subversion. I committed some cleanup and changes to rev 53079.

By: Olle Johansson (oej) 2007-02-01 14:45:33.000-0600

In trunk, I've implemented something called "busy-limit" that may interest you.

By: Florent BARBIER (flo_turc) 2007-02-05 09:04:07.000-0600

I've implemented the SVN-trunk-r51353 and BLF are working well !

By: jogi (jogi) 2007-02-06 07:35:42.000-0600

oej: Why are the hints with realtime in 1.4 not working anymore? Is there any reason why this has been changed? Are there any plans that in the near future hint will be supported within realtime as well?

By: Serge Vecher (serge-v) 2007-02-07 10:15:59.000-0600

guys, as oej has mentioned, please test rev > 53079.

By: jogi (jogi) 2007-02-08 12:26:25.000-0600

See http://bugs.digium.com/view.php?id=7433. Hint does not work correctly even without realtime.
I did some testing with SVN-trunk-r53533 - with realtime - state stays always idle.

By: Serge Vecher (serge-v) 2007-02-08 15:31:43.000-0600

most latest reports in 7433 suggest that hints do work; if that's not the case, please produce some logs as per the first note in this bug with some of your analysis.

By: Daniel Hazelbaker (cabal95) 2007-02-09 12:27:11.000-0600

I have hinting working on SIP<->SIP calls with the following settings on the monitored extension:
call-limit=1
limitpeersonly=yes

If I set call-limit to 0, it stops working. If I set limitpeersonly=no then it stops working as well.  The problem I have with it now, is that if I call voicemail it continues to show idle.  If I call a Zap channel, it continues to show idle.  If I call FROM a Zap channel TO the SIP channel, it updates the hint correctly.  Is there a setting I am missing somewhere or is that still part of the hinting bug?

By: Serge Vecher (serge-v) 2007-02-09 13:17:50.000-0600

please always report the revision and branch of Asterisk in use.

By: Daniel Hazelbaker (cabal95) 2007-02-09 13:23:50.000-0600

Oops, my applogies. I am using the "stock release" version of 1.4.0.  I don't know what SVN version it relates to.

communicator*CLI> core show version
Asterisk 1.4.0 built by root @ communicator.hdcnet.org on a x86_64 running Linux on 2007-01-26 00:34:11 UTC

By: Serge Vecher (serge-v) 2007-02-09 13:40:33.000-0600

cabal95: as mentioned in note 0058859, the problem has been fixed post 1.4.0 release. You need to be testing with 1.4 checked out from svn.

By: Christoph Stadlmann (cstadlmann) 2007-02-12 10:40:44.000-0600

I set up asterisk according to note 58169, hints not working. Furthermore if the device went into state 'hold', the state remains until I completely restart Asterisk, even when I disconnect the device or 'reload' (Bug 7433?). In the following log, devices '101' and '102' are talking to each other...
On top of all that, Asterisk Call Manager only fires event 'Newstate' with State 'up', no event upon hangup, and during call 'ExtensionState' is always 'Idle'. Very strange behaviour...

asterisktest*CLI> core show hints
   -= Registered Asterisk Dial Plan Hints =-
103@from-sip : SIP/103  State:Hold  Watchers  0
102@from-sip : SIP/102  State:Idle  Watchers  0
101@from-sip : SIP/101  State:Idle  Watchers  0
----------------
- 3 hints registered

[Feb 12 14:42:42] NOTICE[6410]: chan_sip.c:15394 sip_poke_noanswer: Peer '103' is now UNREACHABLE!  Last qualify: 20

asterisktest*CLI> core show hints
   -= Registered Asterisk Dial Plan Hints =-
103@from-sip : SIP/103  State:Hold  Watchers  0
102@from-sip : SIP/102  State:Idle  Watchers  0
101@from-sip : SIP/101  State:Idle  Watchers  0

[Feb 12 14:42:52] NOTICE[6410]: chan_sip.c:12428 handle_response_peerpoke: Peer '103' is now Reachable. (26ms / 2000ms)

asterisktest*CLI> core show hints
   -= Registered Asterisk Dial Plan Hints =-
103@from-sip : SIP/103  State:Hold  Watchers  0
102@from-sip : SIP/102  State:Idle  Watchers  0
101@from-sip : SIP/101  State:Idle  Watchers  0

asterisktest*CLI> sip show inuse
* User name               In use          Limit
103                       0               1
102                       1               1
101                       1               1
* Peer name               In use          Limit
103                       0/0/0           1
102                       0/0/0           1
101                       0/0/0           1

asterisktest*CLI> core show version
Asterisk SVN-trunk-r53980 built by root @ asterisktest on a i686 running Linux on 2007-02-12 08:41:38 UTC

By: jogi (jogi) 2007-02-12 11:07:25.000-0600

I have uploaded the output of the debug (verbosedebug.txt). I use sip.conf to configure the phones. When one phone calls the other, only the called phones shows busy. With the inuse output you see, that also the calling party is busy. What is wrong in my configuration. The SVN is SVN-trunk-r53533. Thanks for your support.

By: John Laur (gork) 2007-02-12 18:26:00.000-0600

I am seeing this same behavior.. 1.4 branch from svn and trunk

call-limit is on so asterisk is tracking number of calls

Making an active call from SIP/2003 to SIP/2005:

pbx*CLI> sip show inuse
* User name               In use          Limit
2003                      1               10
2005                      0               10
* Peer name               In use          Limit
2005                      1/0             10
2003                      0/0             10

pbx*CLI> show hints
   -= Registered Asterisk Dial Plan Hints =-
                  2003@default             : SIP/2003              State:Idle            Watchers  1
                  2005@default             : SIP/2005              State:InUse          Watchers  1

hints.conf:
exten => 2003,hint,SIP/2003
exten => 2005,hint,SIP/2005

Asterisk does not seem to be updating the hint whenever the status of a SIP user changes -- they only update when the SIP peer changes for some reason.

By: Christoph Stadlmann (cstadlmann) 2007-02-13 08:48:50.000-0600

I found out a partitial solution with the LATEST SVN r54149: You have to set ALL extensions in sip.conf to type=peer.
See the difference:

1) With type=friend, 101 calls 103:

asterisktest*CLI> sip show inuse
* User name               In use          Limit
103                       0               2
102                       0               2
101                       1               2
* Peer name               In use          Limit
103                       1/0/0           2
102                       0/0/0           2
101                       0/0/0           2


2) With type=peer, 101 calls 103:

asterisktest*CLI> sip show inuse
* User name               In use          Limit
* Peer name               In use          Limit
103                       1/1/0           2
102                       0/0/0           2
101                       1/0/0           2

asterisktest*CLI> core show hints
asterisktest*CLI>
   -= Registered Asterisk Dial Plan Hints =-
103@from-sip : SIP/103  State:Ringing  Watchers  0
102@from-sip : SIP/102  State:Unavailable  Watchers  0
101@from-sip : SIP/101  State:InUse  Watchers  0


As you can see, 101 and 103 have an active channel (the first '1' of the three values), and currently 103 is ringing (the second '1' I guess).
Also, with all phones set to 'type=peer' hints are working. Also Asterisk Manager Interface fires all 'ExtensionState' events.

BUT...

If one peer put's a call on hold, the state remains. Furthermore, all on-holds are sumed up... In the following log, extension 101 put a call on hold 8 times (and of course resumed them...) and the value never decrements.

asterisktest*CLI> sip show inuse
* User name               In use          Limit
* Peer name               In use          Limit
103                       0/0/0           2
102                       0/0/0           2
101                       0/0/8           2

asterisktest*CLI> core show hints
asterisktest*CLI>
   -= Registered Asterisk Dial Plan Hints =-
103@from-sip : SIP/103 State:Idle Watchers  0
102@from-sip : SIP/102 State:Unavailable Watchers  0
101@from-sip : SIP/101 State:Hold Watchers  0

asterisktest*CLI> core show version
Asterisk SVN-trunk-r54149 built by root @ asterisktest on a i686 running Linux on 2007-02-13 13:20:47 UTC



By: John Laur (gork) 2007-02-13 09:57:25.000-0600

Can SIP UA's do a REGISTER without type=user or type=friend? Seems if changing type=friend to type=peer fixes this problem (even partially) then there is another seriously glaring security problem here!

By: Olle Johansson (oej) 2007-02-15 06:18:50.000-0600

The type=peer for this has been well known, and that is why I implemented the new flag in trunk that I need you to test - limitonpeer.

Please test that and tell me if this is a good solution.

Gork- why is this a security issue?

By: Olle Johansson (oej) 2007-02-15 06:20:21.000-0600

Please read
http://lists.digium.com/pipermail/asterisk-dev/2007-February/026190.html

Thanks.

/O

By: Olle Johansson (oej) 2007-02-19 12:08:37.000-0600

Any comments, feedback - or are we ready to close this bug report?

By: Christoph Stadlmann (cstadlmann) 2007-02-20 01:21:40.000-0600

Nope, we aren't ready to close this bug... In the following sequence, 101 calls 103, talks and both parties hang up. Then ext 103 makes a call, and ext 101 rings 103, everything fine so far. But after 101 hangs up, the call counter of 103 resets to 0 although 103 is still on a call. After 103 hangs up, the call counter decreases to -1...

asterisktest*CLI> sip show inuse
* User name               In use          Limit
* Peer name               In use          Limit
103                       0/0/0           2
102                       0/0/0           2
101                       0/0/0           2
   -- Executing [103@from-sip:1] NoOp("SIP/101-081a56a8", "SIP/103 has state NOT_INUSE") in new stack
   -- Executing [103@from-sip:2] NoOp("SIP/101-081a56a8", "SIPPEER(103:curcalls) is 0") in new stack
   -- Executing [103@from-sip:3] Dial("SIP/101-081a56a8", "SIP/103") in new stack
   -- Called 103
   -- SIP/103-081abec0 is ringing
   -- Call on SIP/103-081abec0 left from hold
   -- SIP/103-081abec0 answered SIP/101-081a56a8
   -- Packet2Packet bridging SIP/101-081a56a8 and SIP/103-081abec0
asterisktest*CLI> sip show inuse
* User name               In use          Limit
* Peer name               In use          Limit
103                       1/0/0           2
102                       0/0/0           2
101                       1/0/0           2
 == Spawn extension (from-sip, 103, 3) exited non-zero on 'SIP/101-081a56a8'
asterisktest*CLI> sip show inuse
* User name               In use          Limit
* Peer name               In use          Limit
103                       0/0/0           2
102                       0/0/0           2
101                       0/0/0           2
   -- Executing [1566@from-sip:1] NoCDR("SIP/103-081a38d8", "") in new stack
[Feb 20 08:10:12] NOTICE[25137]: cdr.c:429 ast_cdr_free: CDR on channel 'SIP/103-081a38d8' not posted
[Feb 20 08:10:12] NOTICE[25137]: cdr.c:431 ast_cdr_free: CDR on channel 'SIP/103-081a38d8' lacks end
   -- Executing [1566@from-sip:2] PlayTones("SIP/103-081a38d8", "ring") in new stack
   -- Executing [1566@from-sip:3] Wait("SIP/103-081a38d8", "5") in new stack
   -- Executing [1566@from-sip:4] StopPlayTones("SIP/103-081a38d8", "") in new stack
   -- Executing [1566@from-sip:5] Answer("SIP/103-081a38d8", "") in new stack
   -- Executing [1566@from-sip:6] Playback("SIP/103-081a38d8", "/var/lib/asterisk/moh/fpm-calm-river") in new stack
   -- <SIP/103-081a38d8> Playing '/var/lib/asterisk/moh/fpm-calm-river' (language 'de')
   -- Executing [103@from-sip:1] NoOp("SIP/101-081bb990", "SIP/103 has state INUSE") in new stack
   -- Executing [103@from-sip:2] NoOp("SIP/101-081bb990", "SIPPEER(103:curcalls) is 1") in new stack
   -- Executing [103@from-sip:3] Dial("SIP/101-081bb990", "SIP/103") in new stack
   -- Called 103
   -- SIP/103-081c5d48 is ringing
asterisktest*CLI> sip show inuse
* User name               In use          Limit
* Peer name               In use          Limit
103                       2/1/0           2
102                       0/0/0           2
101                       1/0/0           2
 == Spawn extension (from-sip, 103, 3) exited non-zero on 'SIP/101-081bb990'
asterisktest*CLI> sip show inuse
* User name               In use          Limit
* Peer name               In use          Limit
103                       0/0/0           2
102                       0/0/0           2
101                       0/0/0           2
 == Spawn extension (from-sip, 1566, 6) exited non-zero on 'SIP/103-081a38d8'
asterisktest*CLI> sip show inuse
* User name               In use          Limit
* Peer name               In use          Limit
103                       -1/0/0          2
102                       0/0/0           2
101                       0/0/0           2
asterisktest*CLI> core show hints
asterisktest*CLI>
   -= Registered Asterisk Dial Plan Hints =-
                   103@from-sip            : SIP/103               State:InUse           Watchers  0
                   102@from-sip            : SIP/102               State:Unavailable     Watchers  0
                   101@from-sip            : SIP/101               State:Idle            Watchers  0
----------------
- 3 hints registered
asterisktest*CLI> core show version
Asterisk SVN-trunk-r55495 built by root @ asterisktest on a i686 running Linux on 2007-02-20 07:00:08 UTC


As you can see, call counters don't work (anymore) in SVN 55495. After this call sequence, extension 103 has a negative call counter and hints show state 'InUse'...
Should I open a seperate bug or can we handle this here?

By: Serge Vecher (serge-v) 2007-02-20 09:48:47.000-0600

cstadlmann: this can probably be handled here; please attach a verbosedebug log if you will.

By: Christoph Stadlmann (cstadlmann) 2007-02-21 01:59:58.000-0600

Please find attached the file 'cstadlmann-verbosebedug.txt' as you requested. I also attached my 'sip.conf' and 'extensions.conf'.

By: jogi (jogi) 2007-02-21 02:20:27.000-0600

Olle: Should this also work for realtime configuration of sip-clients. I did not find anything about in your info.



By: Serge Vecher (serge-v) 2007-02-21 11:46:27.000-0600

cstadlmann: please test 1.4 rev > 55914. Thanks.

By: Christoph Stadlmann (cstadlmann) 2007-02-22 01:42:56.000-0600

Sorry to say, no change in Asterisk SVN-trunk-r56095. Did you fix something related to that issue? The 'hold' bug is also still there (9052), maybe the wrong part of code was merged into trunk...

asterisktest*CLI> core show hints
asterisktest*CLI>
   -= Registered Asterisk Dial Plan Hints =-
                   103@from-sip            : SIP/103               State:Idle            Watchers  0
                   102@from-sip            : SIP/102               State:Unavailable     Watchers  0
                   101@from-sip            : SIP/101               State:Idle            Watchers  0
----------------
- 3 hints registered
   -- Executing [1566@from-sip:1] NoCDR("SIP/103-081d4f08", "") in new stack
[Feb 22 08:36:32] NOTICE[16583]: cdr.c:429 ast_cdr_free: CDR on channel 'SIP/103-081d4f08' not posted
[Feb 22 08:36:32] NOTICE[16583]: cdr.c:431 ast_cdr_free: CDR on channel 'SIP/103-081d4f08' lacks end
   -- Executing [1566@from-sip:2] PlayTones("SIP/103-081d4f08", "ring") in new stack
   -- Executing [1566@from-sip:3] Wait("SIP/103-081d4f08", "5") in new stack
   -- Executing [1566@from-sip:4] StopPlayTones("SIP/103-081d4f08", "") in new stack
   -- Executing [1566@from-sip:5] Answer("SIP/103-081d4f08", "") in new stack
   -- Executing [1566@from-sip:6] Playback("SIP/103-081d4f08", "/var/lib/asterisk/moh/fpm-calm-river") in new stack
   -- <SIP/103-081d4f08> Playing '/var/lib/asterisk/moh/fpm-calm-river' (language 'de')
asterisktest*CLI> sip show inuse
* User name               In use          Limit
* Peer name               In use          Limit
103                       1/0/0           2
102                       0/0/0           2
101                       0/0/0           2
   -- Executing [103@from-sip:1] NoOp("SIP/101-081ef108", "SIP/103 has state INUSE") in new stack
   -- Executing [103@from-sip:2] NoOp("SIP/101-081ef108", "SIPPEER(103:curcalls) is 1") in new stack
   -- Executing [103@from-sip:3] Dial("SIP/101-081ef108", "SIP/103") in new stack
   -- Called 103
   -- SIP/103-081f3078 is ringing
asterisktest*CLI> sip show inuse
* User name               In use          Limit
* Peer name               In use          Limit
103                       2/1/0           2
102                       0/0/0           2
101                       1/0/0           2
 == Spawn extension (from-sip, 103, 3) exited non-zero on 'SIP/101-081ef108'
asterisktest*CLI> sip show inuse
* User name               In use          Limit
* Peer name               In use          Limit
103                       0/0/0           2
102                       0/0/0           2
101                       0/0/0           2
 == Spawn extension (from-sip, 1566, 6) exited non-zero on 'SIP/103-081d4f08'
asterisktest*CLI> sip show inuse
* User name               In use          Limit
* Peer name               In use          Limit
103                       -1/0/0          2
102                       0/0/0           2
101                       0/0/0           2
asterisktest*CLI> core show version
Asterisk SVN-trunk-r56095 built by root @ asterisktest on a i686 running Linux on 2007-02-22 07:04:43 UTC

By: Christoph Stadlmann (cstadlmann) 2007-02-24 03:22:49.000-0600

Any updates here?

By: bender (bender) 2007-02-28 21:25:41.000-0600

Howdy folks,

I have also encountered the problem where the call counter drops to -1 (at which point it's BLF light stays lit after the call ends).

So far there is one problem that I can consistently duplicate on my box (running 1.4.0 SVN-trunk-r56232):

Test Case A:

extensions.conf contains:
exten => 099,1,Dial(SIP/099)
exten => 099,hint,SIP/099
exten => 101,1,Dial(SIP/101)
exten => 101,hint,SIP/101

everything seems to work fine.


Test Case B:

extensions.conf contains:
exten => 099,1,Dial(SIP/099&SIP/101)
exten => 099,hint,SIP/099
exten => 101,1,Dial(SIP/101)
exten => 101,hint,SIP/101

This causes a problem.

> sip show inuse
* User name               In use          Limit
* Peer name               In use          Limit
101                       0/0/0           4
099                       0/0/0           4

Now 099 dials 099 and both phones ring (as expected).

>sip show inuse
* User name               In use          Limit
* Peer name               In use          Limit
101                       1/1/0           4
099                       2/1/0           4

Now 101 answers

> sip show inuse
* User name               In use          Limit
* Peer name               In use          Limit
101                       1/0/0           4
099                       0/0/0           4

Finally 101 hangs up

sip show inuse
* User name               In use          Limit
* Peer name               In use          Limit
101                       0/0/0           4
099                       -1/0/0          4

099 gets properly disconnected, but the BLF for 099 stays lit (due to -1 value)

I have attached file bender-verbosedebug.txt

I don't want to hijack this thread if this is a different problem - also let me know if there is anything else I can do/provide.

A big, big thanks to oej for hanging in with these annoying hints - they are very nice indeed when they are working  ;-)

peace

By: bender (bender) 2007-03-05 16:37:45.000-0600

Retested with Ver 1.4.1 and it appears to fix the problem that I was encountering. Many thanks!

By: Serge Vecher (serge-v) 2007-03-20 09:20:50

cstadlmann: what are your test results with 1.4.2?

By: Serge Vecher (serge-v) 2007-03-26 10:01:28

inspired by bugs 9372 and 9001: the UPGRADE.txt for 1.4 specifies that chan_sip's devicestate handling affects app_queue. Manager events are also affected --> proposing to expand the verbage a bit either under chan_sip section or the manager section of UPGRADE.txt

By: Christoph Stadlmann (cstadlmann) 2007-03-26 10:12:01

@serge-v:
Sorry for not responding for a while, but currently I have another project running. As soon as have a little extra time I will resume tests with the lastest svn.

By: Florent BARBIER (flo_turc) 2007-03-26 19:21:13

Hi all,

In the 1.2.17 stable version, PEER IN USE value seams to never decrease after receiving a call. I've set call-limit to =100000...


Rgs, FB.

By: Marek Cervenka (cervajs) 2007-03-27 02:39:32

same problem as flo_turc :(
please, this is critical bug

By: Serge Vecher (serge-v) 2007-03-27 08:43:32

flo_turc, cervajs:

stating that there is a problem without providing any debug information does not help as track this problem down one bit. Please provide debug info as per the first note in this bug.

By: Steve Murphy (murf) 2007-03-27 08:58:49

Let me guess; do you see messages like:

[Mar 26 16:22:28] ERROR[21760]: chan_sip.c:3059 update_call_counter: Call to peer 'murf' rejected due to usage limit of 3


When you shouldn't be? In the above case, that sip softphone would probably NEVER see more than one call at a time. Now it sits idle, never getting a call...

By: Marek Cervenka (cervajs) 2007-03-27 09:10:57

yes, i see this messages
sip softphone is xlite 2.0 (on linux) (but i have this problem on grandstream ht496 too)
show channels does not show any channels associated with this softphone
sip show inuse show user 0 0, peer 1 1  (call-limit=1)

may i create a separate bug? tonight i'll try make some debug info

By: Serge Vecher (serge-v) 2007-03-27 09:22:38

reassigning to murf until oej resurfaces again ;)

By: netscout (netscout) 2007-04-10 05:01:08

hello,

we found a fix for realtme hinting.
when you have a mysql database add a row "call-limit" you have to set this row to a value for exp.: 2
then the realtime hinting is working.

regards netscout

By: Leif Madsen (lmadsen) 2007-04-10 23:10:38

netscout: what does your relevant sip.conf parts look like? I'm using realtime and added the call-limit column to my DB, and everything is still Unavailable, and Asterisk sends 404 Not Found upon the SUBSCRIBE.

By: Olle Johansson (oej) 2007-04-27 09:51:47

i did extensive testing on SIP device states and subscriptions on SIPit. It does work with proper configuration, as documented in the docs. There's one issue in a separate bug report about the hold state that isn't cleared in all circumstances.

To sort things up I am going to close this bug report and you have to open separate new issues for each problem you see and we'll take them separately. When you open a new bug report, please add a reference to this bug report so we can follow them. Thanks.

Please do make sure that you have a proper configuration with call-limit set, hints set and notifyringing/notifyhold if you need those states.

By: Leif Madsen (lmadsen) 2007-04-27 10:11:55

oej: Before you close this can you point us to the exact place where this is documented? I went through the sip.conf.sample file, and I certainly couldn't figure it out -- and I'd say I know how to use Asterisk :)

By: netscout (netscout) 2007-04-28 00:20:21

hi all,

i have this in the sip.conf:

[general]
context = from-sip-external
bindport = 5060
bindaddr = 0.0.0.0
allowguest=no
srvlookup = yes

disallow=gsm
allow=ulaw
allow=g729
allow=alaw
callerid = Unknown
language = de
videosupport = yes
call-limit = 2
busy-level = 1
limitonpeers = yes
buggymwi=yes
allowsubscribe=yes
notifyringing=yes
notifyhold=yes
useclientcode=yes
allguest=no
callevents=yes
alwaysauthreject=yes
rtcachefriends=yes
rtautoclear=no
rtupdate=yes
rtsavesysname=yes
pickupgroup=1-63
jbenable = yes
t38pt_udptl=yes
rfc2833compensate=yes
ignoreregexpire=yes

and the call-limit row in the database.

regards rene

By: Olle Johansson (oej) 2007-04-30 02:04:26

blitzrage:
sip.conf.sample in 1.4:
------
--------------------------- STATUS NOTIFICATIONS (SUBSCRIPTIONS) ----------------------------
; You can subscribe to the status of extensions with a "hint" priority
; (See extensions.conf.sample for examples)
; chan_sip support two major formats for notifications: dialog-info and SIMPLE
;
; You will get more detailed reports (busy etc) if you have a call limit set
; for a device. When the call limit is filled, we will indicate busy. Note that
; you need at least 2 in order to be able to do attended transfers.
;
; For queues, you will need this level of detail in status reporting, regardless
; if you use SIP subscriptions. Queues and manager use the same internal interface
; for reading status information.
;
; Note: Subscriptions does not work if you have a realtime dialplan and use the
; realtime switch.
;
;allowsubscribe=no              ; Disable support for subscriptions. (Default is yes)
;subscribecontext = default     ; Set a specific context for SUBSCRIBE requests
                               ; Useful to limit subscriptions to local extensions
                               ; Settable per peer/user also
;notifyringing = yes            ; Notify subscriptions on RINGING state (default: no)
;notifyhold = yes               ; Notify subscriptions on HOLD state (default: no)
                               ; Turning on notifyringing and notifyhold will add a lot
                               ; more database transactions if you are using realtime.
;limitonpeers = yes             ; Apply call limits on peers only. This will improve
                               ; status notification when you are using type=friend
                               ; Inbound calls, that really apply to the user part
                               ; of a friend will now be added to and compared with
                               ; the peer limit instead of applying two call limits,
                               ; one for the peer and one for the user.

----------
doc/queue.txt in trunk:
----------
* SIP channel configuration
---------------------------
Queues depend on the channel driver reporting the proper state
for each member of the queue. To get proper signalling on
queue members that use the SIP channel driver, you need to
enable a call limit (could be set to a high value so it
is not put into action) and also make sure that both inbound
and outbound calls are accounted for.

Example:

       [general]
       limitonpeer = yes

       [peername]
       type=friend
       call-limit=10

By: Olle Johansson (oej) 2007-05-02 04:45:40

Anyone that still has an open issue here?

By: jogi (jogi) 2007-05-08 04:08:26

So far I could not bring it to work with rtcachefriends=no. With 1.2 it works.
Has anyone a solution for that?

By: Olle Johansson (oej) 2007-05-16 05:10:09

Subscriptions is not really made to work with realtime.

By: Olle Johansson (oej) 2007-05-16 05:11:55

Ok, closing time. If you have further issues, please re-open a new issue with proper debugs and your configuration.

I really appreciate all your feedback and work on this issue. Hopefully, it's much better with all the fixes that has been put in. There's still an issue with transfers that we need to fix, but there are plent of other bug reports on that.

Cheers,
/Olle