[Home]

Summary:ASTERISK-13583: "iax2 prune realtime" doesn't prune user, only peer
Reporter:Steve Poirier (mousepad99)Labels:
Date Opened:2009-02-14 12:06:03.000-0600Date Closed:2009-02-26 11:50:51.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Functions/func_realtime
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:Unlike it's other brother, sip prune realtime,  iax2 prune realtime will only prune the iax2 peer.  Making it impossible to prune a cached iax "friend".

The only way to prune the iax user from the cache is to issue:
iax2 reload


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

Example, here we'll set the context, and cache it. After, we'll change the context, purge the entry.  

mysql> update tbl_iax_buddies set context='from-internal' where name='100085_001';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0


asterisk*CLI> iax2 show peer 100085_001
asterisk*CLI>

 * Name       : 100085_001
 Secret       : <Set>
 Context      : from-internal
 Mailbox      : 851
 Dynamic      : Yes
 Callerid     : "" <2146158599>
 Expire       : 348170
 ACL          : No
 Addr->IP     : 189.202.11.131 Port 4569
 Defaddr->IP  : 0.0.0.0 Port 4569
 Username     : 100085_001
 Codecs       : 0x3fffff (g723|gsm|ulaw|alaw|g726|adpcm|slin|lpc10|g729|speex|ilbc|g726aal2|g722|jpeg|png|h261|h263|h263p|h264)
 Codec Order  : (none)
 Status       : Unmonitored
 Qualify      : every 60000ms when OK, every 10000ms when UNREACHABLE (sample smoothing Off)

asterisk*CLI> iax2 show users
Username         Secret                Authen           Def.Context      A/C    Codec Pref
100085_001       ******                000000000000003  from-internal    No     Host



mysql> update tbl_iax_buddies set context='suspended' where name='100085_001';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

asterisk*CLI> iax2 prune realtime 100085_001
OK peer 100085_001 was removed from the cache.

asterisk*CLI>

 * Name       : 100085_001
 Secret       : <Set>
 Context      : suspended
 Mailbox      : 851
 Dynamic      : Yes
 Callerid     : "" <2146158599>
 Expire       : 348473
 ACL          : No
 Addr->IP     : 189.202.11.131 Port 4569
 Defaddr->IP  : 0.0.0.0 Port 4569
 Username     : 100085_001
 Codecs       : 0x3fffff (g723|gsm|ulaw|alaw|g726|adpcm|slin|lpc10|g729|speex|ilbc|g726aal2|g722|jpeg|png|h261|h263|h263p|h264)
 Codec Order  : (none)
 Status       : Unmonitored
 Qualify      : every 60000ms when OK, every 10000ms when UNREACHABLE (sample smoothing Off)

Username         Secret                Authen           Def.Context      A/C    Codec Pref
100085_001       ******                000000000000003  from-internal    No     Host

Comments:By: Digium Subversion (svnbot) 2009-02-26 09:50:23.000-0600

Repository: asterisk
Revision: 178767

U   trunk/channels/chan_iax2.c

------------------------------------------------------------------------
r178767 | dvossel | 2009-02-26 09:50:22 -0600 (Thu, 26 Feb 2009) | 8 lines

IAX2 prune realtime fix

Iax2 prune realtime had issues.  If "iax2 prune realtime all" was called, it would appear like the command was successful, but in reality nothing happened.  This is because the reload that was supposed to take place checks the config files, sees no changes, and does nothing.  If there had been a change in the the config file, the realtime users would have been marked for deletion and everything would have been fine.  Now prune_users() and prune_peers() are called instead of reload_config() to prune all users/peers that are realtime.  These functions remove all users/peers with the rtfriend and delme flags set. iax2_prune_realtime() also lacked the code to properly delete a single friend.  For example. if iax2 prune realtime <friend> was called, only the peer instance would be removed. The user would still remain.  

(closes issue ASTERISK-13583)
Reported by: mousepad99
Review: http://reviewboard.digium.com/r/176/

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=178767

By: Digium Subversion (svnbot) 2009-02-26 10:01:06.000-0600

Repository: asterisk
Revision: 178768

_U  branches/1.6.0/
U   branches/1.6.0/channels/chan_iax2.c

------------------------------------------------------------------------
r178768 | dvossel | 2009-02-26 10:01:05 -0600 (Thu, 26 Feb 2009) | 15 lines

Merged revisions 178767 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
 r178767 | dvossel | 2009-02-26 09:50:22 -0600 (Thu, 26 Feb 2009) | 8 lines
 
 IAX2 prune realtime fix
 
 Iax2 prune realtime had issues.  If "iax2 prune realtime all" was called, it would appear like the command was successful, but in reality nothing happened.  This is because the reload that was supposed to take place checks the config files, sees no changes, and does nothing.  If there had been a change in the the config file, the realtime users would have been marked for deletion and everything would have been fine.  Now prune_users() and prune_peers() are called instead of reload_config() to prune all users/peers that are realtime.  These functions remove all users/peers with the rtfriend and delme flags set. iax2_prune_realtime() also lacked the code to properly delete a single friend.  For example. if iax2 prune realtime <friend> was called, only the peer instance would be removed. The user would still remain.  
 
 (closes issue ASTERISK-13583)
 Reported by: mousepad99
 Review: http://reviewboard.digium.com/r/176/
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=178768

