From dd824bbf81c49e2fc6482d0c49314dc8da7ec435 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 15 Nov 2006 00:40:45 +0000 Subject: [PATCH] doh git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3375 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- .../endpoints/mod_dingaling/mod_dingaling.c | 35 +++++++++---------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/src/mod/endpoints/mod_dingaling/mod_dingaling.c b/src/mod/endpoints/mod_dingaling/mod_dingaling.c index 1d04e06be7..4c5ef5a0bb 100644 --- a/src/mod/endpoints/mod_dingaling/mod_dingaling.c +++ b/src/mod/endpoints/mod_dingaling/mod_dingaling.c @@ -1471,7 +1471,7 @@ static switch_status_t channel_outgoing_channel(switch_core_session_t *session, 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,32 +1481,29 @@ static switch_status_t channel_outgoing_channel(switch_core_session_t *session, terminate_session(new_session, __LINE__, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER); return SWITCH_STATUS_GENERR; } - + if ((dnis = strchr(callto, ':'))) { *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 ((mdl_profile = switch_core_hash_find(globals.profile_hash, profile_name))) { + 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 ((mdl_profile->user_flags & LDL_FLAG_COMPONENT) && strchr(outbound_profile->caller_id_number, '@')) { + if (strchr(outbound_profile->caller_id_number, '@')) { snprintf(ubuf, sizeof(ubuf), "%s/talk", outbound_profile->caller_id_number); user = ubuf; - } - - if (!user) { + } else { user = mdl_profile->login; }