custom SIP headers in Janus

581 views
Skip to first unread message

Nitesh Bansal

unread,
Mar 10, 2016, 6:30:06 AM3/10/16
to meetecho-janus
Hello,

I'm exploring the Janus SIP gateway plugin. I would like to know if I can use Janus to send custom SIP headers towards my SIP server, when it initiates the call?
These headers are important, it allows your webrtc agents to provide some extra information.

Thanks,
Nitesh

Lorenzo Miniero

unread,
Mar 10, 2016, 7:14:47 AM3/10/16
to meetecho-janus
Hi Nitesh,

no, the SIP stack is within the plugin itself, web users don't see any SIP, and we currently don't expose any API to allow you to add other headers. You'd need a new plugin to only use Janus for media while keeping control of SIP in your application and do what you want there.

L.

Nitesh Bansal

unread,
Mar 10, 2016, 7:43:58 AM3/10/16
to meetecho-janus
Ok, good to know that Lorenzo.

Thanks,
Nitesh

Lorenzo Miniero

unread,
Mar 16, 2016, 8:53:22 AM3/16/16
to meetecho-janus

Nitesh Bansal

unread,
Mar 16, 2016, 9:28:51 AM3/16/16
to meetecho-janus
Hi Lorenzo,

I'll let you know when I get the chance to test it.

thanks,

Nitesh

On Thursday, March 10, 2016 at 12:30:06 PM UTC+1, Nitesh Bansal wrote:

Nitesh Bansal

unread,
Mar 21, 2016, 9:49:20 AM3/21/16
to meetecho-janus
Hi Lorenzo,

I tried it and it didn't work for me

body = { "request": "call", "uri" : destPhone,
                                                        "headers" : {
                                                                        'X-Voxbone-Context: ' : voxbone.WebRTC.context
                                                                    }
                                                       };

I looked at the SIP INVITE and I saw that X-Voxbone-Context is header after the Content length header, it isn't the right place to add the custom SIP headers,
most SIP agents will ignore any header after the Content-Length header.
Will it be possible to change the code to ad the custom headers before the Content-Length header?


Nitesh

On Thursday, March 10, 2016 at 12:30:06 PM UTC+1, Nitesh Bansal wrote:

Lorenzo Miniero

unread,
Mar 21, 2016, 9:56:03 AM3/21/16
to meetecho-janus
I don't think there's anything we can do, I already used the only way Sofia SIP has to add custom headers. Your point was made here too:


and apparently the RFC says that "The relative order of header fields with different field names is not significant.", so it's compliant.
As a side note, you don't need the semicolon in the headers name in the request (so 'X-Voxbone-Context' instead of 'X-Voxbone-Context: ').

Lorenzo

Lorenzo Miniero

unread,
Mar 21, 2016, 10:01:16 AM3/21/16
to meetecho-janus
 
As a side note, you don't need the semicolon in the headers name in the request (so 'X-Voxbone-Context' instead of 'X-Voxbone-Context: ').

Thinking about this, this could actually be the real cause of the issue, as the way you requested it, it could end up with a double-semicolon in place. Have you checked whether Sofia SIP actually formatted it that way in the request, or removed the extra semicolon?

L. 

 

Nitesh Bansal

unread,
Mar 21, 2016, 10:07:42 AM3/21/16
to meetecho-janus
Actually, it works, there was some error in my header.
But I'm aware of SIP UAs who ignore the headers after the Content-Length.
But, all is well for me at least.


On Thursday, March 10, 2016 at 12:30:06 PM UTC+1, Nitesh Bansal wrote:
Reply all
Reply to author
Forward
0 new messages