File: mohq.h

package info (click to toggle)
kamailio 4.2.0-2%2Bdeb8u3
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 56,276 kB
  • sloc: ansic: 552,836; xml: 166,484; sh: 8,659; makefile: 7,676; sql: 6,235; perl: 3,487; yacc: 3,428; python: 1,457; cpp: 1,219; php: 1,047; java: 449; pascal: 194; cs: 40; awk: 27
file content (132 lines) | stat: -rw-r--r-- 2,892 bytes parent folder | download | duplicates (2)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/*
 * $Id$
 *
 * Copyright (C) 2013 Robert Boisvert
 *
 * This file is part of the mohqueue module for sip-router, a free SIP server.
 *
 * The mohqueue module is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version
 *
 * The mohqueue module is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 *
 */

#ifndef MOHQ_H
#define MOHQ_H

#include "mohq_common.h"
#include "mohq_locks.h"

/**********
* definitions
**********/

#define URI_LEN     100
#define USLEEP_LEN  10
#define MOHDIRLEN   100
#define MOHFILELEN  100

/**********
* structures
**********/

typedef struct
  {
  int ntype;
  char *pencode;
  } rtpmap;

/* mohq_flags values */
#define MOHQF_ACT 0x01
#define MOHQF_CHK 0x02
#define MOHQF_DBG 0x04

typedef struct
  {
  char mohq_name [26];
  char mohq_uri [URI_LEN + 1];
  char mohq_mohdir [MOHDIRLEN + 1];
  char mohq_mohfile [MOHFILELEN + 1];
  int mohq_flags;
  int mohq_id;
  } mohq_lst;

/* call_state values */
#define CLSTA_ENTER     100
#define CLSTA_PRACKSTRT 101
#define CLSTA_PRACKRPLY 102
#define CLSTA_RINGING   103
#define CLSTA_INVITED   104
#define CLSTA_CANCEL    105
#define CLSTA_INQUEUE   200
#define CLSTA_REFER     301
#define CLSTA_RFRWAIT   302
#define CLSTA_BYE       305

typedef struct
  {
  int call_active;
  char call_id [101];
  char call_from [URI_LEN + 1];
  char call_referto [URI_LEN + 1];
  char call_contact [URI_LEN + 1];
  char call_tag [101];
  char call_via [1024];
  char call_addr [IP_ADDR_MAX_STR_SIZE + 4];
  int call_state;
  int call_cseq;
  int call_aport;
  mohq_lst *pmohq;
  time_t call_time;
  unsigned int call_hash;
  unsigned int call_label;
  sip_msg_t *call_pmsg;
  } call_lst;

typedef struct
  {
  char *mohdir;
  str db_url;
  str db_ctable;
  str db_qtable;
  } mod_cfg;

typedef struct
  {
  mod_cfg pcfg [1];
  time_t mohq_update;
  int mohq_cnt;
  mohq_lst *pmohq_lst;
  mohq_lock pmohq_lock [1];
  int call_cnt;
  call_lst *pcall_lst;
  mohq_lock pcall_lock [1];
  db_func_t pdb [1];
  tm_api_t ptm [1];
  sl_api_t psl [1];
  rr_api_t prr [1];
  cmd_function fn_rtp_answer;
  cmd_function fn_rtp_destroy;
  cmd_function fn_rtp_offer;
  cmd_function fn_rtp_stream_c;
  cmd_function fn_rtp_stream_s;
  } mod_data;

/**********
* global varb declarations
**********/

extern mod_data *pmod_data;
extern rtpmap prtpmap [];

#endif /* MOHQ_H */