Freeswitch-svn
Threads by month
- ----- 2026 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
May 2008
- 10 participants
- 495 discussions
Author: anthm
Date: Tue May 13 19:23:41 2008
New Revision: 8392
Modified:
freeswitch/trunk/conf/sip_profiles/internal.xml
Log:
fix many nat woes, see changes to default config for details
Modified: freeswitch/trunk/conf/sip_profiles/internal.xml
==============================================================================
--- freeswitch/trunk/conf/sip_profiles/internal.xml (original)
+++ freeswitch/trunk/conf/sip_profiles/internal.xml Tue May 13 19:23:41 2008
@@ -35,7 +35,6 @@
<!-- ip address to bind to -->
<param name="sip-ip" value="$${local_ip_v4}"/>
<param name="hold-music" value="$${hold_music}"/>
- <param name="apply-register-acl" value="rfc1918"/>
<param name="apply-nat-acl" value="rfc1918"/>
<!--<param name="enable-timer" value="false"/>-->
<!--<param name="enable-100rel" value="false"/>-->
1
0
[commit] r8391 - in freeswitch/trunk: conf/sip_profiles src/mod/endpoints/mod_sofia
by Freeswitch SVN 13 May '08
by Freeswitch SVN 13 May '08
13 May '08
Author: anthm
Date: Tue May 13 19:22:21 2008
New Revision: 8391
Modified:
freeswitch/trunk/conf/sip_profiles/internal.xml
freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h
freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c
freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c
freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c
Log:
fix many nat woes, see changes to default config for details
Modified: freeswitch/trunk/conf/sip_profiles/internal.xml
==============================================================================
--- freeswitch/trunk/conf/sip_profiles/internal.xml (original)
+++ freeswitch/trunk/conf/sip_profiles/internal.xml Tue May 13 19:22:21 2008
@@ -35,10 +35,12 @@
<!-- ip address to bind to -->
<param name="sip-ip" value="$${local_ip_v4}"/>
<param name="hold-music" value="$${hold_music}"/>
+ <param name="apply-register-acl" value="rfc1918"/>
+ <param name="apply-nat-acl" value="rfc1918"/>
<!--<param name="enable-timer" value="false"/>-->
<!--<param name="enable-100rel" value="false"/>-->
- <!--<param name="apply-inbound-acl" value="lan"/>-->
- <!--<param name="apply-register-acl" value="lan"/>-->
+ <!--<param name="apply-inbound-acl" value="rfc1918"/>-->
+ <!--<param name="apply-register-acl" value="rfc1918"/>-->
<!--<param name="dtmf-type" value="info"/>-->
<param name="record-template" value="$${base_dir}/recordings/${caller_id_number}.${strftime(%Y-%m-%d-%H-%M-%S)}.wav"/>
<!--enable to use presense and mwi -->
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c Tue May 13 19:22:21 2008
@@ -339,6 +339,7 @@
const char *val;
const char *b_sdp = NULL;
int is_proxy = 0;
+ char *sticky = NULL;
if (switch_test_flag(tech_pvt, TFLAG_ANS) || switch_channel_test_flag(channel, CF_OUTBOUND)) {
return SWITCH_STATUS_SUCCESS;
@@ -405,9 +406,19 @@
session_timeout = v_session_timeout;
}
}
+
+ if (switch_test_flag(tech_pvt, TFLAG_NAT) ||
+ (val = switch_channel_get_variable(channel, "sip-force-contact")) ||
+ ((val = switch_channel_get_variable(channel, "sip_sticky_contact")) && switch_true(val))) {
+ sticky = tech_pvt->record_route;
+ session_timeout = 20;
+ }
+
+
nua_respond(tech_pvt->nh, SIP_200_OK,
NUTAG_AUTOANSWER(0),
+ TAG_IF(sticky, NUTAG_PROXY(tech_pvt->record_route)),
NUTAG_SESSION_TIMER(session_timeout),
SIPTAG_CONTACT_STR(tech_pvt->reply_contact),
SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
@@ -1039,6 +1050,9 @@
break;
case SWITCH_MESSAGE_INDICATE_PROGRESS:
{
+ char *sticky = NULL;
+ const char *val = NULL;
+
if (!switch_test_flag(tech_pvt, TFLAG_ANS) && !switch_test_flag(tech_pvt, TFLAG_EARLY_MEDIA)) {
switch_set_flag_locked(tech_pvt, TFLAG_EARLY_MEDIA);
@@ -1087,9 +1101,18 @@
}
}
switch_channel_mark_pre_answered(channel);
+
+
+ if (switch_test_flag(tech_pvt, TFLAG_NAT) ||
+ (val = switch_channel_get_variable(channel, "sip-force-contact")) ||
+ ((val = switch_channel_get_variable(channel, "sip_sticky_contact")) && switch_true(val))) {
+ sticky = tech_pvt->record_route;
+ }
+
nua_respond(tech_pvt->nh,
SIP_183_SESSION_PROGRESS,
NUTAG_AUTOANSWER(0),
+ TAG_IF(sticky, NUTAG_PROXY(tech_pvt->record_route)),
SIPTAG_CONTACT_STR(tech_pvt->reply_contact),
SOATAG_REUSE_REJECTED(1),
SOATAG_ORDERED_USER(1),
@@ -1865,6 +1888,8 @@
switch_ivr_transfer_variable(session, nsession, "sip_auto_answer");
switch_ivr_transfer_variable(session, nsession, SOFIA_SIP_HEADER_PREFIX_T);
switch_ivr_transfer_variable(session, nsession, "sip_video_fmtp");
+ switch_ivr_transfer_variable(session, nsession, "sip-force-contact");
+ switch_ivr_transfer_variable(session, nsession, "sip_sticky_contact");
if (switch_core_session_compare(session, nsession)) {
/* It's another sofia channel! so lets cache what they use as a pt for telephone event so
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h Tue May 13 19:22:21 2008
@@ -172,7 +172,7 @@
TFLAG_REFER = (1 << 17),
TFLAG_NOHUP = (1 << 18),
TFLAG_XFER = (1 << 19),
- TFLAG_RESERVED = (1 << 20),
+ TFLAG_NAT = (1 << 20),
TFLAG_BUGGY_2833 = (1 << 21),
TFLAG_SIP_HOLD = (1 << 22),
TFLAG_INB_NOMEDIA = (1 << 23),
@@ -330,6 +330,8 @@
uint32_t acl_count;
char *reg_acl[SOFIA_MAX_ACL];
uint32_t reg_acl_count;
+ char *nat_acl[SOFIA_MAX_ACL];
+ uint32_t nat_acl_count;
};
@@ -394,6 +396,7 @@
char *gateway_name;
char *local_crypto_key;
char *remote_crypto_key;
+ char *record_route;
int crypto_tag;
unsigned char local_raw_key[SWITCH_RTP_MAX_CRYPTO_LEN];
unsigned char remote_raw_key[SWITCH_RTP_MAX_CRYPTO_LEN];
@@ -434,6 +437,8 @@
uint32_t video_count;
sofia_dtmf_t dtmf_type;
int q850_cause;
+ char *remote_ip;
+ int remote_port;
};
struct callback_t {
@@ -444,7 +449,8 @@
typedef enum {
REG_REGISTER,
- REG_INVITE
+ REG_AUTO_REGISTER,
+ REG_INVITE,
} sofia_regtype_t;
typedef enum {
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c Tue May 13 19:22:21 2008
@@ -1299,6 +1299,12 @@
profile->username = switch_core_strdup(profile->pool, val);
} else if (!strcasecmp(var, "context")) {
profile->context = switch_core_strdup(profile->pool, val);
+ } else if (!strcasecmp(var, "apply-nat-acl")) {
+ if (profile->acl_count < SOFIA_MAX_ACL) {
+ profile->nat_acl[profile->nat_acl_count++] = switch_core_strdup(profile->pool, val);
+ } else {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Max acl records of %d reached\n", SOFIA_MAX_ACL);
+ }
} else if (!strcasecmp(var, "apply-inbound-acl")) {
if (profile->acl_count < SOFIA_MAX_ACL) {
profile->acl[profile->acl_count++] = switch_core_strdup(profile->pool, val);
@@ -1529,6 +1535,9 @@
if (gateway) {
if (status == 200 || status == 404) {
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "ping success %s\n", gateway->name);
+ if (gateway->state == REG_STATE_FAILED) {
+ gateway->state = REG_STATE_UNREGED;
+ }
gateway->status = SOFIA_GATEWAY_UP;
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "ping failed %s\n", gateway->name);
@@ -2637,7 +2646,7 @@
uint32_t sess_max = switch_core_session_limit(0);
int is_auth = 0, calling_myself = 0;
su_addrinfo_t *my_addrinfo = msg_addrinfo(nua_current_request(nua));
-
+ int network_port = 0;
if (sess_count >= sess_max || !(profile->pflags & PFLAG_RUNNING)) {
nua_respond(nh, 503, "Maximum Calls In Progress", SIPTAG_RETRY_AFTER_STR("300"), TAG_END());
@@ -2652,6 +2661,7 @@
get_addr(network_ip, sizeof(network_ip), &((struct sockaddr_in *) my_addrinfo->ai_addr)->sin_addr);
+ network_port = ntohs(((struct sockaddr_in *) msg_addrinfo(nua_current_request(nua))->ai_addr)->sin_port);
if (profile->acl_count) {
uint32_t x = 0;
@@ -2679,8 +2689,7 @@
if ((profile->pflags & PFLAG_AUTH_CALLS) || (!(profile->pflags & PFLAG_BLIND_AUTH) && (sip->sip_proxy_authorization || sip->sip_authorization))) {
- int rport = ntohs(((struct sockaddr_in *) msg_addrinfo(nua_current_request(nua))->ai_addr)->sin_port);
- if (!strcmp(network_ip, profile->sipip) && rport == profile->sip_port) {
+ if (!strcmp(network_ip, profile->sipip) && network_port == profile->sip_port) {
calling_myself++;
} else {
if (sofia_reg_handle_register(nua, profile, nh, sip, REG_INVITE, key, sizeof(key), &v_event)) {
@@ -2714,6 +2723,16 @@
}
switch_mutex_init(&tech_pvt->flag_mutex, SWITCH_MUTEX_NESTED, switch_core_session_get_pool(session));
+ tech_pvt->remote_ip = switch_core_session_strdup(session, network_ip);
+ tech_pvt->remote_port = network_port;
+
+ if (sip->sip_contact && sip->sip_contact->m_url) {
+ tech_pvt->record_route = switch_core_session_sprintf(session, "sip:%s@%s:%d",
+ sip->sip_contact->m_url->url_user,
+ tech_pvt->remote_ip,
+ tech_pvt->remote_port);
+ }
+
if (*key != '\0') {
tech_pvt->key = switch_core_session_strdup(session, key);
}
@@ -3127,6 +3146,34 @@
switch_assert(sql);
sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE);
}
+
+
+ if (profile->nat_acl_count) {
+ uint32_t x = 0;
+ int ok = 1;
+ char *last_acl = NULL;
+ const char *contact_host = NULL;
+
+ if (sip && sip->sip_contact && sip->sip_contact->m_url && sip->sip_contact->m_url->url_host) {
+ contact_host = sip->sip_contact->m_url->url_host;
+ }
+ if (contact_host) {
+ for (x = 0 ; x < profile->nat_acl_count; x++) {
+ last_acl = profile->nat_acl[x];
+ if (!(ok = switch_check_network_list_ip(contact_host, last_acl))) {
+ break;
+ }
+ }
+
+ if (ok) {
+ switch_set_flag(tech_pvt, TFLAG_NAT);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Setting NAT mode based on acl %s\n", last_acl);
+ }
+ }
+ }
+
+
+
return;
}
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c Tue May 13 19:22:21 2008
@@ -868,6 +868,7 @@
uint32_t session_timeout = 0;
const char *val;
const char *rep;
+ char *sticky;
rep = switch_channel_get_variable(channel, SOFIA_REPLACES_HEADER);
@@ -1001,6 +1002,17 @@
TAG_END());
+ if (switch_test_flag(tech_pvt, TFLAG_NAT) ||
+ (val = switch_channel_get_variable(channel, "sip-force-contact")) ||
+ ((val = switch_channel_get_variable(channel, "sip_sticky_contact")) && switch_true(val))) {
+ tech_pvt->record_route = switch_core_session_strdup(tech_pvt->session, url_str);
+ sticky = tech_pvt->record_route;
+ session_timeout = 20;
+ }
+
+
+
+
/* TODO: We should use the new tags for making an rpid and add profile options to turn this on/off */
if (switch_test_flag(caller_profile, SWITCH_CPF_HIDE_NAME)) {
priv = "name";
@@ -1091,6 +1103,7 @@
sofia_glue_tech_patch_sdp(tech_pvt);
}
+
nua_invite(tech_pvt->nh,
NUTAG_AUTOANSWER(0),
NUTAG_SESSION_TIMER(session_timeout),
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_reg.c Tue May 13 19:22:21 2008
@@ -495,7 +495,8 @@
authorization = sip->sip_proxy_authorization;
}
- if (regtype == REG_REGISTER && (profile->pflags & PFLAG_BLIND_REG)) {
+ if (regtype == REG_AUTO_REGISTER || (regtype == REG_REGISTER && (profile->pflags & PFLAG_BLIND_REG))) {
+ regtype = REG_REGISTER;
goto reg;
}
@@ -716,19 +717,29 @@
switch_event_t *v_event = NULL;
char network_ip[80];
su_addrinfo_t *my_addrinfo = msg_addrinfo(nua_current_request(nua));
-
+ sofia_regtype_t type = REG_REGISTER;
+
if (profile->reg_acl_count) {
uint32_t x = 0;
+ int ok = 1;
+ char *last_acl = NULL;
get_addr(network_ip, sizeof(network_ip), &((struct sockaddr_in *) my_addrinfo->ai_addr)->sin_addr);
-
+
for (x = 0 ; x < profile->reg_acl_count; x++) {
- if (!switch_check_network_list_ip(network_ip, profile->reg_acl[x])) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "IP %s Rejected by acl %s\n", network_ip, profile->reg_acl[x]);
- nua_respond(nh, SIP_403_FORBIDDEN, NUTAG_WITH_THIS(nua), TAG_END());
- goto end;
+ last_acl = profile->reg_acl[x];
+ if (!(ok = switch_check_network_list_ip(network_ip, last_acl))) {
+ break;
}
}
+
+ if (ok && !(profile->pflags & PFLAG_BLIND_REG)) {
+ type = REG_AUTO_REGISTER;
+ } else if (!ok) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "IP %s Rejected by acl %s\n", network_ip, profile->reg_acl[x]);
+ nua_respond(nh, SIP_403_FORBIDDEN, NUTAG_WITH_THIS(nua), TAG_END());
+ goto end;
+ }
}
@@ -749,7 +760,7 @@
goto end;
}
- sofia_reg_handle_register(nua, profile, nh, sip, REG_REGISTER, key, sizeof(key), &v_event);
+ sofia_reg_handle_register(nua, profile, nh, sip, type, key, sizeof(key), &v_event);
if (v_event) {
switch_event_fire(&v_event);
1
0
Author: stkn
Date: Tue May 13 18:02:50 2008
New Revision: 8390
Modified:
freeswitch/trunk/libs/libedit/src/makelist
Log:
Better fix for the tr issue on solaris: force the C locale for the tr call since the issue is cause by the system using utf8 (or any other multibyte locale)
Modified: freeswitch/trunk/libs/libedit/src/makelist
==============================================================================
--- freeswitch/trunk/libs/libedit/src/makelist (original)
+++ freeswitch/trunk/libs/libedit/src/makelist Tue May 13 18:02:50 2008
@@ -36,13 +36,6 @@
# makelist.sh: Automatically generate header files...
AWK=awk
-TR=tr
-
-# workaround for solaris
-if [ -x /usr/xpg4/bin/tr ]
-then
- TR=/usr/xpg4/bin/tr
-fi
USAGE="Usage: $0 -h|-e|-fc|-fh|-bc|-bh|-m <filenames>"
@@ -148,7 +141,7 @@
#
-fh)
cat $FILES | $AWK '/el_action_t/ { print $3 }' | \
- sort | $TR '[:lower:]' '[:upper:]' | $AWK '
+ sort | LANG=C tr '[:lower:]' '[:upper:]' | $AWK '
BEGIN {
printf("/* Automatically generated file, do not edit */\n");
printf("#ifndef _h_fcns_c\n#define _h_fcns_c\n");
1
0
Author: stkn
Date: Tue May 13 17:39:41 2008
New Revision: 8389
Modified:
freeswitch/trunk/libs/libedit/src/makelist
Log:
Fix libedit build on solaris (add workaround to libedit/src/makelist to use /usr/xpg4/bin/tr which properly supports [:lower:] [:upper:])
Modified: freeswitch/trunk/libs/libedit/src/makelist
==============================================================================
--- freeswitch/trunk/libs/libedit/src/makelist (original)
+++ freeswitch/trunk/libs/libedit/src/makelist Tue May 13 17:39:41 2008
@@ -36,6 +36,14 @@
# makelist.sh: Automatically generate header files...
AWK=awk
+TR=tr
+
+# workaround for solaris
+if [ -x /usr/xpg4/bin/tr ]
+then
+ TR=/usr/xpg4/bin/tr
+fi
+
USAGE="Usage: $0 -h|-e|-fc|-fh|-bc|-bh|-m <filenames>"
if [ "x$1" = "x" ]
@@ -140,7 +148,7 @@
#
-fh)
cat $FILES | $AWK '/el_action_t/ { print $3 }' | \
- sort | tr '[:lower:]' '[:upper:]' | $AWK '
+ sort | $TR '[:lower:]' '[:upper:]' | $AWK '
BEGIN {
printf("/* Automatically generated file, do not edit */\n");
printf("#ifndef _h_fcns_c\n#define _h_fcns_c\n");
1
0
Author: anthm
Date: Tue May 13 17:07:01 2008
New Revision: 8388
Modified:
freeswitch/trunk/src/include/switch_cpp.h
Log:
update
Modified: freeswitch/trunk/src/include/switch_cpp.h
==============================================================================
--- freeswitch/trunk/src/include/switch_cpp.h (original)
+++ freeswitch/trunk/src/include/switch_cpp.h Tue May 13 17:07:01 2008
@@ -191,8 +191,8 @@
SWITCH_DECLARE(void *)getPrivate(char *var);
SWITCH_DECLARE(const char *)getVariable(char *var);
SWITCH_DECLARE(switch_status_t) process_callback_result(char *ret);
- SWITCH_DECLARE(void) CoreSession::say(const char *tosay, const char *module_name, const char *say_type, const char *say_method);
- SWITCH_DECLARE(void) CoreSession::sayPhrase(const char *phrase_name, const char *phrase_data = "", const char *phrase_lang = NULL);
+ SWITCH_DECLARE(void) say(const char *tosay, const char *module_name, const char *say_type, const char *say_method);
+ SWITCH_DECLARE(void) sayPhrase(const char *phrase_name, const char *phrase_data = "", const char *phrase_lang = NULL);
/** \brief Record to a file
* \param filename
1
0
13 May '08
Author: anthm
Date: Tue May 13 16:58:38 2008
New Revision: 8387
Modified:
freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c
Log:
when you have both auth-calls and inbound-acl at the same time passing acl lets you in with no challenge and failing gives you auth challenge
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c Tue May 13 16:58:38 2008
@@ -2655,11 +2655,24 @@
if (profile->acl_count) {
uint32_t x = 0;
+ int ok = 1;
+ char *last_acl = NULL;
+
for (x = 0 ; x < profile->acl_count; x++) {
- if (!switch_check_network_list_ip(network_ip, profile->acl[x])) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "IP %s Rejected by acl %s\n", network_ip, profile->acl[x]);
+ last_acl = profile->acl[x];
+ if (!(ok = switch_check_network_list_ip(network_ip, last_acl))) {
+ break;
+ }
+ }
+
+ if (!ok) {
+ if (!(profile->pflags & PFLAG_AUTH_CALLS)) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "IP %s Rejected by acl %s\n", network_ip, switch_str_nil(last_acl));
nua_respond(nh, SIP_403_FORBIDDEN, TAG_END());
return;
+ } else {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "IP %s Rejected by acl %s. Falling back to Digest auth.\n",
+ network_ip, switch_str_nil(last_acl));
}
}
}
1
0
[commit] r8386 - in freeswitch/trunk/src: . include include/private mod/endpoints/mod_sofia mod/languages/mod_java mod/languages/mod_java/src/org/freeswitch/swig mod/languages/mod_lua mod/languages/mod_perl mod/languages/mod_python
by Freeswitch SVN 13 May '08
by Freeswitch SVN 13 May '08
13 May '08
Author: anthm
Date: Tue May 13 16:36:23 2008
New Revision: 8386
Modified:
freeswitch/trunk/src/include/private/switch_core_pvt.h
freeswitch/trunk/src/include/switch_channel.h
freeswitch/trunk/src/include/switch_cpp.h
freeswitch/trunk/src/include/switch_rtp.h
freeswitch/trunk/src/include/switch_types.h
freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
freeswitch/trunk/src/mod/languages/mod_java/src/org/freeswitch/swig/CoreSession.java
freeswitch/trunk/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java
freeswitch/trunk/src/mod/languages/mod_java/switch_swig_wrap.cpp
freeswitch/trunk/src/mod/languages/mod_lua/mod_lua_wrap.cpp
freeswitch/trunk/src/mod/languages/mod_perl/freeswitch.pm
freeswitch/trunk/src/mod/languages/mod_perl/mod_perl_wrap.cpp
freeswitch/trunk/src/mod/languages/mod_python/freeswitch.py
freeswitch/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp
freeswitch/trunk/src/switch_channel.c
freeswitch/trunk/src/switch_core_io.c
freeswitch/trunk/src/switch_core_session.c
freeswitch/trunk/src/switch_cpp.cpp
freeswitch/trunk/src/switch_rtp.c
Log:
cannot pass 2833 on a transcoded call
Modified: freeswitch/trunk/src/include/private/switch_core_pvt.h
==============================================================================
--- freeswitch/trunk/src/include/private/switch_core_pvt.h (original)
+++ freeswitch/trunk/src/include/private/switch_core_pvt.h Tue May 13 16:36:23 2008
@@ -85,7 +85,8 @@
typedef enum {
SSF_NONE = 0,
- SSF_DESTROYED = (1 << 0)
+ SSF_DESTROYED = (1 << 0),
+ SSF_WARN_TRANSCODE = (1 << 1)
} switch_session_flag_t;
Modified: freeswitch/trunk/src/include/switch_channel.h
==============================================================================
--- freeswitch/trunk/src/include/switch_channel.h (original)
+++ freeswitch/trunk/src/include/switch_channel.h Tue May 13 16:36:23 2008
@@ -254,7 +254,7 @@
\param flags or'd list of channel flags to test
\return TRUE if flags were present
*/
-SWITCH_DECLARE(int) switch_channel_test_flag(switch_channel_t *channel, switch_channel_flag_t flags);
+SWITCH_DECLARE(uint32_t) switch_channel_test_flag(switch_channel_t *channel, switch_channel_flag_t flags);
/*!
\brief Set given flag(s) on a given channel
Modified: freeswitch/trunk/src/include/switch_cpp.h
==============================================================================
--- freeswitch/trunk/src/include/switch_cpp.h (original)
+++ freeswitch/trunk/src/include/switch_cpp.h Tue May 13 16:36:23 2008
@@ -191,6 +191,8 @@
SWITCH_DECLARE(void *)getPrivate(char *var);
SWITCH_DECLARE(const char *)getVariable(char *var);
SWITCH_DECLARE(switch_status_t) process_callback_result(char *ret);
+ SWITCH_DECLARE(void) CoreSession::say(const char *tosay, const char *module_name, const char *say_type, const char *say_method);
+ SWITCH_DECLARE(void) CoreSession::sayPhrase(const char *phrase_name, const char *phrase_data = "", const char *phrase_lang = NULL);
/** \brief Record to a file
* \param filename
Modified: freeswitch/trunk/src/include/switch_rtp.h
==============================================================================
--- freeswitch/trunk/src/include/switch_rtp.h (original)
+++ freeswitch/trunk/src/include/switch_rtp.h Tue May 13 16:36:23 2008
@@ -233,7 +233,7 @@
\param flags the flags to test
\return TRUE or FALSE
*/
-SWITCH_DECLARE(uint8_t) switch_rtp_test_flag(switch_rtp_t *rtp_session, switch_rtp_flag_t flags);
+SWITCH_DECLARE(uint32_t) switch_rtp_test_flag(switch_rtp_t *rtp_session, switch_rtp_flag_t flags);
/*!
\brief Clear an RTP Flag
Modified: freeswitch/trunk/src/include/switch_types.h
==============================================================================
--- freeswitch/trunk/src/include/switch_types.h (original)
+++ freeswitch/trunk/src/include/switch_types.h Tue May 13 16:36:23 2008
@@ -513,7 +513,8 @@
SWITCH_MESSAGE_INDICATE_MEDIA_REDIRECT,
SWITCH_MESSAGE_INDICATE_DEFLECT,
SWITCH_MESSAGE_INDICATE_VIDEO_REFRESH_REQ,
- SWITCH_MESSAGE_INDICATE_DISPLAY
+ SWITCH_MESSAGE_INDICATE_DISPLAY,
+ SWITCH_MESSAGE_INDICATE_TRANSCODING_NECESSARY
} switch_core_session_message_types_t;
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c Tue May 13 16:36:23 2008
@@ -752,6 +752,12 @@
}
break;
+ case SWITCH_MESSAGE_INDICATE_TRANSCODING_NECESSARY:
+ if (tech_pvt->rtp_session && switch_rtp_test_flag(tech_pvt->rtp_session, SWITCH_RTP_FLAG_PASS_RFC2833)) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Cannot pass 2833 on a transcoded call.\n");
+ switch_rtp_clear_flag(tech_pvt->rtp_session, SWITCH_RTP_FLAG_PASS_RFC2833);
+ }
+ break;
case SWITCH_MESSAGE_INDICATE_BROADCAST: {
const char *ip = NULL, *port = NULL;
ip = switch_channel_get_variable(channel, SWITCH_REMOTE_MEDIA_IP_VARIABLE);
Modified: freeswitch/trunk/src/mod/languages/mod_java/src/org/freeswitch/swig/CoreSession.java
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_java/src/org/freeswitch/swig/CoreSession.java (original)
+++ freeswitch/trunk/src/mod/languages/mod_java/src/org/freeswitch/swig/CoreSession.java Tue May 13 16:36:23 2008
@@ -121,6 +121,22 @@
return new SWIGTYPE_p_switch_status_t(freeswitchJNI.CoreSession_process_callback_result(swigCPtr, this, ret), true);
}
+ public void say(String tosay, String module_name, String say_type, String say_method) {
+ freeswitchJNI.CoreSession_say(swigCPtr, this, tosay, module_name, say_type, say_method);
+ }
+
+ public void sayPhrase(String phrase_name, String phrase_data, String phrase_lang) {
+ freeswitchJNI.CoreSession_sayPhrase__SWIG_0(swigCPtr, this, phrase_name, phrase_data, phrase_lang);
+ }
+
+ public void sayPhrase(String phrase_name, String phrase_data) {
+ freeswitchJNI.CoreSession_sayPhrase__SWIG_1(swigCPtr, this, phrase_name, phrase_data);
+ }
+
+ public void sayPhrase(String phrase_name) {
+ freeswitchJNI.CoreSession_sayPhrase__SWIG_2(swigCPtr, this, phrase_name);
+ }
+
public int recordFile(String file_name, int max_len, int silence_threshold, int silence_secs) {
return freeswitchJNI.CoreSession_recordFile__SWIG_0(swigCPtr, this, file_name, max_len, silence_threshold, silence_secs);
}
Modified: freeswitch/trunk/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java (original)
+++ freeswitch/trunk/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java Tue May 13 16:36:23 2008
@@ -81,6 +81,10 @@
public final static native long CoreSession_getPrivate(long jarg1, CoreSession jarg1_, String jarg2);
public final static native String CoreSession_getVariable(long jarg1, CoreSession jarg1_, String jarg2);
public final static native long CoreSession_process_callback_result(long jarg1, CoreSession jarg1_, String jarg2);
+ public final static native void CoreSession_say(long jarg1, CoreSession jarg1_, String jarg2, String jarg3, String jarg4, String jarg5);
+ public final static native void CoreSession_sayPhrase__SWIG_0(long jarg1, CoreSession jarg1_, String jarg2, String jarg3, String jarg4);
+ public final static native void CoreSession_sayPhrase__SWIG_1(long jarg1, CoreSession jarg1_, String jarg2, String jarg3);
+ public final static native void CoreSession_sayPhrase__SWIG_2(long jarg1, CoreSession jarg1_, String jarg2);
public final static native int CoreSession_recordFile__SWIG_0(long jarg1, CoreSession jarg1_, String jarg2, int jarg3, int jarg4, int jarg5);
public final static native int CoreSession_recordFile__SWIG_1(long jarg1, CoreSession jarg1_, String jarg2, int jarg3, int jarg4);
public final static native int CoreSession_recordFile__SWIG_2(long jarg1, CoreSession jarg1_, String jarg2, int jarg3);
Modified: freeswitch/trunk/src/mod/languages/mod_java/switch_swig_wrap.cpp
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_java/switch_swig_wrap.cpp (original)
+++ freeswitch/trunk/src/mod/languages/mod_java/switch_swig_wrap.cpp Tue May 13 16:36:23 2008
@@ -1475,6 +1475,120 @@
}
+SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1say(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jstring jarg3, jstring jarg4, jstring jarg5) {
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) 0 ;
+ char *arg4 = (char *) 0 ;
+ char *arg5 = (char *) 0 ;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(CoreSession **)&jarg1;
+ arg2 = 0;
+ if (jarg2) {
+ arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0);
+ if (!arg2) return ;
+ }
+ arg3 = 0;
+ if (jarg3) {
+ arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0);
+ if (!arg3) return ;
+ }
+ arg4 = 0;
+ if (jarg4) {
+ arg4 = (char *)jenv->GetStringUTFChars(jarg4, 0);
+ if (!arg4) return ;
+ }
+ arg5 = 0;
+ if (jarg5) {
+ arg5 = (char *)jenv->GetStringUTFChars(jarg5, 0);
+ if (!arg5) return ;
+ }
+ (arg1)->say((char const *)arg2,(char const *)arg3,(char const *)arg4,(char const *)arg5);
+ if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2);
+ if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3);
+ if (arg4) jenv->ReleaseStringUTFChars(jarg4, (const char *)arg4);
+ if (arg5) jenv->ReleaseStringUTFChars(jarg5, (const char *)arg5);
+}
+
+
+SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1sayPhrase_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jstring jarg3, jstring jarg4) {
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) 0 ;
+ char *arg4 = (char *) 0 ;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(CoreSession **)&jarg1;
+ arg2 = 0;
+ if (jarg2) {
+ arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0);
+ if (!arg2) return ;
+ }
+ arg3 = 0;
+ if (jarg3) {
+ arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0);
+ if (!arg3) return ;
+ }
+ arg4 = 0;
+ if (jarg4) {
+ arg4 = (char *)jenv->GetStringUTFChars(jarg4, 0);
+ if (!arg4) return ;
+ }
+ (arg1)->sayPhrase((char const *)arg2,(char const *)arg3,(char const *)arg4);
+ if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2);
+ if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3);
+ if (arg4) jenv->ReleaseStringUTFChars(jarg4, (const char *)arg4);
+}
+
+
+SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1sayPhrase_1_1SWIG_11(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jstring jarg3) {
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) 0 ;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(CoreSession **)&jarg1;
+ arg2 = 0;
+ if (jarg2) {
+ arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0);
+ if (!arg2) return ;
+ }
+ arg3 = 0;
+ if (jarg3) {
+ arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0);
+ if (!arg3) return ;
+ }
+ (arg1)->sayPhrase((char const *)arg2,(char const *)arg3);
+ if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2);
+ if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3);
+}
+
+
+SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1sayPhrase_1_1SWIG_12(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) {
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(CoreSession **)&jarg1;
+ arg2 = 0;
+ if (jarg2) {
+ arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0);
+ if (!arg2) return ;
+ }
+ (arg1)->sayPhrase((char const *)arg2);
+ if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2);
+}
+
+
SWIGEXPORT jint JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1recordFile_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jint jarg3, jint jarg4, jint jarg5) {
jint jresult = 0 ;
CoreSession *arg1 = (CoreSession *) 0 ;
Modified: freeswitch/trunk/src/mod/languages/mod_lua/mod_lua_wrap.cpp
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_lua/mod_lua_wrap.cpp (original)
+++ freeswitch/trunk/src/mod/languages/mod_lua/mod_lua_wrap.cpp Tue May 13 16:36:23 2008
@@ -3750,6 +3750,217 @@
}
+static int _wrap_CoreSession_say(lua_State* L) {
+ int SWIG_arg = -1;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) 0 ;
+ char *arg4 = (char *) 0 ;
+ char *arg5 = (char *) 0 ;
+
+ SWIG_check_num_args("say",5,5)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("say",1,"CoreSession *");
+ if(!lua_isstring(L,2)) SWIG_fail_arg("say",2,"char const *");
+ if(!lua_isstring(L,3)) SWIG_fail_arg("say",3,"char const *");
+ if(!lua_isstring(L,4)) SWIG_fail_arg("say",4,"char const *");
+ if(!lua_isstring(L,5)) SWIG_fail_arg("say",5,"char const *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
+ SWIG_fail_ptr("CoreSession_say",1,SWIGTYPE_p_CoreSession);
+ }
+
+ arg2 = (char *)lua_tostring(L, 2);
+ arg3 = (char *)lua_tostring(L, 3);
+ arg4 = (char *)lua_tostring(L, 4);
+ arg5 = (char *)lua_tostring(L, 5);
+ (arg1)->say((char const *)arg2,(char const *)arg3,(char const *)arg4,(char const *)arg5);
+ SWIG_arg=0;
+
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_CoreSession_sayPhrase__SWIG_0(lua_State* L) {
+ int SWIG_arg = -1;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) 0 ;
+ char *arg4 = (char *) 0 ;
+
+ SWIG_check_num_args("sayPhrase",4,4)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("sayPhrase",1,"CoreSession *");
+ if(!lua_isstring(L,2)) SWIG_fail_arg("sayPhrase",2,"char const *");
+ if(!lua_isstring(L,3)) SWIG_fail_arg("sayPhrase",3,"char const *");
+ if(!lua_isstring(L,4)) SWIG_fail_arg("sayPhrase",4,"char const *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
+ SWIG_fail_ptr("CoreSession_sayPhrase",1,SWIGTYPE_p_CoreSession);
+ }
+
+ arg2 = (char *)lua_tostring(L, 2);
+ arg3 = (char *)lua_tostring(L, 3);
+ arg4 = (char *)lua_tostring(L, 4);
+ (arg1)->sayPhrase((char const *)arg2,(char const *)arg3,(char const *)arg4);
+ SWIG_arg=0;
+
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_CoreSession_sayPhrase__SWIG_1(lua_State* L) {
+ int SWIG_arg = -1;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) 0 ;
+
+ SWIG_check_num_args("sayPhrase",3,3)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("sayPhrase",1,"CoreSession *");
+ if(!lua_isstring(L,2)) SWIG_fail_arg("sayPhrase",2,"char const *");
+ if(!lua_isstring(L,3)) SWIG_fail_arg("sayPhrase",3,"char const *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
+ SWIG_fail_ptr("CoreSession_sayPhrase",1,SWIGTYPE_p_CoreSession);
+ }
+
+ arg2 = (char *)lua_tostring(L, 2);
+ arg3 = (char *)lua_tostring(L, 3);
+ (arg1)->sayPhrase((char const *)arg2,(char const *)arg3);
+ SWIG_arg=0;
+
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_CoreSession_sayPhrase__SWIG_2(lua_State* L) {
+ int SWIG_arg = -1;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+
+ SWIG_check_num_args("sayPhrase",2,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("sayPhrase",1,"CoreSession *");
+ if(!lua_isstring(L,2)) SWIG_fail_arg("sayPhrase",2,"char const *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
+ SWIG_fail_ptr("CoreSession_sayPhrase",1,SWIGTYPE_p_CoreSession);
+ }
+
+ arg2 = (char *)lua_tostring(L, 2);
+ (arg1)->sayPhrase((char const *)arg2);
+ SWIG_arg=0;
+
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_CoreSession_sayPhrase(lua_State* L) {
+ int argc;
+ int argv[5]={
+ 1,2,3,4,5
+ };
+
+ argc = lua_gettop(L);
+ if (argc == 2) {
+ int _v;
+ {
+ void *ptr;
+ if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_CoreSession, 0)) {
+ _v = 0;
+ } else {
+ _v = 1;
+ }
+ }
+ if (_v) {
+ {
+ _v = lua_isstring(L,argv[1]);
+ }
+ if (_v) {
+ return _wrap_CoreSession_sayPhrase__SWIG_2(L);
+ }
+ }
+ }
+ if (argc == 3) {
+ int _v;
+ {
+ void *ptr;
+ if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_CoreSession, 0)) {
+ _v = 0;
+ } else {
+ _v = 1;
+ }
+ }
+ if (_v) {
+ {
+ _v = lua_isstring(L,argv[1]);
+ }
+ if (_v) {
+ {
+ _v = lua_isstring(L,argv[2]);
+ }
+ if (_v) {
+ return _wrap_CoreSession_sayPhrase__SWIG_1(L);
+ }
+ }
+ }
+ }
+ if (argc == 4) {
+ int _v;
+ {
+ void *ptr;
+ if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_CoreSession, 0)) {
+ _v = 0;
+ } else {
+ _v = 1;
+ }
+ }
+ if (_v) {
+ {
+ _v = lua_isstring(L,argv[1]);
+ }
+ if (_v) {
+ {
+ _v = lua_isstring(L,argv[2]);
+ }
+ if (_v) {
+ {
+ _v = lua_isstring(L,argv[3]);
+ }
+ if (_v) {
+ return _wrap_CoreSession_sayPhrase__SWIG_0(L);
+ }
+ }
+ }
+ }
+ }
+
+ lua_pushstring(L,"No matching function for overloaded 'CoreSession_sayPhrase'");
+ lua_error(L);return 0;
+}
+
+
static int _wrap_CoreSession_recordFile__SWIG_0(lua_State* L) {
int SWIG_arg = -1;
CoreSession *arg1 = (CoreSession *) 0 ;
@@ -4993,6 +5204,8 @@
{"getPrivate", _wrap_CoreSession_getPrivate},
{"getVariable", _wrap_CoreSession_getVariable},
{"process_callback_result", _wrap_CoreSession_process_callback_result},
+ {"say", _wrap_CoreSession_say},
+ {"sayPhrase", _wrap_CoreSession_sayPhrase},
{"recordFile", _wrap_CoreSession_recordFile},
{"setCallerData", _wrap_CoreSession_setCallerData},
{"originate", _wrap_CoreSession_originate},
Modified: freeswitch/trunk/src/mod/languages/mod_perl/freeswitch.pm
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_perl/freeswitch.pm (original)
+++ freeswitch/trunk/src/mod/languages/mod_perl/freeswitch.pm Tue May 13 16:36:23 2008
@@ -308,6 +308,8 @@
*getPrivate = *freeswitchc::CoreSession_getPrivate;
*getVariable = *freeswitchc::CoreSession_getVariable;
*process_callback_result = *freeswitchc::CoreSession_process_callback_result;
+*say = *freeswitchc::CoreSession_say;
+*sayPhrase = *freeswitchc::CoreSession_sayPhrase;
*recordFile = *freeswitchc::CoreSession_recordFile;
*setCallerData = *freeswitchc::CoreSession_setCallerData;
*originate = *freeswitchc::CoreSession_originate;
Modified: freeswitch/trunk/src/mod/languages/mod_perl/mod_perl_wrap.cpp
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_perl/mod_perl_wrap.cpp (original)
+++ freeswitch/trunk/src/mod/languages/mod_perl/mod_perl_wrap.cpp Tue May 13 16:36:23 2008
@@ -4700,6 +4700,357 @@
}
+XS(_wrap_CoreSession_say) {
+ {
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) 0 ;
+ char *arg4 = (char *) 0 ;
+ char *arg5 = (char *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ int res3 ;
+ char *buf3 = 0 ;
+ int alloc3 = 0 ;
+ int res4 ;
+ char *buf4 = 0 ;
+ int alloc4 = 0 ;
+ int res5 ;
+ char *buf5 = 0 ;
+ int alloc5 = 0 ;
+ int argvi = 0;
+ dXSARGS;
+
+ if ((items < 5) || (items > 5)) {
+ SWIG_croak("Usage: CoreSession_say(self,tosay,module_name,say_type,say_method);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_say" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_say" "', argument " "2"" of type '" "char const *""'");
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CoreSession_say" "', argument " "3"" of type '" "char const *""'");
+ }
+ arg3 = reinterpret_cast< char * >(buf3);
+ res4 = SWIG_AsCharPtrAndSize(ST(3), &buf4, NULL, &alloc4);
+ if (!SWIG_IsOK(res4)) {
+ SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CoreSession_say" "', argument " "4"" of type '" "char const *""'");
+ }
+ arg4 = reinterpret_cast< char * >(buf4);
+ res5 = SWIG_AsCharPtrAndSize(ST(4), &buf5, NULL, &alloc5);
+ if (!SWIG_IsOK(res5)) {
+ SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CoreSession_say" "', argument " "5"" of type '" "char const *""'");
+ }
+ arg5 = reinterpret_cast< char * >(buf5);
+ (arg1)->say((char const *)arg2,(char const *)arg3,(char const *)arg4,(char const *)arg5);
+
+
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
+ if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
+ if (alloc5 == SWIG_NEWOBJ) delete[] buf5;
+ XSRETURN(argvi);
+ fail:
+
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
+ if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
+ if (alloc5 == SWIG_NEWOBJ) delete[] buf5;
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_CoreSession_sayPhrase__SWIG_0) {
+ {
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) 0 ;
+ char *arg4 = (char *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ int res3 ;
+ char *buf3 = 0 ;
+ int alloc3 = 0 ;
+ int res4 ;
+ char *buf4 = 0 ;
+ int alloc4 = 0 ;
+ int argvi = 0;
+ dXSARGS;
+
+ if ((items < 4) || (items > 4)) {
+ SWIG_croak("Usage: CoreSession_sayPhrase(self,phrase_name,phrase_data,phrase_lang);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_sayPhrase" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_sayPhrase" "', argument " "2"" of type '" "char const *""'");
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CoreSession_sayPhrase" "', argument " "3"" of type '" "char const *""'");
+ }
+ arg3 = reinterpret_cast< char * >(buf3);
+ res4 = SWIG_AsCharPtrAndSize(ST(3), &buf4, NULL, &alloc4);
+ if (!SWIG_IsOK(res4)) {
+ SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CoreSession_sayPhrase" "', argument " "4"" of type '" "char const *""'");
+ }
+ arg4 = reinterpret_cast< char * >(buf4);
+ (arg1)->sayPhrase((char const *)arg2,(char const *)arg3,(char const *)arg4);
+
+
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
+ if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
+ XSRETURN(argvi);
+ fail:
+
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
+ if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_CoreSession_sayPhrase__SWIG_1) {
+ {
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ int res3 ;
+ char *buf3 = 0 ;
+ int alloc3 = 0 ;
+ int argvi = 0;
+ dXSARGS;
+
+ if ((items < 3) || (items > 3)) {
+ SWIG_croak("Usage: CoreSession_sayPhrase(self,phrase_name,phrase_data);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_sayPhrase" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_sayPhrase" "', argument " "2"" of type '" "char const *""'");
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CoreSession_sayPhrase" "', argument " "3"" of type '" "char const *""'");
+ }
+ arg3 = reinterpret_cast< char * >(buf3);
+ (arg1)->sayPhrase((char const *)arg2,(char const *)arg3);
+
+
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
+ XSRETURN(argvi);
+ fail:
+
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_CoreSession_sayPhrase__SWIG_2) {
+ {
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ int argvi = 0;
+ dXSARGS;
+
+ if ((items < 2) || (items > 2)) {
+ SWIG_croak("Usage: CoreSession_sayPhrase(self,phrase_name);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_sayPhrase" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_sayPhrase" "', argument " "2"" of type '" "char const *""'");
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ (arg1)->sayPhrase((char const *)arg2);
+
+
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ XSRETURN(argvi);
+ fail:
+
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_CoreSession_sayPhrase) {
+ dXSARGS;
+
+ {
+ unsigned long _index = 0;
+ SWIG_TypeRank _rank = 0;
+ if (items == 2) {
+ SWIG_TypeRank _ranki = 0;
+ SWIG_TypeRank _rankm = 0;
+ SWIG_TypeRank _pi = 1;
+ int _v = 0;
+ {
+ void *vptr = 0;
+ int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_CoreSession, 0);
+ _v = SWIG_CheckState(res);
+ }
+ if (!_v) goto check_1;
+ _ranki += _v*_pi;
+ _rankm += _pi;
+ _pi *= SWIG_MAXCASTRANK;
+ {
+ int res = SWIG_AsCharPtrAndSize(ST(1), 0, NULL, 0);
+ _v = SWIG_CheckState(res);
+ }
+ if (!_v) goto check_1;
+ _ranki += _v*_pi;
+ _rankm += _pi;
+ _pi *= SWIG_MAXCASTRANK;
+ if (!_index || (_ranki < _rank)) {
+ _rank = _ranki; _index = 1;
+ if (_rank == _rankm) goto dispatch;
+ }
+ }
+ check_1:
+
+ if (items == 3) {
+ SWIG_TypeRank _ranki = 0;
+ SWIG_TypeRank _rankm = 0;
+ SWIG_TypeRank _pi = 1;
+ int _v = 0;
+ {
+ void *vptr = 0;
+ int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_CoreSession, 0);
+ _v = SWIG_CheckState(res);
+ }
+ if (!_v) goto check_2;
+ _ranki += _v*_pi;
+ _rankm += _pi;
+ _pi *= SWIG_MAXCASTRANK;
+ {
+ int res = SWIG_AsCharPtrAndSize(ST(1), 0, NULL, 0);
+ _v = SWIG_CheckState(res);
+ }
+ if (!_v) goto check_2;
+ _ranki += _v*_pi;
+ _rankm += _pi;
+ _pi *= SWIG_MAXCASTRANK;
+ {
+ int res = SWIG_AsCharPtrAndSize(ST(2), 0, NULL, 0);
+ _v = SWIG_CheckState(res);
+ }
+ if (!_v) goto check_2;
+ _ranki += _v*_pi;
+ _rankm += _pi;
+ _pi *= SWIG_MAXCASTRANK;
+ if (!_index || (_ranki < _rank)) {
+ _rank = _ranki; _index = 2;
+ if (_rank == _rankm) goto dispatch;
+ }
+ }
+ check_2:
+
+ if (items == 4) {
+ SWIG_TypeRank _ranki = 0;
+ SWIG_TypeRank _rankm = 0;
+ SWIG_TypeRank _pi = 1;
+ int _v = 0;
+ {
+ void *vptr = 0;
+ int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_CoreSession, 0);
+ _v = SWIG_CheckState(res);
+ }
+ if (!_v) goto check_3;
+ _ranki += _v*_pi;
+ _rankm += _pi;
+ _pi *= SWIG_MAXCASTRANK;
+ {
+ int res = SWIG_AsCharPtrAndSize(ST(1), 0, NULL, 0);
+ _v = SWIG_CheckState(res);
+ }
+ if (!_v) goto check_3;
+ _ranki += _v*_pi;
+ _rankm += _pi;
+ _pi *= SWIG_MAXCASTRANK;
+ {
+ int res = SWIG_AsCharPtrAndSize(ST(2), 0, NULL, 0);
+ _v = SWIG_CheckState(res);
+ }
+ if (!_v) goto check_3;
+ _ranki += _v*_pi;
+ _rankm += _pi;
+ _pi *= SWIG_MAXCASTRANK;
+ {
+ int res = SWIG_AsCharPtrAndSize(ST(3), 0, NULL, 0);
+ _v = SWIG_CheckState(res);
+ }
+ if (!_v) goto check_3;
+ _ranki += _v*_pi;
+ _rankm += _pi;
+ _pi *= SWIG_MAXCASTRANK;
+ if (!_index || (_ranki < _rank)) {
+ _rank = _ranki; _index = 3;
+ if (_rank == _rankm) goto dispatch;
+ }
+ }
+ check_3:
+
+ dispatch:
+ switch(_index) {
+ case 1:
+ ++PL_markstack_ptr; SWIG_CALLXS(_wrap_CoreSession_sayPhrase__SWIG_2); return;
+ case 2:
+ ++PL_markstack_ptr; SWIG_CALLXS(_wrap_CoreSession_sayPhrase__SWIG_1); return;
+ case 3:
+ ++PL_markstack_ptr; SWIG_CALLXS(_wrap_CoreSession_sayPhrase__SWIG_0); return;
+ }
+ }
+
+ croak("No matching function for overloaded 'CoreSession_sayPhrase'");
+ XSRETURN(0);
+}
+
+
XS(_wrap_CoreSession_recordFile__SWIG_0) {
{
CoreSession *arg1 = (CoreSession *) 0 ;
@@ -7796,6 +8147,8 @@
{"freeswitchc::CoreSession_getPrivate", _wrap_CoreSession_getPrivate},
{"freeswitchc::CoreSession_getVariable", _wrap_CoreSession_getVariable},
{"freeswitchc::CoreSession_process_callback_result", _wrap_CoreSession_process_callback_result},
+{"freeswitchc::CoreSession_say", _wrap_CoreSession_say},
+{"freeswitchc::CoreSession_sayPhrase", _wrap_CoreSession_sayPhrase},
{"freeswitchc::CoreSession_recordFile", _wrap_CoreSession_recordFile},
{"freeswitchc::CoreSession_setCallerData", _wrap_CoreSession_setCallerData},
{"freeswitchc::CoreSession_originate", _wrap_CoreSession_originate},
Modified: freeswitch/trunk/src/mod/languages/mod_python/freeswitch.py
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_python/freeswitch.py (original)
+++ freeswitch/trunk/src/mod/languages/mod_python/freeswitch.py Tue May 13 16:36:23 2008
@@ -199,6 +199,8 @@
def getPrivate(*args): return _freeswitch.CoreSession_getPrivate(*args)
def getVariable(*args): return _freeswitch.CoreSession_getVariable(*args)
def process_callback_result(*args): return _freeswitch.CoreSession_process_callback_result(*args)
+ def say(*args): return _freeswitch.CoreSession_say(*args)
+ def sayPhrase(*args): return _freeswitch.CoreSession_sayPhrase(*args)
def recordFile(*args): return _freeswitch.CoreSession_recordFile(*args)
def setCallerData(*args): return _freeswitch.CoreSession_setCallerData(*args)
def originate(*args): return _freeswitch.CoreSession_originate(*args)
Modified: freeswitch/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp (original)
+++ freeswitch/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp Tue May 13 16:36:23 2008
@@ -5289,6 +5289,282 @@
}
+SWIGINTERN PyObject *_wrap_CoreSession_say(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) 0 ;
+ char *arg4 = (char *) 0 ;
+ char *arg5 = (char *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ int res3 ;
+ char *buf3 = 0 ;
+ int alloc3 = 0 ;
+ int res4 ;
+ char *buf4 = 0 ;
+ int alloc4 = 0 ;
+ int res5 ;
+ char *buf5 = 0 ;
+ int alloc5 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ PyObject * obj3 = 0 ;
+ PyObject * obj4 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOOOO:CoreSession_say",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_say" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_say" "', argument " "2"" of type '" "char const *""'");
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CoreSession_say" "', argument " "3"" of type '" "char const *""'");
+ }
+ arg3 = reinterpret_cast< char * >(buf3);
+ res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4);
+ if (!SWIG_IsOK(res4)) {
+ SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CoreSession_say" "', argument " "4"" of type '" "char const *""'");
+ }
+ arg4 = reinterpret_cast< char * >(buf4);
+ res5 = SWIG_AsCharPtrAndSize(obj4, &buf5, NULL, &alloc5);
+ if (!SWIG_IsOK(res5)) {
+ SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "CoreSession_say" "', argument " "5"" of type '" "char const *""'");
+ }
+ arg5 = reinterpret_cast< char * >(buf5);
+ (arg1)->say((char const *)arg2,(char const *)arg3,(char const *)arg4,(char const *)arg5);
+ resultobj = SWIG_Py_Void();
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
+ if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
+ if (alloc5 == SWIG_NEWOBJ) delete[] buf5;
+ return resultobj;
+fail:
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
+ if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
+ if (alloc5 == SWIG_NEWOBJ) delete[] buf5;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CoreSession_sayPhrase__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) 0 ;
+ char *arg4 = (char *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ int res3 ;
+ char *buf3 = 0 ;
+ int alloc3 = 0 ;
+ int res4 ;
+ char *buf4 = 0 ;
+ int alloc4 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ PyObject * obj3 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOOO:CoreSession_sayPhrase",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_sayPhrase" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_sayPhrase" "', argument " "2"" of type '" "char const *""'");
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CoreSession_sayPhrase" "', argument " "3"" of type '" "char const *""'");
+ }
+ arg3 = reinterpret_cast< char * >(buf3);
+ res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4);
+ if (!SWIG_IsOK(res4)) {
+ SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CoreSession_sayPhrase" "', argument " "4"" of type '" "char const *""'");
+ }
+ arg4 = reinterpret_cast< char * >(buf4);
+ (arg1)->sayPhrase((char const *)arg2,(char const *)arg3,(char const *)arg4);
+ resultobj = SWIG_Py_Void();
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
+ if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
+ return resultobj;
+fail:
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
+ if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CoreSession_sayPhrase__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ int res3 ;
+ char *buf3 = 0 ;
+ int alloc3 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOO:CoreSession_sayPhrase",&obj0,&obj1,&obj2)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_sayPhrase" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_sayPhrase" "', argument " "2"" of type '" "char const *""'");
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CoreSession_sayPhrase" "', argument " "3"" of type '" "char const *""'");
+ }
+ arg3 = reinterpret_cast< char * >(buf3);
+ (arg1)->sayPhrase((char const *)arg2,(char const *)arg3);
+ resultobj = SWIG_Py_Void();
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
+ return resultobj;
+fail:
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CoreSession_sayPhrase__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ CoreSession *arg1 = (CoreSession *) 0 ;
+ char *arg2 = (char *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:CoreSession_sayPhrase",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_sayPhrase" "', argument " "1"" of type '" "CoreSession *""'");
+ }
+ arg1 = reinterpret_cast< CoreSession * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_sayPhrase" "', argument " "2"" of type '" "char const *""'");
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ (arg1)->sayPhrase((char const *)arg2);
+ resultobj = SWIG_Py_Void();
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ return resultobj;
+fail:
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CoreSession_sayPhrase(PyObject *self, PyObject *args) {
+ int argc;
+ PyObject *argv[5];
+ int ii;
+
+ if (!PyTuple_Check(args)) SWIG_fail;
+ argc = (int)PyObject_Length(args);
+ for (ii = 0; (ii < argc) && (ii < 4); ii++) {
+ argv[ii] = PyTuple_GET_ITEM(args,ii);
+ }
+ if (argc == 2) {
+ int _v;
+ void *vptr = 0;
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CoreSession, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ return _wrap_CoreSession_sayPhrase__SWIG_2(self, args);
+ }
+ }
+ }
+ if (argc == 3) {
+ int _v;
+ void *vptr = 0;
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CoreSession, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ int res = SWIG_AsCharPtrAndSize(argv[2], 0, NULL, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ return _wrap_CoreSession_sayPhrase__SWIG_1(self, args);
+ }
+ }
+ }
+ }
+ if (argc == 4) {
+ int _v;
+ void *vptr = 0;
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CoreSession, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ int res = SWIG_AsCharPtrAndSize(argv[2], 0, NULL, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ int res = SWIG_AsCharPtrAndSize(argv[3], 0, NULL, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ return _wrap_CoreSession_sayPhrase__SWIG_0(self, args);
+ }
+ }
+ }
+ }
+ }
+
+fail:
+ SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CoreSession_sayPhrase'.\n"
+ " Possible C/C++ prototypes are:\n"
+ " sayPhrase(CoreSession *,char const *,char const *,char const *)\n"
+ " sayPhrase(CoreSession *,char const *,char const *)\n"
+ " sayPhrase(CoreSession *,char const *)\n");
+ return NULL;
+}
+
+
SWIGINTERN PyObject *_wrap_CoreSession_recordFile__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
CoreSession *arg1 = (CoreSession *) 0 ;
@@ -7358,6 +7634,8 @@
{ (char *)"CoreSession_getPrivate", _wrap_CoreSession_getPrivate, METH_VARARGS, NULL},
{ (char *)"CoreSession_getVariable", _wrap_CoreSession_getVariable, METH_VARARGS, NULL},
{ (char *)"CoreSession_process_callback_result", _wrap_CoreSession_process_callback_result, METH_VARARGS, NULL},
+ { (char *)"CoreSession_say", _wrap_CoreSession_say, METH_VARARGS, NULL},
+ { (char *)"CoreSession_sayPhrase", _wrap_CoreSession_sayPhrase, METH_VARARGS, NULL},
{ (char *)"CoreSession_recordFile", _wrap_CoreSession_recordFile, METH_VARARGS, NULL},
{ (char *)"CoreSession_setCallerData", _wrap_CoreSession_setCallerData, METH_VARARGS, NULL},
{ (char *)"CoreSession_originate", _wrap_CoreSession_originate, METH_VARARGS, NULL},
Modified: freeswitch/trunk/src/switch_channel.c
==============================================================================
--- freeswitch/trunk/src/switch_channel.c (original)
+++ freeswitch/trunk/src/switch_channel.c Tue May 13 16:36:23 2008
@@ -585,7 +585,7 @@
return SWITCH_STATUS_FALSE;
}
-SWITCH_DECLARE(int) switch_channel_test_flag(switch_channel_t *channel, switch_channel_flag_t flags)
+SWITCH_DECLARE(uint32_t) switch_channel_test_flag(switch_channel_t *channel, switch_channel_flag_t flags)
{
switch_assert(channel != NULL);
return switch_test_flag(channel, flags) ? 1 : 0;
Modified: freeswitch/trunk/src/switch_core_io.c
==============================================================================
--- freeswitch/trunk/src/switch_core_io.c (original)
+++ freeswitch/trunk/src/switch_core_io.c Tue May 13 16:36:23 2008
@@ -192,6 +192,14 @@
if (status == SWITCH_STATUS_SUCCESS && need_codec) {
switch_frame_t *enc_frame, *read_frame = *frame;
+ if (!switch_test_flag(session, SSF_WARN_TRANSCODE)) {
+ switch_core_session_message_t msg = { 0 };
+
+ msg.message_id = SWITCH_MESSAGE_INDICATE_TRANSCODING_NECESSARY;
+ switch_core_session_receive_message(session, &msg);
+ switch_set_flag(session, SSF_WARN_TRANSCODE);
+ }
+
if (read_frame->codec || is_cng) {
session->raw_read_frame.datalen = session->raw_read_frame.buflen;
@@ -558,6 +566,14 @@
}
if (need_codec) {
+ if (!switch_test_flag(session, SSF_WARN_TRANSCODE)) {
+ switch_core_session_message_t msg = { 0 };
+
+ msg.message_id = SWITCH_MESSAGE_INDICATE_TRANSCODING_NECESSARY;
+ switch_core_session_receive_message(session, &msg);
+ switch_set_flag(session, SSF_WARN_TRANSCODE);
+ }
+
if (frame->codec) {
session->raw_write_frame.datalen = session->raw_write_frame.buflen;
status = switch_core_codec_decode(frame->codec,
Modified: freeswitch/trunk/src/switch_core_session.c
==============================================================================
--- freeswitch/trunk/src/switch_core_session.c (original)
+++ freeswitch/trunk/src/switch_core_session.c Tue May 13 16:36:23 2008
@@ -634,6 +634,7 @@
}
}
+ switch_clear_flag(session, SSF_WARN_TRANSCODE);
switch_ivr_deactivate_unicast(session);
switch_channel_clear_flag(channel, CF_BREAK);
}
Modified: freeswitch/trunk/src/switch_cpp.cpp
==============================================================================
--- freeswitch/trunk/src/switch_cpp.cpp (original)
+++ freeswitch/trunk/src/switch_cpp.cpp Tue May 13 16:36:23 2008
@@ -644,6 +644,32 @@
return dtmf_buf;
}
+SWITCH_DECLARE(void) CoreSession::say(const char *tosay, const char *module_name, const char *say_type, const char *say_method)
+{
+ sanity_check_noreturn;
+ if (!(tosay && module_name && say_type && say_method)) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error! invalid args.\n");
+ return;
+ }
+ begin_allow_threads();
+ switch_ivr_say(session, tosay, module_name, say_type, say_method, ap);
+ end_allow_threads();
+}
+
+SWITCH_DECLARE(void) CoreSession::sayPhrase(const char *phrase_name, const char *phrase_data, const char *phrase_lang)
+{
+ sanity_check_noreturn;
+
+ if (!(phrase_name)) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error! invalid args.\n");
+ return;
+ }
+
+ begin_allow_threads();
+ switch_ivr_phrase_macro(session, phrase_name, phrase_data, phrase_lang, ap);
+ end_allow_threads();
+}
+
SWITCH_DECLARE(int) CoreSession::streamFile(char *file, int starting_sample_count) {
switch_status_t status;
Modified: freeswitch/trunk/src/switch_rtp.c
==============================================================================
--- freeswitch/trunk/src/switch_rtp.c (original)
+++ freeswitch/trunk/src/switch_rtp.c Tue May 13 16:36:23 2008
@@ -985,9 +985,9 @@
}
}
-SWITCH_DECLARE(uint8_t) switch_rtp_test_flag(switch_rtp_t *rtp_session, switch_rtp_flag_t flags)
+SWITCH_DECLARE(uint32_t) switch_rtp_test_flag(switch_rtp_t *rtp_session, switch_rtp_flag_t flags)
{
- return (uint8_t) switch_test_flag(rtp_session, flags);
+ return (uint32_t) switch_test_flag(rtp_session, flags);
}
SWITCH_DECLARE(void) switch_rtp_clear_flag(switch_rtp_t *rtp_session, switch_rtp_flag_t flags)
1
0
13 May '08
Author: mikej
Date: Tue May 13 15:24:53 2008
New Revision: 8385
Added:
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_types.h
Log:
need this file too
Added: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_types.h
==============================================================================
--- (empty file)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_types.h Tue May 13 15:24:53 2008
@@ -0,0 +1,55 @@
+/*
+ * This file is part of the Sofia-SIP package
+ *
+ * Copyright (C) 2008 Nokia Corporation.
+ *
+ * Contact: Pekka Pessi <pekka.pessi(a)nokia.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#ifndef NUA_TYPES_H
+/** Defined when <nua_types.h> has been included. */
+#define NUA_TYPES_H
+
+/**@internal @file nua_types.h
+ * @brief Internal types for nua.
+ *
+ * @author Pekka Pessi <Pekka.Pessi(a)nokia.com>
+ */
+
+typedef struct nua_handle_preferences nua_handle_preferences_t;
+typedef struct nua_global_preferences nua_global_preferences_t;
+
+#ifndef NUA_OWNER_T
+#define NUA_OWNER_T struct nua_owner_s
+#endif
+typedef NUA_OWNER_T nua_owner_t;
+
+typedef struct nua_dialog_state nua_dialog_state_t;
+typedef struct nua_dialog_usage nua_dialog_usage_t;
+typedef struct nua_server_request nua_server_request_t;
+typedef struct nua_client_request nua_client_request_t;
+typedef struct nua_dialog_peer_info nua_dialog_peer_info_t;
+
+#ifndef NUA_SAVED_SIGNAL_T
+#define NUA_SAVED_SIGNAL_T struct nua_saved_signal *
+#endif
+
+typedef NUA_SAVED_SIGNAL_T nua_saved_signal_t;
+
+#endif
1
0
[commit] r8384 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/nua
by Freeswitch SVN 13 May '08
by Freeswitch SVN 13 May '08
13 May '08
Author: mikej
Date: Tue May 13 15:10:47 2008
New Revision: 8384
Modified:
freeswitch/trunk/libs/sofia-sip/.update
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/Makefile.am
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_dialog.c
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_dialog.h
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_notifier.c
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.c
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.h
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_publish.c
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_register.c
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.c
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.h
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_subnotref.c
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/outbound.c
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/outbound.h
Log:
Mon May 12 18:51:36 EDT 2008 Pekka Pessi <first.last(a)nokia.com>
* nua: using NUTAG_PROXY() as handle-specific tag
Added nua_dialog_update_params() and virtual method usage_update_params()
for each dialog usage.
Modified: freeswitch/trunk/libs/sofia-sip/.update
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/.update (original)
+++ freeswitch/trunk/libs/sofia-sip/.update Tue May 13 15:10:47 2008
@@ -1 +1 @@
-Tue May 13 15:08:14 EDT 2008
+Tue May 13 15:08:49 EDT 2008
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/Makefile.am
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/Makefile.am (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/Makefile.am Tue May 13 15:10:47 2008
@@ -30,7 +30,7 @@
sofia-sip/nua.h sofia-sip/nua_tag.h
libnua_la_SOURCES = nua.c nua_stack.h nua_common.c nua_stack.c \
- nua_extension.c \
+ nua_extension.c nua_types.h \
nua_dialog.c nua_dialog.h \
outbound.c outbound.h \
nua_params.c nua_params.h \
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_dialog.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_dialog.c (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_dialog.c Tue May 13 15:10:47 2008
@@ -468,6 +468,26 @@
ds->ds_terminating = 0;
}
+void nua_dialog_update_params(nua_dialog_state_t *ds,
+ nua_handle_preferences_t const *changed,
+ nua_handle_preferences_t const *params,
+ nua_handle_preferences_t const *defaults)
+{
+ nua_dialog_usage_t *usage;
+
+ for (usage = ds->ds_usage; usage; usage = usage->du_next) {
+ usage->du_class->usage_update_params(usage, changed, params, defaults);
+ }
+}
+
+void nua_base_usage_update_params(nua_dialog_usage_t const *du,
+ nua_handle_preferences_t const *changed,
+ nua_handle_preferences_t const *params,
+ nua_handle_preferences_t const *defaults)
+{
+ (void)du, (void)changed, (void)params, (void)defaults;
+}
+
/**@internal
* Set refresh value suitably.
*
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_dialog.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_dialog.h (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_dialog.h Tue May 13 15:10:47 2008
@@ -35,27 +35,12 @@
* @date Created: Wed Mar 8 11:38:18 EET 2006 ppessi
*/
-#ifndef NUA_OWNER_T
-#define NUA_OWNER_T struct nua_owner_s
-#endif
-typedef NUA_OWNER_T nua_owner_t;
+#include <nua_types.h>
#ifndef NTA_H
#include <sofia-sip/nta.h>
#endif
-typedef struct nua_dialog_state nua_dialog_state_t;
-typedef struct nua_dialog_usage nua_dialog_usage_t;
-typedef struct nua_server_request nua_server_request_t;
-typedef struct nua_client_request nua_client_request_t;
-typedef struct nua_dialog_peer_info nua_dialog_peer_info_t;
-
-#ifndef NUA_SAVED_SIGNAL_T
-#define NUA_SAVED_SIGNAL_T struct nua_saved_signal *
-#endif
-
-typedef NUA_SAVED_SIGNAL_T nua_saved_signal_t;
-
typedef struct {
sip_method_t sm_method;
char const *sm_method_name;
@@ -386,6 +371,10 @@
nua_client_request_t *cr,
nua_server_request_t *sr);
char const *(*usage_name)(nua_dialog_usage_t const *du);
+ void (*usage_update_params)(nua_dialog_usage_t const *du,
+ nua_handle_preferences_t const *changed,
+ nua_handle_preferences_t const *params,
+ nua_handle_preferences_t const *defaults);
void (*usage_peer_info)(nua_dialog_usage_t *du,
nua_dialog_state_t const *ds,
sip_t const *sip);
@@ -452,6 +441,16 @@
nua_client_request_t *cr,
nua_server_request_t *sr);
+void nua_dialog_update_params(nua_dialog_state_t *ds,
+ nua_handle_preferences_t const *changed,
+ nua_handle_preferences_t const *params,
+ nua_handle_preferences_t const *defaults);
+
+void nua_base_usage_update_params(nua_dialog_usage_t const *du,
+ nua_handle_preferences_t const *changed,
+ nua_handle_preferences_t const *params,
+ nua_handle_preferences_t const *defaults);
+
void nua_dialog_deinit(nua_owner_t *own,
nua_dialog_state_t *ds);
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_notifier.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_notifier.c (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_notifier.c Tue May 13 15:10:47 2008
@@ -92,6 +92,7 @@
nua_notify_usage_add,
nua_notify_usage_remove,
nua_notify_usage_name,
+ nua_base_usage_update_params,
NULL,
nua_notify_usage_refresh,
nua_notify_usage_shutdown,
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.c (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.c Tue May 13 15:10:47 2008
@@ -82,17 +82,6 @@
/* Bitwise or of bitfields, casted to unsigned */
a->nhp_set_.set_unsigned[0] |= b->nhp_set_.set_unsigned[0];
a->nhp_set_.set_unsigned[1] |= b->nhp_set_.set_unsigned[1];
-
- /*
- unsigned *ap, const *bp;
- size_t i;
-
- ap = a->nhp_set_.set_unsigned;
- bp = b->nhp_set_.set_unsigned;
- for (i = 0; i < (sizeof a->nhp_set); i += (sizeof *ap))
- *ap++ |= *bp++;
-
- */
}
static int nhp_set_tags(su_home_t *home,
@@ -110,10 +99,9 @@
tag_value_t value);
static int nhp_save_params(nua_handle_t *nh,
- su_home_t *tmphome,
- nua_global_preferences_t *gsrc,
- nua_handle_preferences_t *src);
-
+ su_home_t *tmphome,
+ nua_global_preferences_t *gsrc,
+ nua_handle_preferences_t *src);
/* ====================================================================== */
/* Magical NUTAG_USER_AGENT() - add NHP_USER_AGENT there if it is not there */
@@ -310,6 +298,7 @@
* NUTAG_ONLY183_100REL() \n
* NUTAG_OUTBOUND() \n
* NUTAG_PATH_ENABLE() \n
+ * NUTAG_PROXY() (aka NTATAG_DEFAULT_PROXY()) \n
* NUTAG_REFER_EXPIRES() \n
* NUTAG_REFER_WITH_ID() \n
* NUTAG_REGISTRAR() \n
@@ -430,6 +419,7 @@
* NUTAG_ONLY183_100REL() \n
* NUTAG_OUTBOUND() \n
* NUTAG_PATH_ENABLE() \n
+ * NUTAG_PROXY() (aka NTATAG_DEFAULT_PROXY()) \n
* NUTAG_REFER_EXPIRES() \n
* NUTAG_REFER_WITH_ID() \n
* NUTAG_REGISTRAR() \n
@@ -482,13 +472,15 @@
int status;
char const *phrase;
+ nua_handle_preferences_t tmp[1];
+ int any_changes = 0;
+
enter;
{
su_home_t tmphome[1] = { SU_HOME_INIT(tmphome) };
nua_handle_preferences_t *nhp = nh->nh_prefs;
nua_handle_preferences_t const *dnhp = dnh->nh_prefs;
- nua_handle_preferences_t tmp[1];
nua_global_preferences_t gtmp[1], *ngp = NULL;
*tmp = *nhp; NHP_UNSET_ALL(tmp);
@@ -521,7 +513,7 @@
status = 900, phrase = "Error storing default handle parameters";
else if (nhp_set_tags(tmphome, tmp, ngp, tags) < 0)
status = 900, phrase = "Error storing parameters";
- else if (nhp_save_params(nh, tmphome, ngp, tmp) < 0)
+ else if ((any_changes = nhp_save_params(nh, tmphome, ngp, tmp)) < 0)
status = 900, phrase = su_strerror(ENOMEM);
else
status = 200, phrase = "OK", nh->nh_used_ptags = 1;
@@ -562,7 +554,8 @@
if (nua_stack_set_smime_params(nua, tags) < 0) {
status = 900, phrase = "Error setting S/MIME parameters";
}
- else if (nua->nua_nta && nta_agent_set_params(nua->nua_nta, TAG_NEXT(tags)) < 0) {
+ else if (nua->nua_nta &&
+ nta_agent_set_params(nua->nua_nta, TAG_NEXT(tags)) < 0) {
status = 900, phrase = "Error setting NTA parameters";
}
else {
@@ -581,6 +574,18 @@
else {
if (e == nua_r_set_params)
UA_EVENT2(e, status, phrase);
+
+ if (any_changes) {
+ nua_handle_preferences_t changed[1];
+
+ *changed = *nh->nh_prefs;
+ memcpy(&changed->nhp_set_, &tmp->nhp_set_, sizeof changed->nhp_set_);
+
+ nua_dialog_update_params(nh->nh_ds,
+ changed,
+ nh->nh_prefs,
+ dnh->nh_prefs);
+ }
return 0;
}
}
@@ -612,11 +617,10 @@
}
/* Set copy of string from url to handle pref structure */
-#define NHP_SET_STR_BY_URL(nhp, name, v) \
+#define NHP_SET_STR_BY_URL(nhp, type, name, v) \
if ((v) != (tag_value_t)-1) { \
url_t const *_value = (url_t const *)(v); \
- char *_new; \
- _new = url_as_string(home, (void *)_value); \
+ type *_new = (type *)url_as_string(home, (void *)_value); \
if (NHP_ISSET(nhp, name)) \
su_free(home, (void *)nhp->nhp_##name); \
NHP_SET(nhp, name, _new); \
@@ -953,7 +957,7 @@
}
/* NUTAG_REGISTRAR(registrar) */
else if (tag == nutag_registrar) {
- NHP_SET_STR_BY_URL(nhp, registrar, value);
+ NHP_SET_STR_BY_URL(nhp, char, registrar, value);
if (NHP_ISSET(nhp, registrar) && !str0cmp(nhp->nhp_registrar, "*"))
NHP_SET_STR(nhp, registrar, 0);
}
@@ -981,6 +985,10 @@
else if (tag == nutag_outbound) {
NHP_SET_STR(nhp, outbound, value);
}
+ /* NUTAG_PROXY() (aka NTATAG_DEFAULT_PROXY()) */
+ else if (tag == ntatag_default_proxy) {
+ NHP_SET_STR_BY_URL(nhp, url_string_t, proxy, value);
+ }
/* NUTAG_DETECT_NETWORK_UPDATES(detect_network_updates) */
else if (ngp && tag == nutag_detect_network_updates) {
int detector = (int)value;
@@ -1070,6 +1078,10 @@
}
/** Save parameters in @a gtmp and @a tmp.
+ *
+ * @retval 1 - parameters were changed
+ * @retval 0 - no changes in parameters
+ * @retval -1 - an error
*/
static
int nhp_save_params(nua_handle_t *nh,
@@ -1132,7 +1144,7 @@
nh->nh_prefs = dst;
- return 0;
+ return memcmp(dst, old, sizeof *dst) != 0;
}
static int nua_handle_tags_filter(tagi_t const *f, tagi_t const *t);
@@ -1141,21 +1153,6 @@
/** Save taglist to a handle */
int nua_handle_save_tags(nua_handle_t *nh, tagi_t *tags)
{
-#if HAVE_OPEN_C
- /* Nice. An old symbian compiler */
- tagi_t tagfilter[2];
- tagi_t paramfilter[2];
-#else
- tagi_t const tagfilter[] = {
- { TAG_FILTER(nua_handle_tags_filter) },
- { TAG_NULL() }
- };
- tagi_t const paramfilter[] = {
- { TAG_FILTER(nua_handle_param_filter) },
- { TAG_NULL() }
- };
-#endif
-
/* Initialization parameters */
url_string_t const *url = NULL;
sip_to_t const *p_to = NULL;
@@ -1171,6 +1168,10 @@
int error;
#if HAVE_OPEN_C
+ /* Nice. An old symbian compiler */
+ tagi_t tagfilter[2];
+ tagi_t paramfilter[2];
+
tagfilter[0].t_tag = tag_filter;
tagfilter[0].t_value = tag_filter_v(nua_handle_tags_filter);
tagfilter[1].t_tag = (tag_type_t)0;
@@ -1180,6 +1181,16 @@
paramfilter[0].t_value = tag_filter_v(nua_handle_param_filter);
paramfilter[1].t_tag = (tag_type_t)0;
paramfilter[1].t_value = (tag_value_t)0;
+
+#else
+ tagi_t const tagfilter[] = {
+ { TAG_FILTER(nua_handle_tags_filter) },
+ { TAG_NULL() }
+ };
+ tagi_t const paramfilter[] = {
+ { TAG_FILTER(nua_handle_param_filter) },
+ { TAG_NULL() }
+ };
#endif
for (t = tags; t; t = tl_next(t)) {
@@ -1525,7 +1536,7 @@
nua_handle_t *dnh = nua->nua_dhandle;
nua_global_preferences_t const *ngp = nua->nua_prefs;
nua_handle_preferences_t const *nhp = nh->nh_prefs;
-
+ nua_handle_preferences_t const nhp_zero[1] = {{ 0 }};
tagi_t *lst;
int has_from;
@@ -1549,18 +1560,19 @@
enter;
- nta_agent_get_params(nua->nua_nta,
- NTATAG_UDP_MTU_REF(udp_mtu),
- NTATAG_MAX_PROCEEDING_REF(max_proceeding),
- NTATAG_SIP_T1_REF(sip_t1),
- NTATAG_SIP_T2_REF(sip_t2),
- NTATAG_SIP_T4_REF(sip_t4),
- NTATAG_SIP_T1X64_REF(sip_t1x64),
- NTATAG_DEBUG_DROP_PROB_REF(debug_drop_prob),
- NTATAG_DEFAULT_PROXY_REF(proxy),
- NTATAG_ALIASES_REF(aliases),
- NTATAG_SIPFLAGS_REF(flags),
- TAG_END());
+ if (nh == dnh)
+ nta_agent_get_params(nua->nua_nta,
+ NTATAG_UDP_MTU_REF(udp_mtu),
+ NTATAG_MAX_PROCEEDING_REF(max_proceeding),
+ NTATAG_SIP_T1_REF(sip_t1),
+ NTATAG_SIP_T2_REF(sip_t2),
+ NTATAG_SIP_T4_REF(sip_t4),
+ NTATAG_SIP_T1X64_REF(sip_t1x64),
+ NTATAG_DEBUG_DROP_PROB_REF(debug_drop_prob),
+ NTATAG_DEFAULT_PROXY_REF(proxy),
+ NTATAG_ALIASES_REF(aliases),
+ NTATAG_SIPFLAGS_REF(flags),
+ TAG_END());
if (nh->nh_ds->ds_local)
has_from = 1, *from = *nh->nh_ds->ds_local, from->a_params = NULL;
@@ -1597,6 +1609,9 @@
? sip_##pref##_make(tmphome, (char *)nhp->nhp_##pref) \
: NULL))
+ if (nh != dnh && nhp == dnh->nh_prefs)
+ nhp = nhp_zero;
+
su_home_auto(tmphome, sizeof(tmphome));
lst = tl_filtered_tlist
@@ -1669,6 +1684,10 @@
TIF(NUTAG_M_FEATURES, m_features),
TIF(NUTAG_OUTBOUND, outbound),
+ /* Handle-specific proxy */
+ TAG_IF(nh != dnh && nhp->nhp_set.nhb_proxy,
+ NUTAG_PROXY(nhp->nhp_proxy)),
+
/* Skip user-agent-level parameters if parameters are for handle only */
TAG_IF(nh != dnh, TAG_NEXT(media_params)),
@@ -1693,12 +1712,13 @@
#endif
NTATAG_UDP_MTU(udp_mtu),
- NTATAG_MAX_PROCEEDING(max_proceeding),
+ NTATAG_MAX_PROCEEDING(max_proceeding),
NTATAG_SIP_T1(sip_t1),
NTATAG_SIP_T2(sip_t2),
NTATAG_SIP_T4(sip_t4),
NTATAG_SIP_T1X64(sip_t1x64),
NTATAG_DEBUG_DROP_PROB(debug_drop_prob),
+ /* Stack-wide proxy */
NTATAG_DEFAULT_PROXY(proxy),
NTATAG_ALIASES(aliases),
NTATAG_SIPFLAGS(flags),
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.h (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_params.h Tue May 13 15:10:47 2008
@@ -35,6 +35,8 @@
* @date Created: Wed Mar 8 11:38:18 EET 2006 ppessi
*/
+#include <nua_types.h>
+
/**@internal @brief NUA preferences.
*
* This structure contains values for various preferences and a separate
@@ -50,7 +52,7 @@
*
* @see NHP_GET(), NH_PGET(), NHP_ISSET(), NH_PISSET()
*/
-typedef struct nua_handle_preferences
+struct nua_handle_preferences
{
unsigned nhp_retry_count; /**< times to retry a request */
unsigned nhp_max_subscriptions;
@@ -133,6 +135,9 @@
/** Initial route set */
sip_route_t *nhp_initial_route;
+ /** Next hop URI (used instead of route). */
+ url_string_t *nhp_proxy;
+
union { struct {
/* A bit for each feature set by application */
/* NOTE:
@@ -191,16 +196,17 @@
unsigned nhb_outbound:1;
unsigned nhb_appl_method:1;
unsigned nhb_initial_route:1;
+ unsigned nhb_proxy:1;
unsigned :0;
} set_bits;
unsigned set_unsigned[2];
} nhp_set_;
-} nua_handle_preferences_t;
+};
#define nhp_set nhp_set_.set_bits
/** Global preferences for nua. */
-typedef struct {
+struct nua_global_preferences {
/** Network detection: NONE, INFORMAL, TRY_FULL */
signed int ngp_detect_network_updates:3;
/** Pass events during shutdown, too */
@@ -215,7 +221,7 @@
} set_bits;
unsigned set_unsigned[2];
} ngp_set_;
-} nua_global_preferences_t;
+};
#define ngp_set ngp_set_.set_bits
@@ -238,7 +244,7 @@
/* Get preference from handle, if set, otherwise from default handle */
#define NH_PGET(nh, pref) \
- NHP_GET((nh)->nh_prefs, (nh)->nh_nua->nua_dhandle->nh_prefs, pref)
+ NHP_GET((nh)->nh_prefs, (nh)->nh_dprefs, pref)
/* Get preference from handle, if exists and set,
otherwise from default handle */
@@ -255,7 +261,7 @@
(NHP_ISSET((nh)->nh_prefs, pref) && \
(nh)->nh_nua->nua_dhandle->nh_prefs != (nh)->nh_prefs)
-/* Check if preference has been set by applicationx */
+/* Check if preference has been set by application */
#define NUA_PISSET(nua, nh, pref) \
(NHP_ISSET((nua)->nua_dhandle->nh_prefs, pref) || \
((nh) && NHP_ISSET((nh)->nh_prefs, pref)))
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_publish.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_publish.c (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_publish.c Tue May 13 15:10:47 2008
@@ -79,6 +79,7 @@
nua_publish_usage_add,
nua_publish_usage_remove,
nua_publish_usage_name,
+ nua_base_usage_update_params,
NULL,
nua_publish_usage_refresh,
nua_publish_usage_shutdown,
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_register.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_register.c (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_register.c Tue May 13 15:10:47 2008
@@ -107,6 +107,10 @@
nua_dialog_usage_t *du,
nua_client_request_t *cr,
nua_server_request_t *sr);
+static void nua_register_usage_update_params(nua_dialog_usage_t const *du,
+ nua_handle_preferences_t const *,
+ nua_handle_preferences_t const *,
+ nua_handle_preferences_t const *);
static void nua_register_usage_peer_info(nua_dialog_usage_t *du,
nua_dialog_state_t const *ds,
sip_t const *sip);
@@ -169,6 +173,7 @@
nua_register_usage_add,
nua_register_usage_remove,
nua_register_usage_name,
+ nua_register_usage_update_params,
nua_register_usage_peer_info,
nua_register_usage_refresh,
nua_register_usage_shutdown
@@ -672,6 +677,11 @@
NH_PGET(nh, instance));
if (!nr->nr_ob)
return nua_client_return(cr, 900, "Cannot create outbound", msg);
+
+ nua_register_usage_update_params(du,
+ NULL,
+ nh->nh_prefs,
+ nh->nh_dprefs);
}
if (nr->nr_ob) {
@@ -687,13 +697,6 @@
unreg = 1; /* All contacts have expires=0 */
}
- outbound_set_options(ob,
- NH_PGET(nh, outbound),
- NH_PGET(nh, keepalive),
- NH_PISSET(nh, keepalive_stream)
- ? NH_PGET(nh, keepalive_stream)
- : NH_PGET(nh, keepalive));
-
if (outbound_set_contact(ob, sip->sip_contact, nr->nr_via, unreg) < 0)
return nua_client_return(cr, 900, "Cannot set outbound contact", msg);
}
@@ -1038,6 +1041,42 @@
nua_dialog_usage_set_refresh_range(du, 0, 0);
}
+static void
+nua_register_usage_update_params(nua_dialog_usage_t const *du,
+ nua_handle_preferences_t const *changed,
+ nua_handle_preferences_t const *nhp,
+ nua_handle_preferences_t const *dnhp)
+{
+ nua_registration_t *nr = nua_dialog_usage_private(du);
+ outbound_t *ob = nr->nr_ob;
+
+ if (!ob)
+ return;
+
+ if (!changed ||
+ NHP_ISSET(changed, outbound) ||
+ NHP_ISSET(changed, keepalive) ||
+ NHP_ISSET(changed, keepalive_stream)) {
+ char const *outbound =
+ NHP_ISSET(nhp, outbound) ? nhp->nhp_outbound
+ : dnhp->nhp_outbound;
+ unsigned keepalive =
+ NHP_ISSET(nhp, keepalive) ? nhp->nhp_keepalive
+ : dnhp->nhp_keepalive;
+ unsigned keepalive_stream =
+ NHP_ISSET(nhp, keepalive_stream) ? nhp->nhp_keepalive_stream
+ : NHP_ISSET(dnhp, keepalive_stream) ? nhp->nhp_keepalive_stream
+ : keepalive;
+
+ outbound_set_options(ob, outbound, keepalive, keepalive_stream);
+ }
+
+ if (!changed || NHP_ISSET(changed, proxy)) {
+ if (NHP_ISSET(nhp, proxy))
+ outbound_set_proxy(ob, nhp->nhp_proxy);
+ }
+}
+
static void nua_register_usage_refresh(nua_handle_t *nh,
nua_dialog_state_t *ds,
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c Tue May 13 15:10:47 2008
@@ -207,6 +207,7 @@
nua_session_usage_add,
nua_session_usage_remove,
nua_session_usage_name,
+ nua_base_usage_update_params,
NULL,
nua_session_usage_refresh,
nua_session_usage_shutdown
@@ -335,9 +336,6 @@
/* ======================================================================== */
/* INVITE and call (session) processing */
-int nua_stack_prack(nua_t *nua, nua_handle_t *nh, nua_event_t e,
- tagi_t const *tags);
-
static int session_timer_is_supported(struct session_timer const *t);
static void session_timer_preferences(struct session_timer *t,
@@ -1206,6 +1204,8 @@
sip_authorization_t *wa;
sip_proxy_authorization_t *pa;
sip_cseq_t *cseq;
+ int proxy_is_set;
+ url_string_t *proxy;
nta_outgoing_t *ack;
int status = 200;
char const *phrase = "OK", *reason = NULL;
@@ -1314,9 +1314,14 @@
}
}
+ proxy_is_set = NH_PISSET(nh, proxy);
+ proxy = NH_PGET(nh, proxy);
+
if ((ack = nta_outgoing_mcreate(nh->nh_nua->nua_nta, NULL, NULL, NULL,
msg,
NTATAG_ACK_BRANCH(invite_branch),
+ TAG_IF(proxy_is_set,
+ NTATAG_DEFAULT_PROXY(proxy)),
SIPTAG_END(),
TAG_NEXT(tags)))) {
/* TR engine keeps this around for T2 so it catches all 2XX retransmissions */
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.c (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.c Tue May 13 15:10:47 2008
@@ -2633,6 +2633,8 @@
tagi_t const *tags)
{
nua_handle_t *nh = cr->cr_owner;
+ int proxy_is_set = NH_PISSET(nh, proxy);
+ url_string_t * proxy = NH_PGET(nh, proxy);
if (nh->nh_auth) {
if (cr->cr_challenged ||
@@ -2648,6 +2650,8 @@
nua_client_orq_response, cr,
NULL,
msg,
+ TAG_IF(proxy_is_set,
+ NTATAG_DEFAULT_PROXY(proxy)),
TAG_NEXT(tags));
return cr->cr_orq ? 0 : -1;
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.h (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_stack.h Tue May 13 15:10:47 2008
@@ -154,6 +154,7 @@
nua_handle_t *nh_identity; /**< Identity */
nua_handle_preferences_t *nh_prefs; /**< Preferences */
+#define nh_dprefs nh_nua->nua_dhandle->nh_prefs
/* Handle type is determined by special event and flags. */
nua_event_t nh_special; /**< Special event */
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_subnotref.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_subnotref.c (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/nua_subnotref.c Tue May 13 15:10:47 2008
@@ -91,6 +91,7 @@
nua_subscribe_usage_add,
nua_subscribe_usage_remove,
nua_subscribe_usage_name,
+ nua_base_usage_update_params,
NULL,
nua_subscribe_usage_refresh,
nua_subscribe_usage_shutdown
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/outbound.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/outbound.c (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/outbound.c Tue May 13 15:10:47 2008
@@ -104,8 +104,8 @@
unsigned ob_registering:1;
/** 2XX response to REGISTER containg ob_rcontact has been received */
unsigned ob_registered:1;
- /**The registration has been validated:
- * We have successfully sent OPTIONS to ourselves.
+ /** The registration has been validated:
+ * We have successfully sent OPTIONS to ourselves.
*/
unsigned ob_validated:1;
/** The registration has been validated once.
@@ -113,8 +113,11 @@
* up if OPTIONS probe fails.
*/
unsigned ob_once_validated:1;
+
+ unsigned ob_proxy_override:1; /**< Override stack default proxy */
unsigned :0;
+ url_string_t *ob_proxy; /**< Outbound-specific proxy */
char const *ob_instance; /**< Our instance ID */
int32_t ob_reg_id; /**< Flow-id */
sip_contact_t *ob_rcontact; /**< Our contact */
@@ -209,10 +212,11 @@
ob->ob_nta = agent;
if (instance)
- ob->ob_instance = su_strcat_all(ob->ob_home, "+sip.instance=\"<", instance, ">\"", NULL);
+ ob->ob_instance =
+ su_sprintf(ob->ob_home, "+sip.instance=\"<%s>\"", instance);
ob->ob_reg_id = 0;
- /* Generate a cookie (used as Call-ID) for us */
+ /* Generate a random cookie (used as Call-ID) for us */
su_md5_init(md5);
su_guid_generate(guid);
if (instance)
@@ -246,16 +250,23 @@
/** Set various outbound and nat-traversal related options. */
int outbound_set_options(outbound_t *ob,
- char const *options,
+ char const *_options,
unsigned interval,
unsigned stream_interval)
{
struct outbound_prefs prefs[1] = {{ 0 }};
- char const *s;
+ char *s, *options = su_strdup(NULL, _options);
+ int invalid;
prefs->interval = interval;
prefs->stream_interval = stream_interval;
+#define MATCH(v) (len == sizeof(#v) - 1 && strncasecmp(#v, s, len) == 0)
+
+ if (options) {
+ for (s = options; s[0]; s++) if (s[0] == '-') s[0] = '_';
+ }
+
prefs->gruuize = 1;
prefs->outbound = 0;
prefs->natify = 1;
@@ -263,17 +274,11 @@
prefs->validate = 1;
prefs->use_rport = 1;
-#define MATCH(v) (len == sizeof(#v) - 1 && strncasecmp(#v, s, len) == 0)
-
for (s = options; s && s[0]; ) {
size_t len = span_token(s);
int value = 1;
- if (len > 3 && strncasecmp(s, "no-", 3) == 0)
- value = 0, s += 3, len -= 3;
- else if (len > 4 && strncasecmp(s, "not-", 4) == 0)
- value = 0, s += 4, len -= 4;
- else if (len > 3 && strncasecmp(s, "no_", 3) == 0)
+ if (len > 3 && strncasecmp(s, "no_", 3) == 0)
value = 0, s += 3, len -= 3;
else if (len > 4 && strncasecmp(s, "not_", 4) == 0)
value = 0, s += 4, len -= 4;
@@ -284,14 +289,12 @@
else if (MATCH(outbound)) prefs->outbound = value;
else if (MATCH(natify)) prefs->natify = value;
else if (MATCH(validate)) prefs->validate = value;
- else if (MATCH(options-keepalive)) prefs->okeepalive = value;
else if (MATCH(options_keepalive)) prefs->okeepalive = value;
- else if (MATCH(use-connect)) prefs->use_connect = value;
else if (MATCH(use_connect)) prefs->use_connect = value;
- else if (MATCH(use-rport) || MATCH(use_rport)) prefs->use_rport = value;
- else if (MATCH(use-socks) || MATCH(use_socks)) prefs->use_socks = value;
- else if (MATCH(use-upnp) || MATCH(use_upnp)) prefs->use_upnp = value;
- else if (MATCH(use-stun) || MATCH(use_stun)) prefs->use_stun = value;
+ else if (MATCH(use_rport)) prefs->use_rport = value;
+ else if (MATCH(use_socks)) prefs->use_socks = value;
+ else if (MATCH(use_upnp)) prefs->use_upnp = value;
+ else if (MATCH(use_stun)) prefs->use_stun = value;
else
SU_DEBUG_1(("outbound(%p): unknown option \"%.*s\"\n",
(void *)ob->ob_owner, (int)len, s));
@@ -303,7 +306,10 @@
s += len;
}
- if (s && s[0]) {
+ invalid = s && s[0];
+ su_free(NULL, options);
+
+ if (invalid) {
SU_DEBUG_1(("outbound(%p): invalid options \"%s\"\n",
(void *)ob->ob_owner, options));
return -1;
@@ -326,6 +332,25 @@
return 0;
}
+/** Override stack default proxy for outbound */
+int outbound_set_proxy(outbound_t *ob,
+ url_string_t *proxy)
+{
+ url_string_t *new_proxy = NULL, *old_proxy = ob->ob_proxy;
+
+ if (proxy)
+ new_proxy = (url_string_t *)url_as_string(ob->ob_home, proxy->us_url);
+
+ if (proxy == NULL || new_proxy != NULL) {
+ ob->ob_proxy_override = 1;
+ ob->ob_proxy = new_proxy;
+ su_free(ob->ob_home, old_proxy);
+ return 0;
+ }
+
+ return -1;
+}
+
/* ---------------------------------------------------------------------- */
/** Obtain contacts for REGISTER */
@@ -784,6 +809,8 @@
ob,
NULL,
req,
+ TAG_IF(ob->ob_proxy_override,
+ NTATAG_DEFAULT_PROXY(ob->ob_proxy)),
TAG_END());
if (!ob->ob_keepalive.orq)
@@ -949,6 +976,8 @@
ob,
NULL,
req,
+ TAG_IF(ob->ob_proxy_override,
+ NTATAG_DEFAULT_PROXY(ob->ob_proxy)),
SIPTAG_SUBJECT_STR("REGISTRATION PROBE"),
/* NONE is used to remove
Max-Forwards: 0 found in ordinary keepalives */
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/outbound.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/outbound.h (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/nua/outbound.h Tue May 13 15:10:47 2008
@@ -70,6 +70,9 @@
unsigned dgram_interval,
unsigned stream_interval);
+int outbound_set_proxy(outbound_t *ob,
+ url_string_t *proxy);
+
int outbound_get_contacts(outbound_t *ob,
sip_contact_t **return_current_contact,
sip_contact_t **return_previous_contact);
1
0
[commit] r8383 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/msg/sofia-sip
by Freeswitch SVN 13 May '08
by Freeswitch SVN 13 May '08
13 May '08
Author: mikej
Date: Tue May 13 15:08:22 2008
New Revision: 8383
Modified:
freeswitch/trunk/libs/sofia-sip/.update
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_header.h
Log:
Mon May 12 15:20:02 EDT 2008 Pekka Pessi <first.last(a)nokia.com>
* msg_header.h: removed c99ism
Modified: freeswitch/trunk/libs/sofia-sip/.update
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/.update (original)
+++ freeswitch/trunk/libs/sofia-sip/.update Tue May 13 15:08:22 2008
@@ -1 +1 @@
-Mon May 12 14:41:23 EDT 2008
+Tue May 13 15:08:14 EDT 2008
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_header.h
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_header.h (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/msg/sofia-sip/msg_header.h Tue May 13 15:08:22 2008
@@ -282,7 +282,7 @@
#define MSG_STRUCT_ALIGN(p) ((p) = (void*)MSG_ALIGN(p, sizeof(void *)))
enum {
- msg_n_params = 8, /* allocation size of parameter string list */
+ msg_n_params = 8 /* allocation size of parameter string list */
#define MSG_N_PARAMS msg_n_params
};
1
0