1 /***************************************************************************
3 This is a test program for linphone. It acts as a sip server and answers to linphone's
7 copyright : (C) 2001 by Simon MORLAT
8 email : simon.morlat@free.fr
9 ***************************************************************************/
11 /***************************************************************************
13 * This program is free software; you can redistribute it and/or modify *
14 * it under the terms of the GNU General Public License as published by *
15 * the Free Software Foundation; either version 2 of the License, or *
16 * (at your option) any later version. *
18 ***************************************************************************/
21 #include "../coreapi/linphonecore.h"
22 #include "../coreapi/sdphandler.h"
23 #include <eXosip2/eXosip.h>
26 #include "mediastreamer2/mediastream.h"
28 #include <ortp/ortp.h>
29 #include <ortp/telephonyevents.h>
32 #define ANNOUCE_FILE8000HZ "hello8000.wav"
33 #define ANNOUCE_FILE16000HZ "hello16000.wav"
39 double acceptance_time;
41 char *file_path8000hz;
42 char *file_path16000hz;
46 typedef struct _Sipomatic Sipomatic;
48 void sipomatic_init(Sipomatic *obj, char *url, bool_t ipv6);
49 void sipomatic_uninit(Sipomatic *obj);
50 void sipomatic_iterate(Sipomatic *obj);
51 #define sipomatic_lock(obj) ms_mutex_lock(&(obj)->lock);
52 #define sipomatic_unlock(obj) ms_mutex_unlock(&(obj)->lock);
54 void sipomatic_set_annouce_file(Sipomatic *obj, char *file);
72 AudioStream *audio_stream;
74 VideoStream *video_stream;
77 struct _CallParams *params;
80 struct stream_params audio;
81 struct stream_params video;
84 #define CALL_STATE_INIT 0
85 #define CALL_STATE_RUNNING 1
86 #define CALL_STATE_FINISHED 2
88 typedef struct _Call Call;
91 Call * call_new(Sipomatic *obj, eXosip_event_t *ev);
92 void call_accept(Call *call);
93 void call_release(Call *call);
94 void call_destroy(Call *call);
96 Call* sipomatic_find_call(Sipomatic *obj,int cid);