reject registration if the account is deactivated (#53)

* reject registration if the account is deactivated

* reject registration if the account is deactivated
This commit is contained in:
Hoan Luu Huu
2024-01-17 20:55:59 +07:00
committed by GitHub
parent de3100a4b4
commit 4079f7b83b
4 changed files with 24 additions and 0 deletions

View File

@@ -19,3 +19,14 @@ values ('f23ff996-6534-4aba-8666-4b347391eca2', 'f4e1848d-3ff8-40eb-b9c1-30e1ef0
insert into account_products(account_product_sid, account_subscription_sid, product_sid,quantity)
values ('f23ff997-6534-4aba-8666-4b347391eca2', 'f4e1848d-3ff8-40eb-b9c1-30e1ef053f94', 'c4403cdb-8e75-4b27-9726-7d8315e3216d', 20);
insert into accounts(account_sid, service_provider_sid, name, sip_realm, registration_hook_sid, webhook_secret, device_to_call_ratio, is_active)
values ('ed649e33-e771-403a-8c99-1780eabbc804', '3f35518f-5a0d-4c2e-90a5-2407bb3b36f0', 'test deactivated account', 'deactivated.jambonz.org', '90dda62e-0ea2-47d1-8164-5bd49003476c', 'foobar', 0, 0);
insert into account_subscriptions(account_subscription_sid, account_sid, pending)
values ('f4e1848d-3ff8-40eb-b9c1-30e1ef053f95','ed649e33-e771-403a-8c99-1780eabbc804',0);
insert into account_products(account_product_sid, account_subscription_sid, product_sid,quantity)
values ('f23ff996-6534-4aba-8666-4b347391eca3', 'f4e1848d-3ff8-40eb-b9c1-30e1ef053f95', '2c815913-5c26-4004-b748-183b459329df', 2);
insert into account_products(account_product_sid, account_subscription_sid, product_sid,quantity)
values ('f23ff997-6534-4aba-8666-4b347391eca3', 'f4e1848d-3ff8-40eb-b9c1-30e1ef053f95', 'c4403cdb-8e75-4b27-9726-7d8315e3216d', 20);

View File

@@ -0,0 +1,3 @@
SEQUENTIAL
# user, domain, authentication
john;deactivated.jambonz.org;[authentication username=john password=1234]
1 SEQUENTIAL
2 # user, domain, authentication
3 john;deactivated.jambonz.org;[authentication username=john password=1234]

View File

@@ -24,6 +24,10 @@ test('register tests', (t) => {
};
connect(srf)
.then(() => {
sippRegObj.data_file = 'deactivated_account_user.csv';
return sippUac('uac-register-unknown-realm.xml', sippRegObj);
})
.then(() => {
sippRegObj.data_file = 'bad_realm.csv';
return sippUac('uac-reject-ipv4-realm.xml', sippRegObj);