Functions |
janus_plugin * | create (void) |
int | janus_sip_init (janus_callbacks *callback, const char *config_path) |
void | janus_sip_destroy (void) |
int | janus_sip_get_api_compatibility (void) |
int | janus_sip_get_version (void) |
const char * | janus_sip_get_version_string (void) |
const char * | janus_sip_get_description (void) |
const char * | janus_sip_get_name (void) |
const char * | janus_sip_get_author (void) |
const char * | janus_sip_get_package (void) |
void | janus_sip_create_session (janus_plugin_session *handle, int *error) |
struct janus_plugin_result * | janus_sip_handle_message (janus_plugin_session *handle, char *transaction, char *message, char *sdp_type, char *sdp) |
void | janus_sip_setup_media (janus_plugin_session *handle) |
void | janus_sip_incoming_rtp (janus_plugin_session *handle, int video, char *buf, int len) |
void | janus_sip_incoming_rtcp (janus_plugin_session *handle, int video, char *buf, int len) |
void | janus_sip_hangup_media (janus_plugin_session *handle) |
void | janus_sip_destroy_session (janus_plugin_session *handle, int *error) |
char * | janus_sip_query_session (janus_plugin_session *handle) |
void | janus_sip_message_free (janus_sip_message *msg) |
gpointer | janus_sip_sofia_thread (gpointer user_data) |
void | janus_sip_sofia_callback (nua_event_t event, int status, char const *phrase, nua_t *nua, nua_magic_t *magic, nua_handle_t *nh, nua_hmagic_t *hmagic, sip_t const *sip, tagi_t tags[]) |
void | janus_sip_sdp_process (janus_sip_session *session, sdp_session_t *sdp) |
void * | janus_sip_watchdog (void *data) |
Janus SIP plugin.
- Author
- Lorenzo Miniero loren.nosp@m.zo@m.nosp@m.eetec.nosp@m.ho.c.nosp@m.om
- Copyright
- GNU General Public License v3
This is a simple SIP plugin for Janus, allowing WebRTC peers to register at a SIP server (e.g., Asterisk) and call SIP user agents through the gateway. Specifically, when attaching to the plugin peers are requested to provide their SIP server credentials, i.e., the address of the SIP server and their username/secret. This results in the plugin registering at the SIP server and acting as a SIP client on behalf of the web peer. Most of the SIP states and lifetime are masked by the plugin, and only the relevant events (e.g., INVITEs and BYEs) and functionality (call, hangup) are made available to the web peer: peers can call extensions at the SIP server or wait for incoming INVITEs, and during a call they can send DTMF tones.
The concept behind this plugin is to allow different web pages associated to the same peer, and hence the same SIP user, to attach to the plugin at the same time and yet just do a SIP REGISTER once. The same should apply for calls: while an incoming call would be notified to all the web UIs associated to the peer, only one would be able to pick up and answer, in pretty much the same way as SIP forking works but without the need to fork in the same place. This specific functionality, though, has not been implemented as of yet.
- Todo:
- Only Asterisk and Kamailio have been tested as a SIP server, and specifically only with basic audio calls: this plugin needs some work to make it more stable and reliable.
SIP Plugin API
All requests you can send in the SIP Plugin API are asynchronous, which means all responses (successes and errors) will be delivered as events with the same transaction.
The supported requests are register
, call
, accept
and hangup
. register
can be used, as the name suggests, to register a username at a SIP registrar to call and be called; call
is used to send an INVITE to a different SIP URI through the plugin, while accept
is used to accept the call in case one is invited instead of inviting; finally, hangup
can be used to terminate the communication at any time, either to hangup (BYE) an ongoing call or to cancel/decline (CANCEL/BYE) a call that hasn't started yet.
Actual API docs: TBD.
Plugins