From: Anthony Minessale Date: Tue, 14 Nov 2006 17:41:35 +0000 (+0000) Subject: update X-Git-Tag: v1.0-beta1~1744 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81ff111339ed78dbcf676ebb4daef1d8676a1370;p=thirdparty%2Ffreeswitch.git update git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3369 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- diff --git a/src/mod/endpoints/mod_dingaling/mod_dingaling.c b/src/mod/endpoints/mod_dingaling/mod_dingaling.c index d54ead1562..1d04e06be7 100644 --- a/src/mod/endpoints/mod_dingaling/mod_dingaling.c +++ b/src/mod/endpoints/mod_dingaling/mod_dingaling.c @@ -1486,23 +1486,30 @@ static switch_status_t channel_outgoing_channel(switch_core_session_t *session, *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->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) && strchr(outbound_profile->caller_id_number, '@')) { snprintf(ubuf, sizeof(ubuf), "%s/talk", outbound_profile->caller_id_number); user = ubuf; } + if (!user) { + user = mdl_profile->login; + } + if (!ldl_handle_ready(mdl_profile->handle)) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Doh! we are not logged in yet!\n"); terminate_session(new_session, __LINE__, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);