From 6c0b467d7513f7b7cdf3b30fd0226832b13b4665 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 21 Nov 2006 19:01:54 +0000 Subject: [PATCH] update git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3432 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- .../endpoints/mod_dingaling/mod_dingaling.c | 35 ++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/src/mod/endpoints/mod_dingaling/mod_dingaling.c b/src/mod/endpoints/mod_dingaling/mod_dingaling.c index 367f93c3c4..546c4f964e 100644 --- a/src/mod/endpoints/mod_dingaling/mod_dingaling.c +++ b/src/mod/endpoints/mod_dingaling/mod_dingaling.c @@ -1487,25 +1487,28 @@ static switch_status_t channel_outgoing_channel(switch_core_session_t *session, *dnis++ = '\0'; } - 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 ((p = strchr(profile_name, '@'))) { + *p++ = '\0'; + u = profile_name; + profile_name = p; + snprintf(ubuf, sizeof(ubuf), "%s@%s/talk", u, profile_name); + user = ubuf; + } if ((mdl_profile = switch_core_hash_find(globals.profile_hash, profile_name))) { - if (strchr(outbound_profile->caller_id_number, '@')) { - snprintf(ubuf, sizeof(ubuf), "%s/talk", outbound_profile->caller_id_number); - user = ubuf; - } else { + if (!(mdl_profile->user_flags & LDL_FLAG_COMPONENT)) { user = ldl_handle_get_login(mdl_profile->handle); + } else { + if (!user) { + if (strchr(outbound_profile->caller_id_number, '@')) { + snprintf(ubuf, sizeof(ubuf), "%s/talk", outbound_profile->caller_id_number); + user = ubuf; + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Invalid User!\n"); + terminate_session(new_session, __LINE__, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); + } + } } if (!ldl_handle_ready(mdl_profile->handle)) {