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 1750 2010-07-23 19:33:34Z 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 /** Optional feature tags */ 00050 char *feature_tags; 00051 }; 00052 00053 00054 00055 /** MRCP signaling agent */ 00056 struct mrcp_sig_agent_t { 00057 /** Agent identifier */ 00058 const char *id; 00059 /** Memory pool to allocate memory from */ 00060 apr_pool_t *pool; 00061 /** External object associated with agent */ 00062 void *obj; 00063 /** Parent object (client/server) */ 00064 void *parent; 00065 /** MRCP version */ 00066 mrcp_version_e mrcp_version; 00067 /** MRCP resource factory */ 00068 mrcp_resource_factory_t *resource_factory; 00069 /** Task interface */ 00070 apt_task_t *task; 00071 /** Task message pool used to allocate signaling agent messages */ 00072 apt_task_msg_pool_t *msg_pool; 00073 00074 /** Virtual create_server_session */ 00075 mrcp_session_t* (*create_server_session)(mrcp_sig_agent_t *signaling_agent); 00076 /** Virtual create_client_session */ 00077 apt_bool_t (*create_client_session)(mrcp_session_t *session, mrcp_sig_settings_t *settings); 00078 }; 00079 00080 /** Create signaling agent. */ 00081 MRCP_DECLARE(mrcp_sig_agent_t*) mrcp_signaling_agent_create(const char *id, void *obj, mrcp_version_e mrcp_version, apr_pool_t *pool); 00082 00083 /** Allocate MRCP signaling settings. */ 00084 MRCP_DECLARE(mrcp_sig_settings_t*) mrcp_signaling_settings_alloc(apr_pool_t *pool); 00085 00086 00087 APT_END_EXTERN_C 00088 00089 #endif /* MRCP_SIG_AGENT_H */