00001 /* 00002 * Copyright 2008-2010 Arsen Chaloyan 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 * 00016 * $Id: mrcp_sig_agent.h 1700 2010-05-21 18:56:06Z achaloyan $ 00017 */ 00018 00019 #ifndef MRCP_SIG_AGENT_H 00020 #define MRCP_SIG_AGENT_H 00021 00022 /** 00023 * @file mrcp_sig_agent.h 00024 * @brief Abstract MRCP Signaling Agent 00025 */ 00026 00027 #include <apr_network_io.h> 00028 #include <apr_tables.h> 00029 #include "mrcp_sig_types.h" 00030 #include "apt_task.h" 00031 00032 APT_BEGIN_EXTERN_C 00033 00034 /** Signaling settings */ 00035 struct mrcp_sig_settings_t { 00036 /** Server IP address */ 00037 char *server_ip; 00038 /** Server port */ 00039 apr_port_t server_port; 00040 /** Server SIP user name (v2 only) */ 00041 char *user_name; 00042 /** Resource location (v1 only) */ 00043 char *resource_location; 00044 /** Map of the MRCP resource names (v1 only) */ 00045 apr_table_t *resource_map; 00046 /** Force destination ip address. Should be used only in case 00047 SDP contains incorrect connection address (local IP address behind NAT) */ 00048 apt_bool_t force_destination; 00049 }; 00050 00051 00052 00053 /** MRCP signaling agent */ 00054 struct mrcp_sig_agent_t { 00055 /** Agent identifier */ 00056 const char *id; 00057 /** Memory pool to allocate memory from */ 00058 apr_pool_t *pool; 00059 /** External object associated with agent */ 00060 void *obj; 00061 /** Parent object (client/server) */ 00062 void *parent; 00063 /** MRCP version */ 00064 mrcp_version_e mrcp_version; 00065 /** MRCP resource factory */ 00066 mrcp_resource_factory_t *resource_factory; 00067 /** Task interface */ 00068 apt_task_t *task; 00069 /** Task message pool used to allocate signaling agent messages */ 00070 apt_task_msg_pool_t *msg_pool; 00071 00072 /** Virtual create_server_session */ 00073 mrcp_session_t* (*create_server_session)(mrcp_sig_agent_t *signaling_agent); 00074 /** Virtual create_client_session */ 00075 apt_bool_t (*create_client_session)(mrcp_session_t *session, mrcp_sig_settings_t *settings); 00076 }; 00077 00078 /** Create signaling agent. */ 00079 MRCP_DECLARE(mrcp_sig_agent_t*) mrcp_signaling_agent_create(const char *id, void *obj, mrcp_version_e mrcp_version, apr_pool_t *pool); 00080 00081 /** Allocate MRCP signaling settings. */ 00082 MRCP_DECLARE(mrcp_sig_settings_t*) mrcp_signaling_settings_alloc(apr_pool_t *pool); 00083 00084 00085 APT_END_EXTERN_C 00086 00087 #endif /* MRCP_SIG_AGENT_H */
1.6.2