[ASTPPCOM-401] SIP devices and IP settings are orphaned after deleting provider account Created: 15/Apr/18  Updated: 27/Oct/19  Resolved: 28/May/18

Status: Done
Project: ASTPP Community
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: New Feature
Reporter: powerpbx Assignee: Samir Doshi
Resolution: Done Votes: 0
Labels: bug_fixed
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

It appears that deleting an account only makes the settings disappear from the GUI but not the DB. However, it is not just the row in the account table that remains but also associated settings in other tables. This creates problems when trying to add new settings as they will fail validation if they have the same SIP username or IP etc.

There are probably other settings that are orphaned as well. Maybe all of them? Maybe this is by design and if so why?



 Comments   
Comment by Samir Doshi [ 03/May/18 ]

When you delete an account, we are deleting records from all modules which belong to that account except for accounts and cdrs. For account, we do soft delete which means only flag will be changed and it will disappear from the UI.

The purpose to do soft delete of account and to keep CDR is, in many countries admin need to keep cdr records for all the customers for few months or years. Now if we hard delete those records then admin might be in trouble. To avoid that issue, we implemented soft delete concept.

Now regarding your point for sip device and ip settings, I just tested it in version 3.6 and I am not facing any problem. I am able to create same sip device and ip settings.

If you are still facing the problem then highlight the exact issue.

Comment by powerpbx [ 09/May/18 ]

This appears to happen on provider accounts but not customer accounts.

To reproduce, create a provider account and add a sip device and IP settings. Note the sip device username and IP address. Now delete that provider account. The sip device and IP setting will still exist in the database but no longer shows up in the GUI. So it's orphaned data. This is not the the same behavior as customer accounts. Deleting a customer account from the GUI removes the respective devices and IP settings from the database.

Now create a customer account or another provider account and a sip device with the exact same device username or IP settings with the same IP address as before. It will fail validation because that sip device username and IP setting still exists in the database as orphaned device and IP even though they are no longer in the GUI.

Comment by Samir Doshi [ 15/May/18 ]

Just tried same thing which you mentioned and it worked without any
problem.

Here is the video of it : http://nimb.ws/BqpSnb


[image: Mailtrack]
<https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality4&>
Sender
notified by
Mailtrack
<https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality4&>

Best Regards

Samir Doshi
iNextrix Technologies Pvt. Ltd.
http://www.inextrix.com

Disclaimer:
The information contained in this communication is confidential and may be
legally privileged. It is intended solely for the use of the individual or
entity to whom it is addressed and others authorized to receive it. If you
are not the intended recipient you are hereby notified that any disclosure,
copying, distribution or taking action in reliance on the contents of this
information is strictly prohibited and may be unlawful. Please notify the
sender immediately and destroy all copies of this message and any
attachments contained in it.

On Thu, May 10, 2018 at 12:19 AM, powerpbx <notifications@github.com> wrote:

> Create a customer account and add a sip device. Now delete that customer
> account.
>
> Now create another customer account and try dd a sip device with the exact
> same name. It will fail validation because that same sip device name still
> exists in the database.
>
> I believe the same thing will happen if you add IP Settings to an account
> and then delete account and then try add the same IP again to a different
> account.
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <https://github.com/iNextrix/ASTPP/issues/401#issuecomment-387838730>, or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/AA6gca17X9gGlZNXdduvqXwNERkPRbp1ks5twzowgaJpZM4TVn0j>
> .
>

Comment by powerpbx [ 15/May/18 ]

That video shows you deleting a customer. Not a provider. The orphaned devices only occur when you delete providers with devices.

Comment by powerpbx [ 15/May/18 ]

This is the clean up function that is run for customer that does not exist for provider as far as I can tell.
https://github.com/iNextrix/ASTPP/blob/4861cac21cd49153ecaa14573f89c1b04e5bcd38/web_interface/astpp/application/libraries/astpp/common.php#L2047

It is run here
https://github.com/iNextrix/ASTPP/blob/4861cac21cd49153ecaa14573f89c1b04e5bcd38/web_interface/astpp/application/libraries/astpp/common.php#L2098

here
https://github.com/iNextrix/ASTPP/blob/4861cac21cd49153ecaa14573f89c1b04e5bcd38/web_interface/astpp/application/modules/accounts/controllers/accounts.php#L2154

and here
https://github.com/iNextrix/ASTPP/blob/4861cac21cd49153ecaa14573f89c1b04e5bcd38/web_interface/astpp/application/modules/accounts/controllers/accounts.php#L2340

Comment by (Community) DN (Inactive) [ 28/May/18 ]

[~powerpbx] Bug fixed.

Generated at Sat Feb 10 07:16:47 CET 2024 using Jira 8.13.3#813003-sha1:22ebedbb75c99b147c66f14e031dd8a2d214753a.