Skip to content

Commit 7911709

Browse files
author
John Riordan
committed
New API - update docs
1 parent c1a86a7 commit 7911709

29 files changed

+120
-45
lines changed

docs/api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ userAgent.delegate = {
6060
};
6161

6262
// Handle incoming session state changes.
63-
incomingSession.stateChange.on((newState: SessionState) => {
63+
incomingSession.stateChange.addListener((newState: SessionState) => {
6464
switch (newState) {
6565
case SessionState.Establishing:
6666
// Session is establishing.
@@ -114,7 +114,7 @@ userAgent.start().then(() => {
114114
};
115115

116116
// Handle outgoing session state changes.
117-
outgoingSession.stateChange.on((newState: SessionState) => {
117+
outgoingSession.stateChange.addListener((newState: SessionState) => {
118118
switch (newState) {
119119
case SessionState.Establishing:
120120
// Session is establishing.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [sip.js](./sip.js.md) &gt; [Emitter](./sip.js.emitter.md) &gt; [addListener](./sip.js.emitter.addlistener.md)
4+
5+
## Emitter.addListener() method
6+
7+
Sets up a function that will be called whenever the target changes.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
addListener(listener: (data: T) => void, options?: {
13+
once?: boolean;
14+
}): void;
15+
```
16+
17+
## Parameters
18+
19+
| Parameter | Type | Description |
20+
| --- | --- | --- |
21+
| listener | <code>(data: T) =&gt; void</code> | Callback function. |
22+
| options | <code>{</code><br/><code> once?: boolean;</code><br/><code> }</code> | An options object that specifies characteristics about the listener. If once true, indicates that the listener should be invoked at most once after being added. If once true, the listener would be automatically removed when invoked. |
23+
24+
<b>Returns:</b>
25+
26+
`void`
27+

docs/api/sip.js.emitter.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ export interface Emitter<T>
1616

1717
| Method | Description |
1818
| --- | --- |
19+
| [addListener(listener, options)](./sip.js.emitter.addlistener.md) | Sets up a function that will be called whenever the target changes. |
1920
| [off(listener)](./sip.js.emitter.off.md) | Unregisters a listener. |
2021
| [on(listener)](./sip.js.emitter.on.md) | Registers a listener. |
2122
| [once(listener)](./sip.js.emitter.once.md) | Registers a listener then unregisters the listener after one event emission. |
23+
| [removeListener(listener)](./sip.js.emitter.removelistener.md) | Removes from the listener previously registered with addListener. |
2224

docs/api/sip.js.emitter.off.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55
## Emitter.off() method
66

7+
> Warning: This API is now obsolete.
8+
>
9+
> Use removeListener.
10+
>
11+
712
Unregisters a listener.
813

914
<b>Signature:</b>

docs/api/sip.js.emitter.on.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55
## Emitter.on() method
66

7+
> Warning: This API is now obsolete.
8+
>
9+
> Use addListener.
10+
>
11+
712
Registers a listener.
813

914
<b>Signature:</b>

docs/api/sip.js.emitter.once.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55
## Emitter.once() method
66

7+
> Warning: This API is now obsolete.
8+
>
9+
> Use addListener.
10+
>
11+
712
Registers a listener then unregisters the listener after one event emission.
813

914
<b>Signature:</b>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [sip.js](./sip.js.md) &gt; [Emitter](./sip.js.emitter.md) &gt; [removeListener](./sip.js.emitter.removelistener.md)
4+
5+
## Emitter.removeListener() method
6+
7+
Removes from the listener previously registered with addListener.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
removeListener(listener: (data: T) => void): void;
13+
```
14+
15+
## Parameters
16+
17+
| Parameter | Type | Description |
18+
| --- | --- | --- |
19+
| listener | <code>(data: T) =&gt; void</code> | Callback function. |
20+
21+
<b>Returns:</b>
22+
23+
`void`
24+

docs/api/sip.js.inviter.invite.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,5 @@ The upshot is that if you want "early media", you must not put the initial offer
5858

5959
3) If "early media" and the initial offer is in an INVITE, no INVITE forking.
6060

61-
The default behaviour may be altered and "early media" utilized if the initial offer is in the an INVITE by setting the `earlyMedia` options. However in that case the INVITE request MUST NOT fork. This allows for "early media" in environments where the forking behaviour of the SIP servers being utilized is configured to disallow forking.
61+
The default behavior may be altered and "early media" utilized if the initial offer is in the an INVITE by setting the `earlyMedia` options. However in that case the INVITE request MUST NOT fork. This allows for "early media" in environments where the forking behavior of the SIP servers being utilized is configured to disallow forking.
6262

docs/api/sip.js.inviteroptions.earlymedia.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## InviterOptions.earlyMedia property
66

7-
If true, the first answer to the local offer is immediately utilized for media. Requires that the INVITE request MUST NOT fork. Has no effect if `inviteWtihoutSdp` is true. Default is false.
7+
If true, the first answer to the local offer is immediately utilized for media. Requires that the INVITE request MUST NOT fork. Has no effect if `inviteWithoutSdp` is true. Default is false.
88

99
<b>Signature:</b>
1010

docs/api/sip.js.inviteroptions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export interface InviterOptions extends SessionOptions
1717
| Property | Type | Description |
1818
| --- | --- | --- |
1919
| [anonymous](./sip.js.inviteroptions.anonymous.md) | <code>boolean</code> | If true, an anonymous call. |
20-
| [earlyMedia](./sip.js.inviteroptions.earlymedia.md) | <code>boolean</code> | If true, the first answer to the local offer is immediately utilized for media. Requires that the INVITE request MUST NOT fork. Has no effect if <code>inviteWtihoutSdp</code> is true. Default is false. |
20+
| [earlyMedia](./sip.js.inviteroptions.earlymedia.md) | <code>boolean</code> | If true, the first answer to the local offer is immediately utilized for media. Requires that the INVITE request MUST NOT fork. Has no effect if <code>inviteWithoutSdp</code> is true. Default is false. |
2121
| [extraHeaders](./sip.js.inviteroptions.extraheaders.md) | <code>Array&lt;string&gt;</code> | Array of extra headers added to the INVITE. |
2222
| [inviteWithoutSdp](./sip.js.inviteroptions.invitewithoutsdp.md) | <code>boolean</code> | If true, send INVITE without SDP. Default is false. |
2323
| [params](./sip.js.inviteroptions.params.md) | <code>{</code><br/><code> fromDisplayName?: string;</code><br/><code> fromTag?: string;</code><br/><code> fromUri?: string &#124; URI;</code><br/><code> toDisplayName?: string;</code><br/><code> toUri?: string &#124; URI;</code><br/><code> }</code> | |

0 commit comments

Comments
 (0)