Skip to content

Conversation

@ikq
Copy link

@ikq ikq commented May 20, 2021

I added Subscriber.js Notifier.js to JsSIP

I tried write them according JsSIP style and lint errors.
Please take a look and let me know what needs to be fixed.

I already see that *.d.ts files are missing.

The work still in progress: I want add to SUBSCRIBE Contact +sip.instance
as you do in REGISTER

@jmillan
Copy link
Member

jmillan commented May 21, 2021

Hi @ikq,

JsSIP code must have the same style in order to make it readable and maintainable. Comments before making a deeper review:

  • Debug line as the first method call in al public method implementations.
  • New line after return.
  • New line before and after call to super().
  • First conditional in a block starts in new line and last ends in a new line.
  • Conditional blocks always contain curly brackets.
  • Comments in the line above when possible.
  • Calls to debug have usually a new line above and a new line below.

Please take a certain file (ie: RTCSession.js) as a reference and try to stick to its style.

@jmillan
Copy link
Member

jmillan commented May 25, 2021

@ikq

Thanks for the cleanup, 👍 We'll review the PR as we can.

@devoxy1
Copy link

devoxy1 commented Nov 15, 2023

@jmillan Would it be possible to review again? Thanks!

@devoxy1
Copy link

devoxy1 commented Nov 28, 2023

Kind reminder

@devoxy1
Copy link

devoxy1 commented Dec 5, 2023

Up!

@ddyner
Copy link

ddyner commented Dec 10, 2023

Hello. We also want to use this feature. Will this pull request be merged?

@jmillan
Copy link
Member

jmillan commented Dec 11, 2023

This is waiting for the docs to be generated. @ikq are you willing to create a PR for the doc? We cannot merge the feature without it.

@ikq
Copy link
Author

ikq commented Dec 11, 2023

Writing documentation is never easy for me but let's try.

How do you do this?

I have to download the zip (or git clone) from https://github.com/versatica/jssip.net,

install nanoc and modify content/documentation/api/ua.html

And then check the result using nanoc compile, nanoc view?

If the modified doc compiled, make Pull Request of https://github.com/versatica/jssip.net with

modified api/ua.html,
and created api.subscriber.html, api.notifier.html

Do I understand correctly ?

@ikq
Copy link
Author

ikq commented Dec 17, 2023

I created pull request for https://github.com/versatica/jssip.net
Please take a look.

@devoxy1
Copy link

devoxy1 commented Jan 9, 2024

@jmillan Hello! Could you please check it up? Thank you!

@jmillan
Copy link
Member

jmillan commented Jan 9, 2024

I'll review when I can. If you are in a hurry, please do use this branch freely.

@jmillan
Copy link
Member

jmillan commented Jan 9, 2024

I'll review when I can. If you are in a hurry, please do use this branch freely.

This way you will also collaborate on using, testing and reporting.

@devoxy1
Copy link

devoxy1 commented Jan 9, 2024

@jmillan We already using it this way :) but it's a bit difficult to maintain separate branch.
Anyways, thanks you!

@jmillan
Copy link
Member

jmillan commented Jan 18, 2024

I'm not forgetting about this...,

@devoxy1
Copy link

devoxy1 commented Mar 28, 2024

@jmillan Hello! Any chance you had time to review this one?
Thanks!

@orgads
Copy link

orgads commented Jul 23, 2024

@jmillan Ping?

@jmillan
Copy link
Member

jmillan commented Jul 29, 2024

For those willing to use this feature I would suggest you use this branch. I don't have at the moment the resources to re-check and merge this, so please, do use this branch for the time being.

@johnmarkovalo
Copy link

Looking forward with this merge also 👍

@Catlike14
Copy link

@jmillan ping?

@orgads orgads mentioned this pull request Aug 13, 2025
@orgads
Copy link

orgads commented Aug 13, 2025

Pushed a rebased version in #922.

* @param {String} body Notify body
* @param {Array<string>} extraHeaders
*/
_notify(subsStateParameters, body=null, extraHeaders=null)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private methods must appear after all public ones. Also, this could be called _sendNotify() also to dissambiguate.

/**
* Private API
*/
_dialogTerminated(termination_code)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think terminate() would be a better name for this, as it is what the method does. RTCSession has the same name for such function.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see terminate() is already taken, then terminateDialog() would work.

@jmillan
Copy link
Member

jmillan commented Dec 19, 2025

@ikq thanks for the patience. I'll try 🤞 to finish the review and accept it in the following weeks. Can I ask you to not include any change in dist/ folder nor in package.json and to sync the branch with master?

registrar_server : null,
register : true,
register_expires : 600,
register_from_tag_trail : '',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything related to register_from_tag_trail does not belong to this PR. It's already in master. Please remove it.

Comment on lines +286 to +295
register_from_tag_trail(register_from_tag_trail)
{
if (typeof register_from_tag_trail === 'function')
{
return register_from_tag_trail;
}

return String(register_from_tag_trail);
},

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to be removed.

Comment on lines +112 to +131
let fromTag = Utils.newTag();

if (this._ua.configuration.register_from_tag_trail)
{
if (typeof this._ua.configuration.register_from_tag_trail === 'function')
{
fromTag += this._ua.configuration.register_from_tag_trail();
}
else
{
fromTag += this._ua.configuration.register_from_tag_trail;
}
}

const request = new SIPMessage.OutgoingRequest(
JsSIP_C.REGISTER, this._registrar, this._ua, {
'to_uri' : this._to_uri,
'call_id' : this._call_id,
'cseq' : (this._cseq += 1)
'to_uri' : this._to_uri,
'call_id' : this._call_id,
'cseq' : (this._cseq += 1),
'from_tag' : fromTag
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to be removed.

ha1?: string;
register?: boolean;
register_expires?: number;
register_from_tag_trail?: string | function() : string;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to be removed.

@jmillan
Copy link
Member

jmillan commented Dec 19, 2025

Also please do not edit CHANGELOG.md

Comment on lines +1962 to +1966
if (finished)
{
return;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change does not belong to this PR. It's already in master. Please remove.

}

else if (!finished)
else
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change already in master, please remove.

connection.addEventListener('icegatheringstatechange', iceGatheringStateListener = () =>
{
if ((connection.iceGatheringState === 'complete') && !finished)
if (connection.iceGatheringState === 'complete')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change already in master, please remove.

/**
* Get dialog state.
*/
get state()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getters are set after constructor. Please check RTCSession.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.