-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmsrp_callback.c
More file actions
43 lines (35 loc) · 877 Bytes
/
msrp_callback.c
File metadata and controls
43 lines (35 loc) · 877 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include "msrp_callback.h"
/*
The wrapper to callback the application about endpoints
*/
void local_ep_callback(int event, MsrpEndpoint *endpoint, int content, void *data, int bytes)
{
if(ep_callback)
ep_callback(event, endpoint, content, data, bytes);
}
/*
The wrapper to callback the application about switches
*/
void local_sw_callback(int event, MsrpSwitch *switcher, unsigned short int user, void *data, int bytes)
{
if(sw_callback)
sw_callback(event, switcher, user, data, bytes);
}
/*
The wrapper to compose the event notification strings
*/
void local_events(int event, char *format, ...)
{
if(!events) /* If there's no application callback, stop here */
return;
va_list ap;
va_start(ap, format);
if(!format)
return;
char buffer[200];
memset(buffer, 0, 200);
vsprintf(buffer, format, ap);
va_end(ap);
if(events)
events(event, buffer);
}