From f0b52ef7f0ed40d9ad566bb9556543b82654cbe4 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 18 Oct 2011 12:08:40 -0500 Subject: [PATCH] FS-3611 --resolve --- src/mod/endpoints/mod_dingaling/mod_dingaling.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_dingaling/mod_dingaling.c b/src/mod/endpoints/mod_dingaling/mod_dingaling.c index ee409ac38c..09c4a8f100 100644 --- a/src/mod/endpoints/mod_dingaling/mod_dingaling.c +++ b/src/mod/endpoints/mod_dingaling/mod_dingaling.c @@ -40,6 +40,7 @@ #define DL_EVENT_LOGIN_FAILURE "dingaling::login_failure" #define DL_EVENT_CONNECTED "dingaling::connected" #define MDL_CHAT_PROTO "jingle" +#define MDL_CHAT_FROM_GUESS "auto_from" SWITCH_MODULE_LOAD_FUNCTION(mod_dingaling_load); SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_dingaling_shutdown); @@ -550,7 +551,12 @@ static switch_status_t chat_send(switch_event_t *message_event) *p = '\0'; } } - ldl_handle_send_msg(profile->handle, (char *) from, (char *) to, NULL, switch_str_nil(body)); + if (!(profile->user_flags & LDL_FLAG_COMPONENT) && !strcmp(f_user, MDL_CHAT_FROM_GUESS)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Using auto_from jid address for profile %s\n", profile->name); + ldl_handle_send_msg(profile->handle, NULL, (char *) to, NULL, switch_str_nil(body)); + } else { + ldl_handle_send_msg(profile->handle, (char *) from, (char *) to, NULL, switch_str_nil(body)); + } switch_safe_free(ffrom); } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid Profile %s\n", f_host ? f_host : "NULL");