Skip to content

Commit

Permalink
Doc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
kalta committed Oct 28, 2015
1 parent b7b835f commit 6f23cf5
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 32 deletions.
4 changes: 2 additions & 2 deletions doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* [Concepts](guide/concepts.md)
* [Tutorial](guide/tutorial.md)
* [Starting NkSIP](guide/start_nksip.md)
* [Starting a Service](guide/start_a_sipapp.md)
* [Starting a Service](guide/start_a_service.md)
* [Sending Requests](guide/sending_requests.md)
* [Receiving Requests](guide/receiving_requests.md)

Expand All @@ -21,7 +21,7 @@
* [Logging System](reference/log.md)

## [3. API](api/README.md)
* [Service API](api/sipapp.md)
* [Service API](api/service.md)
* [Requests API](api/requests.md)
* [Responses API](api/responses.md)
* [Dialogs API](api/dialogs.md)
Expand Down
2 changes: 1 addition & 1 deletion doc/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## API

* [Service API](sipapp.md)
* [Service API](service.md)
* [Requests API](requests.md)
* [Responses API](responses.md)
* [Dialogs API](dialogs.md)
Expand Down
14 changes: 7 additions & 7 deletions doc/api/service.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This document describes the API that NkSIP makes available to Services.<br/>
Then SIP-specific functions are available in the [nksip.erl](../../src/nksip.erl) module, while other functions are available in the [nkservice_server](https://github.com/Nekso/nkservice/blob/master/src/nkservice_server.erl) module.<br/>
See [Starting a Service](../guide/start_a_sipapp.md) for a general overview.
See [Starting a Service](../guide/start_a_service.md) for a general overview.


Function|Description
Expand Down Expand Up @@ -34,7 +34,7 @@ nksip:start(nkservice:name(),

Starts a new Service.

See [Starting a Service](../guide/start_a_sipapp.md) and [Configuration](../reference/configuration.md) to see the list of available configuration options.
See [Starting a Service](../guide/start_a_service.md) and [Configuration](../reference/configuration.md) to see the list of available configuration options.

NkSIP returns the _internal name_ of the application. In most API calls you can use the _user name_ or the _internal name_.

Expand Down Expand Up @@ -79,7 +79,7 @@ nksip:get(nksip:srv_name()|nksip:srv_id(), term()) ->
{ok, term()} | undefined | {error, term()}.
```
Gets a value from Service's store.
See [saving state information](../guide/start_a_sipapp.md#saving-state-information).
See [saving state information](../guide/start_a_service.md#saving-state-information).
### get/3
Expand All @@ -88,31 +88,31 @@ nksip:get(nksip:srv_name()|nksip:srv_id(), term(), term()) ->
{ok, term()} | {error, term()}.
```
Gets a value from Service's store, using a default if not found.
See [saving state information](../guide/start_a_sipapp.md#saving-state-information).
See [saving state information](../guide/start_a_service.md#saving-state-information).

### put/3
```erlang
nksip:put(nksip:srv_name()|nksip:srv_id(), term(), term()) ->
ok | {error, term()}.
```
Inserts a value in Service's store.
See [saving state information](../guide/start_a_sipapp.md#saving-state-information).
See [saving state information](../guide/start_a_service.md#saving-state-information).
### del/2
```erlang
nksip:del(nksip:srv_name()|nksip:srv_id(), term()) ->
ok | {error, term()}.
```
Deletes a value from Service's store.
See [saving state information](../guide/start_a_sipapp.md#saving-state-information).
See [saving state information](../guide/start_a_service.md#saving-state-information).

### get_pid/1
```erlang
nksip:get_pid(nksip:srv_name()|srv_id()) ->
pid() | undefined.
```
Gets the Service's _gen_server process_ `pid()`.
See [starting a Service](../guide/start_a_sipapp.md).
See [starting a Service](../guide/start_a_service.md).


### find_srv_id/1
Expand Down
2 changes: 1 addition & 1 deletion doc/guide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* [Concepts](concepts.md)
* [Tutorial](tutorial.md)
* [Starting NkSIP](start_nksip.md)
* [Starting a Service](start_a_sipapp.md)
* [Starting a Service](start_a_service.md)
* [Sending Requests](sending_requests.md)
* [Receiving Requests](receiving_requests.md)

2 changes: 1 addition & 1 deletion doc/guide/concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ You can use the functions in [SDP API](../api/sdp.md) to access, create or modif

You can send a new subscription requirement to a server sending a [subscribe request](sending_requests.md#subscribe). You should select an event package supported at the server. It the remote party accepts the request, it will start sending NOTIFYs requests any time it wants to, and NkSIP will call your callback [sip_notify/2](../reference/callback_functions.md#sip_notify2) for each one. The body of the NOTIFY will have the meaning defined in this specific event package. You should send a new SUBSCRIBE before the subscriptions expires.

If you are defining a server, you indicate in the [Service's config](../reference/configuration.md) the event packages you support, and NkSIP will call your callback [sip_subscribe/2](../reference/callback_functions.md#sip_subscribe2) when a new valid SUBSCRIBE arrives. If you accept it, you [should call inmeditaly nksip_uac:notify/2](../reference/sending_functions.md#notify) to send a NOTIFY, and after that, any time you want to. You can also terminate the subscription at any moment.
If you are defining a server, you indicate in the [service's config](../reference/configuration.md) the event packages you support, and NkSIP will call your callback [sip_subscribe/2](../reference/callback_functions.md#sip_subscribe2) when a new valid SUBSCRIBE arrives. If you accept it, you [should call inmeditaly nksip_uac:notify/2](../reference/sending_functions.md#notify) to send a NOTIFY, and after that, any time you want to. You can also terminate the subscription at any moment.

NkSIP will auto expire the subscriptions after the time proposed in the _Expires_ header (or config parameter `nksip_expires` if not present), and adding the offet time defined in config parameter `nksip_expires_offset`).

Expand Down
2 changes: 1 addition & 1 deletion doc/guide/start_a_service.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Starting a Service

* [Starting a Service](#starting-a-service)
* [Implementation](#sipapp-implementation)
* [Implementation](#service-implementation)
* [Saving State](#saving-state-information)
* [Reconfiguration](#reconfigure-the-service)

Expand Down
11 changes: 2 additions & 9 deletions doc/guide/start_nksip.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Starting NkSIP

There are three main ways to start NkSIP:
There are two main ways to start NkSIP:
* Embedded in your own Erlang application
* As a stand alone application
* Starting it in a development environment

### Embedding NkSIP
Expand All @@ -15,15 +14,9 @@ If you want to embed NkSIP in your own Erlang application, and you are using _re
]}.
```

Then you will have to setup in your erlang environment any [configuration parameter](../reference/configuration.md) you want to change from NkSIP's defaults (usually in your `app.config` file), for `nksip` but also some dependant applications like `nkservice`, `nkpacket` or `lagger`. You can then start NkSIP starting all dependencies (see [nksip.app.src](../../src/nksip.app.src)) and finally start `nksip` Erlang application.
Then you will have to setup in your erlang environment any [configuration parameter](../reference/configuration.md) you want to change from NkSIP's defaults (usually in your `app.config` file), for `nksip` but also some dependant applications like `nkservice`, `nkpacket` or `lager`. You can then start NkSIP starting all dependencies (see [nksip.app.src](../../src/nksip.app.src)) and finally start `nksip` Erlang application.


### Start NkSIP as a stand-alone application

NkSIP does not include any standard Erlang release building system. In the near future, NkSIP will be refactored as a module under the upcoming _NetComposer_ project, so it makes no sense including one.

If you want to start it stand alone now, you can use your own method based on the _development environment_ method.


### Start NkSIP in a development environment

Expand Down
6 changes: 3 additions & 3 deletions doc/guide/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Now you can start a simple proxy server using the included [server callback modu
callback => nksip_tutorial_server_callbacks,
plugins => [nksip_registrar],
transports => "sip:all:5060, <sip:all:5061;transport=tls>"
}),
}).
{ok,armejl7}
```

Expand Down Expand Up @@ -135,7 +135,7 @@ Let's register now both clients with the server. We use the option `contact` to
9> nksip_uac:register(client1, "sip:127.0.0.1",
[{sip_pass, "1234"}, contact, {meta, [<<"contact">>]}]).
{ok,200,[{<<"contact">>, [<<"<sip:client1@localhost:5070>...">>]}]}
10> nksip_uac:register(client2, "sips:127.0.0.1", [{pass, "1234"}, contact]).
10> nksip_uac:register(client2, "sips:127.0.0.1", [{sip_pass, "1234"}, contact]).
{ok,200,[]}
```

Expand Down Expand Up @@ -216,7 +216,7 @@ to `nksip_uac:ack(DlgId, [])` manually inmeditaly after the 2xx response.
If we hadn't included the `auto_2xx_ack`, we should have sent the mandatory ACK for 2xx responses:

```erlang
18> nksip_uac:ack(DlgId, []),
18> nksip_uac:ack(DlgId, []).
ok
```

Expand Down
4 changes: 2 additions & 2 deletions doc/plugins/event_compositor.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ sip_publish(Req, _Call) ->

```erlang
clear(nksip:srv_name()|nksip:srv_id()) ->
ok | callback_error | sipapp_not_found.
ok | callback_error | service_not_found.
```

Clear all stored records by a Service.
Expand Down Expand Up @@ -111,7 +111,7 @@ Op|Response|Comments
{del, AOR, Tag}|ok &#124; not_found|Delete stored information for this `AOR`, `AppId` and `Tag`, returning `ok` or `not_found` if it is not found.
del_all|ok|Delete all stored information for this `AppId`.

See the [default implementation](../../plugins/src/nksip_event_compositor_sipapp.erl) as a basis.
See the [default implementation](../../plugins/src/nksip_event_compositor_callbacks.erl) as a basis.


## Examples
Expand Down
2 changes: 1 addition & 1 deletion doc/plugins/registrar.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ Op|Response|Comments
{del, AOR}|ok &#124; not_found|Delete all stored contacts for this `AOR` and `AppIdp`, returning `ok` or `not_found` if the `AOR` is not found.
del_all|ok|Delete all stored information for this `AppId`.

See the [default implementation](../../plugins/src/nksip_registrar_sipapp.erl) as a basis.
See the [default implementation](../../plugins/src/nksip_registrar_callbacks.erl) as a basis.

## Examples

Expand Down
4 changes: 2 additions & 2 deletions doc/plugins/uac_auto.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Option|Default|Description
```erlang
nksip_uac_auto:start_register(nksip:srv_name()|nksip:srv_id(), Id::term(), Uri::nksip:user_uri(),
Time::pos_integer(), Opts::nksip:optslist()) ->
{ok, boolean()} | {error, invalid_uri|sipapp_not_found}.
{ok, boolean()} | {error, invalid_uri|service_not_found}.
```

Programs the Service to start a serie of automatic registrations to the registrar at `Uri`, at `Time` (in seconds) intervals. `RegId` indentifies this request to be be able to stop it later. Use [get_registers/1](#get_registers1) or the callback function [sip_uac_auto_register_update/3](#sip_uac_auto_register_update3) to know about the registration status.
Expand Down Expand Up @@ -60,7 +60,7 @@ Get current registration status, including if last registration was successful a
```erlang
nksip_uac_auto:start_ping(nksip:srv_name()|nksip:srv_id(), Id::term(), Uri::nksip:user_uri(),
Time::pos_integer(), Opts::nksip:optslist()) ->
{ok, boolean()} | {error, invalid_uri|sipapp_not_found}.
{ok, boolean()} | {error, invalid_uri|service_not_found}.


Programs the Service to start a serie of _pings_ (OPTION requests) to the SIP element at `Uri`, at `Time` (in seconds) intervals. `Id` indentifies this request to be able to stop it later. Use [get_pings1](#get_pings1) or the callback function [sip_uac_auto_ping_update/3](#sip_uac_auto_ping_update3) to know about the ping status.
Expand Down
2 changes: 1 addition & 1 deletion doc/reference/configuration.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Configuration

* [Global configuration options](#global-configuration-options).
* [Service configuration options](#sipapp-configuration-options).
* [Service configuration options](#service-configuration-options).
* [Reconfiguration](#reconfiguration)

Keep in mind that installed plugins can add specific configuration options. See the [plugins documentation](../plugins/README.md).
Expand Down
2 changes: 1 addition & 1 deletion doc/samples/pbx.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ Extension|Description

Feel free to use the functions `nksip_pbx:trace/1` to start or stop the trace of SIP messages to console or `nksip_pbx:loglevel/1` to change the console log level.

Use the function `nksip_pbx_sipapp:check_speed/1` to stop the automatic generation of
Use the function `nksip_pbx_callbacks:check_speed/1` to stop the automatic generation of
_OPTION_ requests.

0 comments on commit 6f23cf5

Please sign in to comment.