SIP Header which can trigger auto answer

Good day, we would like to implement AutoAnswer feature into Janus. We have external API for SIP server which can originate calls with this scenario:

  1. User click “Call” button which triggers API method to create a call.
  2. SIP server send INVITE to this user’s Janus telephone with Header Alert-Info: <sip:127.0.0.1>;info=AutoAnswer
  3. Telephone on Janus automatically answers this call (creating the illusion that the phone itself called another person)

Without this feature user need to click the button for originating call on one web page (like some CRM), and click answer button on another web page (where he have janus telephone).

There are 3 SIP headers which are used for this scenario in some manufacturers:

Alert-Info:info=alert-autoanswer
Alert-Info:answer-after=0
Call-info:answer-after=0

I know how with Janus API I can control my telephone but there is no way to know about such headers in INVITE to initiate answer immediately.

Do you think that implementing property like auto_answer: true in sip plugin event incomingcall is possible in this case?

Thank you

That won’t work. With WebRTC, an answer requires a WebRTC SDP originated by the browser, which means user interaction is still required (e.g., to access devices.). This looks like something you have to automate on the client side, not in Janus.

Thanks for quick reply.

I know that browser involved in this scenario. All I need is to have some meta data in sip plugin events about presents AutoAnswer header in SIP INVITE so I can implement automatic answer in my browser js code, so user don’t need to click on “Answer” button.

I think it’s nice extra feature that not changes any current janus developer work flow with sip plugin.

You can already tell the plugin you’re interested in being notified about specific headers in incoming messages. In that case, you’ll get the value of that header along with the event, allowing you to react to that. You can refer to the documentation for the actual syntax.

wow, thanks! Starting to dig in to documentation

Thanks a lot! incoming_header_prefixes in register request is what I looked for. Already tested, works as expected. AutoAnswer implemented. Janus one love!