fix for FSCORE-97 and add set_name app to rename channel

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7752 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris
2008-02-26 23:29:58 +00:00
parent eb3dc7f2bb
commit bc2fd445ca
5 changed files with 44 additions and 5 deletions

View File

@@ -159,9 +159,15 @@ SWITCH_DECLARE(const char *) switch_caller_get_field_by_name(switch_caller_profi
if (!strcasecmp(name, "context")) {
return caller_profile->context;
}
if (!strcasecmp(name, "chan_name")) {
return caller_profile->chan_name;
}
if (!strcasecmp(name, "profile_index")) {
return caller_profile->profile_index;
}
if (!strcasecmp(name, "caller_ton")) {
return switch_core_sprintf(caller_profile->pool, "%u", caller_profile->caller_ton);
}
@@ -245,6 +251,10 @@ SWITCH_DECLARE(void) switch_caller_profile_event_set_data(switch_caller_profile_
switch_snprintf(header_name, sizeof(header_name), "%s-Channel-Name", prefix);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%s", caller_profile->chan_name);
}
if (!switch_strlen_zero(caller_profile->profile_index)) {
switch_snprintf(header_name, sizeof(header_name), "%s-Profile-Index", prefix);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%s", caller_profile->profile_index);
}
if (caller_profile->times) {
switch_snprintf(header_name, sizeof(header_name), "%s-Channel-Created-Time", prefix);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, "%" SWITCH_TIME_T_FMT, caller_profile->times->created);