mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 17:38:59 +00:00
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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user