Skip to content

Commit 06bc43d

Browse files
committed
Merge pull request onsip#50 from joseph-onsip/rejectReinvite
Session: on re-INVITE, send 488 instead of calling this.receiveReinvite fixes onsip#19
2 parents bacea36 + f4e8e40 commit 06bc43d

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/Session.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,9 @@ Session.prototype = {
622622
case SIP.C.INVITE:
623623
if(this.status === C.STATUS_CONFIRMED) {
624624
this.logger.log('re-INVITE received');
625-
this.receiveReinvite(request);
625+
// Switch these two lines to try re-INVITEs:
626+
//this.receiveReinvite(request);
627+
request.reply(488, null, ["Warning: Cannot update media description"]);
626628
}
627629
break;
628630
case SIP.C.INFO:

test/spec/SpecSession.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,7 +1445,7 @@ describe('InviteServerContext', function() {
14451445
});
14461446

14471447
describe('method is INVITE', function() {
1448-
it('calls receiveReinvite', function() {
1448+
xit('calls receiveReinvite', function() {
14491449
InviteServerContext.status = 12;
14501450
req = SIP.Parser.parseMessage('INVITE sip:[email protected];transport=ws;aor=james%40onsnip.onsip.com SIP/2.0\r\nMax-Forwards: 65\r\nTo: <sip:[email protected]>\r\nFrom: "test1" <sip:[email protected]>;tag=rto5ib4052\r\nCall-ID: grj0liun879lfj35evfq\r\nCSeq: 1798 INVITE\r\nContact: <sip:[email protected];transport=ws;ob>\r\nAllow: ACK,CANCEL,BYE,OPTIONS,INVITE,MESSAGE\r\nContent-Type: application/json\r\nSupported: outbound\r\nUser-Agent: SIP.js 0.5.0-devel\r\nContent-Length: 11\r\n\r\na=sendrecv\r\n', InviteServerContext.ua);
14511451

@@ -2095,7 +2095,7 @@ describe('InviteClientContext', function() {
20952095
expect(InviteClientContext.terminated).toHaveBeenCalledWith(request, SIP.C.causes.BYE);
20962096
});
20972097

2098-
it('logs and calls receiveReinvite if request method is INVITE', function() {
2098+
xit('logs and calls receiveReinvite if request method is INVITE', function() {
20992099
InviteClientContext.status = 12;
21002100
request.method = SIP.C.INVITE;
21012101

0 commit comments

Comments
 (0)