@@ -40,36 +40,40 @@ <h5 id="_getting_started">Getting Started</h5>
4040< div class ="paragraph ">
4141< p > Initializing the Restcomm Client with the Authentication and URL required</ p >
4242</ div >
43- < div class ="listingblock ">
43+ < div class ="literalblock ">
4444< div class ="content ">
45- < pre > Restcomm.COMMON_URL = "http://localhost:8080/";
46- Restcomm.init("username", "password");
47- ----------------------------------------------------------------------------------
48- Incase you need to reset it,just use the '_invalidate()_' method available and initialize it again.
49-
50- ----------------------------------------------------------------------------------
51- Restcomm.invalidate();
52- Restcomm.COMMON_URL = "http://localhost:8080/";
53- Restcomm.init("username", "password");
54- ----------------------------------------------------------------------------------
55-
56- ===== Accounts
57-
58- ===== MainAccount
59-
60- Fetching the default Account with which we authenticated the Restcomm Client</ pre >
45+ < pre > Restcomm.COMMON_URL = "http://localhost:8080/";
46+ Restcomm.init("username", "password");</ pre >
6147</ div >
6248</ div >
49+ < div class ="paragraph ">
50+ < p > Incase you need to reset it,just use the '< em > invalidate()</ em > ' method available and initialize it again.</ p >
51+ </ div >
6352< div class ="literalblock ">
6453< div class ="content ">
65- < pre > Account mainAccount = Account.getAccount();</ pre >
54+ < pre > Restcomm.invalidate();
55+ Restcomm.COMMON_URL = "http://localhost:8080/";
56+ Restcomm.init("username", "password");</ pre >
57+ </ div >
6658</ div >
6759</ div >
68- < div class ="listingblock ">
60+ < div class ="sect4 ">
61+ < h5 id ="_accounts "> Accounts</ h5 >
62+
63+ </ div >
64+ < div class ="sect4 ">
65+ < h5 id ="_mainaccount "> MainAccount</ h5 >
66+ < div class ="paragraph ">
67+ < p > Fetching the default Account with which we authenticated the Restcomm Client</ p >
68+ </ div >
69+ < div class ="literalblock ">
6970< div class ="content ">
70- < pre > The fields of the Account object can be obtained by invoking the respective '_get()_' method of that field </ pre >
71+ < pre > Account mainAccount = Account.getAccount(); </ pre >
7172</ div >
7273</ div >
74+ < div class ="paragraph ">
75+ < p > The fields of the Account object can be obtained by invoking the respective '< em > get()</ em > ' method of that field</ p >
76+ </ div >
7377< div class ="literalblock ">
7478< div class ="content ">
7579< pre > String Sid,FriendlyName,EmailAddress;
@@ -78,88 +82,111 @@ <h5 id="_getting_started">Getting Started</h5>
7882EmailAddress = mainAccount.getEmail_address();</ pre >
7983</ div >
8084</ div >
81- < div class ="listingblock ">
85+ < div class ="paragraph ">
86+ < p > For Modifying any field(s) of the Account, use the '< em > modifyAccountDetails()</ em > ' method</ p >
87+ </ div >
88+ < div class ="literalblock ">
8289< div class ="content ">
83- < pre > For Modifying any field(s) of the Account, use the '_modifyAccountDetails()_' method </ pre >
90+ < pre > mainAccount.modifyAccountDetails().newEmail("[email protected] ").modify(); </ pre > 8491</ div >
8592</ div >
93+ < div class ="paragraph ">
94+ < p > In a similar way you can even modify multiple fields as shown below</ p >
95+ </ div >
8696< div class ="literalblock ">
8797< div class ="content ">
88- < pre > mainAccount.modifyAccountDetails().newEmail("
[email protected] ").modify();
</ pre > 98+ < pre > mainAccount.modifyAccountDetails().newEmail("
[email protected] ").newPassword("12345abcd").newStatus("suspended").modify();
</ pre > 99+ </ div >
100+ </ div >
101+ </ div >
102+ < div class ="sect4 ">
103+ < h5 id ="__strong_note_strong "> < strong > Note:</ strong > </ h5 >
104+ < div class ="ulist ">
105+ < ul >
106+ < li >
107+ < p > After modifying an Account,if we require the Account Object for further operations, we need to update the Object representing that Account too,</ p >
108+ < div class ="literalblock ">
109+ < div class ="content ">
110+ < pre > mainAccount = mainAccount.modifyAccountDetails().newEmail("
[email protected] ").newPassword("12345abcd").newStatus("suspended").modify();
</ pre > 89111</ div >
90112</ div >
91- < div class ="listingblock ">
113+ </ li >
114+ </ ul >
115+ </ div >
116+ < div class ="paragraph ">
117+ < p > Creating a SubAccount under our MainAccount</ p >
118+ </ div >
119+ < div class ="literalblock ">
92120< div class ="content ">
93- < pre > In a similar way you can even modify multiple fields as shown below </ pre >
121+ < pre > Account.createSubAccount().FriendlyName("Paul").Password("restcomm1007").Role("Administrator").create(); </ pre >
94122</ div >
95123</ div >
124+ < div class ="paragraph ">
125+ < p > To Capture the SubAccount created,</ p >
126+ </ div >
96127< div class ="literalblock ">
97128< div class ="content ">
98- < pre > mainAccount.modifyAccountDetails().newEmail("
[email protected] ").newPassword("12345abcd").newStatus("suspended").modify();
</ pre > 129+ < pre > SubAccount SpareAccount = Account.createSubAccount().FriendlyName("Paul").Password("restcomm1007").Role("Administrator").create();</ pre >
130+ </ div >
99131</ div >
132+ < div class ="paragraph ">
133+ < p > Fetching the List of SubAccounts under our Main Account</ p >
100134</ div >
101- < div class ="listingblock ">
135+ < div class ="literalblock ">
102136< div class ="content ">
103- < pre > ===== *Note:*
104- * After modifying an Account,if we require the Account Object for further operations, we need to update the Object representing that Account too,
105-
106- -------------------------------------------------------------------------------------------------------------------------------------------
107- mainAccount = mainAccount.modifyAccountDetails().newEmail("
[email protected] ").newPassword("12345abcd").newStatus("suspended").modify();
108- -------------------------------------------------------------------------------------------------------------------------------------------
109- Creating a SubAccount under our MainAccount
110- ----
111- Account.createSubAccount().FriendlyName("Paul").Password("restcomm1007").Role("Administrator").create();
112- ----
113- To Capture the SubAccount created,
114- ----
115- SubAccount SpareAccount = Account.createSubAccount().FriendlyName("Paul").Password("restcomm1007").Role("Administrator").create();
116- ----
117- Fetching the List of SubAccounts under our Main Account
118- ----
119- SubAccountList List = Account.getSubAccountList();
120- SubAccount a = List.get(0);
121- SubAccount b = List.get(1);
122- ......
123- ....
124- ----
125- ===== SubAccount
126-
127-
128- Fetching a SubAccount with a given 'Sid', available under our MainAccount
129- ----
130- SubAccount spareAccount = SubAccount.getSubAccount(Sid); //Sid is the actual Sid of the SubAccount we wish to fetch
131- ----
132- The fields of the SubAccount object can be obtained by invoking the respective '_get()_' method of that field similar to that Of Accounts</ pre >
137+ < pre > SubAccountList List = Account.getSubAccountList();
138+ SubAccount a = List.get(0);
139+ SubAccount b = List.get(1);
140+ ......
141+ ....</ pre >
142+ </ div >
143+ </ div >
133144</ div >
134145</ div >
146+ < div class ="sect3 ">
147+ < h4 id ="_subaccount "> SubAccount</ h4 >
148+ < div class ="paragraph ">
149+ < p > Fetching a SubAccount with a given 'Sid', available under our MainAccount</ p >
150+ </ div >
151+ < div class ="literalblock ">
152+ < div class ="content ">
153+ < pre > SubAccount spareAccount = SubAccount.getSubAccount(Sid); //Sid is the actual Sid of the SubAccount we wish to fetch</ pre >
154+ </ div >
155+ </ div >
156+ < div class ="paragraph ">
157+ < p > The fields of the SubAccount object can be obtained by invoking the respective '< em > get()</ em > ' method of that field similar to that Of Accounts</ p >
158+ </ div >
135159< div class ="literalblock ">
136160< div class ="content ">
137161< pre > String FriendlyName;
138162FriendlyName = spareAccount.getFriendly_name();</ pre >
139163</ div >
140164</ div >
141- < div class ="listingblock ">
165+ < div class ="paragraph ">
166+ < p > Modifying the SubAccount in a similar way as mentioned above</ p >
167+ </ div >
168+ < div class ="literalblock ">
142169< div class ="content ">
143- < pre > Modifying the SubAccount in a similar way as mentioned above
144- ----
145- spareAccount = spareAccount.modifySubAccount().........modify();
146- (Or)
147- spareAccount = SubAccount.modifySubAccount(Sid).........modify(); //Sid is the actual Sid of the SubAccount we wish to modify
148- ----
149- Deleting a SubAccount
150- ----
151- spareAccount.delete();
152- (Or)
153- SubAccount.deleteSubAccount(Sid); //Sid is the Sid of the SubAccoun to be deleted
154- ----</ pre >
170+ < pre > spareAccount = spareAccount.modifySubAccount().........modify();
171+ (Or)
172+ spareAccount = SubAccount.modifySubAccount(Sid).........modify(); //Sid is the actual Sid of the SubAccount we wish to modify</ pre >
173+ </ div >
155174</ div >
175+ < div class ="paragraph ">
176+ < p > Deleting a SubAccount</ p >
177+ </ div >
178+ < div class ="literalblock ">
179+ < div class ="content ">
180+ < pre > spareAccount.delete();
181+ (Or)
182+ SubAccount.deleteSubAccount(Sid); //Sid is the Sid of the SubAccoun to be deleted</ pre >
156183</ div >
157184</ div >
158185</ div >
159186</ div >
160187< div id ="footer ">
161188< div id ="footer-text ">
162- Last updated 2017-06-19 18:28:19 +05:30
189+ Last updated 2017-06-19 18:38:41 +05:30
163190</ div >
164191</ div >
165192</ body >
0 commit comments