mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 01:26:58 +00:00
FS-7031 #resolve #comment [unimrcp] update library again to pull in upstream fix for --with-sofia-sip=../sofia-sip
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: mrcp_sofiasip_server_agent.h 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
* $Id: mrcp_sofiasip_server_agent.h 2252 2014-11-21 02:45:15Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#ifndef MRCP_SOFIASIP_SERVER_AGENT_H
|
||||
@@ -48,7 +48,7 @@ struct mrcp_sofia_server_config_t {
|
||||
char *origin;
|
||||
/** SIP transport */
|
||||
char *transport;
|
||||
/** Force destination ip address. Should be used only in case
|
||||
/** Force destination IP address. Should be used only in case
|
||||
SDP contains incorrect connection address (local IP address behind NAT) */
|
||||
apt_bool_t force_destination;
|
||||
/** SIP T1 timer */
|
||||
|
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: mrcp_sofiasip_client_agent.c 2225 2014-11-12 00:45:19Z achaloyan@gmail.com $
|
||||
* $Id: mrcp_sofiasip_client_agent.c 2253 2014-11-21 02:57:19Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
typedef struct mrcp_sofia_agent_t mrcp_sofia_agent_t;
|
||||
@@ -25,6 +25,7 @@ typedef struct mrcp_sofia_session_t mrcp_sofia_session_t;
|
||||
#include <sofia-sip/su.h>
|
||||
#include <sofia-sip/nua.h>
|
||||
#include <sofia-sip/sip_status.h>
|
||||
#include <sofia-sip/sip_header.h>
|
||||
#include <sofia-sip/sdp.h>
|
||||
#include <sofia-sip/tport.h>
|
||||
#include <sofia-sip/sofia_features.h>
|
||||
@@ -52,8 +53,7 @@ struct mrcp_sofia_agent_t {
|
||||
|
||||
struct mrcp_sofia_session_t {
|
||||
mrcp_session_t *session;
|
||||
mrcp_sig_settings_t *sip_settings;
|
||||
char *sip_to_str;
|
||||
const mrcp_sig_settings_t *sip_settings;
|
||||
|
||||
su_home_t *home;
|
||||
nua_handle_t *nh;
|
||||
@@ -82,7 +82,7 @@ static const mrcp_session_request_vtable_t session_request_vtable = {
|
||||
};
|
||||
|
||||
static apt_bool_t mrcp_sofia_config_validate(mrcp_sofia_agent_t *sofia_agent, mrcp_sofia_client_config_t *config, apr_pool_t *pool);
|
||||
static apt_bool_t mrcp_sofia_session_create(mrcp_session_t *session, mrcp_sig_settings_t *settings);
|
||||
static apt_bool_t mrcp_sofia_session_create(mrcp_session_t *session, const mrcp_sig_settings_t *settings);
|
||||
|
||||
static void mrcp_sofia_event_callback( nua_event_t nua_event,
|
||||
int status,
|
||||
@@ -203,26 +203,21 @@ static void mrcp_sofia_task_initialize(apt_task_t *task)
|
||||
* an incoming call, etc, occur.
|
||||
*/
|
||||
sofia_agent->nua = nua_create(
|
||||
sofia_agent->root, /* Event loop */
|
||||
mrcp_sofia_event_callback, /* Callback for processing events */
|
||||
sofia_agent, /* Additional data to pass to callback */
|
||||
NUTAG_URL(sofia_agent->sip_bind_str), /* Address to bind to */
|
||||
TAG_IF(sofia_config->tport_log == TRUE,TPTAG_LOG(1)), /* Print out SIP messages to the console */
|
||||
TAG_IF(sofia_config->tport_dump_file,TPTAG_DUMP(sofia_config->tport_dump_file)), /* Dump SIP messages to the file */
|
||||
TAG_END()); /* Last tag should always finish the sequence */
|
||||
if(sofia_agent->nua) {
|
||||
nua_set_params(
|
||||
sofia_agent->nua,
|
||||
NUTAG_AUTOANSWER(0),
|
||||
NUTAG_APPL_METHOD("OPTIONS"),
|
||||
TAG_IF(sofia_config->sip_t1,NTATAG_SIP_T1(sofia_config->sip_t1)),
|
||||
TAG_IF(sofia_config->sip_t2,NTATAG_SIP_T2(sofia_config->sip_t2)),
|
||||
TAG_IF(sofia_config->sip_t4,NTATAG_SIP_T4(sofia_config->sip_t4)),
|
||||
TAG_IF(sofia_config->sip_t1x64,NTATAG_SIP_T1X64(sofia_config->sip_t1x64)),
|
||||
SIPTAG_USER_AGENT_STR(sofia_config->user_agent_name),
|
||||
TAG_END());
|
||||
}
|
||||
else {
|
||||
sofia_agent->root, /* Event loop */
|
||||
mrcp_sofia_event_callback, /* Callback for processing events */
|
||||
sofia_agent, /* Additional data to pass to callback */
|
||||
NUTAG_URL(sofia_agent->sip_bind_str), /* Address to bind to */
|
||||
NUTAG_AUTOANSWER(0),
|
||||
NUTAG_APPL_METHOD("OPTIONS"),
|
||||
TAG_IF(sofia_config->sip_t1,NTATAG_SIP_T1(sofia_config->sip_t1)),
|
||||
TAG_IF(sofia_config->sip_t2,NTATAG_SIP_T2(sofia_config->sip_t2)),
|
||||
TAG_IF(sofia_config->sip_t4,NTATAG_SIP_T4(sofia_config->sip_t4)),
|
||||
TAG_IF(sofia_config->sip_t1x64,NTATAG_SIP_T1X64(sofia_config->sip_t1x64)),
|
||||
SIPTAG_USER_AGENT_STR(sofia_config->user_agent_name),
|
||||
TAG_IF(sofia_config->tport_log == TRUE,TPTAG_LOG(1)), /* Print out SIP messages to the console */
|
||||
TAG_IF(sofia_config->tport_dump_file,TPTAG_DUMP(sofia_config->tport_dump_file)), /* Dump SIP messages to the file */
|
||||
TAG_END()); /* Last tag should always finish the sequence */
|
||||
if(!sofia_agent->nua) {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Create NUA [%s] %s",
|
||||
apt_task_name_get(task),
|
||||
sofia_agent->sip_bind_str);
|
||||
@@ -265,8 +260,9 @@ static APR_INLINE mrcp_sofia_agent_t* mrcp_sofia_agent_get(mrcp_session_t *sessi
|
||||
return session->signaling_agent->obj;
|
||||
}
|
||||
|
||||
static apt_bool_t mrcp_sofia_session_create(mrcp_session_t *session, mrcp_sig_settings_t *settings)
|
||||
static apt_bool_t mrcp_sofia_session_create(mrcp_session_t *session, const mrcp_sig_settings_t *settings)
|
||||
{
|
||||
const char *sip_to_str;
|
||||
mrcp_sofia_agent_t *sofia_agent = mrcp_sofia_agent_get(session);
|
||||
mrcp_sofia_session_t *sofia_session;
|
||||
session->request_vtable = &session_request_vtable;
|
||||
@@ -285,13 +281,13 @@ static apt_bool_t mrcp_sofia_session_create(mrcp_session_t *session, mrcp_sig_se
|
||||
session->obj = sofia_session;
|
||||
|
||||
if(settings->user_name && *settings->user_name != '\0') {
|
||||
sofia_session->sip_to_str = apr_psprintf(session->pool,"sip:%s@%s:%hu",
|
||||
sip_to_str = apr_psprintf(session->pool,"sip:%s@%s:%hu",
|
||||
settings->user_name,
|
||||
settings->server_ip,
|
||||
settings->server_port);
|
||||
}
|
||||
else {
|
||||
sofia_session->sip_to_str = apr_psprintf(session->pool,"sip:%s:%hu",
|
||||
sip_to_str = apr_psprintf(session->pool,"sip:%s:%hu",
|
||||
settings->server_ip,
|
||||
settings->server_port);
|
||||
}
|
||||
@@ -299,7 +295,7 @@ static apt_bool_t mrcp_sofia_session_create(mrcp_session_t *session, mrcp_sig_se
|
||||
sofia_session->nh = nua_handle(
|
||||
sofia_agent->nua,
|
||||
sofia_session,
|
||||
SIPTAG_TO_STR(sofia_session->sip_to_str),
|
||||
SIPTAG_TO_STR(sip_to_str),
|
||||
SIPTAG_FROM_STR(sofia_agent->sip_from_str),
|
||||
TAG_IF(sofia_agent->sip_contact_str,SIPTAG_CONTACT_STR(sofia_agent->sip_contact_str)),
|
||||
TAG_IF(settings->feature_tags,SIPTAG_ACCEPT_CONTACT_STR(settings->feature_tags)),
|
||||
@@ -461,33 +457,21 @@ static void mrcp_sofia_on_session_redirect(
|
||||
tagi_t tags[])
|
||||
{
|
||||
mrcp_session_t *session = sofia_session->session;
|
||||
sip_to_t *sip_to;
|
||||
sip_contact_t *sip_contact;
|
||||
if(!sip) {
|
||||
if(!sip || !sip->sip_contact) {
|
||||
return;
|
||||
}
|
||||
sip_contact = sip->sip_contact;
|
||||
if(!sip_contact) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(sip_contact->m_url->url_user && *sip_contact->m_url->url_user != '\0') {
|
||||
sofia_session->sip_to_str = apr_psprintf(session->pool,"sip:%s@%s:%s",
|
||||
sip_contact->m_url->url_user,
|
||||
sip_contact->m_url->url_host,
|
||||
sip_contact->m_url->url_port);
|
||||
}
|
||||
else {
|
||||
sofia_session->sip_to_str = apr_psprintf(session->pool,"sip:%s:%s",
|
||||
sip_contact->m_url->url_host,
|
||||
sip_contact->m_url->url_port);
|
||||
}
|
||||
|
||||
apr_thread_mutex_lock(sofia_session->mutex);
|
||||
|
||||
apt_obj_log(APT_LOG_MARK,APT_PRIO_INFO,session->log_obj,"Redirect "APT_NAMESID_FMT" to %s",
|
||||
sip_to = sip_to_create(sofia_session->home, (const url_string_t *) sip_contact->m_url);
|
||||
|
||||
apt_obj_log(APT_LOG_MARK,APT_PRIO_INFO,session->log_obj,"Redirect "APT_NAMESID_FMT" to "URL_PRINT_FORMAT,
|
||||
session->name,
|
||||
MRCP_SESSION_SID(session),
|
||||
sofia_session->sip_to_str);
|
||||
MRCP_SESSION_SID(session),
|
||||
URL_PRINT_ARGS(sip_to->a_url));
|
||||
|
||||
if(sofia_session->nh) {
|
||||
nua_handle_bind(sofia_session->nh, NULL);
|
||||
@@ -498,7 +482,7 @@ static void mrcp_sofia_on_session_redirect(
|
||||
sofia_session->nh = nua_handle(
|
||||
sofia_agent->nua,
|
||||
sofia_session,
|
||||
SIPTAG_TO_STR(sofia_session->sip_to_str),
|
||||
SIPTAG_TO(sip_to),
|
||||
SIPTAG_FROM_STR(sofia_agent->sip_from_str),
|
||||
TAG_IF(sofia_agent->sip_contact_str,SIPTAG_CONTACT_STR(sofia_agent->sip_contact_str)),
|
||||
TAG_END());
|
||||
|
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: mrcp_sofiasip_server_agent.c 2221 2014-11-11 02:44:03Z achaloyan@gmail.com $
|
||||
* $Id: mrcp_sofiasip_server_agent.c 2250 2014-11-19 05:41:12Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
typedef struct mrcp_sofia_agent_t mrcp_sofia_agent_t;
|
||||
@@ -182,26 +182,21 @@ static void mrcp_sofia_task_initialize(apt_task_t *task)
|
||||
* an incoming call, etc, occur.
|
||||
*/
|
||||
sofia_agent->nua = nua_create(
|
||||
sofia_agent->root, /* Event loop */
|
||||
mrcp_sofia_event_callback, /* Callback for processing events */
|
||||
sofia_agent, /* Additional data to pass to callback */
|
||||
NUTAG_URL(sofia_agent->sip_bind_str), /* Address to bind to */
|
||||
TAG_IF(sofia_config->tport_log == TRUE,TPTAG_LOG(1)), /* Print out SIP messages to the console */
|
||||
TAG_IF(sofia_config->tport_dump_file,TPTAG_DUMP(sofia_config->tport_dump_file)), /* Dump SIP messages to the file */
|
||||
TAG_END()); /* Last tag should always finish the sequence */
|
||||
if(sofia_agent->nua) {
|
||||
nua_set_params(
|
||||
sofia_agent->nua,
|
||||
NUTAG_AUTOANSWER(0),
|
||||
NUTAG_APPL_METHOD("OPTIONS"),
|
||||
TAG_IF(sofia_config->sip_t1,NTATAG_SIP_T1(sofia_config->sip_t1)),
|
||||
TAG_IF(sofia_config->sip_t2,NTATAG_SIP_T2(sofia_config->sip_t2)),
|
||||
TAG_IF(sofia_config->sip_t4,NTATAG_SIP_T4(sofia_config->sip_t4)),
|
||||
TAG_IF(sofia_config->sip_t1x64,NTATAG_SIP_T1X64(sofia_config->sip_t1x64)),
|
||||
SIPTAG_USER_AGENT_STR(sofia_config->user_agent_name),
|
||||
TAG_END());
|
||||
}
|
||||
else {
|
||||
sofia_agent->root, /* Event loop */
|
||||
mrcp_sofia_event_callback, /* Callback for processing events */
|
||||
sofia_agent, /* Additional data to pass to callback */
|
||||
NUTAG_URL(sofia_agent->sip_bind_str), /* Address to bind to */
|
||||
NUTAG_AUTOANSWER(0),
|
||||
NUTAG_APPL_METHOD("OPTIONS"),
|
||||
TAG_IF(sofia_config->sip_t1,NTATAG_SIP_T1(sofia_config->sip_t1)),
|
||||
TAG_IF(sofia_config->sip_t2,NTATAG_SIP_T2(sofia_config->sip_t2)),
|
||||
TAG_IF(sofia_config->sip_t4,NTATAG_SIP_T4(sofia_config->sip_t4)),
|
||||
TAG_IF(sofia_config->sip_t1x64,NTATAG_SIP_T1X64(sofia_config->sip_t1x64)),
|
||||
SIPTAG_USER_AGENT_STR(sofia_config->user_agent_name),
|
||||
TAG_IF(sofia_config->tport_log == TRUE,TPTAG_LOG(1)), /* Print out SIP messages to the console */
|
||||
TAG_IF(sofia_config->tport_dump_file,TPTAG_DUMP(sofia_config->tport_dump_file)), /* Dump SIP messages to the file */
|
||||
TAG_END()); /* Last tag should always finish the sequence */
|
||||
if(!sofia_agent->nua) {
|
||||
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Create NUA [%s] %s",
|
||||
apt_task_name_get(task),
|
||||
sofia_agent->sip_bind_str);
|
||||
|
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: mrcp_unirtsp_server_agent.h 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
* $Id: mrcp_unirtsp_server_agent.h 2252 2014-11-21 02:45:15Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#ifndef MRCP_UNIRTSP_SERVER_AGENT_H
|
||||
@@ -50,7 +50,7 @@ struct rtsp_server_config_t {
|
||||
/** Number of max RTSP connections */
|
||||
apr_size_t max_connection_count;
|
||||
|
||||
/** Force destination ip address. Should be used only in case
|
||||
/** Force destination IP address. Should be used only in case
|
||||
SDP contains incorrect connection address (local IP address behind NAT) */
|
||||
apt_bool_t force_destination;
|
||||
};
|
||||
|
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: mrcp_unirtsp_client_agent.c 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
|
||||
* $Id: mrcp_unirtsp_client_agent.c 2253 2014-11-21 02:57:19Z achaloyan@gmail.com $
|
||||
*/
|
||||
|
||||
#include <apr_general.h>
|
||||
@@ -42,11 +42,11 @@ struct mrcp_unirtsp_agent_t {
|
||||
};
|
||||
|
||||
struct mrcp_unirtsp_session_t {
|
||||
mrcp_message_t *mrcp_message;
|
||||
mrcp_session_t *mrcp_session;
|
||||
rtsp_client_session_t *rtsp_session;
|
||||
mrcp_sig_settings_t *rtsp_settings;
|
||||
su_home_t *home;
|
||||
mrcp_message_t *mrcp_message;
|
||||
mrcp_session_t *mrcp_session;
|
||||
rtsp_client_session_t *rtsp_session;
|
||||
const mrcp_sig_settings_t *rtsp_settings;
|
||||
su_home_t *home;
|
||||
};
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ static const rtsp_client_vtable_t session_response_vtable = {
|
||||
mrcp_unirtsp_on_session_event
|
||||
};
|
||||
|
||||
static apt_bool_t mrcp_unirtsp_session_create(mrcp_session_t *session, mrcp_sig_settings_t *settings);
|
||||
static apt_bool_t mrcp_unirtsp_session_create(mrcp_session_t *session, const mrcp_sig_settings_t *settings);
|
||||
static apt_bool_t rtsp_config_validate(mrcp_unirtsp_agent_t *agent, rtsp_client_config_t *config, apr_pool_t *pool);
|
||||
static apt_bool_t mrcp_unirtsp_on_resource_discover(mrcp_unirtsp_agent_t *agent, mrcp_unirtsp_session_t *session, rtsp_message_t *request, rtsp_message_t *response);
|
||||
|
||||
@@ -133,7 +133,7 @@ static APR_INLINE mrcp_unirtsp_agent_t* client_agent_get(apt_task_t *task)
|
||||
return agent;
|
||||
}
|
||||
|
||||
static apt_bool_t mrcp_unirtsp_session_create(mrcp_session_t *mrcp_session, mrcp_sig_settings_t *settings)
|
||||
static apt_bool_t mrcp_unirtsp_session_create(mrcp_session_t *mrcp_session, const mrcp_sig_settings_t *settings)
|
||||
{
|
||||
mrcp_unirtsp_agent_t *agent = mrcp_session->signaling_agent->obj;
|
||||
mrcp_unirtsp_session_t *session;
|
||||
|
Reference in New Issue
Block a user