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

Subscribe support #711

Open
wants to merge 84 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 77 commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
ab46c2a
added subscribe support
ikq May 13, 2021
6469fc3
alternative authentication
ikq May 13, 2021
e8f43c9
merged
ikq May 13, 2021
503c60c
subscribe support
ikq May 13, 2021
b9b7f31
Merge branch 'subscribe_support' of https://github.com/ikq/JsSIP into…
ikq May 13, 2021
8ef4afc
subscribe support
ikq May 13, 2021
be1df6d
Merge branch 'subscribe_support' of https://github.com/ikq/JsSIP into…
ikq May 13, 2021
6636713
added subscriber/notifier to JsSIP
ikq May 20, 2021
1220e96
Added Subscriber.js Notifier.js
ikq May 20, 2021
acf80d7
Added Subscriber.js Notifier.js
ikq May 20, 2021
2a8e0b1
style changed
ikq May 21, 2021
b9119ff
style changed
ikq May 21, 2021
ea58279
Merge branch 'subscribe_support' of https://github.com/ikq/JsSIP into…
ikq May 21, 2021
fe32ca3
added *.ts definitions
ikq May 21, 2021
1ceeb78
added *.ts definitions
ikq May 21, 2021
459baa9
edited ts definition
ikq May 21, 2021
825d6ad
subscriber/notifer contact changed
ikq May 21, 2021
b8ab24c
modified Allow-Events
ikq May 22, 2021
1e28648
added check if is_first_notify_request
ikq May 22, 2021
55ea3ce
undefined params is supported
ikq May 23, 2021
0d5dcdc
Added comments for public methods
ikq May 23, 2021
d77e41c
added public method comments
ikq May 23, 2021
7099def
added public method argument descriptions
ikq May 23, 2021
7c935c4
Notifier: termination reason changed to number
ikq May 23, 2021
89fe3d5
Subscriber termination text changed to code
ikq May 24, 2021
15cf6dd
changed constant name RECEIVE
ikq May 24, 2021
a11eb27
Added missed NOTIFY Contact
ikq May 24, 2021
7db192e
Added missed NOTIFY Contact
ikq May 24, 2021
75d2bc0
check NOTIFY event id
ikq May 25, 2021
7ffaf2f
added FAILED_AUTHENTICATION & bug fixing
ikq May 25, 2021
3c8d440
notifier terminated. bug fixing
ikq May 25, 2021
fd1c6d0
style: private starts with _
ikq May 25, 2021
d23b477
improved ts definitions
ikq May 26, 2021
b4d2535
subscriber termination according rfc 6665 4.1.2
ikq May 26, 2021
293344a
adding fetch-subscribe support. work in progress
ikq May 26, 2021
8347714
added fetch-subscribe support
ikq May 27, 2021
4799f57
method arguments use camelCase
ikq May 27, 2021
6f5d248
added terminated reason and retry-after
ikq May 27, 2021
582d205
improved comment
ikq May 28, 2021
f30ad3b
fixed: Notifier expires_timer is not updated
ikq May 28, 2021
5569b5f
comments about state
ikq May 28, 2021
933247f
fixed: NOTIFY Subscription-State expires is small. Update expires tim…
ikq May 28, 2021
ec42af7
subscriber: optional custom contact and cseq
ikq May 31, 2021
491a208
subscriber: custom contact set via headers, not as special argument
ikq May 31, 2021
1df3b9c
Update lib/Notifier.js
ikq Jun 1, 2021
6258013
points at end of sentence
ikq Jun 1, 2021
d77ffde
after review modifications
ikq Jun 1, 2021
3b12423
fixed: Subscriber check matching Notify event
ikq Jun 1, 2021
1238dde
Merge branch 'master' into subscribe_support
ikq Jun 2, 2021
699b463
subscriber/notifer state is number
ikq Jun 5, 2021
6533f4f
merge with latest JsSIP
ikq Jun 5, 2021
9d47a6d
added emit newSubscriber
ikq Jun 8, 2021
c82707a
removed non ascii comment
ikq Jun 8, 2021
be3c82c
subscriber: event pending
ikq Jun 9, 2021
6347ede
using Dialog in subscriber
ikq Jun 24, 2021
f234314
subscriber dialog.sendRequest added event handlers
ikq Jun 24, 2021
4a551ee
fixed: sendRequest handler names
ikq Jun 24, 2021
7c1171b
use dialog in notifier
ikq Jun 24, 2021
7559919
updated jssip.js and jssip.min.js to make push request looks better
ikq Jun 24, 2021
ff125ec
minor code improvement
ikq Jun 26, 2021
5134893
updates jssip from master
ikq Jul 4, 2021
7cfdc7e
fixed: init subscribe non-ok response no emit terminated
ikq Jul 5, 2021
864cff4
equeue subscribe until init subscribe ok
ikq Jul 6, 2021
d12ab9e
use logger instead debug, debugerror
ikq Aug 8, 2021
aa740e5
Merge remote-tracking branch 'origin/master' into subscribe_support
ikq Aug 8, 2021
f303148
subscriber/notifer set contact as ua._contact.toString()
ikq Sep 23, 2021
6f30417
added unit test subscriber/notifier communiction
ikq Sep 25, 2021
642d500
added unit test subscriber/notifier communiction
ikq Sep 25, 2021
4571e68
Merge branch 'subscribe_support' of https://github.com/ikq/JsSIP into…
ikq Sep 25, 2021
1e565a4
unit test improvement: eventSequence checking
ikq Sep 26, 2021
2775008
unit test improvement: check url, method, contact, accept, subscripti…
ikq Sep 27, 2021
8cfc574
fixed typo issues
ikq Sep 27, 2021
5262d48
Update lib/Subscriber.js
ikq Oct 5, 2021
ecdc2ae
Update lib/Notifier.js
ikq Oct 5, 2021
7c9e97c
some of the changes after the review
ikq Oct 5, 2021
2d32667
modified terminate()
ikq Oct 6, 2021
fc88e8d
fixed typo in comment
ikq Oct 6, 2021
ad37497
fixed ts constant definition
ikq Dec 8, 2021
759d40e
fixed ts definitions
ikq Sep 4, 2022
6425bcf
Merge branch 'master' into subscribe_support
ikq Jan 15, 2023
95a2325
removed spaces before EOL. Synchronized with latest master
ikq Nov 3, 2023
aac7d1c
added _notify() that called from notify() and terminate()
ikq Nov 5, 2023
eca25f7
Fixed SUBSCRIPTION_EXPIRED termination functionality
ikq Nov 5, 2023
b2ef69c
Added reason 'timeout' to user final NOTIFY
ikq Nov 5, 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
3 changes: 2 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ gulp.task('test', function()
'test/test-parser.js',
'test/test-properties.js',
'test/test-UA-no-WebRTC.js',
'test/test-digestAuthentication.js'
'test/test-digestAuthentication.js',
'test/test-UA-subscriber-notifier.js'
];

