Freeswitch-trunk
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
October 2006
- 5 participants
- 223 discussions
[commit] r2992 - in freeswitch/trunk/src: . include mod/applications/mod_bridgecall mod/endpoints/mod_sofia
by Freeswitch SVN 06 Oct '06
by Freeswitch SVN 06 Oct '06
06 Oct '06
Author: anthm
Date: Fri Oct 6 18:39:49 2006
New Revision: 2992
Modified:
freeswitch/trunk/src/include/switch_ivr.h
freeswitch/trunk/src/include/switch_types.h
freeswitch/trunk/src/include/switch_utils.h
freeswitch/trunk/src/mod/applications/mod_bridgecall/mod_bridgecall.c
freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
freeswitch/trunk/src/switch_caller.c
freeswitch/trunk/src/switch_console.c
freeswitch/trunk/src/switch_core.c
freeswitch/trunk/src/switch_ivr.c
freeswitch/trunk/src/switch_rtp.c
freeswitch/trunk/src/switch_utils.c
Log:
Insane amounts of yucky satanic code to make transfer and that kind of thing work.
Transfers work better when both legs of the call live in thier own channel eg bridged calls
A -> B where you want a to make B -> C
when you route a call to an IVR or playback app you are not really bridging you have
A all alone executing the script so it's hard to transfer that.
I do have it aparently working but it's goofy and you are better off
putting your IVR on it's own switch so they are all inbound calls
then you have A -> B -> IVR
now A can happily transfer B who can stay on line with IVR without stopping
the execution. You can also accomplish this by calling in a loop back to the same box
if you dont want to have 2 boxes.
Also the beginning effort at bridging calls with no media is here
set this magic variable in your dialplan to convince mod_sofia
to pass A's sdp as it's own to B and return B's sdp back to A on 200 or 183
<action application="set" data="no_media=true"/>
<action application="bridge" data="sofia/id(a)host.com"/>
You will need a new sofia tarball for this version
There is a bunch of other odds and ends added like a function or 2 etc
Oh,
And don't be suprised if it introduces all kinds of bugs!
Modified: freeswitch/trunk/src/include/switch_ivr.h
==============================================================================
--- freeswitch/trunk/src/include/switch_ivr.h (original)
+++ freeswitch/trunk/src/include/switch_ivr.h Fri Oct 6 18:39:49 2006
@@ -223,6 +223,13 @@
void *session_data,
void *peer_session_data);
+/*!
+ \brief Bridge Signalling from one session to another
+ \param session one session
+ \param peer_session the other session
+ \return SWITCH_STATUS_SUCCESS if all is well
+*/
+SWITCH_DECLARE(switch_status_t) switch_ivr_signal_bridge(switch_core_session_t *session, switch_core_session_t *peer_session);
/*!
\brief Transfer an existing session to another location
Modified: freeswitch/trunk/src/include/switch_types.h
==============================================================================
--- freeswitch/trunk/src/include/switch_types.h (original)
+++ freeswitch/trunk/src/include/switch_types.h Fri Oct 6 18:39:49 2006
@@ -72,6 +72,11 @@
#define SWITCH_HTDOCS_DIR SWITCH_PREFIX_DIR SWITCH_PATH_SEPARATOR "htdocs"
#endif
+#define SWITCH_R_SDP_VARIABLE "_switch_r_sdp_"
+#define SWITCH_L_SDP_VARIABLE "_switch_l_sdp_"
+#define SWITCH_BRIDGE_VARIABLE "BRIDGETO"
+#define SWITCH_SIGNAL_BRIDGE_VARIABLE "SIGNAL_BRIDGETO"
+
#define SWITCH_BITS_PER_BYTE 8
typedef uint8_t switch_byte_t;
@@ -232,7 +237,8 @@
SWITCH_MESSAGE_TRANSMIT_TEXT - A text message
SWITCH_MESSAGE_INDICATE_PROGRESS - indicate progress
SWITCH_MESSAGE_INDICATE_BRIDGE - indicate a bridge starting
- SWITCH_MESSAGE_INDICATE_UNBRIDGE - indicate a bridge ending
+ SWITCH_MESSAGE_INDICATE_UNBRIDGE - indicate a bridge ending
+ SWITCH_MESSAGE_INDICATE_TRANSFER - indicate a transfer is taking place
</pre>
*/
typedef enum {
@@ -240,7 +246,8 @@
SWITCH_MESSAGE_TRANSMIT_TEXT,
SWITCH_MESSAGE_INDICATE_PROGRESS,
SWITCH_MESSAGE_INDICATE_BRIDGE,
- SWITCH_MESSAGE_INDICATE_UNBRIDGE
+ SWITCH_MESSAGE_INDICATE_UNBRIDGE,
+ SWITCH_MESSAGE_INDICATE_TRANSFER
} switch_core_session_message_types_t;
@@ -392,6 +399,7 @@
CF_TAGGED = (1 << 10) - Channel is tagged
CF_WINNER = (1 << 11) - Channel is the winner
CF_CONTROLLED = (1 << 12) - Channel is under control
+CF_NOMEDIA = (1 << 13) - Channel has no media
</pre>
*/
@@ -408,7 +416,8 @@
CF_SERVICE = (1 << 9),
CF_TAGGED = (1 << 10),
CF_WINNER = (1 << 11),
- CF_CONTROLLED = (1 << 12)
+ CF_CONTROLLED = (1 << 12),
+ CF_NOMEDIA = (1 << 13)
} switch_channel_flag_t;
Modified: freeswitch/trunk/src/include/switch_utils.h
==============================================================================
--- freeswitch/trunk/src/include/switch_utils.h (original)
+++ freeswitch/trunk/src/include/switch_utils.h Fri Oct 6 18:39:49 2006
@@ -193,6 +193,16 @@
SWITCH_DECLARE(unsigned int) switch_separate_string(char *buf, char delim, char **array, int arraylen);
/*!
+ \brief Escape a string by prefixing a list of characters with an escape character
+ \param pool a memory pool to use
+ \param in the string
+ \param delim the list of characters to escape
+ \param esc the escape character
+ \return the escaped string
+*/
+SWITCH_DECLARE(char *) switch_escape_char(switch_memory_pool_t *pool, char *in, char *delim, char esc);
+
+/*!
\brief Create a set of file descriptors to poll
\param poll the polfd to create
\param sock the socket to add
Modified: freeswitch/trunk/src/mod/applications/mod_bridgecall/mod_bridgecall.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_bridgecall/mod_bridgecall.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_bridgecall/mod_bridgecall.c Fri Oct 6 18:39:49 2006
@@ -51,22 +51,31 @@
timelimit = atoi(var);
}
+ if ((var = switch_channel_get_variable(caller_channel, "no_media"))) {
+ switch_channel_set_flag(caller_channel, CF_NOMEDIA);
+ }
+
if (switch_ivr_originate(session, &peer_session, &cause, data, timelimit, NULL, NULL, NULL, NULL) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot Create Outgoing Channel!\n");
/* Hangup the channel with the cause code from the failed originate.*/
switch_channel_hangup(caller_channel, cause);
return;
} else {
- switch_ivr_multi_threaded_bridge(session, peer_session, NULL, NULL, NULL);
+ if (switch_channel_test_flag(caller_channel, CF_NOMEDIA)) {
+ switch_ivr_signal_bridge(session, peer_session);
+ } else {
+ switch_ivr_multi_threaded_bridge(session, peer_session, NULL, NULL, NULL);
+ }
}
}
-
static const switch_application_interface_t bridge_application_interface = {
/*.interface_name */ "bridge",
- /*.application_function */ audio_bridge_function
+ /*.application_function */ audio_bridge_function,
+ /* long_desc */ "Bridge the audio between two sessions",
+ /* short_desc */ "Bridge Audio",
+ /* syntax */ "<channel_url>",
};
-
static const switch_loadable_module_interface_t mod_bridgecall_module_interface = {
/*.module_name = */ modname,
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 Fri Oct 6 18:39:49 2006
@@ -62,6 +62,7 @@
#define MULTICAST_EVENT "multicast::event"
#define SOFIA_REPLACES_HEADER "_sofia_replaces_"
+
#include <sofia-sip/nua.h>
#include <sofia-sip/sip_status.h>
#include <sofia-sip/sdp.h>
@@ -131,7 +132,10 @@
TFLAG_TIMER = (1 << 14),
TFLAG_READY = (1 << 15),
TFLAG_REINVITE = (1 << 16),
- TFLAG_REFER = (1 << 17)
+ TFLAG_REFER = (1 << 17),
+ TFLAG_NOHUP = (1 << 18),
+ TFLAG_XFER = (1 << 19),
+ TFLAG_NOMEDIA = (1 << 20)
} TFLAGS;
static struct {
@@ -250,11 +254,14 @@
char *local_sdp_str;
char *dest;
char *key;
+ char *xferto;
+ char *kick;
unsigned long rm_rate;
switch_payload_t pt;
switch_mutex_t *flag_mutex;
switch_payload_t te;
nua_handle_t *nh;
+ nua_handle_t *nh2;
su_home_t *home;
sip_contact_t *contact;
};
@@ -594,8 +601,10 @@
char buf[1024];
switch_time_t now = switch_time_now();
- assert(tech_pvt != NULL);
-
+ if (switch_test_flag(tech_pvt, TFLAG_NOMEDIA)) {
+ return;
+ }
+
snprintf(buf, sizeof(buf),
"v=0\n"
"o=FreeSWITCH %d%"APR_TIME_T_FMT" %d%"APR_TIME_T_FMT" IN IP4 %s\n"
@@ -653,6 +662,11 @@
static void tech_set_codecs(private_object_t *tech_pvt)
{
+
+ if (switch_test_flag(tech_pvt, TFLAG_NOMEDIA)) {
+ return;
+ }
+
if (tech_pvt->num_codecs) {
return;
}
@@ -734,11 +748,11 @@
char *ip = tech_pvt->profile->rtpip;
switch_port_t sdp_port;
char *err;
-
- if (tech_pvt->adv_sdp_audio_port) {
+
+ if (switch_test_flag(tech_pvt, TFLAG_NOMEDIA) || tech_pvt->adv_sdp_audio_port) {
return SWITCH_STATUS_SUCCESS;
}
-
+
tech_pvt->local_sdp_audio_ip = ip;
tech_pvt->local_sdp_audio_port = switch_rtp_request_port();
sdp_port = tech_pvt->local_sdp_audio_port;
@@ -787,6 +801,8 @@
caller_profile = switch_channel_get_caller_profile(channel);
+
+
if ((tech_pvt->from_str = switch_core_db_mprintf("\"%s\" <sip:%s@%s>",
(char *) caller_profile->caller_id_name,
(char *) caller_profile->caller_id_number,
@@ -794,21 +810,75 @@
))) {
char *rep = switch_channel_get_variable(channel, SOFIA_REPLACES_HEADER);
-
+
tech_choose_port(tech_pvt);
set_local_sdp(tech_pvt);
+
switch_set_flag_locked(tech_pvt, TFLAG_READY);
- tech_pvt->nh = nua_handle(tech_pvt->profile->nua, NULL,
+ if (!tech_pvt->nh) {
+ tech_pvt->nh = nua_handle(tech_pvt->profile->nua, NULL,
+ SIPTAG_TO_STR(tech_pvt->dest),
+ SIPTAG_FROM_STR(tech_pvt->from_str),
+ SIPTAG_CONTACT_STR(tech_pvt->profile->url),
+ TAG_END());
+
+ tech_pvt->sofia_private.session = session;
+ nua_handle_bind(tech_pvt->nh, &tech_pvt->sofia_private);
+
+ }
+
+ nua_invite(tech_pvt->nh,
+ SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
+ SOATAG_RTP_SORT(SOA_RTP_SORT_REMOTE),
+ SOATAG_RTP_SELECT(SOA_RTP_SELECT_ALL),
+ TAG_IF(rep, SIPTAG_REPLACES_STR(rep)),
+ TAG_END());
+ } else {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Memory Error!\n");
+ }
+
+}
+
+
+
+static void do_xfer_invite(switch_core_session_t *session)
+{
+ private_object_t *tech_pvt;
+ switch_channel_t *channel = NULL;
+ switch_caller_profile_t *caller_profile;
+
+ channel = switch_core_session_get_channel(session);
+ assert(channel != NULL);
+
+ tech_pvt = (private_object_t *) switch_core_session_get_private(session);
+ assert(tech_pvt != NULL);
+
+ caller_profile = switch_channel_get_caller_profile(channel);
+
+
+
+ if ((tech_pvt->from_str = switch_core_db_mprintf("\"%s\" <sip:%s@%s>",
+ (char *) caller_profile->caller_id_name,
+ (char *) caller_profile->caller_id_number,
+ tech_pvt->profile->sipip
+ ))) {
+
+ char *rep = switch_channel_get_variable(channel, SOFIA_REPLACES_HEADER);
+
+
+ tech_pvt->nh2 = nua_handle(tech_pvt->profile->nua, NULL,
SIPTAG_TO_STR(tech_pvt->dest),
SIPTAG_FROM_STR(tech_pvt->from_str),
SIPTAG_CONTACT_STR(tech_pvt->profile->url),
TAG_END());
+
- tech_pvt->sofia_private.session = session;
- nua_handle_bind(tech_pvt->nh, &tech_pvt->sofia_private);
-
- nua_invite(tech_pvt->nh,
+ nua_handle_bind(tech_pvt->nh2, &tech_pvt->sofia_private);
+
+
+
+ nua_invite(tech_pvt->nh2,
SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
SOATAG_RTP_SORT(SOA_RTP_SORT_REMOTE),
SOATAG_RTP_SELECT(SOA_RTP_SELECT_ALL),
@@ -829,6 +899,7 @@
{
private_object_t *tech_pvt;
switch_channel_t *channel = NULL;
+ char *sdp;
channel = switch_core_session_get_channel(session);
assert(channel != NULL);
@@ -841,6 +912,16 @@
switch_channel_set_variable(channel, "endpoint_disposition", "INIT");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "SOFIA INIT\n");
+ if (switch_channel_test_flag(channel, CF_NOMEDIA)) {
+ switch_set_flag_locked(tech_pvt, TFLAG_NOMEDIA);
+ }
+
+ if ((sdp = switch_channel_get_variable(channel, SWITCH_L_SDP_VARIABLE))) {
+ tech_pvt->local_sdp_str = switch_core_session_strdup(session, sdp);
+ switch_set_flag(tech_pvt, TFLAG_NOMEDIA);
+ switch_channel_set_flag(channel, CF_NOMEDIA);
+ }
+
if (switch_test_flag(tech_pvt, TFLAG_OUTBOUND)) {
do_invite(session);
}
@@ -937,6 +1018,7 @@
static switch_status_t sofia_on_hangup(switch_core_session_t *session)
{
+ switch_core_session_t *asession;
private_object_t *tech_pvt;
switch_channel_t *channel = NULL;
switch_call_cause_t cause;
@@ -958,6 +1040,13 @@
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Channel %s hanging up, cause: %s\n",
switch_channel_get_name(channel), switch_channel_cause2str(cause), sip_cause);
+
+ if (tech_pvt->kick && (asession = switch_core_session_locate(tech_pvt->kick))) {
+ switch_channel_t *a_channel = switch_core_session_get_channel(asession);
+ switch_channel_hangup(a_channel, switch_channel_get_cause(channel));
+ switch_core_session_rwunlock(asession);
+ }
+
if (tech_pvt->nh) {
if (!switch_test_flag(tech_pvt, TFLAG_BYE)) {
if (switch_test_flag(tech_pvt, TFLAG_ANS)) {
@@ -1088,6 +1177,9 @@
channel = switch_core_session_get_channel(tech_pvt->session);
assert(channel != NULL);
+ if (switch_test_flag(tech_pvt, TFLAG_NOMEDIA)) {
+ return SWITCH_STATUS_SUCCESS;
+ }
if (switch_rtp_ready(tech_pvt->rtp_session) && !switch_test_flag(tech_pvt, TFLAG_REINVITE)) {
return SWITCH_STATUS_SUCCESS;
@@ -1168,7 +1260,8 @@
{
private_object_t *tech_pvt;
switch_channel_t *channel = NULL;
-
+ char *sdp;
+
assert(session != NULL);
channel = switch_core_session_get_channel(session);
@@ -1177,13 +1270,25 @@
tech_pvt = (private_object_t *) switch_core_session_get_private(session);
assert(tech_pvt != NULL);
+ if ((sdp = switch_channel_get_variable(channel, SWITCH_L_SDP_VARIABLE))) {
+ tech_pvt->local_sdp_str = switch_core_session_strdup(session, sdp);
+ switch_set_flag(tech_pvt, TFLAG_NOMEDIA);
+ switch_channel_set_flag(channel, CF_NOMEDIA);
+ }
+
+
if (!switch_test_flag(tech_pvt, TFLAG_ANS) && !switch_channel_test_flag(channel, CF_OUTBOUND)) {
switch_set_flag_locked(tech_pvt, TFLAG_ANS);
+
+
tech_choose_port(tech_pvt);
set_local_sdp(tech_pvt);
activate_rtp(tech_pvt);
+
if (tech_pvt->nh) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Local SDP:\n%s\n", tech_pvt->local_sdp_str);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Local SDP %s:\n%s\n",
+ switch_channel_get_name(channel),
+ tech_pvt->local_sdp_str);
nua_respond(tech_pvt->nh, SIP_200_OK,
SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
SOATAG_AUDIO_AUX("cn telephone-event"),
@@ -1203,10 +1308,6 @@
switch_channel_t *channel = NULL;
int payload = 0;
- //switch_time_t now, started = switch_time_now(), last_act = switch_time_now();
- //unsigned int elapsed;
- //uint32_t hard_timeout = 60000 * 3;
-
channel = switch_core_session_get_channel(session);
assert(channel != NULL);
@@ -1246,7 +1347,6 @@
while (!switch_test_flag(tech_pvt, TFLAG_BYE) && switch_test_flag(tech_pvt, TFLAG_IO) && tech_pvt->read_frame.datalen == 0) {
- //now = switch_time_now();
tech_pvt->read_frame.flags = SFF_NONE;
status = switch_rtp_zerocopy_read_frame(tech_pvt->rtp_session, &tech_pvt->read_frame);
@@ -1448,6 +1548,34 @@
switch (msg->message_id) {
case SWITCH_MESSAGE_INDICATE_BRIDGE:
+
+ if (switch_test_flag(tech_pvt, TFLAG_XFER)) {
+ switch_clear_flag_locked(tech_pvt, TFLAG_XFER);
+ if (msg->pointer_arg) {
+ switch_core_session_t *asession, *bsession = msg->pointer_arg;
+
+ if ((asession = switch_core_session_locate(tech_pvt->xferto))) {
+ private_object_t *a_tech_pvt = switch_core_session_get_private(asession);
+ private_object_t *b_tech_pvt = switch_core_session_get_private(bsession);
+
+ switch_set_flag_locked(a_tech_pvt, TFLAG_REINVITE);
+ a_tech_pvt->remote_sdp_audio_ip = switch_core_session_strdup(asession, b_tech_pvt->remote_sdp_audio_ip);
+ a_tech_pvt->remote_sdp_audio_port = b_tech_pvt->remote_sdp_audio_port;
+ a_tech_pvt->local_sdp_audio_ip = switch_core_session_strdup(asession, b_tech_pvt->local_sdp_audio_ip);
+ a_tech_pvt->local_sdp_audio_port = b_tech_pvt->local_sdp_audio_port;
+ activate_rtp(a_tech_pvt);
+
+ b_tech_pvt->kick = switch_core_session_strdup(bsession, tech_pvt->xferto);
+
+
+ switch_core_session_rwunlock(asession);
+ }
+
+
+ msg->pointer_arg = NULL;
+ return SWITCH_STATUS_FALSE;
+ }
+ }
if (tech_pvt->rtp_session && switch_test_flag(tech_pvt, TFLAG_TIMER)) {
switch_rtp_clear_flag(tech_pvt->rtp_session, SWITCH_RTP_FLAG_USE_TIMER);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "De-activate timed RTP!\n");
@@ -1462,17 +1590,26 @@
case SWITCH_MESSAGE_INDICATE_PROGRESS: {
struct private_object *tech_pvt;
switch_channel_t *channel = NULL;
-
+ char *sdp;
+
channel = switch_core_session_get_channel(session);
assert(channel != NULL);
tech_pvt = switch_core_session_get_private(session);
assert(tech_pvt != NULL);
-
+
if (!switch_test_flag(tech_pvt, TFLAG_EARLY_MEDIA)) {
switch_set_flag_locked(tech_pvt, TFLAG_EARLY_MEDIA);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Asked to send early media by %s\n", msg->from);
+
+ if ((sdp = switch_channel_get_variable(channel, SWITCH_L_SDP_VARIABLE))) {
+ tech_pvt->local_sdp_str = switch_core_session_strdup(session, sdp);
+ switch_set_flag(tech_pvt, TFLAG_NOMEDIA);
+ switch_channel_set_flag(channel, CF_NOMEDIA);
+ }
+
+
/* Transmit 183 Progress with SDP */
tech_choose_port(tech_pvt);
set_local_sdp(tech_pvt);
@@ -1540,6 +1677,7 @@
switch_caller_profile_t *caller_profile = NULL;
private_object_t *tech_pvt = NULL;
switch_channel_t *channel;
+ switch_channel_t *nchannel;
char *host;
*new_session = NULL;
@@ -1586,19 +1724,24 @@
tech_pvt->dest = switch_core_session_alloc(nsession, strlen(dest) + 5);
snprintf(tech_pvt->dest, strlen(dest) + 5, "sip:%s", dest);
}
-
- channel = switch_core_session_get_channel(nsession);
- attach_private(nsession, profile, tech_pvt, dest);
+ attach_private(nsession, profile, tech_pvt, dest);
+ channel = switch_core_session_get_channel(session);
+ nchannel = switch_core_session_get_channel(nsession);
caller_profile = switch_caller_profile_clone(nsession, outbound_profile);
- switch_channel_set_caller_profile(channel, caller_profile);
- switch_channel_set_flag(channel, CF_OUTBOUND);
+ switch_channel_set_caller_profile(nchannel, caller_profile);
+ switch_channel_set_flag(nchannel, CF_OUTBOUND);
switch_set_flag_locked(tech_pvt, TFLAG_OUTBOUND);
- switch_channel_set_state(channel, CS_INIT);
- switch_channel_set_variable(channel, "endpoint_disposition", "OUTBOUND");
+ switch_channel_set_state(nchannel, CS_INIT);
+ switch_channel_set_variable(nchannel, "endpoint_disposition", "OUTBOUND");
*new_session = nsession;
status = SWITCH_STATUS_SUCCESS;
if (session) {
+ char *val;
switch_ivr_transfer_variable(session, nsession, SOFIA_REPLACES_HEADER);
+
+ if (switch_channel_test_flag(channel, CF_NOMEDIA) && (val = switch_channel_get_variable(channel, SWITCH_R_SDP_VARIABLE))) {
+ switch_channel_set_variable(nchannel, SWITCH_L_SDP_VARIABLE, val);
+ }
}
done:
@@ -1723,7 +1866,6 @@
{
char const *l_sdp = NULL, *r_sdp = NULL;
- //int audio = nua_active_inactive, video = nua_active_inactive, chat = nua_active_inactive;
int offer_recv = 0, answer_recv = 0, offer_sent = 0, answer_sent = 0;
int ss_state = nua_callstate_init;
switch_channel_t *channel = NULL;
@@ -1758,6 +1900,7 @@
if (r_sdp) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Remote SDP:\n%s\n", r_sdp);
tech_pvt->remote_sdp_str = switch_core_session_strdup(session, (char *)r_sdp);
+ switch_channel_set_variable(channel, SWITCH_R_SDP_VARIABLE, (char *) r_sdp);
}
}
@@ -1772,34 +1915,38 @@
case nua_callstate_proceeding:
if (channel) {
if (r_sdp) {
- sdp_parser_t *parser = sdp_parse(tech_pvt->home, r_sdp, (int)strlen(r_sdp), 0);
- sdp_session_t *sdp;
- uint8_t match = 0;
+ if (switch_test_flag(tech_pvt, TFLAG_NOMEDIA)) {
+ switch_channel_pre_answer(channel);
+ return;
+ } else {
+ sdp_parser_t *parser = sdp_parse(tech_pvt->home, r_sdp, (int)strlen(r_sdp), 0);
+ sdp_session_t *sdp;
+ uint8_t match = 0;
- if (tech_pvt->num_codecs) {
- if ((sdp = sdp_session(parser))) {
- match = negotiate_sdp(session, sdp);
+ if (tech_pvt->num_codecs) {
+ if ((sdp = sdp_session(parser))) {
+ match = negotiate_sdp(session, sdp);
+ }
}
- }
- if (parser) {
- sdp_parser_free(parser);
- }
+ if (parser) {
+ sdp_parser_free(parser);
+ }
- if (match) {
- tech_choose_port(tech_pvt);
- activate_rtp(tech_pvt);
- switch_channel_set_variable(channel, "endpoint_disposition", "EARLY MEDIA");
- switch_channel_pre_answer(channel);
- return;
+ if (match) {
+ tech_choose_port(tech_pvt);
+ activate_rtp(tech_pvt);
+ switch_channel_set_variable(channel, "endpoint_disposition", "EARLY MEDIA");
+ switch_channel_pre_answer(channel);
+ return;
+ }
+ switch_channel_set_variable(channel, "endpoint_disposition", "NO CODECS");
+ nua_respond(nh, SIP_488_NOT_ACCEPTABLE,
+ TAG_END());
}
- switch_channel_set_variable(channel, "endpoint_disposition", "NO CODECS");
- nua_respond(nh, SIP_488_NOT_ACCEPTABLE,
- TAG_END());
}
}
-
break;
case nua_callstate_completing:
nua_ack(nh, TAG_END());
@@ -1807,60 +1954,69 @@
case nua_callstate_received:
if (channel) {
if (r_sdp) {
- sdp_parser_t *parser = sdp_parse(tech_pvt->home, r_sdp, (int)strlen(r_sdp), 0);
- sdp_session_t *sdp;
- uint8_t match = 0;
+ if (switch_test_flag(tech_pvt, TFLAG_NOMEDIA)) {
+ switch_channel_set_variable(channel, "endpoint_disposition", "RECEIVED_NOMEDIA");
+ switch_channel_set_state(channel, CS_INIT);
+ switch_set_flag_locked(tech_pvt, TFLAG_READY);
+ switch_core_session_thread_launch(session);
+ return;
+ } else {
+ sdp_parser_t *parser = sdp_parse(tech_pvt->home, r_sdp, (int)strlen(r_sdp), 0);
+ sdp_session_t *sdp;
+ uint8_t match = 0;
- if (tech_pvt->num_codecs) {
- if ((sdp = sdp_session(parser))) {
- match = negotiate_sdp(session, sdp);
+ if (tech_pvt->num_codecs) {
+ if ((sdp = sdp_session(parser))) {
+ match = negotiate_sdp(session, sdp);
+ }
}
- }
- if (parser) {
- sdp_parser_free(parser);
- }
+ if (parser) {
+ sdp_parser_free(parser);
+ }
- if (match) {
- nua_handle_t *bnh;
- sip_replaces_t *replaces;
+ if (match) {
+ nua_handle_t *bnh;
+ sip_replaces_t *replaces;
- switch_channel_set_variable(channel, "endpoint_disposition", "RECEIVED");
- switch_channel_set_state(channel, CS_INIT);
- switch_set_flag_locked(tech_pvt, TFLAG_READY);
- switch_core_session_thread_launch(session);
+ switch_channel_set_variable(channel, "endpoint_disposition", "RECEIVED");
+ switch_channel_set_state(channel, CS_INIT);
+ switch_set_flag_locked(tech_pvt, TFLAG_READY);
+ switch_core_session_thread_launch(session);
- if (replaces_str && (replaces = sip_replaces_make(tech_pvt->home, replaces_str)) && (bnh = nua_handle_by_replaces(nua, replaces))) {
- sofia_private_t *b_private;
+ if (replaces_str && (replaces = sip_replaces_make(tech_pvt->home, replaces_str)) && (bnh = nua_handle_by_replaces(nua, replaces))) {
+ sofia_private_t *b_private;
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Processing Attended Transfer\n");
- while (switch_channel_get_state(channel) < CS_EXECUTE) {
- switch_yield(10000);
- }
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Processing Replaces Attended Transfer\n");
+ while (switch_channel_get_state(channel) < CS_EXECUTE) {
+ switch_yield(10000);
+ }
- if ((b_private = nua_handle_fetch(bnh))) {
- char *br_b = switch_channel_get_variable(channel, "BRIDGETO");
- char *br_a = switch_core_session_get_uuid(b_private->session);
+ if ((b_private = nua_handle_fetch(bnh))) {
+ char *br_b = switch_channel_get_variable(channel, SWITCH_BRIDGE_VARIABLE);
+ char *br_a = switch_core_session_get_uuid(b_private->session);
- if (br_b) {
- switch_ivr_uuid_bridge(br_a, br_b);
- switch_channel_set_variable(channel, "endpoint_disposition", "ATTENDED_TRANSFER");
- switch_channel_hangup(channel, SWITCH_CAUSE_ATTENDED_TRANSFER);
+ if (br_b) {
+ switch_ivr_uuid_bridge(br_a, br_b);
+ switch_channel_set_variable(channel, "endpoint_disposition", "ATTENDED_TRANSFER");
+ switch_channel_hangup(channel, SWITCH_CAUSE_ATTENDED_TRANSFER);
+ } else {
+ switch_channel_set_variable(channel, "endpoint_disposition", "ATTENDED_TRANSFER_ERROR");
+ switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
+ }
} else {
switch_channel_set_variable(channel, "endpoint_disposition", "ATTENDED_TRANSFER_ERROR");
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
}
- } else {
- switch_channel_set_variable(channel, "endpoint_disposition", "ATTENDED_TRANSFER_ERROR");
- switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
+ nua_handle_unref(bnh);
}
+ return;
}
- return;
- }
- switch_channel_set_variable(channel, "endpoint_disposition", "NO CODECS");
- nua_respond(nh, SIP_488_NOT_ACCEPTABLE,
- TAG_END());
+ switch_channel_set_variable(channel, "endpoint_disposition", "NO CODECS");
+ nua_respond(nh, SIP_488_NOT_ACCEPTABLE,
+ TAG_END());
+ }
}
}
@@ -1869,77 +2025,104 @@
break;
case nua_callstate_completed:
if (tech_pvt && r_sdp) {
- sdp_parser_t *parser = sdp_parse(tech_pvt->home, r_sdp, (int)strlen(r_sdp), 0);
- sdp_session_t *sdp;
- uint8_t match = 0;
+ if (r_sdp) {
+ if (switch_test_flag(tech_pvt, TFLAG_NOMEDIA)) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "What should i do?\n%s\n", r_sdp);
+ return;
+ } else {
+ sdp_parser_t *parser = sdp_parse(tech_pvt->home, r_sdp, (int)strlen(r_sdp), 0);
+ sdp_session_t *sdp;
+ uint8_t match = 0;
- if (tech_pvt->num_codecs) {
- if ((sdp = sdp_session(parser))) {
- match = negotiate_sdp(session, sdp);
+ if (tech_pvt->num_codecs) {
+ if ((sdp = sdp_session(parser))) {
+ match = negotiate_sdp(session, sdp);
+ }
+ }
+ tech_choose_port(tech_pvt);
+ set_local_sdp(tech_pvt);
+ tech_set_codec(tech_pvt);
+ switch_set_flag_locked(tech_pvt, TFLAG_REINVITE);
+ activate_rtp(tech_pvt);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Processing Reinvite\n");
+ if (parser) {
+ sdp_parser_free(parser);
+ }
}
}
- tech_choose_port(tech_pvt);
- set_local_sdp(tech_pvt);
- tech_set_codec(tech_pvt);
- switch_set_flag_locked(tech_pvt, TFLAG_REINVITE);
- activate_rtp(tech_pvt);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Processing Reinvite\n");
- if (parser) {
- sdp_parser_free(parser);
- }
}
break;
case nua_callstate_ready:
+ if (nh == tech_pvt->nh2) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Cheater Reinvite!\n");
+ switch_set_flag_locked(tech_pvt, TFLAG_REINVITE);
+ tech_pvt->nh = tech_pvt->nh2;
+ tech_pvt->nh2 = NULL;
+ tech_choose_port(tech_pvt);
+ activate_rtp(tech_pvt);
+ return;
+ }
+
if (channel) {
if (r_sdp) {
- sdp_parser_t *parser = sdp_parse(tech_pvt->home, r_sdp, (int)strlen(r_sdp), 0);
- sdp_session_t *sdp;
- uint8_t match = 0;
+ if (switch_test_flag(tech_pvt, TFLAG_NOMEDIA)) {
+ switch_set_flag_locked(tech_pvt, TFLAG_ANS);
+ switch_channel_answer(channel);
+ return;
+ } else {
+ sdp_parser_t *parser = sdp_parse(tech_pvt->home, r_sdp, (int)strlen(r_sdp), 0);
+ sdp_session_t *sdp;
+ uint8_t match = 0;
- if (tech_pvt->num_codecs) {
- if ((sdp = sdp_session(parser))) {
- match = negotiate_sdp(session, sdp);
+ if (tech_pvt->num_codecs) {
+ if ((sdp = sdp_session(parser))) {
+ match = negotiate_sdp(session, sdp);
+ }
}
- }
- if (parser) {
- sdp_parser_free(parser);
- }
+ if (parser) {
+ sdp_parser_free(parser);
+ }
- if (match) {
- switch_set_flag_locked(tech_pvt, TFLAG_ANS);
- switch_channel_set_variable(channel, "endpoint_disposition", "ANSWER");
- tech_choose_port(tech_pvt);
- activate_rtp(tech_pvt);
- switch_channel_answer(channel);
- return;
+ if (match) {
+ switch_set_flag_locked(tech_pvt, TFLAG_ANS);
+ switch_channel_set_variable(channel, "endpoint_disposition", "ANSWER");
+ tech_choose_port(tech_pvt);
+ activate_rtp(tech_pvt);
+ switch_channel_answer(channel);
+ return;
+ }
+
+ switch_channel_set_variable(channel, "endpoint_disposition", "NO CODECS");
+ nua_respond(nh, SIP_488_NOT_ACCEPTABLE, TAG_END());
}
-
- switch_channel_set_variable(channel, "endpoint_disposition", "NO CODECS");
- nua_respond(nh, SIP_488_NOT_ACCEPTABLE,
- TAG_END());
} else if (switch_test_flag(tech_pvt, TFLAG_EARLY_MEDIA)) {
switch_set_flag_locked(tech_pvt, TFLAG_ANS);
switch_channel_set_variable(channel, "endpoint_disposition", "ANSWER");
switch_channel_answer(channel);
return;
} //else probably an ack
-
}
-
+
break;
case nua_callstate_terminating:
break;
- case nua_callstate_terminated:
+ case nua_callstate_terminated:
if (session) {
switch_set_flag_locked(tech_pvt, TFLAG_BYE);
- terminate_session(&session, sip_cause_to_freeswitch(status), __LINE__);
+ if (switch_test_flag(tech_pvt, TFLAG_NOHUP)) {
+ switch_clear_flag_locked(tech_pvt, TFLAG_NOHUP);
+ nua_handle_destroy(tech_pvt->nh);
+ tech_pvt->nh = NULL;
+ } else {
+ terminate_session(&session, sip_cause_to_freeswitch(status), __LINE__);
+ }
}
break;
}
+
-
}
@@ -2235,9 +2418,27 @@
if (session) {
private_object_t *tech_pvt = NULL;
- char *exten = NULL;
+ char *etmp = NULL, *exten = NULL;
+ switch_channel_t *channel_a = NULL, *channel_b = NULL;
tech_pvt = switch_core_session_get_private(session);
+ channel_a = switch_core_session_get_channel(session);
+
+
+ if (!sip->sip_cseq || !(etmp = switch_core_db_mprintf("refer;id=%u", sip->sip_cseq->cs_seq))) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Memory Error!\n");
+ goto done;
+ }
+
+
+ if (switch_channel_test_flag(channel_a, CF_NOMEDIA)) {
+ nua_notify(tech_pvt->nh, SIPTAG_CONTENT_TYPE_STR("message/sipfrag"),
+ SIPTAG_PAYLOAD_STR("SIP/2.0 403 Forbidden"),
+ SIPTAG_EVENT_STR(etmp),
+ TAG_END());
+ goto done;
+ }
+
from = sip->sip_from;
to = sip->sip_to;
@@ -2256,12 +2457,11 @@
char *rep;
if ((rep = strchr(refer_to->r_url->url_headers, '='))) {
- switch_channel_t *channel_a = NULL, *channel_b = NULL;
char *br_a = NULL, *br_b = NULL;
char *buf;
rep++;
- channel_a = switch_core_session_get_channel(session);
+
if ((buf = switch_core_session_alloc(session, strlen(rep) + 1))) {
rep = url_unescape(buf, (const char *) rep);
@@ -2272,45 +2472,86 @@
}
if ((replaces = sip_replaces_make(tech_pvt->home, rep)) && (bnh = nua_handle_by_replaces(nua, replaces))) {
sofia_private_t *b_private;
-
+
+ switch_channel_set_variable(channel_a, SOFIA_REPLACES_HEADER, rep);
if ((b_private = nua_handle_fetch(bnh))) {
channel_b = switch_core_session_get_channel(b_private->session);
- br_a = switch_channel_get_variable(channel_a, "BRIDGETO");
- br_b = switch_channel_get_variable(channel_b, "BRIDGETO");
+ br_a = switch_channel_get_variable(channel_a, SWITCH_BRIDGE_VARIABLE);
+ br_b = switch_channel_get_variable(channel_b, SWITCH_BRIDGE_VARIABLE);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Attended Transfer [%s][%s]\n", br_a, br_b);
if (br_a && br_b) {
switch_ivr_uuid_bridge(br_a, br_b);
switch_channel_set_variable(channel_b, "endpoint_disposition", "ATTENDED_TRANSFER");
- switch_channel_hangup(channel_b, SWITCH_CAUSE_ATTENDED_TRANSFER);
- switch_channel_set_variable(channel_a, "endpoint_disposition", "ATTENDED_TRANSFER");
- switch_channel_hangup(channel_a, SWITCH_CAUSE_ATTENDED_TRANSFER);
+
+ nua_notify(tech_pvt->nh, SIPTAG_CONTENT_TYPE_STR("message/sipfrag"),
+ SIPTAG_PAYLOAD_STR("SIP/2.0 200 OK"),
+ SIPTAG_EVENT_STR(etmp),
+ TAG_END());
+
} else {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid Transfer! [%s][%s]\n", br_a, br_b);
- switch_channel_set_variable(channel_b, "endpoint_disposition", "ATTENDED_TRANSFER_ERROR");
- switch_channel_hangup(channel_b, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
- switch_channel_set_variable(channel_a, "endpoint_disposition", "ATTENDED_TRANSFER_ERROR");
- switch_channel_hangup(channel_a, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
+ private_object_t *tech_pvt_b = (private_object_t *) switch_core_session_get_private(b_private->session);
+
+ if (!br_a && !br_b) {
+ switch_set_flag_locked(tech_pvt, TFLAG_NOHUP);
+ switch_set_flag_locked(tech_pvt_b, TFLAG_XFER);
+ tech_pvt_b->xferto = switch_core_session_strdup(b_private->session, switch_core_session_get_uuid(session));
+ } else if (!br_a && br_b) {
+ switch_core_session_t *bsession;
+
+ if ((bsession = switch_core_session_locate(br_b))) {
+ private_object_t *b_tech_pvt = switch_core_session_get_private(bsession);
+ switch_channel_t *b_channel = switch_core_session_get_channel(bsession);
+ private_object_t *bp_tech_pvt = switch_core_session_get_private(b_private->session);
+
+ switch_core_session_get_uuid(b_private->session);
+ switch_set_flag_locked(tech_pvt, TFLAG_NOHUP);
+
+ switch_channel_clear_state_handler(b_channel, NULL);
+ switch_channel_set_state_flag(b_channel, CF_TRANSFER);
+ switch_channel_set_state(b_channel, CS_TRANSMIT);
+
+ switch_set_flag_locked(tech_pvt, TFLAG_REINVITE);
+ tech_pvt->local_sdp_audio_ip = switch_core_session_strdup(session, bp_tech_pvt->local_sdp_audio_ip);
+ tech_pvt->local_sdp_audio_port = bp_tech_pvt->local_sdp_audio_port;
+
+ tech_pvt->remote_sdp_audio_ip = switch_core_session_strdup(session, b_tech_pvt->remote_sdp_audio_ip);
+ tech_pvt->remote_sdp_audio_port = b_tech_pvt->remote_sdp_audio_port;
+ activate_rtp(tech_pvt);
+
+ b_tech_pvt->kick = switch_core_session_strdup(bsession, switch_core_session_get_uuid(session));
+
+
+ switch_core_session_rwunlock(bsession);
+ }
+
+ switch_channel_hangup(channel_b, SWITCH_CAUSE_ATTENDED_TRANSFER);
+ }
+
+ nua_notify(tech_pvt->nh, SIPTAG_CONTENT_TYPE_STR("message/sipfrag"),
+ SIPTAG_PAYLOAD_STR("SIP/2.0 200 OK"),
+ SIPTAG_EVENT_STR(etmp),
+ TAG_END());
+
}
}
-
nua_handle_unref(bnh);
} else { /* the other channel is on a different box, we have to go find them */
- if (exten && (br_a = switch_channel_get_variable(channel_a, "BRIDGETO"))) {
- switch_core_session_t *bsession;
+ if (exten && (br_a = switch_channel_get_variable(channel_a, SWITCH_BRIDGE_VARIABLE))) {
+ switch_core_session_t *asession;
switch_channel_t *channel = switch_core_session_get_channel(session);
- if ((bsession = switch_core_session_locate(br_a))) {
+ if ((asession = switch_core_session_locate(br_a))) {
switch_core_session_t *tsession;
switch_call_cause_t cause = SWITCH_CAUSE_NORMAL_CLEARING;
uint32_t timeout = 60;
char *tuuid_str;
- channel = switch_core_session_get_channel(bsession);
+ channel = switch_core_session_get_channel(asession);
- exten = switch_core_db_mprintf("sofia/%s/%s@%s:%d",
+ exten = switch_core_db_mprintf("sofia/%s/%s@%s:%s",
profile->name,
(char *) refer_to->r_url->url_user,
(char *) refer_to->r_url->url_host,
@@ -2319,7 +2560,7 @@
switch_channel_set_variable(channel, SOFIA_REPLACES_HEADER, rep);
- if (switch_ivr_originate(bsession,
+ if (switch_ivr_originate(asession,
&tsession,
&cause,
exten,
@@ -2329,14 +2570,21 @@
NULL,
NULL) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot Create Outgoing Channel! [%s]\n", exten);
+ nua_notify(tech_pvt->nh, SIPTAG_CONTENT_TYPE_STR("message/sipfrag"),
+ SIPTAG_PAYLOAD_STR("SIP/2.0 403 Forbidden"),
+ SIPTAG_EVENT_STR(etmp),
+ TAG_END());
goto done;
}
- switch_core_session_rwunlock(bsession);
+ switch_core_session_rwunlock(asession);
tuuid_str = switch_core_session_get_uuid(tsession);
switch_ivr_uuid_bridge(br_a, tuuid_str);
switch_channel_set_variable(channel_a, "endpoint_disposition", "ATTENDED_TRANSFER");
- switch_channel_hangup(channel_a, SWITCH_CAUSE_ATTENDED_TRANSFER);
+ nua_notify(tech_pvt->nh, SIPTAG_CONTENT_TYPE_STR("message/sipfrag"),
+ SIPTAG_PAYLOAD_STR("SIP/2.0 200 OK"),
+ SIPTAG_EVENT_STR(etmp),
+ TAG_END());
} else {
goto error;
}
@@ -2344,7 +2592,10 @@
} else { error:
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid Transfer! [%s]\n", br_a);
switch_channel_set_variable(channel_a, "endpoint_disposition", "ATTENDED_TRANSFER_ERROR");
- switch_channel_hangup(channel_a, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
+ nua_notify(tech_pvt->nh, SIPTAG_CONTENT_TYPE_STR("message/sipfrag"),
+ SIPTAG_PAYLOAD_STR("SIP/2.0 403 Forbidden"),
+ SIPTAG_EVENT_STR(etmp),
+ TAG_END());
}
}
} else {
@@ -2362,26 +2613,50 @@
switch_channel_t *channel = switch_core_session_get_channel(session);
char *br;
- switch_channel_set_variable(channel, "endpoint_disposition", "BLIND_TRANSFER");
- switch_channel_hangup(channel, SWITCH_CAUSE_BLIND_TRANSFER);
-
- if ((br = switch_channel_get_variable(channel, "BRIDGETO"))) {
+ if ((br = switch_channel_get_variable(channel, SWITCH_BRIDGE_VARIABLE))) {
switch_core_session_t *bsession;
-
+
if ((bsession = switch_core_session_locate(br))) {
channel = switch_core_session_get_channel(bsession);
switch_channel_set_variable(channel, "TRANSFER_FALLBACK", (char *) from->a_user);
switch_ivr_session_transfer(bsession, exten, profile->dialplan, profile->context);
switch_core_session_rwunlock(bsession);
}
- }
+ switch_channel_set_variable(channel, "endpoint_disposition", "BLIND_TRANSFER");
+
+ nua_notify(tech_pvt->nh, SIPTAG_CONTENT_TYPE_STR("message/sipfrag"),
+ SIPTAG_PAYLOAD_STR("SIP/2.0 200 OK"),
+ SIPTAG_EVENT_STR(etmp),
+ TAG_END());
+ } else {
+ exten = switch_core_db_mprintf("sip:%s@%s:%s",
+ (char *) refer_to->r_url->url_user,
+ (char *) refer_to->r_url->url_host,
+ refer_to->r_url->url_port);
+ tech_pvt->dest = switch_core_session_strdup(session, exten);
+
+
+ switch_set_flag_locked(tech_pvt, TFLAG_NOHUP);
+
+
+ nua_notify(tech_pvt->nh, SIPTAG_CONTENT_TYPE_STR("message/sipfrag"),
+ SIPTAG_PAYLOAD_STR("SIP/2.0 200 OK"),
+ SIPTAG_EVENT_STR(etmp),
+ TAG_END());
+
+ do_xfer_invite(session);
+
+ }
}
done:
- if (strchr(exten, '@')) {
+ if (exten && strchr(exten, '@')) {
switch_core_db_free(exten);
}
+ if (etmp) {
+ switch_core_db_free(etmp);
+ }
}
}
@@ -2394,11 +2669,11 @@
tagi_t tags[])
{
switch_core_session_t *session = sofia_private ? sofia_private->session : NULL;
- //refer_handle_t *refer = sofia_private ? sofia_private->refer : NULL;
char key[128] = "";
- if (!session) {
+ if (!session) {
+
if ((profile->pflags & PFLAG_AUTH_CALLS)) {
if (handle_register(nua, profile, nh, sip, REG_INVITE, key, sizeof(key))) {
return;
@@ -2510,7 +2785,6 @@
sip_t const *sip,
tagi_t tags[])
{
- //switch_core_session_t *session = sofia_private ? sofia_private->session : NULL;
handle_register(nua, profile, nh, sip, REG_REGISTER, NULL, 0);
}
@@ -2547,15 +2821,11 @@
if ((tech_pvt = switch_core_session_get_private(session)) && switch_test_flag(tech_pvt, TFLAG_REFER)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "received reply from refer\n");
- if (status == 200) {
- //crap
- }
return;
}
}
if (!oreg) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No authentication available!\n");
if (sofia_private->oreg) {
nua_handle_destroy(nh);
}
@@ -2906,9 +3176,7 @@
}
su_root_step(profile->s_root, 1000);
- //su_root_run(profile->s_root);
}
-
if (switch_event_create(&s_event, SWITCH_EVENT_UNPUBLISH) == SWITCH_STATUS_SUCCESS) {
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "service", "_sip._udp");
Modified: freeswitch/trunk/src/switch_caller.c
==============================================================================
--- freeswitch/trunk/src/switch_caller.c (original)
+++ freeswitch/trunk/src/switch_caller.c Fri Oct 6 18:39:49 2006
@@ -145,55 +145,55 @@
if (caller_profile->username) {
snprintf(header_name, sizeof(header_name), "%s-Username", prefix);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->username);
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%s", caller_profile->username);
}
if (caller_profile->dialplan) {
snprintf(header_name, sizeof(header_name), "%s-Dialplan", prefix);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->dialplan);
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%s", caller_profile->dialplan);
}
if (caller_profile->caller_id_name) {
snprintf(header_name, sizeof(header_name), "%s-Caller-ID-Name", prefix);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->caller_id_name);
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%s", caller_profile->caller_id_name);
}
if (caller_profile->caller_id_number) {
snprintf(header_name, sizeof(header_name), "%s-Caller-ID-Number", prefix);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->caller_id_number);
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%s", caller_profile->caller_id_number);
}
if (caller_profile->network_addr) {
snprintf(header_name, sizeof(header_name), "%s-Network-Addr", prefix);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->network_addr);
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%s", caller_profile->network_addr);
}
if (caller_profile->ani) {
snprintf(header_name, sizeof(header_name), "%s-ANI", prefix);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->ani);
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%s", caller_profile->ani);
}
if (caller_profile->ani2) {
snprintf(header_name, sizeof(header_name), "%s-ANI2", prefix);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->ani2);
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%s", caller_profile->ani2);
}
if (caller_profile->destination_number) {
snprintf(header_name, sizeof(header_name), "%s-Destination-Number", prefix);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->destination_number);
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%s", caller_profile->destination_number);
}
if (caller_profile->uuid) {
snprintf(header_name, sizeof(header_name), "%s-Unique-ID", prefix);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->uuid);
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%s", caller_profile->uuid);
}
if (caller_profile->source) {
snprintf(header_name, sizeof(header_name), "%s-Source", prefix);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->source);
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%s", caller_profile->source);
}
if (caller_profile->context) {
snprintf(header_name, sizeof(header_name), "%s-Context", prefix);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->context);
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%s", caller_profile->context);
}
if (caller_profile->rdnis) {
snprintf(header_name, sizeof(header_name), "%s-RDNIS", prefix);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->rdnis);
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%s", caller_profile->rdnis);
}
if (caller_profile->chan_name) {
snprintf(header_name, sizeof(header_name), "%s-Channel-Name", prefix);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, caller_profile->chan_name);
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%s", caller_profile->chan_name);
}
}
Modified: freeswitch/trunk/src/switch_console.c
==============================================================================
--- freeswitch/trunk/src/switch_console.c (original)
+++ freeswitch/trunk/src/switch_console.c Fri Oct 6 18:39:49 2006
@@ -88,7 +88,7 @@
ret = -1;
} else {
ret = 0;
- snprintf(end, remaining, data);
+ snprintf(end, remaining, "%s", data);
handle->data_len = strlen(buf);
handle->end = (uint8_t *)(handle->data) + handle->data_len;
}
Modified: freeswitch/trunk/src/switch_core.c
==============================================================================
--- freeswitch/trunk/src/switch_core.c (original)
+++ freeswitch/trunk/src/switch_core.c Fri Oct 6 18:39:49 2006
@@ -2456,8 +2456,8 @@
if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_EXECUTE) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(session->channel, event);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Application", extension->current_application->application_name);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Application-Data", extension->current_application->application_data);
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Application", "%s", extension->current_application->application_name);
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Application-Data", "%s", extension->current_application->application_data);
switch_event_fire(&event);
}
application_interface->application_function(session, extension->current_application->application_data);
Modified: freeswitch/trunk/src/switch_ivr.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr.c (original)
+++ freeswitch/trunk/src/switch_ivr.c Fri Oct 6 18:39:49 2006
@@ -1372,7 +1372,7 @@
msg.from = __FILE__;
switch_core_session_receive_message(session_a, &msg);
- switch_channel_set_variable(chan_a, "BRIDGETO", NULL);
+ switch_channel_set_variable(chan_a, SWITCH_BRIDGE_VARIABLE, NULL);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "BRIDGE THREAD DONE [%s]\n", switch_channel_get_name(chan_a));
switch_channel_clear_flag(chan_a, CF_BRIDGED);
@@ -1514,14 +1514,14 @@
if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_EXECUTE) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(channel, event);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Application", "uuid_bridge");
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Application-Data", switch_core_session_get_uuid(other_session));
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Application-Data", "%s", switch_core_session_get_uuid(other_session));
switch_event_fire(&event);
}
if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_EXECUTE) == SWITCH_STATUS_SUCCESS) {
switch_channel_event_set_data(other_channel, event);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Application", "uuid_bridge");
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Application-Data", switch_core_session_get_uuid(session));
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Application-Data", "%s", switch_core_session_get_uuid(session));
switch_event_fire(&event);
}
@@ -1912,7 +1912,7 @@
}
endfor1:
- if (session) {
+ if (session && !switch_channel_test_flag(caller_channel, CF_NOMEDIA)) {
switch_codec_t *read_codec = NULL;
switch_channel_pre_answer(caller_channel);
@@ -1946,7 +1946,8 @@
check_channel_status(peer_channels, peer_sessions, argc, &idx, file, key) && ((time(NULL) - start) < (time_t)timelimit_sec)) {
/* read from the channel while we wait if the audio is up on it */
- if (session && (switch_channel_test_flag(caller_channel, CF_ANSWERED) || switch_channel_test_flag(caller_channel, CF_EARLY_MEDIA))) {
+ if (session && !switch_channel_test_flag(caller_channel, CF_NOMEDIA) &&
+ (switch_channel_test_flag(caller_channel, CF_ANSWERED) || switch_channel_test_flag(caller_channel, CF_EARLY_MEDIA))) {
switch_status_t status = switch_core_session_read_frame(session, &read_frame, 1000, 0);
if (!SWITCH_READ_ACCEPTABLE(status)) {
@@ -1964,7 +1965,7 @@
}
- if (session) {
+ if (session && !switch_channel_test_flag(caller_channel, CF_NOMEDIA)) {
switch_core_session_reset(session);
}
@@ -1987,6 +1988,11 @@
}
if (caller_channel && switch_channel_test_flag(peer_channel, CF_ANSWERED)) {
+ char *val;
+
+ if (switch_channel_test_flag(peer_channel, CF_NOMEDIA) && (val = switch_channel_get_variable(peer_channel, SWITCH_R_SDP_VARIABLE))) {
+ switch_channel_set_variable(caller_channel, SWITCH_L_SDP_VARIABLE, val);
+ }
switch_channel_answer(caller_channel);
}
@@ -2042,6 +2048,100 @@
}
+static switch_status_t signal_bridge_on_hangup(switch_core_session_t *session)
+{
+ char *uuid;
+ switch_channel_t *channel = NULL;
+ switch_core_session_t *other_session;
+ switch_event_t *event;
+
+ channel = switch_core_session_get_channel(session);
+ assert(channel != NULL);
+
+ if (switch_channel_test_flag(channel, CF_ORIGINATOR)) {
+ switch_channel_clear_flag(channel, CF_ORIGINATOR);
+ if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_UNBRIDGE) == SWITCH_STATUS_SUCCESS) {
+ switch_channel_event_set_data(channel, event);
+ switch_event_fire(&event);
+ }
+ }
+
+
+ if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BRIDGE_VARIABLE)) && (other_session = switch_core_session_locate(uuid))) {
+ switch_channel_t *other_channel = NULL;
+
+ other_channel = switch_core_session_get_channel(other_session);
+ assert(other_channel != NULL);
+
+ switch_channel_hangup(other_channel, switch_channel_get_cause(channel));
+ switch_core_session_rwunlock(other_session);
+ }
+
+ return SWITCH_STATUS_SUCCESS;
+}
+
+static const switch_state_handler_table_t signal_bridge_state_handlers = {
+ /*.on_init */ NULL,
+ /*.on_ring */ NULL,
+ /*.on_execute */ NULL,
+ /*.on_hangup */ signal_bridge_on_hangup,
+ /*.on_loopback */ NULL,
+ /*.on_transmit */ NULL,
+ /*.on_hold */ NULL
+};
+
+
+
+SWITCH_DECLARE(switch_status_t) switch_ivr_signal_bridge(switch_core_session_t *session, switch_core_session_t *peer_session)
+{
+ switch_channel_t *caller_channel, *peer_channel;
+ switch_event_t *event;
+
+ caller_channel = switch_core_session_get_channel(session);
+ assert(caller_channel != NULL);
+
+ switch_channel_set_flag(caller_channel, CF_ORIGINATOR);
+
+ peer_channel = switch_core_session_get_channel(peer_session);
+ assert(peer_channel != NULL);
+
+ switch_channel_set_variable(caller_channel, SWITCH_SIGNAL_BRIDGE_VARIABLE, switch_core_session_get_uuid(peer_session));
+ switch_channel_set_variable(peer_channel, SWITCH_SIGNAL_BRIDGE_VARIABLE, switch_core_session_get_uuid(session));
+
+ switch_channel_clear_state_handler(caller_channel, NULL);
+ switch_channel_clear_state_handler(peer_channel, NULL);
+
+ switch_channel_add_state_handler(caller_channel, &signal_bridge_state_handlers);
+ switch_channel_add_state_handler(peer_channel, &signal_bridge_state_handlers);
+
+
+ /* fire events that will change the data table from "show channels" */
+ if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_EXECUTE) == SWITCH_STATUS_SUCCESS) {
+ switch_channel_event_set_data(caller_channel, event);
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Application", "signal_bridge");
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Application-Data", "%s", switch_core_session_get_uuid(peer_session));
+ switch_event_fire(&event);
+ }
+
+ if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_EXECUTE) == SWITCH_STATUS_SUCCESS) {
+ switch_channel_event_set_data(peer_channel, event);
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Application", "signal_bridge");
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Application-Data", "%s", switch_core_session_get_uuid(session));
+ switch_event_fire(&event);
+ }
+
+ if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_BRIDGE) == SWITCH_STATUS_SUCCESS) {
+ switch_channel_event_set_data(caller_channel, event);
+ switch_event_fire(&event);
+ }
+
+ switch_channel_set_state(caller_channel, CS_TRANSMIT);
+ switch_channel_set_state(peer_channel, CS_TRANSMIT);
+
+ return SWITCH_STATUS_SUCCESS;
+}
+
+
SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_session_t *session,
switch_core_session_t *peer_session,
switch_input_callback_function_t input_callback,
@@ -2102,18 +2202,32 @@
switch_event_fire(&event);
}
- msg.message_id = SWITCH_MESSAGE_INDICATE_BRIDGE;
- msg.from = __FILE__;
- msg.pointer_arg = session;
+ if (switch_core_session_read_lock(peer_session) == SWITCH_STATUS_SUCCESS) {
+ switch_channel_set_variable(caller_channel, SWITCH_BRIDGE_VARIABLE, switch_core_session_get_uuid(peer_session));
+ switch_channel_set_variable(peer_channel, SWITCH_BRIDGE_VARIABLE, switch_core_session_get_uuid(session));
- switch_core_session_receive_message(peer_session, &msg);
- msg.pointer_arg = peer_session;
- switch_core_session_receive_message(session, &msg);
+ msg.message_id = SWITCH_MESSAGE_INDICATE_BRIDGE;
+ msg.from = __FILE__;
+ msg.pointer_arg = session;
- if (switch_core_session_read_lock(peer_session) == SWITCH_STATUS_SUCCESS) {
- switch_channel_set_variable(caller_channel, "BRIDGETO", switch_core_session_get_uuid(peer_session));
- switch_channel_set_variable(peer_channel, "BRIDGETO", switch_core_session_get_uuid(session));
+ switch_core_session_receive_message(peer_session, &msg);
+ if (!msg.pointer_arg) {
+ status = SWITCH_STATUS_FALSE;
+ switch_core_session_rwunlock(peer_session);
+ goto done;
+ }
+
+ msg.pointer_arg = peer_session;
+ switch_core_session_receive_message(session, &msg);
+
+ if (!msg.pointer_arg) {
+ status = SWITCH_STATUS_FALSE;
+ switch_core_session_rwunlock(peer_session);
+ goto done;
+ }
+
+
switch_channel_set_private(peer_channel, "_bridge_", other_audio_thread);
switch_channel_set_state(peer_channel, CS_LOOPBACK);
audio_bridge_thread(NULL, (void *) this_audio_thread);
@@ -2164,6 +2278,7 @@
switch_channel_hangup(peer_channel, SWITCH_CAUSE_NO_ANSWER);
}
+ done:
return status;
}
@@ -2219,6 +2334,7 @@
{
switch_channel_t *channel;
switch_caller_profile_t *profile, *new_profile;
+ switch_core_session_message_t msg = {0};
assert(session != NULL);
assert(extension != NULL);
@@ -2245,6 +2361,11 @@
switch_channel_set_caller_profile(channel, new_profile);
switch_channel_set_flag(channel, CF_TRANSFER);
switch_channel_set_state(channel, CS_RING);
+
+ msg.message_id = SWITCH_MESSAGE_INDICATE_TRANSFER;
+ msg.from = __FILE__;
+ switch_core_session_receive_message(session, &msg);
+
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Transfer %s to %s[%s@%s]\n",
switch_channel_get_name(channel), dialplan, extension, context);
return SWITCH_STATUS_SUCCESS;
Modified: freeswitch/trunk/src/switch_rtp.c
==============================================================================
--- freeswitch/trunk/src/switch_rtp.c (original)
+++ freeswitch/trunk/src/switch_rtp.c Fri Oct 6 18:39:49 2006
@@ -329,6 +329,11 @@
return SWITCH_STATUS_SOCKERR;
}
+ if (switch_socket_opt_set(rtp_session->sock, SWITCH_SO_REUSEADDR, 1) != SWITCH_STATUS_SUCCESS) {
+ *err = "Socket Error!";
+ return SWITCH_STATUS_FALSE;
+ }
+
if (switch_socket_bind(rtp_session->sock, rtp_session->local_addr) != SWITCH_STATUS_SUCCESS) {
*err = "Bind Error!";
return SWITCH_STATUS_FALSE;
Modified: freeswitch/trunk/src/switch_utils.c
==============================================================================
--- freeswitch/trunk/src/switch_utils.c (original)
+++ freeswitch/trunk/src/switch_utils.c Fri Oct 6 18:39:49 2006
@@ -72,6 +72,45 @@
return '\0';
}
+SWITCH_DECLARE(char *) switch_escape_char(switch_memory_pool_t *pool, char *in, char *delim, char esc)
+{
+ char *data, *p, *d;
+ int count = 1, i = 0;
+
+ p = in;
+ while(*p) {
+ d = delim;
+ while (*d) {
+ if (*p == *d) {
+ count++;
+ }
+ d++;
+ }
+ p++;
+ }
+
+ if (count == 1) {
+ return in;
+ }
+
+ data = switch_core_alloc(pool, strlen(in) + count);
+
+ p = in;
+ while(*p) {
+ d = delim;
+ while (*d) {
+ if (*p == *d) {
+ data[i++] = esc;
+ }
+ d++;
+ }
+ data[i++] = *p;
+ p++;
+ }
+ return data;
+}
+
+
SWITCH_DECLARE(unsigned int) switch_separate_string(char *buf, char delim, char **array, int arraylen)
{
int argc;
1
0
Author: mikej
Date: Fri Oct 6 11:27:14 2006
New Revision: 2990
Modified:
freeswitch/trunk/w32/Setup/Setup.vdproj
Log:
add pthread dll to setup for sofia
Modified: freeswitch/trunk/w32/Setup/Setup.vdproj
==============================================================================
--- freeswitch/trunk/w32/Setup/Setup.vdproj (original)
+++ freeswitch/trunk/w32/Setup/Setup.vdproj Fri Oct 6 11:27:14 2006
@@ -63,222 +63,240 @@
}
"Entry"
{
- "MsmKey" = "8:_329D8DAE6C01FCF026E9DFB48B932203"
- "OwnerKey" = "8:_28FBC5A60B44423B8A2CC378347483CE"
+ "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
+ "OwnerKey" = "8:_1CFB1AB04E024FC993E0EB4859DF8408"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_3FBEFE0119944C6781F81104ECEF37CA"
- "OwnerKey" = "8:_UNDEFINED"
+ "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
+ "OwnerKey" = "8:_3E37631016BC45B2B672FE23257D542B"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_4A285D260C3748A4BEFA6E5A9004D128"
- "OwnerKey" = "8:_UNDEFINED"
+ "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
+ "OwnerKey" = "8:_FBB0E565B1DE49CE9C827ACAC337AC5B"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_59CFED0C4EC0492C945E4EBC04FE965F"
- "OwnerKey" = "8:_UNDEFINED"
+ "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
+ "OwnerKey" = "8:_F0B800E719294692A02518CFD8CBAEFF"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_5A636BB90F7F4B86ACB8839EA2C899AA"
- "OwnerKey" = "8:_UNDEFINED"
+ "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
+ "OwnerKey" = "8:_EF14CB99F3414BB689D0CB0E6D6B8AB8"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_684D96FA2BDD46909367E651099D8C4E"
- "OwnerKey" = "8:_UNDEFINED"
+ "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
+ "OwnerKey" = "8:_D2EF447106B24E67907DAED3D39CFBB1"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_69EB1A147CC2428435BDCA35014C96E1"
- "OwnerKey" = "8:_D2EF447106B24E67907DAED3D39CFBB1"
+ "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
+ "OwnerKey" = "8:_D1269F1E49D442CF8EAC96C23E60325D"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_6E5C001E7A314DCEA0A4BF52BF74BCAD"
- "OwnerKey" = "8:_UNDEFINED"
+ "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
+ "OwnerKey" = "8:_BB649A2C1ABE4895859025B09A240323"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_72A8732C0C0C4D0EAAE89DBB82073335"
- "OwnerKey" = "8:_UNDEFINED"
+ "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
+ "OwnerKey" = "8:_B20769E090034897B32E3EA4EC1BA8A0"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_7358123D2D064AD1BC517911A8B23D1B"
- "OwnerKey" = "8:_UNDEFINED"
+ "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
+ "OwnerKey" = "8:_A944ADCEDF884574A23F7BA5420A6BA1"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_83062AA0528B40A59202BC7668F7132A"
- "OwnerKey" = "8:_UNDEFINED"
+ "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
+ "OwnerKey" = "8:_A0D5F714A0F94250A1C39603B699AB82"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_83C1B93AD71B4F8F9E074F9607B60DF1"
- "OwnerKey" = "8:_UNDEFINED"
+ "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
+ "OwnerKey" = "8:_83C1B93AD71B4F8F9E074F9607B60DF1"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_87768631363249B2B301143C193612F7"
- "OwnerKey" = "8:_UNDEFINED"
+ "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
+ "OwnerKey" = "8:_59CFED0C4EC0492C945E4EBC04FE965F"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_879085EF680EFDF6242DCB77439EC825"
+ "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
+ "OwnerKey" = "8:_4A285D260C3748A4BEFA6E5A9004D128"
+ "MsmSig" = "8:_UNDEFINED"
+ }
+ "Entry"
+ {
+ "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
"OwnerKey" = "8:_3FBEFE0119944C6781F81104ECEF37CA"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_879085EF680EFDF6242DCB77439EC825"
- "OwnerKey" = "8:_F0B800E719294692A02518CFD8CBAEFF"
+ "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
+ "OwnerKey" = "8:_318FCC99E8D143D6B4F9F534E63009B3"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_879085EF680EFDF6242DCB77439EC825"
- "OwnerKey" = "8:_D2EF447106B24E67907DAED3D39CFBB1"
+ "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
+ "OwnerKey" = "8:_2F2FEC549F02436EB87961BD1B9E5783"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_879085EF680EFDF6242DCB77439EC825"
- "OwnerKey" = "8:_59CFED0C4EC0492C945E4EBC04FE965F"
+ "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
+ "OwnerKey" = "8:_28FBC5A60B44423B8A2CC378347483CE"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_87C07635A76B4C5D85C78D91ED64A537"
- "OwnerKey" = "8:_1CFB1AB04E024FC993E0EB4859DF8408"
+ "MsmKey" = "8:_327123955D614480BF2995F2C39195DD"
+ "OwnerKey" = "8:_2814E641538B42EFA83525986A9D5AC1"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_87C07635A76B4C5D85C78D91ED64A537"
- "OwnerKey" = "8:_FBB0E565B1DE49CE9C827ACAC337AC5B"
+ "MsmKey" = "8:_329D8DAE6C01FCF026E9DFB48B932203"
+ "OwnerKey" = "8:_28FBC5A60B44423B8A2CC378347483CE"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_87C07635A76B4C5D85C78D91ED64A537"
- "OwnerKey" = "8:_F0B800E719294692A02518CFD8CBAEFF"
+ "MsmKey" = "8:_3E37631016BC45B2B672FE23257D542B"
+ "OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_87C07635A76B4C5D85C78D91ED64A537"
- "OwnerKey" = "8:_EF14CB99F3414BB689D0CB0E6D6B8AB8"
+ "MsmKey" = "8:_3FBEFE0119944C6781F81104ECEF37CA"
+ "OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_87C07635A76B4C5D85C78D91ED64A537"
- "OwnerKey" = "8:_D2EF447106B24E67907DAED3D39CFBB1"
+ "MsmKey" = "8:_4A285D260C3748A4BEFA6E5A9004D128"
+ "OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_87C07635A76B4C5D85C78D91ED64A537"
- "OwnerKey" = "8:_D1269F1E49D442CF8EAC96C23E60325D"
+ "MsmKey" = "8:_59CFED0C4EC0492C945E4EBC04FE965F"
+ "OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_87C07635A76B4C5D85C78D91ED64A537"
- "OwnerKey" = "8:_BB649A2C1ABE4895859025B09A240323"
+ "MsmKey" = "8:_5A636BB90F7F4B86ACB8839EA2C899AA"
+ "OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_87C07635A76B4C5D85C78D91ED64A537"
- "OwnerKey" = "8:_B20769E090034897B32E3EA4EC1BA8A0"
+ "MsmKey" = "8:_684D96FA2BDD46909367E651099D8C4E"
+ "OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_87C07635A76B4C5D85C78D91ED64A537"
- "OwnerKey" = "8:_A944ADCEDF884574A23F7BA5420A6BA1"
+ "MsmKey" = "8:_69EB1A147CC2428435BDCA35014C96E1"
+ "OwnerKey" = "8:_D2EF447106B24E67907DAED3D39CFBB1"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_87C07635A76B4C5D85C78D91ED64A537"
- "OwnerKey" = "8:_A0D5F714A0F94250A1C39603B699AB82"
+ "MsmKey" = "8:_6E5C001E7A314DCEA0A4BF52BF74BCAD"
+ "OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_87C07635A76B4C5D85C78D91ED64A537"
- "OwnerKey" = "8:_83C1B93AD71B4F8F9E074F9607B60DF1"
+ "MsmKey" = "8:_72A8732C0C0C4D0EAAE89DBB82073335"
+ "OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_87C07635A76B4C5D85C78D91ED64A537"
- "OwnerKey" = "8:_59CFED0C4EC0492C945E4EBC04FE965F"
+ "MsmKey" = "8:_7358123D2D064AD1BC517911A8B23D1B"
+ "OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_87C07635A76B4C5D85C78D91ED64A537"
- "OwnerKey" = "8:_4A285D260C3748A4BEFA6E5A9004D128"
+ "MsmKey" = "8:_83062AA0528B40A59202BC7668F7132A"
+ "OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_87C07635A76B4C5D85C78D91ED64A537"
- "OwnerKey" = "8:_3FBEFE0119944C6781F81104ECEF37CA"
+ "MsmKey" = "8:_83C1B93AD71B4F8F9E074F9607B60DF1"
+ "OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_87C07635A76B4C5D85C78D91ED64A537"
- "OwnerKey" = "8:_318FCC99E8D143D6B4F9F534E63009B3"
+ "MsmKey" = "8:_87768631363249B2B301143C193612F7"
+ "OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_87C07635A76B4C5D85C78D91ED64A537"
- "OwnerKey" = "8:_2F2FEC549F02436EB87961BD1B9E5783"
+ "MsmKey" = "8:_879085EF680EFDF6242DCB77439EC825"
+ "OwnerKey" = "8:_3FBEFE0119944C6781F81104ECEF37CA"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_87C07635A76B4C5D85C78D91ED64A537"
- "OwnerKey" = "8:_28FBC5A60B44423B8A2CC378347483CE"
+ "MsmKey" = "8:_879085EF680EFDF6242DCB77439EC825"
+ "OwnerKey" = "8:_F0B800E719294692A02518CFD8CBAEFF"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
- "MsmKey" = "8:_87C07635A76B4C5D85C78D91ED64A537"
- "OwnerKey" = "8:_2814E641538B42EFA83525986A9D5AC1"
+ "MsmKey" = "8:_879085EF680EFDF6242DCB77439EC825"
+ "OwnerKey" = "8:_D2EF447106B24E67907DAED3D39CFBB1"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
+ "MsmKey" = "8:_879085EF680EFDF6242DCB77439EC825"
+ "OwnerKey" = "8:_59CFED0C4EC0492C945E4EBC04FE965F"
+ "MsmSig" = "8:_UNDEFINED"
+ }
+ "Entry"
+ {
"MsmKey" = "8:_91BA2668F87764F53188E93BC8D363D7"
"OwnerKey" = "8:_59CFED0C4EC0492C945E4EBC04FE965F"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
+ "MsmKey" = "8:_98CF7609810C41BABC219DFBA0A6075D"
+ "OwnerKey" = "8:_327123955D614480BF2995F2C39195DD"
+ "MsmSig" = "8:_UNDEFINED"
+ }
+ "Entry"
+ {
"MsmKey" = "8:_9A293E8A356A4959BB6E541B7DC213CD"
"OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
@@ -387,12 +405,6 @@
}
"Entry"
{
- "MsmKey" = "8:_E0FBD4D007C74B368ED03D076D7C1D75"
- "OwnerKey" = "8:_87C07635A76B4C5D85C78D91ED64A537"
- "MsmSig" = "8:_UNDEFINED"
- }
- "Entry"
- {
"MsmKey" = "8:_E1CC91FCF87955D17FC3C0A8E875B690"
"OwnerKey" = "8:_59CFED0C4EC0492C945E4EBC04FE965F"
"MsmSig" = "8:_UNDEFINED"
@@ -1598,7 +1610,7 @@
}
"MergeModule"
{
- "{CEE29DC0-9FBA-4B99-8D47-5BC643D9B626}:_87C07635A76B4C5D85C78D91ED64A537"
+ "{CEE29DC0-9FBA-4B99-8D47-5BC643D9B626}:_327123955D614480BF2995F2C39195DD"
{
"UseDynamicProperties" = "11:TRUE"
"IsDependency" = "11:TRUE"
@@ -1612,7 +1624,7 @@
"Feature" = "8:"
"IsolateTo" = "8:"
}
- "{CEE29DC0-9FBA-4B99-8D47-5BC643D9B626}:_E0FBD4D007C74B368ED03D076D7C1D75"
+ "{CEE29DC0-9FBA-4B99-8D47-5BC643D9B626}:_98CF7609810C41BABC219DFBA0A6075D"
{
"UseDynamicProperties" = "11:TRUE"
"IsDependency" = "11:TRUE"
@@ -1792,6 +1804,34 @@
"OutputConfiguration" = "8:"
"OutputGroupCanonicalName" = "8:Built"
"OutputProjectGuid" = "8:{AFAC0568-7548-42D5-9F6A-8D3400A1E4F6}"
+ "ShowKeyOutput" = "11:TRUE"
+ "ExcludeFilters"
+ {
+ }
+ }
+ "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_3E37631016BC45B2B672FE23257D542B"
+ {
+ "SourcePath" = "8:..\\..\\debug\\pthreadVC2.dll"
+ "TargetName" = "8:"
+ "Tag" = "8:"
+ "Folder" = "8:_04AC783F1C9F41AEB4E947C46CE9C9FF"
+ "Condition" = "8:"
+ "Transitive" = "11:FALSE"
+ "Vital" = "11:TRUE"
+ "ReadOnly" = "11:FALSE"
+ "Hidden" = "11:FALSE"
+ "System" = "11:FALSE"
+ "Permanent" = "11:FALSE"
+ "SharedLegacy" = "11:FALSE"
+ "PackageAs" = "3:1"
+ "Register" = "3:1"
+ "Exclude" = "11:FALSE"
+ "IsDependency" = "11:FALSE"
+ "IsolateTo" = "8:"
+ "ProjectOutputGroupRegister" = "3:1"
+ "OutputConfiguration" = "8:"
+ "OutputGroupCanonicalName" = "8:Built"
+ "OutputProjectGuid" = "8:{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}"
"ShowKeyOutput" = "11:TRUE"
"ExcludeFilters"
{
1
0
Author: mikej
Date: Fri Oct 6 09:13:28 2006
New Revision: 2988
Modified:
freeswitch/trunk/Freeswitch.sln
freeswitch/trunk/libs/win32/pthread/pthread.vcproj
Log:
fix debug build for sofia on windows, use dll version of pthread win32 so it can do the cleanup properly.
Modified: freeswitch/trunk/Freeswitch.sln
==============================================================================
--- freeswitch/trunk/Freeswitch.sln (original)
+++ freeswitch/trunk/Freeswitch.sln Fri Oct 6 09:13:28 2006
@@ -891,8 +891,8 @@
{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Debug|Win32.Build.0 = Debug|Win32
{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Release|Win32.ActiveCfg = Release|Win32
{8B3B4C4C-13C2-446C-BEB0-F412CC2CFB9A}.Release|Win32.Build.0 = Release|Win32
- {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Debug|Win32.ActiveCfg = Debug|Win32
- {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Debug|Win32.Build.0 = Debug|Win32
+ {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Debug|Win32.ActiveCfg = Debug DLL|Win32
+ {DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Debug|Win32.Build.0 = Debug DLL|Win32
{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Release|Win32.ActiveCfg = Release DLL|Win32
{DF018947-0FFF-4EB3-BDEE-441DC81DA7A4}.Release|Win32.Build.0 = Release DLL|Win32
{FEA1EEF7-876F-48DE-88BF-C0E3E606D758}.Debug|Win32.ActiveCfg = Debug Passthrough|Win32
@@ -936,9 +936,9 @@
{C24FB505-05D7-4319-8485-7540B44C8603} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
{B5881A85-FE70-4F64-8607-2CAAE52669C6} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
{2740F45C-475A-4DE0-BCED-6E2E5F6C4B8B} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}
- {3A5B9131-F20C-4A85-9447-6C1610941CEE} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
{5FD31A25-5D83-4794-8BEE-904DAD84CE71} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
{FE3540C5-3303-46E0-A69E-D92F775687F1} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
+ {3A5B9131-F20C-4A85-9447-6C1610941CEE} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
{FFAA4C52-3A53-4F99-90C1-D59D1F0427F3} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
{0DF3ABD0-DDC0-4265-B778-07C66780979B} = {9460B5F1-0A95-41C4-BEB7-9C2C96459A7C}
{DCC13474-28DF-47CA-A8EB-72F8CE9A78C5} = {2D57D093-3F8D-4729-AD9A-68E945C200A5}
Modified: freeswitch/trunk/libs/win32/pthread/pthread.vcproj
==============================================================================
--- freeswitch/trunk/libs/win32/pthread/pthread.vcproj (original)
+++ freeswitch/trunk/libs/win32/pthread/pthread.vcproj Fri Oct 6 09:13:28 2006
@@ -131,8 +131,8 @@
Optimization="0"
AdditionalIncludeDirectories="../../pthreads-w32-2-7-0-release/"
PreprocessorDefinitions="__CLEANUP_C;WIN32;_DEBUG;_WINDOWS;_USRDLL;PTW32_BUILD;_CRT_SECURE_NO_DEPRECATE;PTW32_STATIC_LIB"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
+ MinimalRebuild="false"
+ BasicRuntimeChecks="0"
RuntimeLibrary="3"
PrecompiledHeaderFile=".\./pthread.pch"
AssemblerListingLocation="$(IntDir)\"
@@ -178,7 +178,7 @@
</Configuration>
<Configuration
Name="Debug DLL|Win32"
- OutputDirectory="$(ConfigurationName)"
+ OutputDirectory="$(SolutionDir)Debug"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
@@ -239,7 +239,7 @@
<Tool
Name="VCLinkerTool"
AdditionalDependencies="ws2_32.lib"
- OutputFile=".\pthreadVC2.dll"
+ OutputFile="$(OutDir)\pthreadVC2.dll"
LinkIncremental="2"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
@@ -278,7 +278,7 @@
</Configuration>
<Configuration
Name="Release DLL|Win32"
- OutputDirectory="$(ConfigurationName)"
+ OutputDirectory="$(SolutionDir)Debug"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
@@ -339,7 +339,7 @@
<Tool
Name="VCLinkerTool"
AdditionalDependencies="ws2_32.lib"
- OutputFile=".\pthreadVC2.dll"
+ OutputFile="$(OutDir)\pthreadVC2.dll"
LinkIncremental="1"
SuppressStartupBanner="true"
ImportLibrary=".\./pthreadVC2.lib"
1
0
05 Oct '06
Author: mikej
Date: Thu Oct 5 16:49:09 2006
New Revision: 2983
Modified:
freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c
Log:
update usage descriptions.
Modified: freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_commands/mod_commands.c Thu Oct 5 16:49:09 2006
@@ -193,7 +193,7 @@
argc = switch_separate_string(cmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
if (argc < 2 || argc > 4) {
- stream->write_function(stream, "Invalid Parameters\n");
+ stream->write_function(stream, "USAGE: transfer <uuid> <dest-exten> [<dialplan>] [<context>]\n");
} else {
char *uuid = argv[0];
char *dest = argv[1];
@@ -255,7 +255,7 @@
argc = switch_separate_string(cmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
if (argc < 2) {
- stream->write_function(stream, "Invalid Parameters\n");
+ stream->write_function(stream, "USAGE: pause <uuid> <on|off>\n");
} else {
char *uuid = argv[0];
char *dest = argv[1];
1
0
05 Oct '06
Author: anthm
Date: Thu Oct 5 11:07:45 2006
New Revision: 2981
Modified:
freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
Log:
sofia again
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 Thu Oct 5 11:07:45 2006
@@ -2413,6 +2413,7 @@
char *displayname;
char *username, *to_username;
char *url_user = (char *) from->a_url->url_user;
+ char *to_user, *to_host;
if (!(tech_pvt = (private_object_t *) switch_core_session_alloc(session, sizeof(private_object_t)))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Hey where is my memory pool?\n");
@@ -2424,6 +2425,25 @@
tech_pvt->key = switch_core_session_strdup(session, key);
}
+ to_user = (char *) to->a_url->url_user;
+ to_host = (char *) to->a_url->url_host;
+
+ if (switch_strlen_zero(to_user)) { /* if sofia doesnt parse the To: right, we'll have to do it */
+ if ((to_user = sip_header_as_string(tech_pvt->home, (sip_header_t *) to))) {
+ char *p;
+ if (*to_user == '<') {
+ to_user++;
+ }
+ if ((p = strchr((to_user += 4), '@'))) {
+ *p++ = '\0';
+ to_host = p;
+ if ((p = strchr(to_host, '>'))) {
+ *p = '\0';
+ }
+ }
+ }
+ }
+
if (switch_strlen_zero(url_user)) {
url_user = "service";
}
@@ -2446,7 +2466,7 @@
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Memory Error!\n");
return;
}
- if (!(to_username = switch_core_db_mprintf("%s@%s", (char *) to->a_url->url_user, (char *) to->a_url->url_host))) {
+ if (!(to_username = switch_core_db_mprintf("%s@%s", (char *) to_user, (char *) to_host))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Memory Error!\n");
switch_core_db_free(username);
return;
@@ -2470,7 +2490,7 @@
(profile->context && !strcasecmp(profile->context, "_domain_")) ?
(char *) from->a_url->url_host : profile->context,
(profile->pflags & PFLAG_FULL_ID) ?
- to_username : (char *) to->a_url->url_user
+ to_username : (char *) to_user
)) != 0) {
switch_channel_set_caller_profile(channel, tech_pvt->caller_profile);
switch_core_db_free(username);
1
0
05 Oct '06
Author: anthm
Date: Thu Oct 5 10:45:56 2006
New Revision: 2980
Modified:
freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
Log:
sigh
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 Thu Oct 5 10:45:56 2006
@@ -1729,13 +1729,15 @@
switch_channel_t *channel = NULL;
private_object_t *tech_pvt = NULL;
switch_core_session_t *session = sofia_private ? sofia_private->session : NULL;
-
+ const char *replaces_str;
+
tl_gets(tags,
NUTAG_CALLSTATE_REF(ss_state),
NUTAG_OFFER_RECV_REF(offer_recv),
NUTAG_ANSWER_RECV_REF(answer_recv),
NUTAG_OFFER_SENT_REF(offer_sent),
NUTAG_ANSWER_SENT_REF(answer_sent),
+ SIPTAG_REPLACES_STR_REF(replaces_str),
SOATAG_LOCAL_SDP_STR_REF(l_sdp),
SOATAG_REMOTE_SDP_STR_REF(r_sdp),
TAG_END());
@@ -1821,12 +1823,14 @@
if (match) {
nua_handle_t *bnh;
-
+ sip_replaces_t *replaces;
+
switch_channel_set_variable(channel, "endpoint_disposition", "RECEIVED");
switch_channel_set_state(channel, CS_INIT);
switch_set_flag_locked(tech_pvt, TFLAG_READY);
switch_core_session_thread_launch(session);
- if (sip->sip_replaces && (bnh = nua_handle_by_replaces(nua, sip->sip_replaces))) {
+
+ if (replaces_str && (replaces = sip_replaces_make(tech_pvt->home, replaces_str)) && (bnh = nua_handle_by_replaces(nua, replaces))) {
sofia_private_t *b_private;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Processing Attended Transfer\n");
1
0
05 Oct '06
Author: mikej
Date: Thu Oct 5 10:29:54 2006
New Revision: 2979
Modified:
freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
Log:
initialize some vars that might not get initialized in some codepaths.
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 Thu Oct 5 10:29:54 2006
@@ -2231,7 +2231,7 @@
if (session) {
private_object_t *tech_pvt = NULL;
- char *exten;
+ char *exten = NULL;
tech_pvt = switch_core_session_get_private(session);
from = sip->sip_from;
@@ -2253,7 +2253,7 @@
if ((rep = strchr(refer_to->r_url->url_headers, '='))) {
switch_channel_t *channel_a = NULL, *channel_b = NULL;
- char *br_a, *br_b;
+ char *br_a = NULL, *br_b = NULL;
char *buf;
rep++;
1
0
[commit] r2978 - in freeswitch/trunk/src: . include mod/endpoints/mod_sofia
by Freeswitch SVN 05 Oct '06
by Freeswitch SVN 05 Oct '06
05 Oct '06
Author: anthm
Date: Thu Oct 5 10:24:25 2006
New Revision: 2978
Modified:
freeswitch/trunk/src/include/switch_ivr.h
freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
freeswitch/trunk/src/switch_ivr.c
Log:
more sofia stuff
Modified: freeswitch/trunk/src/include/switch_ivr.h
==============================================================================
--- freeswitch/trunk/src/include/switch_ivr.h (original)
+++ freeswitch/trunk/src/include/switch_ivr.h Thu Oct 5 10:24:25 2006
@@ -242,6 +242,15 @@
*/
SWITCH_DECLARE(switch_status_t) switch_ivr_uuid_bridge(char *originator_uuid, char *originatee_uuid);
+/*!
+ \brief Transfer variables from one session to another
+ \param sessa the original session
+ \param sessb the new session
+ \param var the name of the variable to transfer (NULL for all)
+ \return SWITCH_STATUS_SUCCESS if all is well
+*/
+SWITCH_DECLARE(switch_status_t) switch_ivr_transfer_variable(switch_core_session_t *sessa, switch_core_session_t *sessb, char *var);
+
/** @} */
SWITCH_END_EXTERN_C
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 Thu Oct 5 10:24:25 2006
@@ -60,8 +60,8 @@
#define MY_EVENT_REGISTER "sofia::register"
#define MY_EVENT_EXPIRE "sofia::expire"
#define MULTICAST_EVENT "multicast::event"
+#define SOFIA_REPLACES_HEADER "_sofia_replaces_"
-
#include <sofia-sip/nua.h>
#include <sofia-sip/sip_status.h>
#include <sofia-sip/sdp.h>
@@ -110,6 +110,7 @@
PFLAG_AUTH_CALLS = (1 << 0),
PFLAG_BLIND_REG = (1 << 1),
PFLAG_AUTH_ALL = (1 << 2),
+ PFLAG_FULL_ID = (1 << 3)
} PFLAGS;
typedef enum {
@@ -792,6 +793,7 @@
tech_pvt->profile->sipip
))) {
+ char *rep = switch_channel_get_variable(channel, SOFIA_REPLACES_HEADER);
tech_choose_port(tech_pvt);
set_local_sdp(tech_pvt);
@@ -810,6 +812,7 @@
SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
SOATAG_RTP_SORT(SOA_RTP_SORT_REMOTE),
SOATAG_RTP_SELECT(SOA_RTP_SELECT_ALL),
+ TAG_IF(rep, SIPTAG_REPLACES_STR(rep)),
TAG_END());
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Memory Error!\n");
@@ -1594,6 +1597,10 @@
switch_channel_set_variable(channel, "endpoint_disposition", "OUTBOUND");
*new_session = nsession;
status = SWITCH_STATUS_SUCCESS;
+ if (session) {
+ switch_ivr_transfer_variable(session, nsession, SOFIA_REPLACES_HEADER);
+ }
+
done:
return status;
}
@@ -1801,9 +1808,7 @@
sdp_parser_t *parser = sdp_parse(tech_pvt->home, r_sdp, (int)strlen(r_sdp), 0);
sdp_session_t *sdp;
uint8_t match = 0;
-
-
-
+
if (tech_pvt->num_codecs) {
if ((sdp = sdp_session(parser))) {
match = negotiate_sdp(session, sdp);
@@ -1814,14 +1819,41 @@
sdp_parser_free(parser);
}
-
if (match) {
+ nua_handle_t *bnh;
+
switch_channel_set_variable(channel, "endpoint_disposition", "RECEIVED");
switch_channel_set_state(channel, CS_INIT);
switch_set_flag_locked(tech_pvt, TFLAG_READY);
switch_core_session_thread_launch(session);
+ if (sip->sip_replaces && (bnh = nua_handle_by_replaces(nua, sip->sip_replaces))) {
+ sofia_private_t *b_private;
+
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Processing Attended Transfer\n");
+ while (switch_channel_get_state(channel) < CS_EXECUTE) {
+ switch_yield(10000);
+ }
+
+ if ((b_private = nua_handle_fetch(bnh))) {
+ char *br_b = switch_channel_get_variable(channel, "BRIDGETO");
+ char *br_a = switch_core_session_get_uuid(b_private->session);
+
+ if (br_b) {
+ switch_ivr_uuid_bridge(br_a, br_b);
+ switch_channel_set_variable(channel, "endpoint_disposition", "ATTENDED_TRANSFER");
+ switch_channel_hangup(channel, SWITCH_CAUSE_ATTENDED_TRANSFER);
+ } else {
+ switch_channel_set_variable(channel, "endpoint_disposition", "ATTENDED_TRANSFER_ERROR");
+ switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
+ }
+ } else {
+ switch_channel_set_variable(channel, "endpoint_disposition", "ATTENDED_TRANSFER_ERROR");
+ switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
+ }
+ }
return;
}
+
switch_channel_set_variable(channel, "endpoint_disposition", "NO CODECS");
nua_respond(nh, SIP_488_NOT_ACCEPTABLE,
TAG_END());
@@ -2200,57 +2232,47 @@
if (session) {
private_object_t *tech_pvt = NULL;
char *exten;
- const char *tmp = NULL;
-#ifdef this_was_done
- char *dest;
- private_object_t *ntech_pvt;
- switch_core_session_t *nsession;
- switch_channel_t *channel, *nchannel;
- switch_caller_profile_t *caller_profile = NULL, *outbound_profile = NULL;
-#endif
tech_pvt = switch_core_session_get_private(session);
from = sip->sip_from;
to = sip->sip_to;
- tl_gets(tags,
- SIPTAG_REFER_TO_STR_REF(tmp),
- TAG_END());
-
if ((refer_to = sip->sip_refer_to)) {
- exten = (char *) refer_to->r_url->url_user;
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Process REFER to [%s@%s]\n",
- exten, (char *) refer_to->r_url->url_host);
+ if (profile->pflags & PFLAG_FULL_ID) {
+ exten = switch_core_db_mprintf("%s@%s", (char *) refer_to->r_url->url_user, (char *) refer_to->r_url->url_host);
+ } else {
+ exten = (char *) refer_to->r_url->url_user;
+ }
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Process REFER to [%s@%s]\n", exten, (char *) refer_to->r_url->url_host);
+
if (refer_to->r_url->url_headers) {
sip_replaces_t *replaces;
nua_handle_t *bnh;
char *rep;
if ((rep = strchr(refer_to->r_url->url_headers, '='))) {
+ switch_channel_t *channel_a = NULL, *channel_b = NULL;
+ char *br_a, *br_b;
char *buf;
rep++;
+ channel_a = switch_core_session_get_channel(session);
+
if ((buf = switch_core_session_alloc(session, strlen(rep) + 1))) {
rep = url_unescape(buf, (const char *) rep);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Replaces: [%s]\n", rep);
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Memory Error!\n");
- return;
+ goto done;
}
if ((replaces = sip_replaces_make(tech_pvt->home, rep)) && (bnh = nua_handle_by_replaces(nua, replaces))) {
sofia_private_t *b_private;
- switch_channel_t *channel_a = NULL, *channel_b = NULL;
-
- channel_a = switch_core_session_get_channel(session);
-
+
if ((b_private = nua_handle_fetch(bnh))) {
- char *br_a, *br_b;
-
channel_b = switch_core_session_get_channel(b_private->session);
br_a = switch_channel_get_variable(channel_a, "BRIDGETO");
- //br_a = switch_core_session_get_uuid(session);
br_b = switch_channel_get_variable(channel_b, "BRIDGETO");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Attended Transfer [%s][%s]\n", br_a, br_b);
@@ -2271,18 +2293,65 @@
}
nua_handle_unref(bnh);
- } else {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot find handle from Replaces!\n");
+ } else { /* the other channel is on a different box, we have to go find them */
+ if (exten && (br_a = switch_channel_get_variable(channel_a, "BRIDGETO"))) {
+ switch_core_session_t *bsession;
+ switch_channel_t *channel = switch_core_session_get_channel(session);
+
+ if ((bsession = switch_core_session_locate(br_a))) {
+ switch_core_session_t *tsession;
+ switch_call_cause_t cause = SWITCH_CAUSE_NORMAL_CLEARING;
+ uint32_t timeout = 60;
+ char *tuuid_str;
+
+ channel = switch_core_session_get_channel(bsession);
+
+ exten = switch_core_db_mprintf("sofia/%s/%s@%s:%d",
+ profile->name,
+ (char *) refer_to->r_url->url_user,
+ (char *) refer_to->r_url->url_host,
+ refer_to->r_url->url_port
+ );
+
+ switch_channel_set_variable(channel, SOFIA_REPLACES_HEADER, rep);
+
+ if (switch_ivr_originate(bsession,
+ &tsession,
+ &cause,
+ exten,
+ timeout,
+ &noop_state_handler,
+ NULL,
+ NULL,
+ NULL) != SWITCH_STATUS_SUCCESS) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot Create Outgoing Channel! [%s]\n", exten);
+ goto done;
+ }
+
+ switch_core_session_rwunlock(bsession);
+ tuuid_str = switch_core_session_get_uuid(tsession);
+ switch_ivr_uuid_bridge(br_a, tuuid_str);
+ switch_channel_set_variable(channel_a, "endpoint_disposition", "ATTENDED_TRANSFER");
+ switch_channel_hangup(channel_a, SWITCH_CAUSE_ATTENDED_TRANSFER);
+ } else {
+ goto error;
+ }
+
+ } else { error:
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid Transfer! [%s]\n", br_a);
+ switch_channel_set_variable(channel_a, "endpoint_disposition", "ATTENDED_TRANSFER_ERROR");
+ switch_channel_hangup(channel_a, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
+ }
}
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot parse Replaces!\n");
}
- return;
+ goto done;
}
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Missing Refer-To\n");
- return;
+ goto done;
}
if (exten) {
@@ -2304,38 +2373,11 @@
}
}
-
-#ifdef this_was_done
- if (!(nsession = switch_core_session_request(&sofia_endpoint_interface, NULL))) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Error Creating Session\n");
- goto done;
+ done:
+ if (strchr(exten, '@')) {
+ switch_core_db_free(exten);
}
-
- if (!(ntech_pvt = (struct private_object *) switch_core_session_alloc(nsession, sizeof(*ntech_pvt)))) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Error Creating Session\n");
- terminate_session(&nsession, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER, __LINE__);
- goto done;
- }
- ntech_pvt->dest = switch_core_session_strdup(nsession, exten);
- dest = ntech_pvt->dest + 4;
- channel = switch_core_session_get_channel(session);
- outbound_profile = switch_channel_get_caller_profile(channel);
- nchannel = switch_core_session_get_channel(nsession);
- attach_private(nsession, profile, ntech_pvt, dest);
- caller_profile = switch_caller_profile_clone(nsession, outbound_profile);
- caller_profile->destination_number = switch_core_session_strdup(nsession, dest);
- switch_channel_set_caller_profile(nchannel, caller_profile);
- switch_channel_set_flag(nchannel, CF_OUTBOUND);
- switch_set_flag_locked(ntech_pvt, TFLAG_OUTBOUND);
- switch_set_flag_locked(ntech_pvt, TFLAG_REFER);
- switch_channel_set_state(nchannel, CS_INIT);
- switch_channel_set_variable(channel, "endpoint_disposition", "OUTBOUND_REFER");
- switch_core_session_thread_launch(nsession);
-#endif
-
- //done:
- return;
}
}
@@ -2365,7 +2407,7 @@
sip_from_t const *from = sip->sip_from;
sip_to_t const *to = sip->sip_to;
char *displayname;
- char username[256];
+ char *username, *to_username;
char *url_user = (char *) from->a_url->url_user;
if (!(tech_pvt = (private_object_t *) switch_core_session_alloc(session, sizeof(private_object_t)))) {
@@ -2396,7 +2438,16 @@
displayname = url_user;
}
- snprintf(username, sizeof(username), "%s@%s", url_user, (char *) from->a_url->url_host);
+ if (!(username = switch_core_db_mprintf("%s@%s", url_user, (char *) from->a_url->url_host))) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Memory Error!\n");
+ return;
+ }
+ if (!(to_username = switch_core_db_mprintf("%s@%s", (char *) to->a_url->url_user, (char *) to->a_url->url_host))) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Memory Error!\n");
+ switch_core_db_free(username);
+ return;
+ }
+
attach_private(session, profile, tech_pvt, username);
channel = switch_core_session_get_channel(session);
@@ -2412,9 +2463,14 @@
NULL,
NULL,
(char *)modname,
- profile->context,
- (char *) to->a_url->url_user)) != 0) {
+ (profile->context && !strcasecmp(profile->context, "_domain_")) ?
+ (char *) from->a_url->url_host : profile->context,
+ (profile->pflags & PFLAG_FULL_ID) ?
+ to_username : (char *) to->a_url->url_user
+ )) != 0) {
switch_channel_set_caller_profile(channel, tech_pvt->caller_profile);
+ switch_core_db_free(username);
+ switch_core_db_free(to_username);
}
switch_set_flag_locked(tech_pvt, TFLAG_INBOUND);
tech_pvt->sofia_private.session = session;
@@ -2752,8 +2808,8 @@
uint32_t ireg_loops = 0;
uint32_t oreg_loops = 0;
switch_core_db_t *db;
+ switch_event_t *s_event;
-
profile->s_root = su_root_create(NULL);
profile->nua = nua_create(profile->s_root, /* Event loop */
event_callback, /* Callback for processing events */
@@ -2765,7 +2821,6 @@
NUTAG_EARLY_MEDIA(1),
NUTAG_AUTOANSWER(0),
NUTAG_AUTOALERT(0),
- //NUTAG_AUTOTRYING(0),
NUTAG_ALLOW("REGISTER"),
NUTAG_ALLOW("REFER"),
SIPTAG_SUPPORTED_STR("100rel, precondition"),
@@ -2783,7 +2838,6 @@
NUTAG_EARLY_MEDIA(1),
NUTAG_AUTOANSWER(0),
NUTAG_AUTOALERT(0),
- //NUTAG_AUTOTRYING(0),
NUTAG_ALLOW("REGISTER"),
SIPTAG_SUPPORTED_STR("100rel, precondition"),
TAG_END());
@@ -2810,6 +2864,12 @@
ireg_loops = IREG_SECONDS;
oreg_loops = OREG_SECONDS;
+ if (switch_event_create(&s_event, SWITCH_EVENT_PUBLISH) == SWITCH_STATUS_SUCCESS) {
+ switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "service", "_sip._udp");
+ switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "port", "%d", profile->sip_port);
+ switch_event_fire(&s_event);
+ }
+
while(globals.running == 1) {
if (++ireg_loops >= IREG_SECONDS) {
check_expire(profile, time(NULL));
@@ -2825,6 +2885,13 @@
//su_root_run(profile->s_root);
}
+
+ if (switch_event_create(&s_event, SWITCH_EVENT_UNPUBLISH) == SWITCH_STATUS_SUCCESS) {
+ switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "service", "_sip._udp");
+ switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "port", "%d", profile->sip_port);
+ switch_event_fire(&s_event);
+ }
+
su_root_destroy(profile->s_root);
pool = profile->pool;
@@ -2943,6 +3010,10 @@
} else if (!strcasecmp(var, "auth-all-packets")) {
if (switch_true(val)) {
profile->pflags |= PFLAG_AUTH_ALL;
+ }
+ } else if (!strcasecmp(var, "full-id-in-dialplan")) {
+ if (switch_true(val)) {
+ profile->pflags |= PFLAG_FULL_ID;
}
} else if (!strcasecmp(var, "ext-sip-ip")) {
profile->extsipip = switch_core_strdup(profile->pool, val);
Modified: freeswitch/trunk/src/switch_ivr.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr.c (original)
+++ freeswitch/trunk/src/switch_ivr.c Thu Oct 5 10:24:25 2006
@@ -2253,4 +2253,28 @@
return SWITCH_STATUS_FALSE;
}
+SWITCH_DECLARE(switch_status_t) switch_ivr_transfer_variable(switch_core_session_t *sessa, switch_core_session_t *sessb, char *var)
+{
+ switch_channel_t *chana = switch_core_session_get_channel(sessa);
+ switch_channel_t *chanb = switch_core_session_get_channel(sessb);
+ char *val = NULL;
+ if (var) {
+ if ((val = switch_channel_get_variable(chana, var))) {
+ switch_channel_set_variable(chanb, var, val);
+ }
+ } else {
+ switch_hash_index_t *hi;
+ void *vval;
+ const void *vvar;
+
+ for (hi = switch_channel_variable_first(chana, switch_core_session_get_pool(sessa)); hi; hi = switch_hash_next(hi)) {
+ switch_hash_this(hi, &vvar, NULL, &vval);
+ if (vvar && vval) {
+ switch_channel_set_variable(chanb, (char *) vvar, (char *) vval);
+ }
+ }
+ }
+
+ return SWITCH_STATUS_SUCCESS;
+}
1
0
05 Oct '06
Author: anthm
Date: Thu Oct 5 00:25:32 2006
New Revision: 2976
Modified:
freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
Log:
update
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 Thu Oct 5 00:25:32 2006
@@ -784,13 +784,15 @@
tech_pvt = (private_object_t *) switch_core_session_get_private(session);
assert(tech_pvt != NULL);
+ caller_profile = switch_channel_get_caller_profile(channel);
+
if ((tech_pvt->from_str = switch_core_db_mprintf("\"%s\" <sip:%s@%s>",
(char *) caller_profile->caller_id_name,
(char *) caller_profile->caller_id_number,
tech_pvt->profile->sipip
))) {
- caller_profile = switch_channel_get_caller_profile(channel);
+
tech_choose_port(tech_pvt);
set_local_sdp(tech_pvt);
switch_set_flag_locked(tech_pvt, TFLAG_READY);
1
0
05 Oct '06
Author: anthm
Date: Thu Oct 5 00:23:13 2006
New Revision: 2975
Modified:
freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
Log:
update
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 Thu Oct 5 00:23:13 2006
@@ -3009,7 +3009,6 @@
}
if (profile) {
if ((registrations = switch_xml_child(xprofile, "registrations"))) {
- uint32_t reg_count = 0;
for (registration = switch_xml_child(registrations, "registration"); registration; registration = registration->next) {
char *name = (char *) switch_xml_attr_soft(registration, "name");
outbound_reg_t *oreg;
1
0