UniMRCP  1.7.0
mrcp_sig_agent.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008-2015 Arsen Chaloyan
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef MRCP_SIG_AGENT_H
18 #define MRCP_SIG_AGENT_H
19 
20 /**
21  * @file mrcp_sig_agent.h
22  * @brief Abstract MRCP Signaling Agent
23  */
24 
25 #include <apr_network_io.h>
26 #include <apr_tables.h>
27 #include "mrcp_sig_types.h"
28 #include "apt_task.h"
29 
31 
32 /** Signaling settings */
34  /** Server IP address */
35  char *server_ip;
36  /** Server port */
37  apr_port_t server_port;
38  /** Server SIP user name (v2 only) */
39  char *user_name;
40  /** Resource location (v1 only) */
42  /** Map of the MRCP resource names (v1 only) */
43  apr_table_t *resource_map;
44  /** Force destination IP address. Should be used only in case
45  SDP contains incorrect connection address (local IP address behind NAT) */
47  /** Optional feature tags */
48  char *feature_tags;
49 };
50 
51 /** MRCP signaling agent */
53  /** Agent identifier */
54  const char *id;
55  /** Memory pool to allocate memory from */
56  apr_pool_t *pool;
57  /** External object associated with agent */
58  void *obj;
59  /** Parent object (client/server) */
60  void *parent;
61  /** MRCP resource factory */
63  /** Task interface */
65  /** Task message pool used to allocate signaling agent messages */
67 
68  /** Virtual create_server_session */
69  mrcp_session_t* (*create_server_session)(mrcp_sig_agent_t *signaling_agent);
70  /** Virtual create_client_session */
71  apt_bool_t (*create_client_session)(mrcp_session_t *session, const mrcp_sig_settings_t *settings, const mrcp_session_attribs_t *attribs);
72 };
73 
74 /** Create signaling agent. */
75 MRCP_DECLARE(mrcp_sig_agent_t*) mrcp_signaling_agent_create(const char *id, void *obj, apr_pool_t *pool);
76 
77 /** Create factory of signaling agents. */
79 
80 /** Add signaling agent to factory. */
82 
83 /** Determine whether factory is empty. */
85 
86 /** Select next available signaling agent. */
88 
89 /** Allocate MRCP signaling settings. */
91 
92 
94 
95 #endif /* MRCP_SIG_AGENT_H */
#define MRCP_DECLARE(type)
Definition: mrcp.h:40
Definition: mrcp_session.h:49
mrcp_sig_settings_t * mrcp_signaling_settings_alloc(apr_pool_t *pool)
mrcp_sa_factory_t * mrcp_sa_factory_create(apr_pool_t *pool)
mrcp_sig_agent_t * mrcp_sa_factory_agent_select(mrcp_sa_factory_t *sa_factory)
apr_table_t * resource_map
Definition: mrcp_sig_agent.h:43
#define APT_END_EXTERN_C
Definition: apt.h:38
int apt_bool_t
Definition: apt.h:57
apr_port_t server_port
Definition: mrcp_sig_agent.h:37
char * feature_tags
Definition: mrcp_sig_agent.h:48
void * obj
Definition: mrcp_sig_agent.h:58
void * parent
Definition: mrcp_sig_agent.h:60
apt_task_t * task
Definition: mrcp_sig_agent.h:64
Definition: mrcp_session_descriptor.h:42
Definition: mrcp_sig_agent.h:33
struct mrcp_resource_factory_t mrcp_resource_factory_t
Definition: mrcp_types.h:76
mrcp_resource_factory_t * resource_factory
Definition: mrcp_sig_agent.h:62
apt_bool_t mrcp_sa_factory_is_empty(const mrcp_sa_factory_t *sa_factory)
#define APT_BEGIN_EXTERN_C
Definition: apt.h:36
char * resource_location
Definition: mrcp_sig_agent.h:41
MRCP Signaling Types Declaration.
Definition: mrcp_sig_agent.h:52
apt_task_msg_pool_t * msg_pool
Definition: mrcp_sig_agent.h:66
typedefAPT_BEGIN_EXTERN_C struct apt_task_t apt_task_t
Definition: apt_task.h:31
const char * id
Definition: mrcp_sig_agent.h:54
Thread Execution Abstraction.
char * server_ip
Definition: mrcp_sig_agent.h:35
apt_bool_t mrcp_sa_factory_agent_add(mrcp_sa_factory_t *sa_factory, mrcp_sig_agent_t *sig_agent)
apr_pool_t * pool
Definition: mrcp_sig_agent.h:56
apt_bool_t force_destination
Definition: mrcp_sig_agent.h:46
struct apt_task_msg_pool_t apt_task_msg_pool_t
Definition: apt_task_msg.h:50
char * user_name
Definition: mrcp_sig_agent.h:39
mrcp_sig_agent_t * mrcp_signaling_agent_create(const char *id, void *obj, apr_pool_t *pool)
struct mrcp_sa_factory_t mrcp_sa_factory_t
Definition: mrcp_sig_types.h:36