This commit is contained in:
parent
f5396bdfce
commit
63a4e79b51
@ -162,6 +162,7 @@ int PLUGIN_END(plugin_def_t *plugin_def){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*--------------------------------------------------------------------*/
|
||||||
/* private plugin code */
|
/* private plugin code */
|
||||||
static int plugin_defaulttarget_redirect(sip_ticket_t *ticket) {
|
static int plugin_defaulttarget_redirect(sip_ticket_t *ticket) {
|
||||||
int i;
|
int i;
|
||||||
|
|||||||
@ -23,6 +23,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <time.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
@ -354,6 +355,7 @@ int main (int argc, char *argv[])
|
|||||||
*****************************/
|
*****************************/
|
||||||
while (!exit_program) {
|
while (!exit_program) {
|
||||||
|
|
||||||
|
memset(&ticket, 0, sizeof(sip_ticket_t));
|
||||||
while ((sts = sipsock_waitfordata(buff, sizeof(buff)-1,
|
while ((sts = sipsock_waitfordata(buff, sizeof(buff)-1,
|
||||||
&ticket.from, &ticket.protocol)) <=0 ) {
|
&ticket.from, &ticket.protocol)) <=0 ) {
|
||||||
|
|
||||||
@ -392,6 +394,7 @@ int main (int argc, char *argv[])
|
|||||||
buflen = (size_t)sts;
|
buflen = (size_t)sts;
|
||||||
DEBUGC(DBCLASS_BABBLE,"received %zd bytes of data", buflen);
|
DEBUGC(DBCLASS_BABBLE,"received %zd bytes of data", buflen);
|
||||||
ticket.direction=0;
|
ticket.direction=0;
|
||||||
|
ticket.timestamp=time(NULL);
|
||||||
memset(&ticket.next_hop, 0, sizeof(ticket.next_hop));
|
memset(&ticket.next_hop, 0, sizeof(ticket.next_hop));
|
||||||
buff[buflen]='\0';
|
buff[buflen]='\0';
|
||||||
|
|
||||||
|
|||||||
@ -125,9 +125,10 @@ typedef struct {
|
|||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *raw_buffer; /* raw UDP packet */
|
char *raw_buffer; /* raw UDP packet */
|
||||||
size_t raw_buffer_len; /* length of raw data */
|
size_t raw_buffer_len; /* length of raw data */
|
||||||
osip_message_t *sipmsg; /* SIP */
|
osip_message_t *sipmsg; /* SIP */
|
||||||
struct sockaddr_in from; /* received from */
|
struct sockaddr_in from; /* received from */
|
||||||
|
time_t timestamp; /* timestamp of reception */
|
||||||
#define PROTO_UNKN -1
|
#define PROTO_UNKN -1
|
||||||
#define PROTO_UDP 1
|
#define PROTO_UDP 1
|
||||||
#define PROTO_TCP 2
|
#define PROTO_TCP 2
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user