[asterisk-bugs] [Asterisk 0012862]: incorrect state update in friend nodes (chan_sip.c)

noreply at bugs.digium.com noreply at bugs.digium.com
Mon Jun 16 10:38:44 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=12862 
====================================================================== 
Reported By:                mojadita
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   12862
Category:                   Channels/chan_sip/General
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     feedback
Asterisk Version:           1.4.19 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             06-15-2008 15:52 CDT
Last Modified:              06-16-2008 10:38 CDT
====================================================================== 
Summary:                    incorrect state update in friend nodes (chan_sip.c)
Description: 
I have noticed that when devices are being monitored for NOTICE events,
when two extensions call each other only the destination one is marked as
busy.  This issue was discovered with a Linksys SPA-962 with SPA-932 button
attendant used to monitor the SIP extensions status.

Following the code I have observed that when a call is being made from a
sip friend, only the user part is being updated for state (on the calling
side) but not the peer part for friends, and when it is consulted, only the
peer part gets involved for status (and not the user part in case of a
friend).

I have modified chan_sip.c to update the peer part for peers/friends and
the user part for users only, and the sip_devicestate routine to do the
same when asking for status.  Now, both extensions (the calling and the
called one) activate their busy lights when monitored.

I have published a patch to update the code as I don't have developer
status, patch is at
http://www.lcssl.es/~luis/asterisk_patches/patch_correct_state.patch
please, feel free to check it (it's been developed for 1.4.19, but it
applies well on 1.4.20 and probably to 1.4.21, sorry for the inconvenience)
and incorporate to the main trunk if possible (granted will be a mention of
my two cents contribution, if possible)  Feel free of checking it, as it's
a very short one.

Thanks for your attention.

Luis Colorado
====================================================================== 

---------------------------------------------------------------------- 
 bcnit - 06-16-08 10:38  
---------------------------------------------------------------------- 
This seems to be a much bigger problem.

If I change any value (or even delete the record), the command 'sip show
peer 204' still shows as existing with the old details.

In the example below, I show that this is the case:


[root at pbx09a asterisk]# asterisk -rx 'realtime load sippeers name 204'
No rows found matching search criteria.
[root at pbx09a asterisk]# asterisk -rx 'realtime load sippeers name 204x'
                   Column Name  Column Value
          --------------------  --------------------
                            id  311
                          name  204x
                          host  dynamic
                           nat  no
                          type  friend
                   accountcode  BAN
                      callerid  204 <204>
                    call-limit  2
                cancallforward  yes
                   canreinvite  no
                       context  from-authorised
                      dtmfmode  rfc2833
                      language  en
                          deny  0.0.0.0/0.0.0.0
                        permit  0.0.0.0/0.0.0.0
                   musiconhold  default
                       qualify  yes
                        secret  bank57
                      disallow  all
                         allow  alaw
                   fullcontact  sip:204 at 192.168.1.116:2057
                   fullcontact  line=ho1d1yj6
                        ipaddr  192.168.1.116
                          port  2057
                    regseconds  1213630511
                   defaultuser  204
[root at pbx09a asterisk]# asterisk -rx 'sip show peer 204'


  * Name       : 204
  Realtime peer: No
  Secret       : <Set>
  MD5Secret    : <Not set>
  Context      : from-agent
  Subscr.Cont. : <Not set>
  Language     : en
  Accountcode  : BAN
  AMA flags    : Unknown
  Transfer mode: open
  CallingPres  : Presentation Allowed, Not Screened
  Callgroup    :
  Pickupgroup  :
  Mailbox      :
  VM Extension : voicemail
  LastMsgsSent : 32767/65535
  Call limit   : 2
  Dynamic      : Yes
  Callerid     : "204" <204>
  MaxCallBR    : 384 kbps
  Expire       : 521
  Insecure     : no
  Nat          : RFC3581
  ACL          : Yes
  T38 pt UDPTL : No
  CanReinvite  : No
  PromiscRedir : No
  User=Phone   : No
  Video Support: No
  Text Support : No
  Trust RPID   : No
  Send RPID    : Yes
  Subscriptions: Yes
  Overlap dial : No
  DTMFmode     : rfc2833
  Timer T1     : 500
  Timer B      : 32000
  ToHost       :
  Addr->IP     : 192.168.1.116 Port 2057
  Defaddr->IP  : 0.0.0.0 Port 2054
  Transport    : UDP
  Def. Username: 204
  SIP Options  : (none)
  Codecs       : 0x8 (alaw)
  Codec Order  : (alaw:20)
  Auto-Framing :  No
  100 on REG   : No
  Status       : OK (42 ms)
  Useragent    : snom320/7.1.30
  Reg. Contact : sip:204 at 192.168.1.116:2057;line=ho1d1yj6
  Qualify Freq : 60000 ms
  Sess-Timers  : Accept
  Sess-Refresh : uas
  Sess-Expires : 1800 secs
  Min-Sess     : 90 secs

[root at pbx09a asterisk]# asterisk -rx 'sip show peer 204x'
Peer 204x not found. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
06-16-08 10:38  bcnit          Note Added: 0088754                          
======================================================================




More information about the asterisk-bugs mailing list