Fork me on GitHub
Data Structures | Macros | Typedefs | Functions
janus_voicemail.c File Reference

Janus VoiceMail plugin. More...

#include "plugin.h"
#include <jansson.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <ogg/ogg.h>
#include "../debug.h"
#include "../apierror.h"
#include "../config.h"
#include "../mutex.h"
#include "../rtp.h"
#include "../utils.h"
Include dependency graph for janus_voicemail.c:

Data Structures

struct  janus_voicemail_message
 
struct  janus_voicemail_session
 

Macros

#define JANUS_VOICEMAIL_VERSION   7
 
#define JANUS_VOICEMAIL_VERSION_STRING   "0.0.7"
 
#define JANUS_VOICEMAIL_DESCRIPTION   "This is a plugin implementing a very simple VoiceMail service for Janus, recording Opus streams."
 
#define JANUS_VOICEMAIL_NAME   "JANUS VoiceMail plugin"
 
#define JANUS_VOICEMAIL_AUTHOR   "Meetecho s.r.l."
 
#define JANUS_VOICEMAIL_PACKAGE   "janus.plugin.voicemail"
 
#define sdp_template
 
#define JANUS_VOICEMAIL_ERROR_UNKNOWN_ERROR   499
 
#define JANUS_VOICEMAIL_ERROR_NO_MESSAGE   460
 
#define JANUS_VOICEMAIL_ERROR_INVALID_JSON   461
 
#define JANUS_VOICEMAIL_ERROR_INVALID_REQUEST   462
 
#define JANUS_VOICEMAIL_ERROR_MISSING_ELEMENT   463
 
#define JANUS_VOICEMAIL_ERROR_INVALID_ELEMENT   464
 
#define JANUS_VOICEMAIL_ERROR_ALREADY_RECORDING   465
 
#define JANUS_VOICEMAIL_ERROR_IO_ERROR   466
 
#define JANUS_VOICEMAIL_ERROR_LIBOGG_ERROR   467
 
#define JANUS_VOICEMAIL_ERROR_INVALID_STATE   468
 

Typedefs

typedef struct janus_voicemail_message janus_voicemail_message
 
typedef struct janus_voicemail_session janus_voicemail_session
 

Functions

janus_plugincreate (void)
 
int janus_voicemail_init (janus_callbacks *callback, const char *config_path)
 
void janus_voicemail_destroy (void)
 
int janus_voicemail_get_api_compatibility (void)
 
int janus_voicemail_get_version (void)
 
const char * janus_voicemail_get_version_string (void)
 
const char * janus_voicemail_get_description (void)
 
const char * janus_voicemail_get_name (void)
 
const char * janus_voicemail_get_author (void)
 
const char * janus_voicemail_get_package (void)
 
void janus_voicemail_create_session (janus_plugin_session *handle, int *error)
 
struct janus_plugin_resultjanus_voicemail_handle_message (janus_plugin_session *handle, char *transaction, json_t *message, json_t *jsep)
 
void janus_voicemail_setup_media (janus_plugin_session *handle)
 
void janus_voicemail_incoming_rtp (janus_plugin_session *handle, int video, char *buf, int len)
 
void janus_voicemail_incoming_rtcp (janus_plugin_session *handle, int video, char *buf, int len)
 
void janus_voicemail_hangup_media (janus_plugin_session *handle)
 
void janus_voicemail_destroy_session (janus_plugin_session *handle, int *error)
 
json_tjanus_voicemail_query_session (janus_plugin_session *handle)
 
void le32 (unsigned char *p, int v)
 
void le16 (unsigned char *p, int v)
 
ogg_packet * op_opushead (void)
 
ogg_packet * op_opustags (void)
 
ogg_packet * op_from_pkt (const unsigned char *pkt, int len)
 
void op_free (ogg_packet *op)
 
int ogg_write (janus_voicemail_session *session)
 
int ogg_flush (janus_voicemail_session *session)
 

Detailed Description

Janus VoiceMail plugin.