return gulp.src(src)
Expand Down
2 changes: 1 addition & 1 deletion lib/Constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ module.exports = {
606 : 'Not Acceptable'
},

ALLOWED_METHODS : 'INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO,NOTIFY',
ALLOWED_METHODS : 'INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO,NOTIFY,SUBSCRIBE',
ACCEPTED_BODY_TYPES : 'application/sdp, application/dtmf-relay',
MAX_FORWARDS : 69,
SESSION_EXPIRES : 90,
Expand Down
24 changes: 24 additions & 0 deletions lib/Notifier.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import {EventEmitter} from 'events'
import {SUBSCRIBE, NOTIFY} from './Constants'
import * as Utils from './Utils'

declare enum NotifierTerminatedCode {
NOTIFY_RESPONSE_TIMEOUT = 0,
NOTIFY_TRANSPORT_ERROR = 1,
NOTIFY_NON_OK_RESPONSE = 2,
NOTIFY_FAILED_AUTHENTICATION = 3,
SEND_FINAL_NOTIFY = 4,
RECEIVE_UNSUBSCRIBE = 5,
SUBSCRIPTION_EXPIRED = 6
}

export class Notifier extends EventEmitter {
start(): void;
setActiveState(): void;
notify(body?: string): void;
terminate(body?: string, reason?: string): void;
get state(): string;
get id(): string;
static get C(): typeof NotifierTerminatedCode;
get C(): typeof NotifierTerminatedCode;
}
Loading