@@ -6,6 +6,95 @@ This Documentation provides the basic information on the usage of this SDK in pe
66
77==== Table Of Contents
88
9+
910* Getting Started
1011* Accounts
1112* Applications
13+
14+ ===== Getting Started
15+
16+ Initializing the Restcomm Client with the Authentication and URL required
17+
18+ ---------------------------------------------------------------------------------
19+ Restcomm.COMMON_URL = "http://localhost:8080/";
20+ Restcomm.init("username", "password");
21+ ----------------------------------------------------------------------------------
22+ Incase you need to reset it,just use the '_invalidate()_' method available and initialize it again.
23+
24+ ----------------------------------------------------------------------------------
25+ Restcomm.invalidate();
26+ Restcomm.COMMON_URL = "http://localhost:8080/";
27+ Restcomm.init("username", "password");
28+ ----------------------------------------------------------------------------------
29+
30+ ===== Accounts
31+
32+ ===== MainAccount
33+
34+ Fetching the default Account with which we authenticated the Restcomm Client
35+
36+ ---------------------------------------------------------------------------------
37+ Account mainAccount = Account.getAccount();
38+ ----------------------------------------------------------------------------------
39+ The fields of the Account object can be obtained by invoking the respective '_get()_' method of that field
40+ ----------------------------------------------------------------------------------
41+ String Sid,FriendlyName,EmailAddress;
42+ Sid = mainAccount.getSid();
43+ FriendlyName = mainAccount.getFriendly_name();
44+ EmailAddress = mainAccount.getEmail_address();
45+ ----------------------------------------------------------------------------------
46+ For Modifying any field(s) of the Account, use the '_modifyAccountDetails()_' method
47+ ----------------------------------------------------------------------------------
48+ mainAccount.modifyAccountDetails().newEmail("[email protected] ").modify(); 49+ ----------------------------------------------------------------------------------
50+ In a similar way you can even modify multiple fields as shown below
51+ ----------------------------------------------------------------------------------
52+ mainAccount.modifyAccountDetails().newEmail("[email protected] ").newPassword("12345abcd").newStatus("suspended").modify(); 53+ ----------------------------------------------------------------------------------
54+ ===== *Note:*
55+ * After modifying an Account,if we require the Account Object for further operations, we need to update the Object representing that Account too,
56+
57+ -------------------------------------------------------------------------------------------------------------------------------------------
58+ mainAccount = mainAccount.modifyAccountDetails().newEmail("[email protected] ").newPassword("12345abcd").newStatus("suspended").modify(); 59+ -------------------------------------------------------------------------------------------------------------------------------------------
60+ Creating a SubAccount under our MainAccount
61+ ----
62+ Account.createSubAccount().FriendlyName("Paul").Password("restcomm1007").Role("Administrator").create();
63+ ----
64+ To Capture the SubAccount created,
65+ ----
66+ SubAccount SpareAccount = Account.createSubAccount().FriendlyName("Paul").Password("restcomm1007").Role("Administrator").create();
67+ ----
68+ Fetching the List of SubAccounts under our Main Account
69+ ----
70+ SubAccountList List = Account.getSubAccountList();
71+ SubAccount a = List.get(0);
72+ SubAccount b = List.get(1);
73+ ......
74+ ....
75+ ----
76+ ===== SubAccount
77+
78+
79+ Fetching a SubAccount with a given 'Sid', available under our MainAccount
80+ ----
81+ SubAccount spareAccount = SubAccount.getSubAccount(Sid); //Sid is the actual Sid of the SubAccount we wish to fetch
82+ ----
83+ The fields of the SubAccount object can be obtained by invoking the respective '_get()_' method of that field similar to that Of Accounts
84+ ----------------------------------------------------------------------------------
85+ String FriendlyName;
86+ FriendlyName = spareAccount.getFriendly_name();
87+ ----------------------------------------------------------------------------------
88+
89+ Modifying the SubAccount in a similar way as mentioned above
90+ ----
91+ spareAccount = spareAccount.modifySubAccount().........modify();
92+ (Or)
93+ spareAccount = SubAccount.modifySubAccount(Sid).........modify(); //Sid is the actual Sid of the SubAccount we wish to modify
94+ ----
95+ Deleting a SubAccount
96+ ----
97+ spareAccount.delete();
98+ (Or)
99+ SubAccount.deleteSubAccount(Sid); //Sid is the Sid of the SubAccoun to be deleted
100+ ----
0 commit comments