Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add extraHeaders to unsubscribe #1046

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
70eff7e
Merge pull request #3 from reporty/feature/REP-44855
slavikbialik Mar 1, 2021
c821359
Bump lodash from 4.17.20 to 4.17.21
dependabot[bot] May 7, 2021
4ef4403
Bump url-parse from 1.4.7 to 1.5.1
dependabot[bot] May 8, 2021
852270c
Merge pull request #926 from onsip/dependabot/npm_and_yarn/lodash-4.1…
egreenmachine May 11, 2021
06c4ed2
Merge pull request #927 from onsip/dependabot/npm_and_yarn/url-parse-…
egreenmachine May 11, 2021
94adc03
Bump ws from 7.4.4 to 7.4.6
dependabot[bot] May 28, 2021
f757998
Bump glob-parent from 5.1.1 to 5.1.2
dependabot[bot] Jun 8, 2021
67bea3e
fix typo in docs/session-description-handler.md
aoinau Jul 8, 2021
bee355b
Merge pull request #940 from nnaoi/master
etamme Jul 8, 2021
4910cc8
Support for ephemeral credentials
luis-claro Jul 14, 2021
697fb08
Merge pull request #936 from onsip/dependabot/npm_and_yarn/glob-paren…
egreenmachine Jul 19, 2021
5dc8d56
Merge pull request #935 from onsip/dependabot/npm_and_yarn/ws-7.4.6
egreenmachine Jul 19, 2021
5cf8056
Merge pull request #941 from Talkdesk/master
etamme Jul 20, 2021
a399b7c
Merge pull request #4 from onsip/master
slavikbialik Aug 10, 2021
fa6013c
Merge branch 'master' into develop
Aug 10, 2021
f296edc
add onCancel delegation for Session
Aug 24, 2021
0957804
changing onCancel according to eric's caveats
Aug 25, 2021
b4737b6
Merge pull request #5 from carbyne911/REP-48854
slavikbialik Aug 25, 2021
22c2f24
fix unsubscribe by disabling N timer on unsubscribe
Aug 8, 2022
25d3330
Merge pull request #7 from carbyne911/feature/REP-58286
slavikbialik Aug 31, 2022
b3a242c
create new function to dispose registrer without unregister
Sep 29, 2022
a744277
Merge pull request #8 from carbyne911/feature/REP-59194
netdad1712 Oct 2, 2022
0086f08
Add extraHeaders to unsubscribe
slavikbialik Feb 14, 2023
8718c33
Merge remote-tracking branch 'upstream/main' into feature/REP-60578_2
netdad1712 Mar 12, 2023
c9a6e28
align with source sipJS source
netdad1712 Mar 12, 2023
8778a28
Merge pull request #10 from carbyne911/feature/REP-60578_2
netdad1712 Mar 12, 2023
523a304
Merge branch 'develop' into feature/REP-61021
slavikbialik Mar 21, 2023
0e4a1b4
Merge pull request #11 from carbyne911/feature/REP-61021
slavikbialik Jun 8, 2023
0d087da
no message
Jun 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/api/subscriber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,13 +247,13 @@ export class Subscriber extends Subscription {
break;
case SubscriptionDialogState.Pending:
if (this._dialog) {
this._dialog.unsubscribe();
this._dialog.unsubscribe(options);
// responses intentionally ignored
}
break;
case SubscriptionDialogState.Active:
if (this._dialog) {
this._dialog.unsubscribe();
this._dialog.unsubscribe(options);
// responses intentionally ignored
}
break;
Expand Down
4 changes: 3 additions & 1 deletion src/api/subscription-unsubscribe-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
* Options for {@link Subscription.unsubscribe}.
* @public
*/
export interface SubscriptionUnsubscribeOptions {}
export interface SubscriptionUnsubscribeOptions {
extraHeaders?: Array<string>;
}
3 changes: 1 addition & 2 deletions src/core/dialogs/subscription-dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,9 +342,8 @@ export class SubscriptionDialog extends Dialog implements Subscription {
* 4.1.2.3. Unsubscribing
* https://tools.ietf.org/html/rfc6665#section-4.1.2.3
*/
public unsubscribe(): OutgoingSubscribeRequest {
public unsubscribe(options: RequestOptions = {}): OutgoingSubscribeRequest {
const allowHeader = "Allow: " + AllowedMethods.toString();
const options: RequestOptions = {};
options.extraHeaders = (options.extraHeaders || []).slice();
options.extraHeaders.push(allowHeader);
options.extraHeaders.push("Event: " + this.subscriptionEvent);
Expand Down
2 changes: 1 addition & 1 deletion src/core/subscription/subscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export interface Subscription {
* 4.1.2.3. Unsubscribing
* https://tools.ietf.org/html/rfc6665#section-4.1.2.3
*/
unsubscribe(): OutgoingSubscribeRequest;
unsubscribe(options?: RequestOptions): OutgoingSubscribeRequest;
}

/**
Expand Down