Author
Lorenzo Miniero loren.nosp@m.zo@m.nosp@m.eetec.nosp@m.ho.c.nosp@m.om

Check the VoiceMail plugin documentation for more details.

Plugins

Macro Definition Documentation

#define JANUS_VOICEMAIL_AUTHOR   "Meetecho s.r.l."
#define JANUS_VOICEMAIL_DESCRIPTION   "This is a plugin implementing a very simple VoiceMail service for Janus, recording Opus streams."
#define JANUS_VOICEMAIL_ERROR_ALREADY_RECORDING   465
#define JANUS_VOICEMAIL_ERROR_INVALID_ELEMENT   464
#define JANUS_VOICEMAIL_ERROR_INVALID_JSON   461
#define JANUS_VOICEMAIL_ERROR_INVALID_REQUEST   462
#define JANUS_VOICEMAIL_ERROR_INVALID_STATE   468
#define JANUS_VOICEMAIL_ERROR_IO_ERROR   466
#define JANUS_VOICEMAIL_ERROR_LIBOGG_ERROR   467
#define JANUS_VOICEMAIL_ERROR_MISSING_ELEMENT   463
#define JANUS_VOICEMAIL_ERROR_NO_MESSAGE   460
#define JANUS_VOICEMAIL_ERROR_UNKNOWN_ERROR   499
#define JANUS_VOICEMAIL_NAME   "JANUS VoiceMail plugin"
#define JANUS_VOICEMAIL_PACKAGE   "janus.plugin.voicemail"
#define JANUS_VOICEMAIL_VERSION   7
#define JANUS_VOICEMAIL_VERSION_STRING   "0.0.7"
#define sdp_template
Value:
"v=0\r\n" \
"o=- %"SCNu64" %"SCNu64" IN IP4 127.0.0.1\r\n" /* We need current time here */ \
"s=VoiceMail %"SCNu64"\r\n" /* VoiceMail recording ID */ \
"t=0 0\r\n" \
"m=audio 1 RTP/SAVPF %d\r\n" /* Opus payload type */ \
"c=IN IP4 1.1.1.1\r\n" \
"a=rtpmap:%d opus/48000/2\r\n" /* Opus payload type */ \
"a=recvonly\r\n" /* This plugin doesn't send any frames */

Typedef Documentation

Function Documentation

janus_plugin* create ( void  )
void janus_voicemail_create_session ( janus_plugin_session handle,
int *  error 
)
void janus_voicemail_destroy ( void  )
void janus_voicemail_destroy_session ( janus_plugin_session handle,
int *  error 
)
int janus_voicemail_get_api_compatibility ( void  )
const char * janus_voicemail_get_author ( void  )
const char * janus_voicemail_get_description ( void  )
const char * janus_voicemail_get_name ( void  )
const char * janus_voicemail_get_package ( void  )
int janus_voicemail_get_version ( void  )
const char * janus_voicemail_get_version_string ( void  )
struct janus_plugin_result * janus_voicemail_handle_message ( janus_plugin_session handle,
char *  transaction,
json_t message,
json_t jsep 
)
void janus_voicemail_hangup_media ( janus_plugin_session handle)
void janus_voicemail_incoming_rtcp ( janus_plugin_session handle,
int  video,
char *  buf,
int  len 
)
void janus_voicemail_incoming_rtp ( janus_plugin_session handle,
int  video,
char *  buf,
int  len 
)
int janus_voicemail_init ( janus_callbacks callback,
const char *  config_path 
)
json_t * janus_voicemail_query_session ( janus_plugin_session handle)
void janus_voicemail_setup_media ( janus_plugin_session handle)
void le16 ( unsigned char *  p,
int  v 
)
void le32 ( unsigned char *  p,
int  v 
)
int ogg_flush ( janus_voicemail_session session)
int ogg_write ( janus_voicemail_session session)
void op_free ( ogg_packet *  op)
ogg_packet * op_from_pkt ( const unsigned char *  pkt,
int  len 
)
ogg_packet * op_opushead ( void  )
ogg_packet * op_opustags ( void  )