Fork me on GitHub
Loading...
Searching...
No Matches
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, janus_plugin_rtp *packet)
 
void janus_voicemail_incoming_rtcp (janus_plugin_session *handle, janus_plugin_rtcp *packet)
 
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

◆ JANUS_VOICEMAIL_AUTHOR

#define JANUS_VOICEMAIL_AUTHOR   "Meetecho s.r.l."

◆ JANUS_VOICEMAIL_DESCRIPTION

#define JANUS_VOICEMAIL_DESCRIPTION   "This is a plugin implementing a very simple VoiceMail service for Janus, recording Opus streams."

◆ JANUS_VOICEMAIL_ERROR_ALREADY_RECORDING

#define JANUS_VOICEMAIL_ERROR_ALREADY_RECORDING   465

◆ JANUS_VOICEMAIL_ERROR_INVALID_ELEMENT

#define JANUS_VOICEMAIL_ERROR_INVALID_ELEMENT   464

◆ JANUS_VOICEMAIL_ERROR_INVALID_JSON

#define JANUS_VOICEMAIL_ERROR_INVALID_JSON   461

◆ JANUS_VOICEMAIL_ERROR_INVALID_REQUEST

#define JANUS_VOICEMAIL_ERROR_INVALID_REQUEST   462

◆ JANUS_VOICEMAIL_ERROR_INVALID_STATE

#define JANUS_VOICEMAIL_ERROR_INVALID_STATE   468

◆ JANUS_VOICEMAIL_ERROR_IO_ERROR

#define JANUS_VOICEMAIL_ERROR_IO_ERROR   466

◆ JANUS_VOICEMAIL_ERROR_LIBOGG_ERROR

#define JANUS_VOICEMAIL_ERROR_LIBOGG_ERROR   467

◆ JANUS_VOICEMAIL_ERROR_MISSING_ELEMENT

#define JANUS_VOICEMAIL_ERROR_MISSING_ELEMENT   463

◆ JANUS_VOICEMAIL_ERROR_NO_MESSAGE

#define JANUS_VOICEMAIL_ERROR_NO_MESSAGE   460

◆ JANUS_VOICEMAIL_ERROR_UNKNOWN_ERROR

#define JANUS_VOICEMAIL_ERROR_UNKNOWN_ERROR   499

◆ JANUS_VOICEMAIL_NAME

#define JANUS_VOICEMAIL_NAME   "JANUS VoiceMail plugin"

◆ JANUS_VOICEMAIL_PACKAGE

#define JANUS_VOICEMAIL_PACKAGE   "janus.plugin.voicemail"

◆ JANUS_VOICEMAIL_VERSION

#define JANUS_VOICEMAIL_VERSION   7

◆ JANUS_VOICEMAIL_VERSION_STRING

#define JANUS_VOICEMAIL_VERSION_STRING   "0.0.7"

◆ sdp_template

#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

◆ janus_voicemail_message

typedef struct janus_voicemail_message janus_voicemail_message

◆ janus_voicemail_session

typedef struct janus_voicemail_session janus_voicemail_session

Function Documentation

◆ create()

janus_plugin * create ( void )

◆ janus_voicemail_create_session()

void janus_voicemail_create_session ( janus_plugin_session * handle,
int * error )

◆ janus_voicemail_destroy()

void janus_voicemail_destroy ( void )

◆ janus_voicemail_destroy_session()

void janus_voicemail_destroy_session ( janus_plugin_session * handle,
int * error )

◆ janus_voicemail_get_api_compatibility()

int janus_voicemail_get_api_compatibility ( void )

◆ janus_voicemail_get_author()

const char * janus_voicemail_get_author ( void )

◆ janus_voicemail_get_description()

const char * janus_voicemail_get_description ( void )

◆ janus_voicemail_get_name()

const char * janus_voicemail_get_name ( void )

◆ janus_voicemail_get_package()

const char * janus_voicemail_get_package ( void )

◆ janus_voicemail_get_version()

int janus_voicemail_get_version ( void )

◆ janus_voicemail_get_version_string()

const char * janus_voicemail_get_version_string ( void )

◆ janus_voicemail_handle_message()

struct janus_plugin_result * janus_voicemail_handle_message ( janus_plugin_session * handle,
char * transaction,
json_t * message,
json_t * jsep )

◆ janus_voicemail_hangup_media()

void janus_voicemail_hangup_media ( janus_plugin_session * handle)

◆ janus_voicemail_incoming_rtcp()

void janus_voicemail_incoming_rtcp ( janus_plugin_session * handle,
janus_plugin_rtcp * packet )

◆ janus_voicemail_incoming_rtp()

void janus_voicemail_incoming_rtp ( janus_plugin_session * handle,
janus_plugin_rtp * packet )

◆ janus_voicemail_init()

int janus_voicemail_init ( janus_callbacks * callback,
const char * config_path )

◆ janus_voicemail_query_session()

json_t * janus_voicemail_query_session ( janus_plugin_session * handle)

◆ janus_voicemail_setup_media()

void janus_voicemail_setup_media ( janus_plugin_session * handle)

◆ le16()

void le16 ( unsigned char * p,
int v )

◆ le32()

void le32 ( unsigned char * p,
int v )

◆ ogg_flush()

int ogg_flush ( janus_voicemail_session * session)

◆ ogg_write()

int ogg_write ( janus_voicemail_session * session)

◆ op_free()

void op_free ( ogg_packet * op)

◆ op_from_pkt()

ogg_packet * op_from_pkt ( const unsigned char * pkt,
int len )

◆ op_opushead()

ogg_packet * op_opushead ( void )

◆ op_opustags()

ogg_packet * op_opustags ( void )