Freeswitch-svn
Threads by month
- ----- 2026 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
November 2006
- 10 participants
- 251 discussions
16 Nov '06
Author: anthm
Date: Thu Nov 16 17:16:30 2006
New Revision: 3390
Modified:
freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
Log:
ignore options reply
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 Nov 16 17:16:30 2006
@@ -4271,10 +4271,6 @@
//sip_r_unregister(status, phrase, nua, profile, nh, sofia_private, sip, tags);
break;
- case nua_r_options:
- //sip_r_options(status, phrase, nua, profile, nh, sofia_private, sip, tags);
- break;
-
case nua_i_options:
sip_i_options(status, phrase, nua, profile, nh, sofia_private, sip, tags);
break;
@@ -4347,6 +4343,7 @@
case nua_r_publish:
//sip_r_publish(status, phrase, nua, profile, nh, sofia_private, sip, tags);
break;
+ case nua_r_options:
case nua_r_message:
case nua_r_notify:
if (nh) {
1
0
16 Nov '06
Author: anthm
Date: Thu Nov 16 16:20:00 2006
New Revision: 3389
Modified:
freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
freeswitch/trunk/src/switch_log.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 Nov 16 16:20:00 2006
@@ -167,7 +167,8 @@
TFLAG_XFER = (1 << 19),
TFLAG_NOMEDIA = (1 << 20),
TFLAG_BUGGY_2833 = (1 << 21),
- TFLAG_SIP_HOLD = (1 << 22)
+ TFLAG_SIP_HOLD = (1 << 22),
+ TFLAG_RWLOCK = (1 << 23)
} TFLAGS;
static struct {
@@ -2754,7 +2755,12 @@
break;
case nua_callstate_terminated:
if (session) {
+ if (switch_test_flag(tech_pvt, TFLAG_RWLOCK)) {
+ switch_core_session_rwunlock(session);
+ switch_clear_flag(tech_pvt, TFLAG_RWLOCK);
+ }
if (!switch_test_flag(tech_pvt, TFLAG_BYE)) {
+
switch_set_flag_locked(tech_pvt, TFLAG_BYE);
if (switch_test_flag(tech_pvt, TFLAG_NOHUP)) {
switch_clear_flag_locked(tech_pvt, TFLAG_NOHUP);
@@ -3977,7 +3983,8 @@
}
attach_private(session, profile, tech_pvt, username);
-
+ switch_core_session_read_lock(session);
+ switch_set_flag(tech_pvt, TFLAG_RWLOCK);
channel = switch_core_session_get_channel(session);
switch_channel_set_variable(channel, "endpoint_disposition", "INBOUND CALL");
set_chat_hash(tech_pvt, sip);
Modified: freeswitch/trunk/src/switch_log.c
==============================================================================
--- freeswitch/trunk/src/switch_log.c (original)
+++ freeswitch/trunk/src/switch_log.c Thu Nov 16 16:20:00 2006
@@ -238,6 +238,8 @@
node->content = content;
node->timestamp = now;
switch_queue_push(LOG_QUEUE, node);
+ } else {
+ free(data);
}
}
}
1
0
Author: anthm
Date: Thu Nov 16 14:43:25 2006
New Revision: 3388
Modified:
freeswitch/trunk/src/include/switch_core.h
freeswitch/trunk/src/switch.c
freeswitch/trunk/src/switch_core.c
Log:
vg mode
Modified: freeswitch/trunk/src/include/switch_core.h
==============================================================================
--- freeswitch/trunk/src/include/switch_core.h (original)
+++ freeswitch/trunk/src/include/switch_core.h Thu Nov 16 14:43:25 2006
@@ -219,9 +219,10 @@
/*!
\brief Destroy the core
+ \param vg nonzero to skip core uninitilize for memory debugging
\note to be called at application shutdown
*/
-SWITCH_DECLARE(switch_status_t) switch_core_destroy(void);
+SWITCH_DECLARE(switch_status_t) switch_core_destroy(int vg);
///\}
Modified: freeswitch/trunk/src/switch.c
==============================================================================
--- freeswitch/trunk/src/switch.c (original)
+++ freeswitch/trunk/src/switch.c Thu Nov 16 14:43:25 2006
@@ -195,6 +195,7 @@
char pid_path[256] = ""; // full path to the pid file
const char *err = NULL; // error value for return from freeswitch initialization
int bg = 0; // TRUE if we are running in background mode
+ int vg = 0; // TRUE if we are running in vg mode
FILE *f; // file handle to the pid file
pid_t pid = 0; //
int x; //
@@ -265,6 +266,10 @@
if (argv[x] && !strcmp(argv[x], "-nc")) {
bg++;
}
+
+ if (argv[x] && !strcmp(argv[x], "-vg")) {
+ vg++;
+ }
}
if (die) {
@@ -302,5 +307,5 @@
switch_core_runtime_loop(bg);
- return switch_core_destroy();
+ return switch_core_destroy(vg);
}
Modified: freeswitch/trunk/src/switch_core.c
==============================================================================
--- freeswitch/trunk/src/switch_core.c (original)
+++ freeswitch/trunk/src/switch_core.c Thu Nov 16 14:43:25 2006
@@ -4070,7 +4070,7 @@
return 0;
}
-SWITCH_DECLARE(switch_status_t) switch_core_destroy(void)
+SWITCH_DECLARE(switch_status_t) switch_core_destroy(int vg)
{
switch_event_t *event;
if (switch_event_create(&event, SWITCH_EVENT_SHUTDOWN) == SWITCH_STATUS_SUCCESS) {
@@ -4097,7 +4097,9 @@
switch_core_db_close(runtime.db);
switch_core_db_close(runtime.event_db);
switch_xml_destroy();
-
+ if (vg) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Full destruction of the core disabled for memory debugging purposes.\n");
+ }
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Finalizing Shutdown.\n");
switch_log_shutdown();
@@ -4108,7 +4110,9 @@
if (runtime.memory_pool) {
apr_pool_destroy(runtime.memory_pool);
- apr_terminate();
+ if (!vg) {
+ apr_terminate();
+ }
}
#ifdef WIN32
1
0
Author: anthm
Date: Thu Nov 16 14:28:05 2006
New Revision: 3387
Modified:
freeswitch/trunk/libs/libdingaling/src/libdingaling.c
Log:
pesky interop
Modified: freeswitch/trunk/libs/libdingaling/src/libdingaling.c
==============================================================================
--- freeswitch/trunk/libs/libdingaling/src/libdingaling.c (original)
+++ freeswitch/trunk/libs/libdingaling/src/libdingaling.c Thu Nov 16 14:28:05 2006
@@ -264,9 +264,9 @@
session->id = apr_pstrdup(session->pool, id);
session->them = apr_pstrdup(session->pool, them);
-
- session->initiator = apr_pstrdup(session->pool, (flags & LDL_FLAG_OUTBOUND) ? me : them);
-
+ if (flags & LDL_FLAG_OUTBOUND) {
+ session->initiator = apr_pstrdup(session->pool, me);
+ }
if (ldl_test_flag(handle, LDL_FLAG_COMPONENT)) {
session->login = apr_pstrdup(session->pool, me);
1
0
Author: mikej
Date: Thu Nov 16 13:48:53 2006
New Revision: 3386
Modified:
freeswitch/trunk/src/switch_rtp.c
Log:
logic fix on rtp_common_read on a not ready session, init bytes to 0 so the checks outside of the while loop work.
Modified: freeswitch/trunk/src/switch_rtp.c
==============================================================================
--- freeswitch/trunk/src/switch_rtp.c (original)
+++ freeswitch/trunk/src/switch_rtp.c Thu Nov 16 13:48:53 2006
@@ -757,7 +757,7 @@
static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_type, switch_frame_flag_t *flags)
{
- switch_size_t bytes;
+ switch_size_t bytes = 0;
switch_status_t status;
uint8_t check = 1;
1
0
[commit] r3385 - in freeswitch/trunk: libs/libdingaling libs/libdingaling/src src/mod/endpoints/mod_dingaling
by Freeswitch SVN 16 Nov '06
by Freeswitch SVN 16 Nov '06
16 Nov '06
Author: anthm
Date: Thu Nov 16 11:10:39 2006
New Revision: 3385
Modified:
freeswitch/trunk/libs/libdingaling/.update
freeswitch/trunk/libs/libdingaling/src/libdingaling.c
freeswitch/trunk/libs/libdingaling/src/libdingaling.h
freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c
Log:
update
Modified: freeswitch/trunk/libs/libdingaling/.update
==============================================================================
--- freeswitch/trunk/libs/libdingaling/.update (original)
+++ freeswitch/trunk/libs/libdingaling/.update Thu Nov 16 11:10:39 2006
@@ -1 +1 @@
-Wed Nov 15 20:20:53 UTC 2006
+Thu Nov 16 16:09:31 UTC 2006
Modified: freeswitch/trunk/libs/libdingaling/src/libdingaling.c
==============================================================================
--- freeswitch/trunk/libs/libdingaling/src/libdingaling.c (original)
+++ freeswitch/trunk/libs/libdingaling/src/libdingaling.c Thu Nov 16 11:10:39 2006
@@ -250,7 +250,7 @@
}
-ldl_status ldl_session_create(ldl_session_t **session_p, ldl_handle_t *handle, char *id, char *them, char *me)
+ldl_status ldl_session_create(ldl_session_t **session_p, ldl_handle_t *handle, char *id, char *them, char *me, ldl_user_flag_t flags)
{
ldl_session_t *session = NULL;
@@ -264,10 +264,10 @@
session->id = apr_pstrdup(session->pool, id);
session->them = apr_pstrdup(session->pool, them);
- if (me) {
- session->initiator = apr_pstrdup(session->pool, me);
- }
+
+ session->initiator = apr_pstrdup(session->pool, (flags & LDL_FLAG_OUTBOUND) ? me : them);
+
if (ldl_test_flag(handle, LDL_FLAG_COMPONENT)) {
session->login = apr_pstrdup(session->pool, me);
} else {
@@ -298,7 +298,7 @@
char *msg = NULL;
if (!(session = apr_hash_get(handle->sessions, id, APR_HASH_KEY_STRING))) {
- ldl_session_create(&session, handle, id, from, to);
+ ldl_session_create(&session, handle, id, from, to, LDL_FLAG_NONE);
if (!session) {
return LDL_STATUS_MEMERR;
}
Modified: freeswitch/trunk/libs/libdingaling/src/libdingaling.h
==============================================================================
--- freeswitch/trunk/libs/libdingaling/src/libdingaling.h (original)
+++ freeswitch/trunk/libs/libdingaling/src/libdingaling.h Thu Nov 16 11:10:39 2006
@@ -110,10 +110,12 @@
} ldl_flag_t;
typedef enum {
+ LDL_FLAG_NONE = 0,
LDL_FLAG_TLS = (1 << 10),
LDL_FLAG_SASL_PLAIN = (1 << 11),
LDL_FLAG_SASL_MD5 = (1 << 12),
LDL_FLAG_COMPONENT = (1 << 13),
+ LDL_FLAG_OUTBOUND = (1 << 14)
} ldl_user_flag_t;
typedef enum {
@@ -253,9 +255,10 @@
\param id the id to use for the session
\param them the id of the other end of the call
\param me the id of our end of the call
+ \param flags user flags
\return SUCCESS OR FAILURE
*/
-ldl_status ldl_session_create(ldl_session_t **session_p, ldl_handle_t *handle, char *id, char *them, char *me);
+ldl_status ldl_session_create(ldl_session_t **session_p, ldl_handle_t *handle, char *id, char *them, char *me, ldl_user_flag_t flags);
/*!
\brief get the id of a session
Modified: freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c Thu Nov 16 11:10:39 2006
@@ -1565,7 +1565,7 @@
switch_stun_random_string(sess_id, 10, "0123456789");
tech_pvt->us = switch_core_session_strdup(session, user);
tech_pvt->them = switch_core_session_strdup(session, full_id);
- ldl_session_create(&dlsession, mdl_profile->handle, sess_id, full_id, user);
+ ldl_session_create(&dlsession, mdl_profile->handle, sess_id, full_id, user, LDL_FLAG_OUTBOUND);
tech_pvt->profile = mdl_profile;
ldl_session_set_private(dlsession, *new_session);
//ldl_session_set_value(dlsession, "dnis", dnis);
1
0
[commit] r3384 - in freeswitch/trunk: libs/libdingaling/src src src/mod/endpoints/mod_dingaling
by Freeswitch SVN 16 Nov '06
by Freeswitch SVN 16 Nov '06
16 Nov '06
Author: anthm
Date: Thu Nov 16 10:50:17 2006
New Revision: 3384
Modified:
freeswitch/trunk/libs/libdingaling/src/libdingaling.c
freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c
freeswitch/trunk/src/switch_rtp.c
Log:
update
Modified: freeswitch/trunk/libs/libdingaling/src/libdingaling.c
==============================================================================
--- freeswitch/trunk/libs/libdingaling/src/libdingaling.c (original)
+++ freeswitch/trunk/libs/libdingaling/src/libdingaling.c Thu Nov 16 10:50:17 2006
@@ -264,9 +264,9 @@
session->id = apr_pstrdup(session->pool, id);
session->them = apr_pstrdup(session->pool, them);
- //if (me) {
- //session->initiator = apr_pstrdup(session->pool, them);
- //}
+ if (me) {
+ session->initiator = apr_pstrdup(session->pool, me);
+ }
if (ldl_test_flag(handle, LDL_FLAG_COMPONENT)) {
session->login = apr_pstrdup(session->pool, me);
@@ -1468,14 +1468,29 @@
}
+static void add_elements(ldl_session_t *session, iks *tag)
+{
+ apr_hash_index_t *hi;
+ for (hi = apr_hash_first(session->pool, session->variables); hi; hi = apr_hash_next(hi)) {
+ void *val = NULL;
+ const void *key = NULL;
+ apr_hash_this(hi, &key, NULL, &val);
+ if (val) {
+ iks *var = iks_insert(tag, "info_element");
+ iks_insert_attrib(var, "xmlns", "http://www.freeswitch.org/jie");
+ iks_insert_attrib(var, "name", (char *) key);
+ iks_insert_attrib(var, "value", (char *) val);
+ }
+ }
+}
+
static ldl_status new_session_iq(ldl_session_t *session, iks **iqp, iks **sessp, unsigned int *id, char *type)
{
iks *iq, *sess;
unsigned int myid;
char idbuf[80];
- apr_hash_index_t *hi;
myid = next_id();
snprintf(idbuf, sizeof(idbuf), "%u", myid);
@@ -1491,19 +1506,7 @@
iks_insert_attrib(sess, "type", type);
iks_insert_attrib(sess, "id", session->id);
iks_insert_attrib(sess, "initiator", session->initiator ? session->initiator : session->them);
- for (hi = apr_hash_first(session->pool, session->variables); hi; hi = apr_hash_next(hi)) {
- void *val = NULL;
- const void *key = NULL;
- apr_hash_this(hi, &key, NULL, &val);
- if (val) {
- iks *var = iks_insert(sess, "info_element");
- iks_insert_attrib(var, "xmlns", "http://www.freeswitch.org/jie");
- iks_insert_attrib(var, "name", (char *) key);
- iks_insert_attrib(var, "value", (char *) val);
- }
- }
-
*sessp = sess;
*iqp = iq;
*id = myid;
@@ -1717,6 +1720,8 @@
new_session_iq(session, &iq, &sess, &id, "transport-info");
tag = iks_insert(sess, "transport");
iks_insert_attrib(tag, "xmlns", "http://www.google.com/transport/p2p");
+
+ add_elements(session, tag);
tag = iks_insert(tag, "candidate");
if (candidates[x].name) {
Modified: freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c Thu Nov 16 10:50:17 2006
@@ -248,7 +248,7 @@
}
rpid = translate_rpid(rpid, status);
- ldl_handle_send_presence(profile->handle, sub_to, sub_from, "probe", rpid, status);
+ //ldl_handle_send_presence(profile->handle, sub_to, sub_from, "probe", rpid, status);
ldl_handle_send_presence(profile->handle, sub_to, sub_from, type, rpid, status);
@@ -333,7 +333,6 @@
type, rpid, status, proto, from);
-
for (hi = switch_hash_first(apr_hash_pool_get(globals.profile_hash), globals.profile_hash); hi; hi = switch_hash_next(hi)) {
char *errmsg;
switch_hash_this(hi, NULL, NULL, &val);
@@ -819,6 +818,7 @@
cand[0].protocol = "udp";
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Send Candidate %s:%d [%s]\n", cand[0].address, cand[0].port, cand[0].username);
tech_pvt->cand_id = ldl_session_candidates(tech_pvt->dlsession, cand, 1);
+ switch_set_flag_locked(tech_pvt, TFLAG_TRANSPORT);
switch_set_flag_locked(tech_pvt, TFLAG_RTP_READY);
}
switch_clear_flag_locked(tech_pvt, TFLAG_DO_CAND);
@@ -913,6 +913,7 @@
started = switch_time_now();
if (switch_test_flag(tech_pvt, TFLAG_OUTBOUND)) {
+ tech_pvt->next_cand = switch_time_now() + DL_CAND_WAIT;
tech_pvt->next_desc = switch_time_now();
} else {
tech_pvt->next_cand = switch_time_now() + DL_CAND_WAIT;
@@ -1567,9 +1568,9 @@
ldl_session_create(&dlsession, mdl_profile->handle, sess_id, full_id, user);
tech_pvt->profile = mdl_profile;
ldl_session_set_private(dlsession, *new_session);
- ldl_session_set_value(dlsession, "dnis", dnis);
- ldl_session_set_value(dlsession, "caller_id_name", outbound_profile->caller_id_name);
- ldl_session_set_value(dlsession, "caller_id_number", outbound_profile->caller_id_number);
+ //ldl_session_set_value(dlsession, "dnis", dnis);
+ //ldl_session_set_value(dlsession, "caller_id_name", outbound_profile->caller_id_name);
+ //ldl_session_set_value(dlsession, "caller_id_number", outbound_profile->caller_id_number);
tech_pvt->dlsession = dlsession;
if (!get_codecs(tech_pvt)) {
terminate_session(new_session, __LINE__, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
@@ -2101,7 +2102,13 @@
execute_sql(profile->dbname, sql, profile->mutex);
switch_core_db_free(sql);
}
+
if (is_special(to)) {
+ ldl_handle_send_presence(profile->handle, to, from, NULL, "unknown", "Click To Call");
+ }
+
+#if 0
+ if (is_special(to)) {
if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) {
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", MDL_CHAT_PROTO);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->login);
@@ -2111,6 +2118,7 @@
switch_event_fire(&event);
}
}
+#endif
break;
case LDL_SIGNAL_ROSTER:
if (switch_event_create(&event, SWITCH_EVENT_ROSTER) == SWITCH_STATUS_SUCCESS) {
@@ -2135,7 +2143,12 @@
switch_event_fire(&event);
}
+
if (is_special(to)) {
+ ldl_handle_send_presence(profile->handle, to, from, NULL, "unknown", "Click To Call");
+ }
+#if 0
+ if (is_special(to)) {
if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) {
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", MDL_CHAT_PROTO);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->login);
@@ -2146,7 +2159,7 @@
}
}
break;
-
+#endif
case LDL_SIGNAL_PRESENCE_OUT:
if ((sql = switch_mprintf("update subscriptions set show='%q', status='%q' where sub_from='%q'", msg, subject, from))) {
@@ -2285,6 +2298,7 @@
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Creating a session for %s\n", ldl_session_get_id(dlsession));
ldl_session_set_private(dlsession, session);
tech_pvt->dlsession = dlsession;
+ switch_channel_set_name(channel, "DingaLing/new");
switch_channel_set_state(channel, CS_INIT);
switch_core_session_thread_launch(session);
} else {
@@ -2414,176 +2428,178 @@
}
}
}
-
break;
case LDL_SIGNAL_CANDIDATES:
if (signal) {
ldl_candidate_t *candidates;
unsigned int len = 0;
+ unsigned int x;
- if (ldl_session_get_candidates(dlsession, &candidates, &len) == LDL_STATUS_SUCCESS) {
- unsigned int x;
+ if (ldl_session_get_candidates(dlsession, &candidates, &len) != LDL_STATUS_SUCCESS) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Candidate Error!\n");
+ switch_set_flag(tech_pvt, TFLAG_BYE);
+ switch_clear_flag(tech_pvt, TFLAG_IO);
+ status = LDL_STATUS_FALSE;
+ goto done;
+ }
- if (tech_pvt->remote_ip) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Already picked an IP [%s]\n", tech_pvt->remote_ip);
- break;
- }
+ if (tech_pvt->remote_ip) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Already picked an IP [%s]\n", tech_pvt->remote_ip);
+ break;
+ }
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%u candidates\n", len);
- for(x = 0; x < len; x++) {
- uint8_t lanaddr = 0;
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%u candidates\n", len);
+ for(x = 0; x < len; x++) {
+ uint8_t lanaddr = 0;
- if (profile->lanaddr) {
- lanaddr = strncasecmp(candidates[x].address, profile->lanaddr, strlen(profile->lanaddr)) ? 0 : 1;
- }
+ if (profile->lanaddr) {
+ lanaddr = strncasecmp(candidates[x].address, profile->lanaddr, strlen(profile->lanaddr)) ? 0 : 1;
+ }
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "candidates %s:%d\n", candidates[x].address, candidates[x].port);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "candidates %s:%d\n", candidates[x].address, candidates[x].port);
- if (!strcasecmp(candidates[x].protocol, "udp") && (!strcasecmp(candidates[x].type, "local") || !strcasecmp(candidates[x].type, "stun")) &&
- ((profile->lanaddr && lanaddr) ||
- (strncasecmp(candidates[x].address, "10.", 3) &&
- strncasecmp(candidates[x].address, "192.168.", 8) &&
- strncasecmp(candidates[x].address, "127.", 4) &&
- strncasecmp(candidates[x].address, "1.", 2) &&
- strncasecmp(candidates[x].address, "2.", 2) &&
- strncasecmp(candidates[x].address, "172.16.", 7) &&
- strncasecmp(candidates[x].address, "172.17.", 7) &&
- strncasecmp(candidates[x].address, "172.18.", 7) &&
- strncasecmp(candidates[x].address, "172.19.", 7) &&
- strncasecmp(candidates[x].address, "172.2", 5) &&
- strncasecmp(candidates[x].address, "172.30.", 7) &&
- strncasecmp(candidates[x].address, "172.31.", 7)
- ))) {
- ldl_payload_t payloads[5];
- char *exten;
- char *context;
- char *cid_name;
- char *cid_num;
- char *tmp, *t, *them = NULL;
+ if (!strcasecmp(candidates[x].protocol, "udp") && (!strcasecmp(candidates[x].type, "local") || !strcasecmp(candidates[x].type, "stun")) &&
+ ((profile->lanaddr && lanaddr) ||
+ (strncasecmp(candidates[x].address, "10.", 3) &&
+ strncasecmp(candidates[x].address, "192.168.", 8) &&
+ strncasecmp(candidates[x].address, "127.", 4) &&
+ strncasecmp(candidates[x].address, "1.", 2) &&
+ strncasecmp(candidates[x].address, "2.", 2) &&
+ strncasecmp(candidates[x].address, "172.16.", 7) &&
+ strncasecmp(candidates[x].address, "172.17.", 7) &&
+ strncasecmp(candidates[x].address, "172.18.", 7) &&
+ strncasecmp(candidates[x].address, "172.19.", 7) &&
+ strncasecmp(candidates[x].address, "172.2", 5) &&
+ strncasecmp(candidates[x].address, "172.30.", 7) &&
+ strncasecmp(candidates[x].address, "172.31.", 7)
+ ))) {
+ ldl_payload_t payloads[5];
+ char *exten;
+ char *context;
+ char *cid_name;
+ char *cid_num;
+ char *tmp, *t, *them = NULL;
- memset(payloads, 0, sizeof(payloads));
+ memset(payloads, 0, sizeof(payloads));
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Acceptable Candidate %s:%d\n", candidates[x].address, candidates[x].port);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Acceptable Candidate %s:%d\n", candidates[x].address, candidates[x].port);
- if (!switch_test_flag(tech_pvt, TFLAG_OUTBOUND)) {
- ldl_session_accept_candidate(dlsession, &candidates[x]);
- }
+ if (!switch_test_flag(tech_pvt, TFLAG_OUTBOUND)) {
+ switch_set_flag_locked(tech_pvt, TFLAG_TRANSPORT_ACCEPT);
+ ldl_session_accept_candidate(dlsession, &candidates[x]);
+ }
- if (!(exten = ldl_session_get_value(dlsession, "dnis"))) {
- exten = profile->exten;
- /* if it's _auto_ set the extension to match the username portion of the called address */
- if (!strcmp(exten, "_auto_")) {
- if ((t = ldl_session_get_callee(dlsession))) {
- if ((them = strdup(t))) {
- char *a, *b, *p;
- if ((p = strchr(them, '/'))) {
- *p = '\0';
- }
+ if (!(exten = ldl_session_get_value(dlsession, "dnis"))) {
+ exten = profile->exten;
+ /* if it's _auto_ set the extension to match the username portion of the called address */
+ if (!strcmp(exten, "_auto_")) {
+ if ((t = ldl_session_get_callee(dlsession))) {
+ if ((them = strdup(t))) {
+ char *a, *b, *p;
+ if ((p = strchr(them, '/'))) {
+ *p = '\0';
+ }
- if ((a = strchr(them, '+')) && (b = strrchr(them, '+')) && a != b) {
- *b++ = '\0';
- switch_channel_set_variable(channel, "dl_user", them);
- switch_channel_set_variable(channel, "dl_host", b);
- }
- exten = them;
+ if ((a = strchr(them, '+')) && (b = strrchr(them, '+')) && a != b) {
+ *b++ = '\0';
+ switch_channel_set_variable(channel, "dl_user", them);
+ switch_channel_set_variable(channel, "dl_host", b);
}
+ exten = them;
}
}
}
+ }
- if (!(context = ldl_session_get_value(dlsession, "context"))) {
- context = profile->context;
- }
+ if (!(context = ldl_session_get_value(dlsession, "context"))) {
+ context = profile->context;
+ }
- if (!(cid_name = ldl_session_get_value(dlsession, "caller_id_name"))) {
- cid_name = tech_pvt->recip;
- }
+ if (!(cid_name = ldl_session_get_value(dlsession, "caller_id_name"))) {
+ cid_name = tech_pvt->recip;
+ }
- if (!(cid_num = ldl_session_get_value(dlsession, "caller_id_number"))) {
- cid_num = tech_pvt->recip;
- }
+ if (!(cid_num = ldl_session_get_value(dlsession, "caller_id_number"))) {
+ cid_num = tech_pvt->recip;
+ }
- /* context of "_auto_" means set it to the domain */
- if (profile->context && !strcmp(profile->context, "_auto_")) {
- context = profile->name;
- }
+ /* context of "_auto_" means set it to the domain */
+ if (profile->context && !strcmp(profile->context, "_auto_")) {
+ context = profile->name;
+ }
- tech_pvt->them = switch_core_session_strdup(session, ldl_session_get_callee(dlsession));
- tech_pvt->us = switch_core_session_strdup(session, ldl_session_get_caller(dlsession));
+ tech_pvt->them = switch_core_session_strdup(session, ldl_session_get_callee(dlsession));
+ tech_pvt->us = switch_core_session_strdup(session, ldl_session_get_caller(dlsession));
- if ((tmp = strdup(tech_pvt->us))) {
- char *p, *q;
+ if ((tmp = strdup(tech_pvt->us))) {
+ char *p, *q;
- if ((p = strchr(tmp, '@'))) {
- *p++ = '\0';
- if ((q = strchr(p, '/'))) {
- *q = '\0';
- }
- switch_channel_set_variable(channel, "dl_from_user", tmp);
- switch_channel_set_variable(channel, "dl_from_host", p);
+ if ((p = strchr(tmp, '@'))) {
+ *p++ = '\0';
+ if ((q = strchr(p, '/'))) {
+ *q = '\0';
}
-
- switch_safe_free(tmp);
+ switch_channel_set_variable(channel, "dl_from_user", tmp);
+ switch_channel_set_variable(channel, "dl_from_host", p);
}
+
+ switch_safe_free(tmp);
+ }
- if (!tech_pvt->caller_profile) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Creating an identity for %s %s <%s> %s\n",
- ldl_session_get_id(dlsession), cid_name, cid_num, exten);
+ if (!tech_pvt->caller_profile) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Creating an identity for %s %s <%s> %s\n",
+ ldl_session_get_id(dlsession), cid_name, cid_num, exten);
- if ((tech_pvt->caller_profile = switch_caller_profile_new(switch_core_session_get_pool(session),
- ldl_handle_get_login(profile->handle),
- profile->dialplan,
- cid_name,
- cid_num,
- ldl_session_get_ip(dlsession),
- ldl_session_get_value(dlsession, "ani"),
- ldl_session_get_value(dlsession, "aniii"),
- ldl_session_get_value(dlsession, "rdnis"),
- (char *)modname,
- context,
- exten)) != 0) {
- char name[128];
- snprintf(name, sizeof(name), "DingaLing/%s", tech_pvt->caller_profile->destination_number);
- switch_channel_set_name(channel, name);
- switch_channel_set_caller_profile(channel, tech_pvt->caller_profile);
- }
+ if ((tech_pvt->caller_profile = switch_caller_profile_new(switch_core_session_get_pool(session),
+ ldl_handle_get_login(profile->handle),
+ profile->dialplan,
+ cid_name,
+ cid_num,
+ ldl_session_get_ip(dlsession),
+ ldl_session_get_value(dlsession, "ani"),
+ ldl_session_get_value(dlsession, "aniii"),
+ ldl_session_get_value(dlsession, "rdnis"),
+ (char *)modname,
+ context,
+ exten)) != 0) {
+ char name[128];
+ snprintf(name, sizeof(name), "DingaLing/%s", tech_pvt->caller_profile->destination_number);
+ switch_channel_set_name(channel, name);
+ switch_channel_set_caller_profile(channel, tech_pvt->caller_profile);
}
+ }
- switch_safe_free(them);
+ switch_safe_free(them);
- if (lanaddr) {
- switch_set_flag_locked(tech_pvt, TFLAG_LANADDR);
- }
+ if (lanaddr) {
+ switch_set_flag_locked(tech_pvt, TFLAG_LANADDR);
+ }
- if (!get_codecs(tech_pvt)) {
- terminate_session(&session, __LINE__, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
- status = LDL_STATUS_FALSE;
- goto done;
- }
+ if (!get_codecs(tech_pvt)) {
+ terminate_session(&session, __LINE__, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
+ status = LDL_STATUS_FALSE;
+ goto done;
+ }
- tech_pvt->remote_ip = switch_core_session_strdup(session, candidates[x].address);
- ldl_session_set_ip(dlsession, tech_pvt->remote_ip);
- tech_pvt->remote_port = candidates[x].port;
- tech_pvt->remote_user = switch_core_session_strdup(session, candidates[x].username);
+ tech_pvt->remote_ip = switch_core_session_strdup(session, candidates[x].address);
+ ldl_session_set_ip(dlsession, tech_pvt->remote_ip);
+ tech_pvt->remote_port = candidates[x].port;
+ tech_pvt->remote_user = switch_core_session_strdup(session, candidates[x].username);
- if (!switch_test_flag(tech_pvt, TFLAG_OUTBOUND)) {
- if (!do_candidates(tech_pvt, 0)) {
- terminate_session(&session, __LINE__, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
- status = LDL_STATUS_FALSE;
- goto done;
- }
+ if (!switch_test_flag(tech_pvt, TFLAG_OUTBOUND)) {
+ if (!do_candidates(tech_pvt, 0)) {
+ terminate_session(&session, __LINE__, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
+ status = LDL_STATUS_FALSE;
+ goto done;
}
-
-
- switch_set_flag_locked(tech_pvt, TFLAG_TRANSPORT);
-
- status = LDL_STATUS_SUCCESS;
- goto done;
}
+
+ status = LDL_STATUS_SUCCESS;
+ goto done;
}
}
}
Modified: freeswitch/trunk/src/switch_rtp.c
==============================================================================
--- freeswitch/trunk/src/switch_rtp.c (original)
+++ freeswitch/trunk/src/switch_rtp.c Thu Nov 16 10:50:17 2006
@@ -765,7 +765,7 @@
rtp_session->last_time = switch_time_now();
}
- for(;;) {
+ while(rtp_session->ready) {
bytes = sizeof(rtp_msg_t);
status = switch_socket_recvfrom(rtp_session->from_addr, rtp_session->sock, 0, (void *)&rtp_session->recv_msg, &bytes);
1
0
Author: sphere
Date: Thu Nov 16 10:36:23 2006
New Revision: 3383
Added:
freeswitch/branches/glenn/
Log:
Creating empty folder for glenn
1
0
[commit] r3382 - in freeswitch/branches/knhor/trunk: . libs/libdingaling libs/libdingaling/src libs/win32/sofia scripts src src/include src/mod/endpoints/mod_dingaling src/mod/endpoints/mod_sofia src/mod/languages/mod_python src/mod/languages/mod_spidermonkey
by Freeswitch SVN 16 Nov '06
by Freeswitch SVN 16 Nov '06
16 Nov '06
Author: knhor
Date: Wed Nov 15 20:38:30 2006
New Revision: 3382
Added:
freeswitch/branches/knhor/trunk/scripts/mytest.py
- copied unchanged from r3381, /freeswitch/trunk/scripts/mytest.py
Modified:
freeswitch/branches/knhor/trunk/ (props changed)
freeswitch/branches/knhor/trunk/AUTHORS
freeswitch/branches/knhor/trunk/libs/libdingaling/.update
freeswitch/branches/knhor/trunk/libs/libdingaling/src/libdingaling.c
freeswitch/branches/knhor/trunk/libs/libdingaling/src/libdingaling.h
freeswitch/branches/knhor/trunk/libs/libdingaling/src/sha1.c
freeswitch/branches/knhor/trunk/libs/libdingaling/src/sha1.h
freeswitch/branches/knhor/trunk/libs/win32/sofia/libsofia_sip_ua_static.vcproj
freeswitch/branches/knhor/trunk/src/include/switch_am_config.h.in
freeswitch/branches/knhor/trunk/src/include/switch_apr.h
freeswitch/branches/knhor/trunk/src/include/switch_utils.h
freeswitch/branches/knhor/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c
freeswitch/branches/knhor/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
freeswitch/branches/knhor/trunk/src/mod/languages/mod_python/Makefile
freeswitch/branches/knhor/trunk/src/mod/languages/mod_python/mod_python.c
freeswitch/branches/knhor/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
freeswitch/branches/knhor/trunk/src/switch_rtp.c
freeswitch/branches/knhor/trunk/src/switch_utils.c
Log:
Merged revisions 3349-3381 via svnmerge from trunk
Modified: freeswitch/branches/knhor/trunk/AUTHORS
==============================================================================
--- freeswitch/branches/knhor/trunk/AUTHORS (original)
+++ freeswitch/branches/knhor/trunk/AUTHORS Wed Nov 15 20:38:30 2006
@@ -29,6 +29,7 @@
Paul D. Tinsley - Various patches and support. <pdt at jackhammer.org>
Ken Rice of Asteria Solutions Group, INC <ken AT asteriasgi.com> - xmlcdr, sofia improvements, load testing.
Neal Horman <neal at wanlink dot com> - conference improvements, switch_ivr menu additions and other tweaks.
+ Johny Kadarisman <jkr888 at gmail.com> - mod_python fixups.
A big THANK YOU goes to:
Modified: freeswitch/branches/knhor/trunk/libs/libdingaling/.update
==============================================================================
--- freeswitch/branches/knhor/trunk/libs/libdingaling/.update (original)
+++ freeswitch/branches/knhor/trunk/libs/libdingaling/.update Wed Nov 15 20:38:30 2006
@@ -1 +1 @@
-Tue Oct 24 13:51:01 CDT 2006
+Wed Nov 15 20:20:53 UTC 2006
Modified: freeswitch/branches/knhor/trunk/libs/libdingaling/src/libdingaling.c
==============================================================================
--- freeswitch/branches/knhor/trunk/libs/libdingaling/src/libdingaling.c (original)
+++ freeswitch/branches/knhor/trunk/libs/libdingaling/src/libdingaling.c Wed Nov 15 20:38:30 2006
@@ -149,6 +149,17 @@
};
+static void lowercase(char *str)
+{
+ size_t x = 0;
+
+ if (str) {
+ for (x = 0; x < strlen(str); x++) {
+ str[x] = (char)tolower((int)str[x]);
+ }
+ }
+}
+
static char *cut_path(char *in)
{
char *p, *ret = in;
@@ -682,7 +693,6 @@
char id[1024];
char *resource;
struct ldl_buffer *buffer;
- size_t x;
ldl_signal_t signal;
@@ -696,8 +706,6 @@
status = type;
}
-
-
if (!apr_hash_get(handle->sub_hash, from, APR_HASH_KEY_STRING)) {
iks *msg;
apr_hash_set(handle->sub_hash, apr_pstrdup(handle->pool, from), APR_HASH_KEY_STRING, &marker);
@@ -706,16 +714,12 @@
}
apr_cpystrn(id, from, sizeof(id));
+ lowercase(id);
+
if ((resource = strchr(id, '/'))) {
*resource++ = '\0';
}
-
- if (resource) {
- for (x = 0; x < strlen(resource); x++) {
- resource[x] = (char)tolower((int)resource[x]);
- }
- }
-
+
if (resource && strstr(resource, "talk") && (buffer = apr_hash_get(handle->probe_hash, id, APR_HASH_KEY_STRING))) {
apr_cpystrn(buffer->buf, from, buffer->len);
fflush(stderr);
@@ -861,8 +865,10 @@
if (!strcasecmp(iks_name(tag), "bind")) {
char *jid = iks_find_cdata(tag, "jid");
char *resource = strchr(jid, '/');
- //iks *iq, *x;
- handle->acc->resource = apr_pstrdup(handle->pool, resource);
+ if (resource) {
+ resource++;
+ handle->acc->resource = apr_pstrdup(handle->pool, resource);
+ }
handle->login = apr_pstrdup(handle->pool, jid);
#if 0
if ((iq = iks_new("iq"))) {
@@ -973,7 +979,7 @@
sha_context_t sha;
char *p;
int x;
- unsigned char digest[20];
+ unsigned char digest[20] = "";
SHA1Init(&sha);
@@ -995,9 +1001,10 @@
switch (type) {
case IKS_NODE_START:
if (handle->state == CS_NEW) {
- char secret[256];
- char hash[256];
- char handshake[512];
+ char secret[256] = "";
+ char hash[256] = "";
+ char handshake[512] = "";
+
snprintf(secret, sizeof(secret), "%s%s", pak->id, handle->password);
sha1_hash(hash, secret);
snprintf(handshake, sizeof(handshake), "<handshake>%s</handshake>", hash);
@@ -1581,6 +1588,11 @@
return handle->private_info;
}
+void *ldl_handle_get_login(ldl_handle_t *handle)
+{
+ return handle->login;
+}
+
void ldl_handle_send_presence(ldl_handle_t *handle, char *from, char *to, char *type, char *rpid, char *message)
{
do_presence(handle, from, to, type, rpid, message);
@@ -1746,7 +1758,7 @@
char *ldl_handle_probe(ldl_handle_t *handle, char *id, char *from, char *buf, unsigned int len)
{
iks *pres, *msg;
- char *lid = NULL;
+ char *lid = NULL, *low_id = NULL;
struct ldl_buffer buffer;
apr_time_t started;
unsigned int elapsed;
@@ -1761,13 +1773,14 @@
iks_insert_attrib(pres, "type", "probe");
iks_insert_attrib(pres, "from", from);
iks_insert_attrib(pres, "to", id);
+
-
apr_hash_set(handle->probe_hash, id, APR_HASH_KEY_STRING, &buffer);
msg = iks_make_s10n (IKS_TYPE_SUBSCRIBE, id, notice);
- iks_insert_attrib(pres, "from", from);
+ iks_insert_attrib(msg, "from", from);
apr_queue_push(handle->queue, msg);
msg = iks_make_s10n (IKS_TYPE_SUBSCRIBED, id, notice);
+ iks_insert_attrib(msg, "from", from);
apr_queue_push(handle->queue, msg);
apr_queue_push(handle->queue, pres);
@@ -1792,7 +1805,12 @@
ldl_yield(1000);
}
- apr_hash_set(handle->probe_hash, id, APR_HASH_KEY_STRING, NULL);
+ if ((low_id = strdup(id))) {
+ lowercase(id);
+ apr_hash_set(handle->probe_hash, low_id, APR_HASH_KEY_STRING, NULL);
+ free(low_id);
+ }
+
return lid;
}
Modified: freeswitch/branches/knhor/trunk/libs/libdingaling/src/libdingaling.h
==============================================================================
--- freeswitch/branches/knhor/trunk/libs/libdingaling/src/libdingaling.h (original)
+++ freeswitch/branches/knhor/trunk/libs/libdingaling/src/libdingaling.h Wed Nov 15 20:38:30 2006
@@ -356,6 +356,13 @@
void *ldl_handle_get_private(ldl_handle_t *handle);
/*!
+ \brief Get the full login of a connection handle
+ \param handle the conection handle
+ \return the requested data
+*/
+void *ldl_handle_get_login(ldl_handle_t *handle);
+
+/*!
\brief Send a message to a session
\param session the session handle
\param subject optional subject
Modified: freeswitch/branches/knhor/trunk/libs/libdingaling/src/sha1.c
==============================================================================
--- freeswitch/branches/knhor/trunk/libs/libdingaling/src/sha1.c (original)
+++ freeswitch/branches/knhor/trunk/libs/libdingaling/src/sha1.c Wed Nov 15 20:38:30 2006
@@ -92,12 +92,12 @@
/* Hash a single 512-bit block. This is the core of the algorithm. */
-void SHA1Transform(unsigned long state[5], unsigned char buffer[64])
+void SHA1Transform(uint32_t state[5], unsigned char buffer[64])
{
-unsigned long a, b, c, d, e;
+uint32_t a, b, c, d, e;
typedef union {
unsigned char c[64];
- unsigned long l[16];
+ uint32_t l[16];
} CHAR64LONG16;
CHAR64LONG16* block;
#ifdef SHA1HANDSOFF
@@ -161,9 +161,9 @@
/* Run your data through this. */
-void SHA1Update(sha_context_t* context, unsigned char* data, unsigned int len)
+void SHA1Update(sha_context_t* context, unsigned char* data, uint32_t len)
{
-unsigned int i, j;
+uint32_t i, j;
j = (context->count[0] >> 3) & 63;
if ((context->count[0] += len << 3) < (len << 3)) context->count[1]++;
@@ -185,7 +185,7 @@
void SHA1Final(unsigned char digest[20], sha_context_t* context)
{
-unsigned long i, j;
+uint32_t i, j;
unsigned char finalcount[8];
for (i = 0; i < 8; i++) {
Modified: freeswitch/branches/knhor/trunk/libs/libdingaling/src/sha1.h
==============================================================================
--- freeswitch/branches/knhor/trunk/libs/libdingaling/src/sha1.h (original)
+++ freeswitch/branches/knhor/trunk/libs/libdingaling/src/sha1.h Wed Nov 15 20:38:30 2006
@@ -41,15 +41,40 @@
}
#endif
+#undef inline
+#define inline __inline
+
+#ifndef uint32_t
+#ifdef WIN32
+typedef unsigned __int8 uint8_t;
+typedef unsigned __int16 uint16_t;
+typedef unsigned __int32 uint32_t;
+typedef unsigned __int64 uint64_t;
+typedef __int8 int8_t;
+typedef __int16 int16_t;
+typedef __int32 int32_t;
+typedef __int64 int64_t;
+typedef unsigned long in_addr_t;
+#else
+#include <limits.h>
+#include <inttypes.h>
+#include <sys/types.h>
+#include <inttypes.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <time.h>
+#endif
+#endif
+
typedef struct {
- unsigned long state[5];
- unsigned long count[2];
+ uint32_t state[5];
+ uint32_t count[2];
unsigned char buffer[64];
} sha_context_t;
-void SHA1Transform(unsigned long state[5], unsigned char buffer[64]);
+void SHA1Transform(uint32_t state[5], unsigned char buffer[64]);
void SHA1Init(sha_context_t* context);
-void SHA1Update(sha_context_t* context, unsigned char* data, unsigned int len);
+void SHA1Update(sha_context_t* context, unsigned char* data, uint32_t len);
void SHA1Final(unsigned char digest[20], sha_context_t* context);
#ifdef __cplusplus
Modified: freeswitch/branches/knhor/trunk/libs/win32/sofia/libsofia_sip_ua_static.vcproj
==============================================================================
--- freeswitch/branches/knhor/trunk/libs/win32/sofia/libsofia_sip_ua_static.vcproj (original)
+++ freeswitch/branches/knhor/trunk/libs/win32/sofia/libsofia_sip_ua_static.vcproj Wed Nov 15 20:38:30 2006
@@ -419,7 +419,7 @@
Name="soa"
>
<File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\soa\soa.c"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\soa\sofia-sip-1.12.3.10\soa_session.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\soa\sofia-sip\soa_session.h"></File>
<File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\soa\soa_static.c"></File>
<File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\soa\soa_tag.c"></File>
<File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\soa\soa_tag_ref.c"></File>
@@ -433,36 +433,36 @@
Name="su headers"
Filter="su*.h"
>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip-1.12.3.10\htable.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip-1.12.3.10\htable2.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip-1.12.3.10\rbtree.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip-1.12.3.10\su.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip-1.12.3.10\su_addrinfo.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip-1.12.3.10\su_alloc.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip-1.12.3.10\su_alloc_stat.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip-1.12.3.10\su_bm.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip-1.12.3.10\su_config.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip-1.12.3.10\su_debug.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip-1.12.3.10\su_errno.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip-1.12.3.10\su_localinfo.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip-1.12.3.10\su_log.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip-1.12.3.10\su_md5.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip\htable.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip\htable2.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip\rbtree.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip\su.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip\su_addrinfo.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip\su_alloc.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip\su_alloc_stat.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip\su_bm.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip\su_config.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip\su_debug.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip\su_errno.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip\su_localinfo.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip\su_log.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip\su_md5.h"></File>
<File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\su_module_debug.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip-1.12.3.10\su_os_nw.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip\su_os_nw.h"></File>
<File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\su_port.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip-1.12.3.10\su_source.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip-1.12.3.10\su_strlst.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip-1.12.3.10\su_tag.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip-1.12.3.10\su_tag_class.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip-1.12.3.10\su_tag_inline.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip-1.12.3.10\su_tag_io.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip-1.12.3.10\su_tagarg.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip-1.12.3.10\su_time.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip-1.12.3.10\su_types.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip-1.12.3.10\su_uniqueid.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip-1.12.3.10\su_vector.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip-1.12.3.10\su_wait.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip-1.12.3.10\tstdef.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip\su_source.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip\su_strlst.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip\su_tag.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip\su_tag_class.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip\su_tag_inline.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip\su_tag_io.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip\su_tagarg.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip\su_time.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip\su_types.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip\su_uniqueid.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip\su_vector.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip\su_wait.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\su\sofia-sip\tstdef.h"></File>
</Filter>
<Filter
Name="win32 headers"
@@ -474,83 +474,83 @@
<Filter
Name="ipt headers"
>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\ipt\sofia-sip-1.12.3.10\base64.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\ipt\sofia-sip-1.12.3.10\rc4.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\ipt\sofia-sip-1.12.3.10\string0.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\ipt\sofia-sip-1.12.3.10\token64.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\ipt\sofia-sip\base64.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\ipt\sofia-sip\rc4.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\ipt\sofia-sip\string0.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\ipt\sofia-sip\token64.h"></File>
</Filter>
<Filter
Name="url headers"
Filter="url*.h"
>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\url\sofia-sip-1.12.3.10\url.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\url\sofia-sip-1.12.3.10\url_tag.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\url\sofia-sip-1.12.3.10\url_tag_class.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\url\sofia-sip\url.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\url\sofia-sip\url_tag.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\url\sofia-sip\url_tag_class.h"></File>
</Filter>
<Filter
Name="features headers"
Filter="features*.h"
>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\features\sofia-sip-1.12.3.10\sofia_features.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\features\sofia-sip\sofia_features.h"></File>
</Filter>
<Filter
Name="bnf headers"
Filter="bnf*.h"
>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\bnf\sofia-sip-1.12.3.10\bnf.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\bnf\sofia-sip-1.12.3.10\hostdomain.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\bnf\sofia-sip\bnf.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\bnf\sofia-sip\hostdomain.h"></File>
</Filter>
<Filter
Name="msg headers"
>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\msg\sofia-sip-1.12.3.10\msg.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\msg\sofia-sip-1.12.3.10\msg_addr.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\msg\sofia-sip\msg.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\msg\sofia-sip\msg_addr.h"></File>
<File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\msg\msg_bnf.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\msg\sofia-sip-1.12.3.10\msg_buffer.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\msg\sofia-sip-1.12.3.10\msg_date.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\msg\sofia-sip-1.12.3.10\msg_header.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\msg\sofia-sip\msg_buffer.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\msg\sofia-sip\msg_date.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\msg\sofia-sip\msg_header.h"></File>
<File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\msg\msg_internal.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\msg\sofia-sip-1.12.3.10\msg_mclass.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\msg\sofia-sip-1.12.3.10\msg_mclass_hash.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\msg\sofia-sip-1.12.3.10\msg_mime.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\msg\sofia-sip-1.12.3.10\msg_mime_protos.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\msg\sofia-sip-1.12.3.10\msg_parser.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\msg\sofia-sip-1.12.3.10\msg_protos.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\msg\sofia-sip-1.12.3.10\msg_tag_class.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\msg\sofia-sip-1.12.3.10\msg_types.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\msg\sofia-sip\msg_mclass.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\msg\sofia-sip\msg_mclass_hash.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\msg\sofia-sip\msg_mime.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\msg\sofia-sip\msg_mime_protos.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\msg\sofia-sip\msg_parser.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\msg\sofia-sip\msg_protos.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\msg\sofia-sip\msg_tag_class.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\msg\sofia-sip\msg_types.h"></File>
</Filter>
<Filter
Name="sip headers"
>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\sip\sofia-sip-1.12.3.10\sip.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\sip\sofia-sip\sip.h"></File>
<File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\sip\sip_extensions.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\sip\sofia-sip-1.12.3.10\sip_hclasses.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\sip\sofia-sip-1.12.3.10\sip_header.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\sip\sofia-sip\sip_hclasses.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\sip\sofia-sip\sip_header.h"></File>
<File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\sip\sip_internal.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\sip\sofia-sip-1.12.3.10\sip_parser.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\sip\sofia-sip-1.12.3.10\sip_protos.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\sip\sofia-sip-1.12.3.10\sip_status.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\sip\sofia-sip-1.12.3.10\sip_tag.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\sip\sofia-sip-1.12.3.10\sip_tag_class.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\sip\sofia-sip-1.12.3.10\sip_util.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\sip\sofia-sip\sip_parser.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\sip\sofia-sip\sip_protos.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\sip\sofia-sip\sip_status.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\sip\sofia-sip\sip_tag.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\sip\sofia-sip\sip_tag_class.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\sip\sofia-sip\sip_util.h"></File>
</Filter>
<Filter
Name="http headers"
>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\http\sofia-sip-1.12.3.10\http.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\http\sofia-sip-1.12.3.10\http_hclasses.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\http\sofia-sip-1.12.3.10\http_header.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\http\sofia-sip-1.12.3.10\http_parser.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\http\sofia-sip-1.12.3.10\http_protos.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\http\sofia-sip-1.12.3.10\http_status.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\http\sofia-sip-1.12.3.10\http_tag.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\http\sofia-sip-1.12.3.10\http_tag_class.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\http\sofia-sip\http.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\http\sofia-sip\http_hclasses.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\http\sofia-sip\http_header.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\http\sofia-sip\http_parser.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\http\sofia-sip\http_protos.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\http\sofia-sip\http_status.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\http\sofia-sip\http_tag.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\http\sofia-sip\http_tag_class.h"></File>
</Filter>
<Filter
Name="nth headers"
>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\nth\sofia-sip-1.12.3.10\nth.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\nth\sofia-sip-1.12.3.10\nth_tag.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\nth\sofia-sip\nth.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\nth\sofia-sip\nth_tag.h"></File>
</Filter>
<Filter
Name="sresolv headers"
@@ -559,68 +559,68 @@
<File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\sresolv\sofia-resolv\sres_async.h"></File>
<File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\sresolv\sofia-resolv\sres_cache.h"></File>
<File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\sresolv\sofia-resolv\sres_record.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\sresolv\sofia-sip-1.12.3.10\sresolv.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\sresolv\sofia-sip\sresolv.h"></File>
</Filter>
<Filter
Name="nea headers"
>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\nea\sofia-sip-1.12.3.10\nea.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\nea\sofia-sip\nea.h"></File>
<File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\nea\nea_debug.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\nea\sofia-sip-1.12.3.10\nea_tag.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\nea\sofia-sip\nea_tag.h"></File>
</Filter>
<Filter
Name="iptsec headers"
>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\iptsec\sofia-sip-1.12.3.10\auth_client.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\iptsec\sofia-sip-1.12.3.10\auth_digest.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\iptsec\sofia-sip-1.12.3.10\auth_module.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\iptsec\sofia-sip-1.12.3.10\auth_ntlm.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\iptsec\sofia-sip-1.12.3.10\auth_plugin.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\iptsec\sofia-sip\auth_client.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\iptsec\sofia-sip\auth_digest.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\iptsec\sofia-sip\auth_module.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\iptsec\sofia-sip\auth_ntlm.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\iptsec\sofia-sip\auth_plugin.h"></File>
<File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\iptsec\iptsec_debug.h"></File>
</Filter>
<Filter
Name="stun headers"
>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\stun\sofia-sip-1.12.3.10\stun.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\stun\sofia-sip-1.12.3.10\stun_common.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\stun\sofia-sip-1.12.3.10\stun_tag.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\stun\sofia-sip\stun.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\stun\sofia-sip\stun_common.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\stun\sofia-sip\stun_tag.h"></File>
</Filter>
<Filter
Name="nua headers"
>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\nua\sofia-sip-1.12.3.10\nua.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\nua\sofia-sip-1.12.3.10\nua_tag.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\nua\sofia-sip\nua.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\nua\sofia-sip\nua_tag.h"></File>
</Filter>
<Filter
Name="nta headers"
>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\nta\sofia-sip-1.12.3.10\nta.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\nta\sofia-sip\nta.h"></File>
<File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\nta\nta_internal.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\nta\sofia-sip-1.12.3.10\nta_stateless.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\nta\sofia-sip-1.12.3.10\nta_tag.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\nta\sofia-sip-1.12.3.10\nta_tport.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\nta\sofia-sip-1.12.3.10\sl_utils.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\nta\sofia-sip\nta_stateless.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\nta\sofia-sip\nta_tag.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\nta\sofia-sip\nta_tport.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\nta\sofia-sip\sl_utils.h"></File>
</Filter>
<Filter
Name="tport headers"
>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\tport\sofia-sip-1.12.3.10\tport.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\tport\sofia-sip-1.12.3.10\tport_plugins.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\tport\sofia-sip-1.12.3.10\tport_tag.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\tport\sofia-sip\tport.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\tport\sofia-sip\tport_plugins.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\tport\sofia-sip\tport_tag.h"></File>
<File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\tport\tport_tls.h"></File>
</Filter>
<Filter
Name="sdp headers"
>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\sdp\sofia-sip-1.12.3.10\sdp.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\sdp\sofia-sip-1.12.3.10\sdp_tag.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\sdp\sofia-sip\sdp.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\sdp\sofia-sip\sdp_tag.h"></File>
</Filter>
<Filter
Name="soa headers"
>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\soa\sofia-sip-1.12.3.10\soa.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\soa\sofia-sip-1.12.3.10\soa_add.h"></File>
- <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\soa\sofia-sip-1.12.3.10\soa_tag.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\soa\sofia-sip\soa.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\soa\sofia-sip\soa_add.h"></File>
+ <File RelativePath="..\..\sofia-sip-1.12.3.10\libsofia-sip-ua\soa\sofia-sip\soa_tag.h"></File>
</Filter>
</Filter>
</Files>
Modified: freeswitch/branches/knhor/trunk/src/include/switch_am_config.h.in
==============================================================================
--- freeswitch/branches/knhor/trunk/src/include/switch_am_config.h.in (original)
+++ freeswitch/branches/knhor/trunk/src/include/switch_am_config.h.in Wed Nov 15 20:38:30 2006
@@ -124,5 +124,5 @@
/* Define to rpl_malloc if the replacement function should be used. */
#undef malloc
-/* Define to `unsigned int' if <sys/types.h> does not define. */
+/* Define to `unsigned' if <sys/types.h> does not define. */
#undef size_t
Modified: freeswitch/branches/knhor/trunk/src/include/switch_apr.h
==============================================================================
--- freeswitch/branches/knhor/trunk/src/include/switch_apr.h (original)
+++ freeswitch/branches/knhor/trunk/src/include/switch_apr.h Wed Nov 15 20:38:30 2006
@@ -649,7 +649,7 @@
* @param flags The flags to use
* @param buf The buffer to use
* @param len The length of the available buffer
- */
+ *
DoxyDefine(apr_status_t switch_socket_recvfrom(switch_sockaddr_t *from,
switch_socket_t *sock,
@@ -657,6 +657,7 @@
char *buf,
apr_size_t *len);)
#define switch_socket_recvfrom apr_socket_recvfrom
+*/
/**
* Send a file from an open file descriptor to a socket, along with
Modified: freeswitch/branches/knhor/trunk/src/include/switch_utils.h
==============================================================================
--- freeswitch/branches/knhor/trunk/src/include/switch_utils.h (original)
+++ freeswitch/branches/knhor/trunk/src/include/switch_utils.h Wed Nov 15 20:38:30 2006
@@ -54,6 +54,11 @@
#define SWITCH_SMIN -32768
#define switch_normalize_to_16bit(n) if (n > SWITCH_SMAX) n = SWITCH_SMAX / 2; else if (n < SWITCH_SMIN) n = SWITCH_SMIN / 2;
+SWITCH_DECLARE(char *) switch_get_addr(char *buf, switch_size_t len, switch_sockaddr_t *in);
+
+SWITCH_DECLARE(apr_status_t) switch_socket_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock,
+ apr_int32_t flags, char *buf,
+ apr_size_t *len);
/*!
Modified: freeswitch/branches/knhor/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c
==============================================================================
--- freeswitch/branches/knhor/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c (original)
+++ freeswitch/branches/knhor/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c Wed Nov 15 20:38:30 2006
@@ -1471,7 +1471,7 @@
char *dnis = NULL;
char workspace[1024] = "";
char *p, *u, ubuf[512] = "", *user = NULL;;
-
+
switch_copy_string(workspace, outbound_profile->destination_number, sizeof(workspace));
profile_name = workspace;
if ((callto = strchr(profile_name, '/'))) {
@@ -1481,26 +1481,30 @@
terminate_session(new_session, __LINE__, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
return SWITCH_STATUS_GENERR;
}
-
+
if ((dnis = strchr(callto, ':'))) {
*dnis++ = '\0';
}
- if ((p = strchr(profile_name, '@'))) {
- *p++ = '\0';
- u = profile_name;
- profile_name = p;
- snprintf(ubuf, sizeof(ubuf), "%s@%s/talk", u, profile_name);
- user = ubuf;
- } else {
- user = (char *) modname;
- }
-
if ((mdl_profile = switch_core_hash_find(globals.profile_hash, profile_name))) {
-
- if ((mdl_profile->user_flags & LDL_FLAG_COMPONENT) && strchr(outbound_profile->caller_id_number, '@')) {
+ if ((mdl_profile->user_flags & LDL_FLAG_COMPONENT)) {
+ if ((p = strchr(profile_name, '@'))) {
+ *p++ = '\0';
+ u = profile_name;
+ profile_name = p;
+ snprintf(ubuf, sizeof(ubuf), "%s@%s/talk", u, profile_name);
+ user = ubuf;
+ } else {
+ terminate_session(new_session, __LINE__, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
+ return SWITCH_STATUS_GENERR;
+ }
+ }
+
+ if (strchr(outbound_profile->caller_id_number, '@')) {
snprintf(ubuf, sizeof(ubuf), "%s/talk", outbound_profile->caller_id_number);
user = ubuf;
+ } else {
+ user = ldl_handle_get_login(mdl_profile->handle);
}
if (!ldl_handle_ready(mdl_profile->handle)) {
@@ -2170,7 +2174,9 @@
char *hint;
if (profile->auto_reply) {
- ldl_handle_send_msg(handle, (profile->user_flags & LDL_FLAG_COMPONENT) ? to : profile->login, from, "", profile->auto_reply);
+ ldl_handle_send_msg(handle,
+ (profile->user_flags & LDL_FLAG_COMPONENT) ? to : ldl_handle_get_login(profile->handle),
+ from, "", profile->auto_reply);
}
if (strchr(to, '+')) {
@@ -2203,7 +2209,7 @@
break;
case LDL_SIGNAL_LOGIN_SUCCESS:
if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, DL_EVENT_LOGIN_SUCCESS) == SWITCH_STATUS_SUCCESS) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->login);
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", ldl_handle_get_login(profile->handle));
switch_event_fire(&event);
}
if (profile->user_flags & LDL_FLAG_COMPONENT) {
@@ -2213,13 +2219,13 @@
break;
case LDL_SIGNAL_LOGIN_FAILURE:
if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, DL_EVENT_LOGIN_FAILURE) == SWITCH_STATUS_SUCCESS) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->login);
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", ldl_handle_get_login(profile->handle));
switch_event_fire(&event);
}
break;
case LDL_SIGNAL_CONNECTED:
if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, DL_EVENT_CONNECTED) == SWITCH_STATUS_SUCCESS) {
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->login);
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", ldl_handle_get_login(profile->handle));
switch_event_fire(&event);
}
break;
@@ -2313,7 +2319,7 @@
}
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", MDL_CHAT_PROTO);
- switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->login);
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", ldl_handle_get_login(profile->handle));
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "hint", "%s", hint);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s", from);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "to", "%s", to);
@@ -2527,7 +2533,7 @@
ldl_session_get_id(dlsession), cid_name, cid_num, exten);
if ((tech_pvt->caller_profile = switch_caller_profile_new(switch_core_session_get_pool(session),
- profile->login,
+ ldl_handle_get_login(profile->handle),
profile->dialplan,
cid_name,
cid_num,
Modified: freeswitch/branches/knhor/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/branches/knhor/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c (original)
+++ freeswitch/branches/knhor/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c Wed Nov 15 20:38:30 2006
@@ -426,6 +426,26 @@
AUTH_STALE,
} auth_res_t;
+
+static char *get_url_from_contact(char *buf, uint8_t dup)
+{
+ char *url = NULL, *e;
+
+
+ if ((url = strchr(buf, '<')) && (e = strchr(url, '>'))) {
+ url++;
+ if (dup) {
+ url = strdup(url);
+ e = strchr(url, '>');
+ }
+
+ *e = '\0';
+ }
+
+ return url;
+}
+
+
static auth_res_t parse_auth(sofia_profile_t *profile, sip_authorization_t const *authorization, char *regstr, char *np, size_t nplen)
{
int index;
@@ -1871,22 +1891,13 @@
activate_rtp(tech_pvt);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Ring SDP:\n%s\n", tech_pvt->local_sdp_str);
+ nua_respond(tech_pvt->nh,
+ SIP_183_SESSION_PROGRESS,
+ SIPTAG_CONTACT_STR(tech_pvt->profile->url),
+ SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
+ SOATAG_AUDIO_AUX("cn telephone-event"),
+ TAG_END());
- if (msg->message_id == SWITCH_MESSAGE_INDICATE_RINGING) {
- nua_respond(tech_pvt->nh,
- SIP_180_RINGING,
- SIPTAG_CONTACT_STR(tech_pvt->profile->url),
- SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
- SOATAG_AUDIO_AUX("cn telephone-event"),
- TAG_END());
- } else {
- nua_respond(tech_pvt->nh,
- SIP_183_SESSION_PROGRESS,
- SIPTAG_CONTACT_STR(tech_pvt->profile->url),
- SOATAG_USER_SDP_STR(tech_pvt->local_sdp_str),
- SOATAG_AUDIO_AUX("cn telephone-event"),
- TAG_END());
- }
}
}
break;
@@ -2078,7 +2089,6 @@
snprintf(tech_pvt->dest, strlen(dest) + 5, "sip:%s", dest);
}
- printf("WTF [%s]\n", dest);
attach_private(nsession, profile, tech_pvt, dest);
nchannel = switch_core_session_get_channel(nsession);
@@ -3185,6 +3195,7 @@
nua_handle_t *nh;
char *to;
char *open;
+ char *tmp;
if (!rpid) {
rpid = "unknown";
@@ -3226,6 +3237,8 @@
nh = nua_handle(profile->nua, NULL, TAG_END());
+ tmp = contact;
+ contact = get_url_from_contact(tmp, 0);
nua_notify(nh,
NUTAG_URL(contact),
@@ -4465,8 +4478,8 @@
TAG_IF((profile->pflags & PFLAG_PRESENCE), NUTAG_ALLOW("NOTIFY")),
TAG_IF((profile->pflags & PFLAG_PRESENCE), NUTAG_ALLOW("SUBSCRIBE")),
TAG_IF((profile->pflags & PFLAG_PRESENCE), NUTAG_ENABLEMESSAGE(1)),
- TAG_IF((profile->pflags & PFLAG_PRESENCE), NUTAG_ALLOW_EVENTS("presence")),
- TAG_IF((profile->pflags & PFLAG_PRESENCE), NUTAG_ALLOW_EVENTS("presence.winfo")),
+ //TAG_IF((profile->pflags & PFLAG_PRESENCE), NUTAG_ALLOW_EVENTS("presence")),
+ //TAG_IF((profile->pflags & PFLAG_PRESENCE), NUTAG_ALLOW_EVENTS("presence.winfo")),
SIPTAG_SUPPORTED_STR("100rel, precondition"),
SIPTAG_USER_AGENT_STR(SOFIA_USER_AGENT),
TAG_END());
@@ -4916,6 +4929,7 @@
sofia_profile_t *profile;
char *ffrom = NULL;
nua_handle_t *msg_nh;
+ char *contact;
if (to && (user = strdup(to))) {
if ((host = strchr(user, '@'))) {
@@ -4947,20 +4961,23 @@
*p = '+';
}
- ffrom = switch_mprintf("\"%s\"<sip:%s+%s@%s>", fu, proto, fp, profile->name);
+ ffrom = switch_mprintf("\"%s\" <sip:%s+%s@%s>", fu, proto, fp, profile->name);
from = ffrom;
switch_safe_free(fu);
switch_safe_free(fp);
}
-
+ contact = get_url_from_contact(buf, 1);
msg_nh = nua_handle(profile->nua, NULL,
SIPTAG_FROM_STR(from),
- NUTAG_URL(buf),
- SIPTAG_TO_STR(buf),
+ NUTAG_URL(contact),
+ SIPTAG_TO_STR(buf), // if this cries, add contact here too, change the 1 to 0 and omit the safe_free
SIPTAG_CONTACT_STR(profile->url),
TAG_END());
-
+
+ switch_safe_free(contact);
+
+
nua_message(msg_nh,
SIPTAG_CONTENT_TYPE_STR("text/html"),
SIPTAG_PAYLOAD_STR(body),
Modified: freeswitch/branches/knhor/trunk/src/mod/languages/mod_python/Makefile
==============================================================================
--- freeswitch/branches/knhor/trunk/src/mod/languages/mod_python/Makefile (original)
+++ freeswitch/branches/knhor/trunk/src/mod/languages/mod_python/Makefile Wed Nov 15 20:38:30 2006
@@ -1,7 +1,7 @@
LCFLAGS=-fPIC
CFLAGS += -fPIC -I$(PREFIX)/include/python2.4/
PYMOD=freeswitch
-LDFLAGS=-lpython2.4 -Xlinker -L$(PREFIX)/lib/python2.4/config/
+LDFLAGS=-lpython2.4 -Xlinker -export-dynamic -L$(PREFIX)/lib/python2.4/config/ -lutil
SWIGCFILE=../../../switch_swig.c
SWIGIFILE=../../../switch_swig.i
@@ -32,13 +32,13 @@
$(CC) $(SOLINK) -o py_$(PYMOD).$(DYNAMIC_LIB_EXTEN) switch_swig_wrap.o switch_swig.o $(LDFLAGS)
-$(MODNAME).$(DYNAMIC_LIB_EXTEN): $(MODNAME).c $(MODNAME).o $(OBJS) Makefile
- $(CC) $(LCFLAGS) $(SOLINK) -o $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(MODNAME).o $(OBJS) $(LDFLAGS)
+$(MODNAME).$(DYNAMIC_LIB_EXTEN): $(MODNAME).c $(MODNAME).o $(OBJS) switch_swig_wrap.o switch_swig.o Makefile
+ $(CC) $(LCFLAGS) $(SOLINK) -o $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(MODNAME).o switch_swig_wrap.o switch_swig.o $(OBJS) $(LDFLAGS)
clean:
rm -fr *.$(DYNAMIC_LIB_EXTEN) *.o *~
install:
- #cp -f py_$(PYMOD).$(DYNAMIC_LIB_EXTEN) $(MDIR)
+ # cp -f py_$(PYMOD).$(DYNAMIC_LIB_EXTEN) $(PREFIX)/mod
cp -f $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(PREFIX)/mod
Modified: freeswitch/branches/knhor/trunk/src/mod/languages/mod_python/mod_python.c
==============================================================================
--- freeswitch/branches/knhor/trunk/src/mod/languages/mod_python/mod_python.c (original)
+++ freeswitch/branches/knhor/trunk/src/mod/languages/mod_python/mod_python.c Wed Nov 15 20:38:30 2006
@@ -24,6 +24,7 @@
* Contributor(s):
*
* Brian Fertig <brian.fertig(a)convergencetek.com>
+ * Johny Kadarisman <jkr888 at gmail.com>
*
* mod_python.c -- Python Module
*
@@ -41,104 +42,24 @@
#include <switch.h>
+void init_freeswitch(void);
+
const char modname[] = "mod_python";
-static int numargs=0;
-static PyObject* emb_numargs(PyObject *self, PyObject *args)
-{
- if(!PyArg_ParseTuple(args, ":numargs"))
- return NULL;
- return Py_BuildValue("i", numargs);
-}
-
-static PyMethodDef EmbMethods[] = {
- {"numargs", emb_numargs, METH_VARARGS,
- "Return the number of arguments received by the process."},
- {NULL, NULL, 0, NULL}
-};
-
static void python_function(switch_core_session_t *session, char *data)
{
char *uuid = switch_core_session_get_uuid(session);
- uint32_t ulen = strlen(uuid);
- uint32_t len = strlen((char *) data) + ulen + 2;
- char *mydata = switch_core_session_alloc(session, len);
- int argc, i;
- char *argv[5];
- char python_code[1024];
-// void*** tsrm_ls = NULL;
+ char *argv[1];
+ FILE* pythonfile;
- PyObject *pName, *pModule, *pFunc;
- PyObject *pArgs, *pValue;
+ argv[0] = uuid;
+ pythonfile = fopen(data, "r");
-
- snprintf(mydata, len, "%s %s", uuid, data);
-
- argc = switch_separate_string(mydata, ' ',argv,(sizeof(argv) / sizeof(argv[0])));
-
- sprintf(python_code, "$uuid=\"%s\"; include(\"%s\");\n", argv[0], argv[1]);
- //python_embed_init(argc, argv, &tsrm_ls);
- //python_EMBED_START_BLOCK(argc, argv);
- //zend_eval_string(python_code, NULL, "Embedded code" TSRMLS_CC);
- //python_EMBED_END_BLOCK();
- //python_embed_shutdown(tsrm_ls);
-
-
Py_Initialize();
- numargs = argc;
- Py_InitModule("emb", EmbMethods);
- pName = PyString_FromString(data);
- /* Error checking of pName left out */
-
- pModule = PyImport_Import(pName);
- Py_DECREF(pName);
-
- if (pModule != NULL) {
- pFunc = PyObject_GetAttrString(pModule, "main");
- /* pFunc is a new reference */
-
- if (pFunc && PyCallable_Check(pFunc)) {
- pArgs = PyTuple_New(argc - 3);
- for (i = 0; i < argc - 3; ++i) {
- pValue = PyInt_FromLong(atoi(argv[i + 3]));
- if (!pValue) {
- Py_DECREF(pArgs);
- Py_DECREF(pModule);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot convert argument\n");
-
- }
- /* pValue reference stolen here: */
- PyTuple_SetItem(pArgs, i, pValue);
- }
- pValue = PyObject_CallObject(pFunc, pArgs);
- Py_DECREF(pArgs);
- if (pValue != NULL) {
- printf("Result of call: %ld\n", PyInt_AsLong(pValue));
- Py_DECREF(pValue);
- }
- else {
- Py_DECREF(pFunc);
- Py_DECREF(pModule);
- PyErr_Print();
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Call failed\n");
-
- }
- }
- else {
- if (PyErr_Occurred())
- PyErr_Print();
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot find function \"%s\"\n", argv[2]);
- }
- Py_XDECREF(pFunc);
- Py_DECREF(pModule);
- }
- else {
- PyErr_Print();
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to load \"%s\"\n", argv[1]);
-
- }
+ PySys_SetArgv(1, argv);
+ init_freeswitch();
+ PyRun_SimpleFile(pythonfile, "");
Py_Finalize();
-
}
Modified: freeswitch/branches/knhor/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
==============================================================================
--- freeswitch/branches/knhor/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c (original)
+++ freeswitch/branches/knhor/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c Wed Nov 15 20:38:30 2006
@@ -416,7 +416,7 @@
apr_status_t status = SWITCH_STATUS_SUCCESS;
apr_dso_handle_sym_t function_handle = NULL;
spidermonkey_init_t spidermonkey_init = NULL;
- const sm_module_interface_t *module_interface, *mp;
+ const sm_module_interface_t *module_interface = NULL, *mp;
int loading = 1;
const char *err = NULL;
Modified: freeswitch/branches/knhor/trunk/src/switch_rtp.c
==============================================================================
--- freeswitch/branches/knhor/trunk/src/switch_rtp.c (original)
+++ freeswitch/branches/knhor/trunk/src/switch_rtp.c Wed Nov 15 20:38:30 2006
@@ -272,14 +272,18 @@
switch_stun_packet_t *rpacket;
char *remote_ip;
switch_size_t bytes;
-
+ char ipbuf[25];
+
memset(buf, 0, sizeof(buf));
rpacket = switch_stun_packet_build_header(SWITCH_STUN_BINDING_RESPONSE, packet->header.id, buf);
switch_stun_packet_attribute_add_username(rpacket, username, 32);
- switch_sockaddr_ip_get(&remote_ip, rtp_session->from_addr);
+ //switch_sockaddr_ip_get(&remote_ip, rtp_session->from_addr);
+
+ remote_ip = switch_get_addr(ipbuf, sizeof(ipbuf), rtp_session->from_addr);
+
+
switch_stun_packet_attribute_add_binded_address(rpacket, remote_ip, rtp_session->from_addr->port);
bytes = switch_stun_packet_length(rpacket);
-
switch_socket_sendto(rtp_session->sock, rtp_session->from_addr, 0, (void*)rpacket, &bytes);
}
}
@@ -866,9 +870,14 @@
char *tx_host;
uint32_t old = rtp_session->remote_port;
char *old_host;
-
- switch_sockaddr_ip_get(&tx_host, rtp_session->from_addr);
- switch_sockaddr_ip_get(&old_host, rtp_session->remote_addr);
+ char bufa[30], bufb[30];
+
+ //switch_sockaddr_ip_get(&tx_host, rtp_session->from_addr);
+ //switch_sockaddr_ip_get(&old_host, rtp_session->remote_addr);
+
+ tx_host = switch_get_addr(bufa, sizeof(bufa), rtp_session->from_addr);
+ old_host = switch_get_addr(bufb, sizeof(bufb), rtp_session->remote_addr);
+
if (!switch_strlen_zero(tx_host) && rtp_session->from_addr->port > 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Auto Changing port from %s:%u to %s:%u\n",
old_host, old, tx_host, rtp_session->from_addr->port);
Modified: freeswitch/branches/knhor/trunk/src/switch_utils.c
==============================================================================
--- freeswitch/branches/knhor/trunk/src/switch_utils.c (original)
+++ freeswitch/branches/knhor/trunk/src/switch_utils.c Wed Nov 15 20:38:30 2006
@@ -34,6 +34,7 @@
#include <string.h>
#include <stdlib.h>
+
SWITCH_DECLARE(char *) switch_priority_name(switch_priority_t priority)
{
switch(priority) { /*lol*/
@@ -49,6 +50,40 @@
}
static char RFC2833_CHARS[] = "0123456789*#ABCDF";
+
+
+
+SWITCH_DECLARE(char *) switch_get_addr(char *buf, switch_size_t len, switch_sockaddr_t *in)
+{
+ uint8_t x, *i;
+ char *p = buf;
+
+
+ i = (uint8_t *) &in->sa.sin.sin_addr;
+
+ memset(buf, 0, len);
+ for(x =0; x < 4; x++) {
+ sprintf(p, "%u%s", i[x], x == 3 ? "" : ".");
+ p = buf + strlen(buf);
+ }
+ return buf;
+}
+
+SWITCH_DECLARE(apr_status_t) switch_socket_recvfrom(apr_sockaddr_t *from, apr_socket_t *sock,
+ apr_int32_t flags, char *buf,
+ apr_size_t *len)
+{
+ apr_status_t r;
+
+ if ((r = apr_socket_recvfrom(from, sock, flags, buf, len)) == APR_SUCCESS) {
+ from->port = ntohs(from->sa.sin.sin_port);
+ //from->ipaddr_ptr = &(from->sa.sin.sin_addr);
+ //from->ipaddr_ptr = inet_ntoa(from->sa.sin.sin_addr);
+ }
+
+ return r;
+
+}
SWITCH_DECLARE(char) switch_rfc2833_to_char(int event)
{
1
0
Author: anthm
Date: Wed Nov 15 15:21:46 2006
New Revision: 3381
Modified:
freeswitch/trunk/libs/libdingaling/.update
Log:
update
Modified: freeswitch/trunk/libs/libdingaling/.update
==============================================================================
--- freeswitch/trunk/libs/libdingaling/.update (original)
+++ freeswitch/trunk/libs/libdingaling/.update Wed Nov 15 15:21:46 2006
@@ -1 +1 @@
-Tue Nov 14 19:14:29 EST 2006
+Wed Nov 15 20:20:53 UTC 2006
1
0