diff --git a/docs/accounts.md b/docs/accounts.md index 3c475e28..d50b484f 100644 --- a/docs/accounts.md +++ b/docs/accounts.md @@ -8,13 +8,20 @@ So for each action, promise will be returned. ``` let configuration = { - username: '100', - password: '****', - host: '192.168.1.100' // IP or Domain name. - port: 5060, - realm: 'my.pbx.com' // Authorization host (see TODO: Link to wiki) - transport: 'UDP' // Default TCP -} + "name": "John", + "username": "sip_username", + "domain": "pbx.carusto.com", + "password": "****", + "proxy": null, + "transport": null, // Default TCP + "regServer": null, // Default wildcard + "regTimeout": null // Default 3600 + "regHeaders": { + "X-Custom-Header": "Value" + }, + "regContactParams": ";unique-device-token-id=XXXXXXXXX", + "regOnAdd": false, // Default true, use false for manual REGISTRATION +}; let endpoint = new Endpoint(); let state = await endpoint.start(); @@ -56,6 +63,18 @@ Example: Invalid host +.then((account) => { + console.log("Account: ", account); + + setTimeout(() => { + endpoint.registerAccount(account, true); + }, 10000); + + setTimeout(() => { + endpoint.registerAccount(account, false); + }, 20000); + }); + diff --git a/docs/settings.md b/docs/settings.md index 18b87fd1..6b2fb2e3 100644 --- a/docs/settings.md +++ b/docs/settings.md @@ -1,11 +1,32 @@ # Settings -TODO: Show how to change nat, pres, and registration settings. - - - - -# Codecs - - +# Connectivity settings +TODO + +# Network settings +TODO + + +# Codecs settings +Print codec settings +```javascript +let endpoint = new Endpoint(); +let state = await endpoint.start(); +let {accounts, calls, settings, connectivity} = state; + +console.log("codecs", settings.codecs); // Shows a list of available codecs with priority +``` + +Change codec configuration +```javascript +// Not listed codecs are automatically will have zero priority +endpoint.changeCodecSettings({ + "PCMA/8000/1": 0, + "G722/16000/1": 0, // Zero means to disable the codec. + "iLBC/8000/1": 210, + "speex/8000/1": 0, + "speex/16000/1": 0, + "speex/32000/1": 0 +}) +``` \ No newline at end of file