]> sjero.net Git - linphone/blob - console/sipomatic.h
Aac-eld add missing header according to RFC3640 3.3.6
[linphone] / console / sipomatic.h
1 /***************************************************************************
2                           linphone  - sipomatic.c
3 This is a test program for linphone. It acts as a sip server and answers to linphone's
4 call.
5                              -------------------
6     begin                : ven mar  30
7     copyright            : (C) 2001 by Simon MORLAT
8     email                : simon.morlat@free.fr
9  ***************************************************************************/
10
11 /***************************************************************************
12  *                                                                         *
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.                                   *
17  *                                                                         *
18  ***************************************************************************/
19
20
21 #include "../coreapi/linphonecore.h"
22 #include "../coreapi/sdphandler.h"
23 #include <eXosip2/eXosip.h>
24 #undef PACKAGE
25 #undef VERSION
26 #include "mediastreamer2/mediastream.h"
27
28 #include <ortp/ortp.h>
29 #include <ortp/telephonyevents.h>
30
31
32 #define ANNOUCE_FILE8000HZ      "hello8000.wav"
33 #define ANNOUCE_FILE16000HZ     "hello16000.wav"
34
35 struct _Sipomatic
36 {
37         ms_mutex_t lock;
38         MSList *calls;
39         double acceptance_time;
40         double max_call_time;
41         char *file_path8000hz;
42         char *file_path16000hz;
43         bool_t ipv6;
44 };
45
46 typedef struct _Sipomatic Sipomatic;
47         
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);
53
54 void sipomatic_set_annouce_file(Sipomatic *obj, char *file);
55
56 struct stream_params{
57         int ncodecs;
58         int line;
59         int localport;
60         int remoteport;
61         int pt;
62         char *remaddr;
63 };
64
65 struct _Call
66 {
67         Sipomatic *root;
68         sdp_context_t *sdpc;
69         int time;
70         int did;
71         int tid;
72         AudioStream *audio_stream;
73 #ifdef VIDEO_ENABLED
74         VideoStream *video_stream;
75 #endif
76         int state;
77         struct _CallParams *params;
78         int eof;
79         RtpProfile *profile;
80         struct stream_params audio;
81         struct stream_params video;
82 };
83
84 #define CALL_STATE_INIT 0
85 #define CALL_STATE_RUNNING 1
86 #define CALL_STATE_FINISHED 2
87
88 typedef struct _Call Call;
89
90         
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);
95
96 Call* sipomatic_find_call(Sipomatic *obj,int cid);