[Spce-user] API - Failed to delete Contact => Contact is still in use
Ml Ml
mliebherr99 at googlemail.com
Tue Jul 25 09:37:37 EDT 2023
Hello,
i added Contacts, Customers and Subscribers by a API Script.
Somehow something went wrong and i seem to have multiple
"dead/incomplete" Contacts. (IDs: 12600, 12601, 12602)
I can not delete them since they are referenced somewhere else.
{"code":"423","message":"Contact is still in use."}
However, i can not figure out where.
The customer (id 3197)has assigned the correct contact (contact_id = 12491)
The subscriber has the correct contact.
The only place i can find the "dead contact" ist the voip_subscribers
mysql table.
But i should not delete that, since its the only entry with that number.
Thinking about it, i should update and fix it like this:
UPDATE voip_subscribers SET contact_id = 12491 WHERE contact_id = 12600;
Now i would be able to delete that dead/incomplete contact.
I just wonder how i got there and if i should fix it like that...
Writing this mail it seems like it created a new contact for each subscriber :/
MariaDB [billing]> select * from voip_subscribers where contact_id IN
(12600, 12601, 12602, 12491);
+------+-------------+--------------------------------------+--------------+-----------+--------+-------------------+-------------+------------+
| id | contract_id | uuid | username
| domain_id | status | primary_number_id | external_id |
contact_id |
+------+-------------+--------------------------------------+--------------+-----------+--------+-------------------+-------------+------------+
| 9400 | 3197 | 70899ca3-6752-4f2c-ab7f-7d69b01aa869 | xxxx |
5 | locked | 8297 | NULL | 12491 |
| 9401 | 3197 | 7bcf739a-d3e3-4a63-9ca7-c2f64c168f2b | xxxx |
5 | active | 8298 | NULL | 12601 |
| 9402 | 3197 | 8b99c24a-49b0-4af9-a3f8-831de212e24b | xxxx |
5 | active | 8299 | NULL | 12602 |
+------+-------------+--------------------------------------+--------------+-----------+--------+-------------------+-------------+------------+
In my case the contact_id should be 12491 for all three.
And should the column "contract_id" not be named "customer_id"?!
Cheers,
Michael
More information about the Spce-user
mailing list