By: Digium Subversion (svnbot) 2009-02-26 10:07:08.000-0600

Repository: asterisk
Revision: 178769

_U  branches/1.6.1/
U   branches/1.6.1/channels/chan_iax2.c

------------------------------------------------------------------------
r178769 | dvossel | 2009-02-26 10:07:08 -0600 (Thu, 26 Feb 2009) | 15 lines

Merged revisions 178767 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
 r178767 | dvossel | 2009-02-26 09:50:22 -0600 (Thu, 26 Feb 2009) | 8 lines
 
 IAX2 prune realtime fix
 
 Iax2 prune realtime had issues.  If "iax2 prune realtime all" was called, it would appear like the command was successful, but in reality nothing happened.  This is because the reload that was supposed to take place checks the config files, sees no changes, and does nothing.  If there had been a change in the the config file, the realtime users would have been marked for deletion and everything would have been fine.  Now prune_users() and prune_peers() are called instead of reload_config() to prune all users/peers that are realtime.  These functions remove all users/peers with the rtfriend and delme flags set. iax2_prune_realtime() also lacked the code to properly delete a single friend.  For example. if iax2 prune realtime <friend> was called, only the peer instance would be removed. The user would still remain.  
 
 (closes issue ASTERISK-13583)
 Reported by: mousepad99
 Review: http://reviewboard.digium.com/r/176/
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=178769

By: Digium Subversion (svnbot) 2009-02-26 11:24:07.000-0600

Repository: asterisk
Revision: 178838

U   branches/1.4/channels/chan_iax2.c

------------------------------------------------------------------------
r178838 | dvossel | 2009-02-26 11:24:07 -0600 (Thu, 26 Feb 2009) | 9 lines

IAX2 prune realtime fix

Now prune_users() and prune_peers() are called instead of reload_config() to prune all users/peers that are realtime.  These functions remove all users/peers with the rtfriend and delme flags set. iax2_prune_realtime() also lacked the code to properly delete a single friend.  For example. if iax2 prune realtime <friend> was called, only the peer instance would be removed. The user would still remain.

(closes issue ASTERISK-13583)
Reported by: mousepad99
Review: http://reviewboard.digium.com/r/176/


------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=178838

By: Digium Subversion (svnbot) 2009-02-26 11:26:15.000-0600

Repository: asterisk
Revision: 178848

_U  trunk/

------------------------------------------------------------------------
r178848 | dvossel | 2009-02-26 11:26:14 -0600 (Thu, 26 Feb 2009) | 14 lines

Blocked revisions 178838 via svnmerge

........
 r178838 | dvossel | 2009-02-26 11:24:02 -0600 (Thu, 26 Feb 2009) | 9 lines
 
 IAX2 prune realtime fix
 
 Now prune_users() and prune_peers() are called instead of reload_config() to prune all users/peers that are realtime.  These functions remove all users/peers with the rtfriend and delme flags set. iax2_prune_realtime() also lacked the code to properly delete a single friend.  For example. if iax2 prune realtime <friend> was called, only the peer instance would be removed. The user would still remain.
 
 (closes issue ASTERISK-13583)
 Reported by: mousepad99
 Review: http://reviewboard.digium.com/r/176/
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=178848

By: Digium Subversion (svnbot) 2009-02-26 11:46:12.000-0600

Repository: asterisk
Revision: 178871

U   trunk/channels/chan_iax2.c

------------------------------------------------------------------------
r178871 | dvossel | 2009-02-26 11:46:12 -0600 (Thu, 26 Feb 2009) | 6 lines

IAX2 prune realtime, minor tweak to last fix

A return statement was missing which caused unexpected cli output.

issue ASTERISK-13583

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=178871

By: Digium Subversion (svnbot) 2009-02-26 11:50:01.000-0600

Repository: asterisk
Revision: 178874

_U  branches/1.6.0/
U   branches/1.6.0/channels/chan_iax2.c

------------------------------------------------------------------------
r178874 | dvossel | 2009-02-26 11:50:00 -0600 (Thu, 26 Feb 2009) | 13 lines

Merged revisions 178871 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
 r178871 | dvossel | 2009-02-26 11:46:12 -0600 (Thu, 26 Feb 2009) | 6 lines
 
 IAX2 prune realtime, minor tweak to last fix
 
 A return statement was missing which caused unexpected cli output.
 
 issue ASTERISK-13583
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=178874

By: Digium Subversion (svnbot) 2009-02-26 11:50:51.000-0600

Repository: asterisk
Revision: 178875

_U  branches/1.6.1/
U   branches/1.6.1/channels/chan_iax2.c

------------------------------------------------------------------------
r178875 | dvossel | 2009-02-26 11:50:51 -0600 (Thu, 26 Feb 2009) | 13 lines

Merged revisions 178871 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
 r178871 | dvossel | 2009-02-26 11:46:12 -0600 (Thu, 26 Feb 2009) | 6 lines
 
 IAX2 prune realtime, minor tweak to last fix
 
 A return statement was missing which caused unexpected cli output.
 
 issue ASTERISK-13583
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=178875