Asterisk - The Open Source Telephony Project  21.4.1
chan_ooh323.h
1 /*
2  * Copyright (C) 2004-2005 by Objective Systems, Inc.
3  *
4  * This software is furnished under an open source license and may be
5  * used and copied only in accordance with the terms of this license.
6  * The text of the license may generally be found in the root
7  * directory of this installation in the COPYING file. It
8  * can also be viewed online at the following URL:
9  *
10  * http://www.obj-sys.com/open/license.html
11  *
12  * Any redistributions of this file including modified versions must
13  * maintain this copyright notice.
14  *
15  *****************************************************************************/
16 #ifndef _OO_CHAN_H323_H_
17 #define _OO_CHAN_H323_H_
18 
19 #include "asterisk.h"
20 #undef PACKAGE_NAME
21 #undef PACKAGE_TARNAME
22 #undef PACKAGE_VERSION
23 #undef PACKAGE_STRING
24 #undef PACKAGE_BUGREPORT
25 
26 #include <stdlib.h>
27 #include <stdio.h>
28 #include <string.h>
29 #include <sys/socket.h>
30 #include <sys/param.h>
31 #include <arpa/inet.h>
32 #include <net/if.h>
33 #include <netinet/in.h>
34 #include <netinet/in_systm.h>
35 #include <netinet/ip.h>
36 #include <unistd.h>
37 #include <netdb.h>
38 #include <errno.h>
39 #include <fcntl.h>
40 #include <signal.h>
41 
42 #include "asterisk/lock.h"
43 #include "asterisk/channel.h"
44 #include "asterisk/config.h"
45 #include "asterisk/logger.h"
46 #include "asterisk/module.h"
47 #include "asterisk/pbx.h"
48 #include "asterisk/utils.h"
49 #include "asterisk/options.h"
50 #include "asterisk/sched.h"
51 #include "asterisk/io.h"
52 #include "asterisk/causes.h"
53 #include "asterisk/rtp_engine.h"
54 #include "asterisk/acl.h"
55 #include "asterisk/callerid.h"
56 #include "asterisk/file.h"
57 #include "asterisk/cli.h"
58 #include "asterisk/app.h"
59 #include "asterisk/musiconhold.h"
60 #include "asterisk/manager.h"
61 #include "asterisk/dsp.h"
62 #include "asterisk/stringfields.h"
63 #include "asterisk/format.h"
64 #include "asterisk/format_cap.h"
65 #include "asterisk/udptl.h"
66 #include "asterisk/stasis_channels.h"
67 #include "asterisk/format_cache.h"
68 #include "asterisk/paths.h"
69 
70 #include "ootypes.h"
71 #include "ooUtils.h"
72 #include "ooCapability.h"
73 #include "oochannels.h"
74 #include "ooh323ep.h"
75 #include "ooh323cDriver.h"
76 #include "ooCalls.h"
77 #include "ooq931.h"
78 #include "ooStackCmds.h"
79 #include "ooCapability.h"
80 #include "ooGkClient.h"
81 
82 
83 struct ooh323_pvt;
84 struct ooh323_user;
85 struct ooh323_peer;
86 /* Helper functions */
87 struct ooh323_user *find_user(const char * name, const char *ip);
88 struct ooh323_peer *find_peer(const char * name, int port);
89 void ooh323_delete_peer(struct ooh323_peer *peer);
90 
91 int delete_users(void);
92 int delete_peers(void);
93 
94 int ooh323_destroy(struct ooh323_pvt *p);
95 int reload_config(int reload);
96 int restart_monitor(void);
97 
98 int configure_local_rtp(struct ooh323_pvt *p, ooCallData* call);
99 void setup_rtp_connection(ooCallData *call, const char *remoteIp,
100  int remotePort);
101 void close_rtp_connection(ooCallData *call);
102 struct ast_frame *ooh323_rtp_read
103  (struct ast_channel *ast, struct ooh323_pvt *p);
104 
105 void ooh323_set_write_format(ooCallData *call, struct ast_format *fmt, int txframes);
106 void ooh323_set_read_format(ooCallData *call, struct ast_format *fmt);
107 
108 int ooh323_convertAsteriskCapToH323Cap(struct ast_format *format);
109 
110 int ooh323_convert_hangupcause_asteriskToH323(int cause);
111 int ooh323_convert_hangupcause_h323ToAsterisk(int cause);
112 int update_our_aliases(ooCallData *call, struct ooh323_pvt *p);
113 
114 /* h323 msg callbacks */
115 int ooh323_onReceivedSetup(ooCallData *call, Q931Message *pmsg);
116 int ooh323_onReceivedDigit(OOH323CallData *call, const char* digit);
117 
118 void setup_udptl_connection(ooCallData *call, const char *remoteIp, int remotePort);
119 void close_udptl_connection(ooCallData *call);
120 
121 EXTERN char *handle_cli_ooh323_reload(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a);
122 
123 #endif
Main Channel structure associated with a channel.
Music on hold handling.
Asterisk locking-related definitions:
Asterisk main include file. File version handling, generic pbx functions.
static struct iax2_peer * find_peer(const char *name, int realtime)
Definition: chan_iax2.c:2056
CallerID (and other GR30) management and generation Includes code and algorithms from the Zapata libr...
Convenient Signal Processing routines.
descriptor for a cli entry.
Definition: cli.h:171
UDPTL support for T.38.
Definition of a media format.
Definition: format.c:43
Generic File Format Support. Should be included by clients of the file handling routines. File service providers should instead include mod_format.h.
I/O Management (derived from Cheops-NG)
Utility functions.
Media Format API.
Configuration File Parser.
General Asterisk PBX channel definitions.
Asterisk file paths, configured in asterisk.conf.
Access Control of various sorts.
Scheduler Routines (derived from cheops)
Core PBX routines and definitions.
Format Capabilities API.
The AMI - Asterisk Manager Interface - is a TCP protocol created to manage Asterisk with third-party ...
Support for logging to various files, console and syslog Configuration in file logger.conf.
Standard Command Line Interface.
Data structure associated with a single frame of data.
Internal Asterisk hangup causes.
static void delete_users(void)
Delete all users.
Options provided by main asterisk program.
Pluggable RTP Architecture.
Asterisk module definitions.
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
Media Format Cache API.