fix LBDING-7

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10530 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2008-11-24 23:12:36 +00:00
parent 35018aed97
commit 3e05fd297b
2 changed files with 34 additions and 27 deletions

View File

@ -1792,24 +1792,25 @@ void ldl_handle_send_vcard(ldl_handle_t *handle, char *from, char *to, char *id,
void ldl_handle_send_msg(ldl_handle_t *handle, char *from, char *to, const char *subject, const char *body) void ldl_handle_send_msg(ldl_handle_t *handle, char *from, char *to, const char *subject, const char *body)
{ {
iks *msg; iks *msg;
char *t, *e; const char *t;
char *e;
char *bdup = NULL; char *bdup = NULL;
int on = 0; int on = 0;
int len = 0; int len = 0;
char *my_body = strdup(body);
assert(handle != NULL);
assert(body != NULL);
if (strchr(my_body, '<')) { assert(handle != NULL);
len = (int) strlen(my_body);
if (body) {
if (strchr(body, '<')) {
len = (int) strlen(body);
if (!(bdup = malloc(len))) { if (!(bdup = malloc(len))) {
return; abort();
} }
memset(bdup, 0, len); memset(bdup, 0, len);
e = bdup; e = bdup;
for(t = my_body; *t; t++) { for(t = body; t && *t; t++) {
if (*t == '<') { if (*t == '<') {
on = 1; on = 1;
} else if (*t == '>') { } else if (*t == '>') {
@ -1821,10 +1822,14 @@ void ldl_handle_send_msg(ldl_handle_t *handle, char *from, char *to, const char
*e++ = *t; *e++ = *t;
} }
} }
my_body = bdup; body = bdup;
}
} else {
body = "";
} }
msg = iks_make_msg(IKS_TYPE_NONE, to, my_body); msg = iks_make_msg(IKS_TYPE_NONE, to, body);
iks_insert_attrib(msg, "type", "chat"); iks_insert_attrib(msg, "type", "chat");
if (!from) { if (!from) {
@ -1841,8 +1846,6 @@ void ldl_handle_send_msg(ldl_handle_t *handle, char *from, char *to, const char
free(bdup); free(bdup);
} }
free(my_body);
apr_queue_push(handle->queue, msg); apr_queue_push(handle->queue, msg);
msg = NULL; msg = NULL;

View File

@ -1186,7 +1186,11 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
or did he just suggest it to make our lives miserable? or did he just suggest it to make our lives miserable?
*/ */
use_from_str = from_str; use_from_str = from_str;
if ((val = switch_channel_get_variable(tech_pvt->channel, "suppress_from_cidname")) && switch_true(val)) {
from_str = switch_core_session_sprintf(session, "<%s>", use_from_str);
} else {
from_str = switch_core_session_sprintf(session, "\"%s\" <%s>", tech_pvt->caller_profile->caller_id_name, use_from_str); from_str = switch_core_session_sprintf(session, "\"%s\" <%s>", tech_pvt->caller_profile->caller_id_name, use_from_str);
}
if (!(call_id = switch_channel_get_variable(channel, "sip_outgoing_call_id"))) { if (!(call_id = switch_channel_get_variable(channel, "sip_outgoing_call_id"))) {
if (tech_pvt->profile->pflags & PFLAG_UUID_AS_CALLID) { if (tech_pvt->profile->pflags & PFLAG_UUID_AS_CALLID) {