diff --git a/libs/libspeakup/Makefile.in b/libs/libspeakup/Makefile.in index 5e9c656cf5..f1053764a0 100644 --- a/libs/libspeakup/Makefile.in +++ b/libs/libspeakup/Makefile.in @@ -136,6 +136,7 @@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ +GREP = @GREP@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -164,12 +165,9 @@ STRIP = @STRIP@ VERSION = @VERSION@ WANT_DEBUG_FALSE = @WANT_DEBUG_FALSE@ WANT_DEBUG_TRUE = @WANT_DEBUG_TRUE@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -186,25 +184,32 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ new_AM_CFLAGS = @new_AM_CFLAGS@ new_AM_LDFLAGS = @new_AM_LDFLAGS@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ diff --git a/src/mod/endpoints/mod_dingaling/mod_dingaling.c b/src/mod/endpoints/mod_dingaling/mod_dingaling.c index fccc2b9cf7..99f3d0914a 100644 --- a/src/mod/endpoints/mod_dingaling/mod_dingaling.c +++ b/src/mod/endpoints/mod_dingaling/mod_dingaling.c @@ -2449,7 +2449,7 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi char *context; char *cid_name; char *cid_num; - char *t, *them = NULL; + char *tmp, *t, *them = NULL; memset(payloads, 0, sizeof(payloads)); @@ -2481,8 +2481,6 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi } } - - if (!(context = ldl_session_get_value(dlsession, "context"))) { context = profile->context; } @@ -2502,6 +2500,21 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi tech_pvt->them = switch_core_session_strdup(session, ldl_session_get_callee(dlsession)); tech_pvt->us = switch_core_session_strdup(session, ldl_session_get_caller(dlsession)); + + if ((tmp = strdup(tech_pvt->us))) { + char *p, *q; + + if ((p = strchr(tmp, '@'))) { + *p++ = '\0'; + if ((q = strchr(p, '/'))) { + *q = '\0'; + } + switch_channel_set_variable(channel, "dl_from_user", tmp); + switch_channel_set_variable(channel, "dl_from_host", p); + } + + switch_safe_free(tmp); + } if (!tech_pvt->caller_profile) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Creating an identity for %s %s <%s> %s\n", diff --git a/src/switch_channel.c b/src/switch_channel.c index 313a8bfccb..4534299a81 100644 --- a/src/switch_channel.c +++ b/src/switch_channel.c @@ -1171,7 +1171,7 @@ SWITCH_DECLARE(char *) switch_channel_expand_variables(switch_channel_t *channel return in; } } - nlen = strlen(sub_val); + nlen = sub_val ? strlen(sub_val) : 0; if (len + nlen >= olen) { olen += block; cpos = c - data; @@ -1186,10 +1186,11 @@ SWITCH_DECLARE(char *) switch_channel_expand_variables(switch_channel_t *channel vname = data + vvalpos; } - len += nlen; - strcat(c, sub_val); - c += nlen; - + if (nlen) { + len += nlen; + strcat(c, sub_val); + c += nlen; + } if (func_val) { free(func_val); func_val = NULL;