JsSIP icon indicating copy to clipboard operation
JsSIP copied to clipboard

RFC8599 support

Open ghenry opened this issue 5 years ago • 8 comments

Hi,

I’m looking for the right way to add details into the Contact URI here:

https://github.com/versatica/JsSIP/blob/5f5da6b802554be4f857cad5671154184308a21b/lib/UA.js#L874

As per:

https://tools.ietf.org/html/rfc8599#section-4

Like:


Contact: <sip:[email protected];
       pn-provider=acme;
       pn-param=acme-param;
       pn-prid=ZTY4ZDJlMzODE1NmUgKi0K>

We’re also discussing this here:

https://github.com/cloudwebrtc/dart-sip-ua/issues/89

Thanks.

ghenry avatar Aug 04 '20 00:08 ghenry

That would be great!

maynor96 avatar Aug 04 '20 04:08 maynor96

The same way Registrator provides a setExtraContactParams method, it can be added a new setExtraContactUriParams. Whenever it comes to generate the Contact header field within Registrator, you have to parse this._contact, add the corresponding URI params and stringify.

jmillan avatar Aug 04 '20 06:08 jmillan

Or setExtraContactUriParams could generate this._contact itself.

jmillan avatar Aug 04 '20 06:08 jmillan

Summarizing:

	setExtraContactUriParams(params) {
		const contact = JsSIP.Grammar.parse(this._contact, 'Contact')[0].parsed;

		contact.uri.clearParams();

		for (const { key, value } of params) {
			contact.uri.setParam(key, value);
		}

		this._contact = contact.toString();
	}

jmillan avatar Aug 04 '20 07:08 jmillan

That makes sense and keeps it consistent. I'll read your contributors guide. Thanks.

ghenry avatar Aug 04 '20 08:08 ghenry

		contact.uri.clearParams();

Would this not clear out any existing contact uri params?

ghenry avatar Sep 13 '20 11:09 ghenry

Sorry, I mean

		this._contact = contact.toString();

Sorry, I mean when you do this.

ghenry avatar Sep 13 '20 11:09 ghenry

All working on our side - https://github.com/cloudwebrtc/dart-sip-ua/pull/117

Will look to add this to JsSIP too.

ghenry avatar Sep 14 '20 12:09 ghenry

Hi @ghenry,

Are you willing go on with the contribution? Let's close this issue.

jmillan avatar Nov 05 '22 16:11 jmillan

Hi @jmillan

My company was acquired from me July last year, so it's not something I'm focusing on any more. Apologies.

https://blog.surevoip.co.uk/2021/12/15/telcoswitch-acquires-surevoip-to-enhance-sme-presence-and-network-capabilities/

Thanks for the chaser.

Gavin.

ghenry avatar Nov 05 '22 17:11 ghenry