mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 09:36:46 +00:00
clear up some more display issues and fix resume-media-on-hold sofia option
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15177 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -622,6 +622,65 @@ SWITCH_DECLARE(char *) switch_channel_get_name(switch_channel_t *channel)
|
||||
return (!switch_strlen_zero(channel->name)) ? channel->name : "N/A";
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_channel_set_profile_var(switch_channel_t *channel, const char *name, const char *val)
|
||||
{
|
||||
char *v;
|
||||
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
||||
|
||||
switch_mutex_lock(channel->profile_mutex);
|
||||
|
||||
if (!switch_strlen_zero(val)) {
|
||||
v = switch_core_strdup(channel->caller_profile->pool, val);
|
||||
} else {
|
||||
v = SWITCH_BLANK_STRING;
|
||||
}
|
||||
|
||||
if (!strcasecmp(name, "dialplan")) {
|
||||
channel->caller_profile->dialplan = v;
|
||||
} else if (!strcasecmp(name, "username")) {
|
||||
channel->caller_profile->username = v;
|
||||
} else if (!strcasecmp(name, "caller_id_name")) {
|
||||
channel->caller_profile->caller_id_name = v;
|
||||
} else if (!strcasecmp(name, "caller_id_number")) {
|
||||
channel->caller_profile->caller_id_number = v;
|
||||
} else if (!strcasecmp(name, "callee_id_name")) {
|
||||
channel->caller_profile->callee_id_name = v;
|
||||
} else if (!strcasecmp(name, "callee_id_number")) {
|
||||
channel->caller_profile->callee_id_number = v;
|
||||
} else if (val && !strcasecmp(name, "caller_ton")) {
|
||||
channel->caller_profile->caller_ton = (uint8_t) atoi(v);
|
||||
} else if (val && !strcasecmp(name, "caller_numplan")) {
|
||||
channel->caller_profile->caller_numplan = (uint8_t) atoi(v);
|
||||
} else if (val && !strcasecmp(name, "destination_number_ton")) {
|
||||
channel->caller_profile->destination_number_ton = (uint8_t) atoi(v);
|
||||
} else if (val && !strcasecmp(name, "destination_number_numplan")) {
|
||||
channel->caller_profile->destination_number_numplan = (uint8_t) atoi(v);
|
||||
} else if (!strcasecmp(name, "ani")) {
|
||||
channel->caller_profile->ani = v;
|
||||
} else if (!strcasecmp(name, "aniii")) {
|
||||
channel->caller_profile->aniii = v;
|
||||
} else if (!strcasecmp(name, "network_addr")) {
|
||||
channel->caller_profile->network_addr = v;
|
||||
} else if (!strcasecmp(name, "rdnis")) {
|
||||
channel->caller_profile->rdnis = v;
|
||||
} else if (!strcasecmp(name, "destination_number")) {
|
||||
channel->caller_profile->destination_number = v;
|
||||
} else if (!strcasecmp(name, "uuid")) {
|
||||
channel->caller_profile->uuid = v;
|
||||
} else if (!strcasecmp(name, "source")) {
|
||||
channel->caller_profile->source = v;
|
||||
} else if (!strcasecmp(name, "context")) {
|
||||
channel->caller_profile->context = v;
|
||||
} else if (!strcasecmp(name, "chan_name")) {
|
||||
channel->caller_profile->chan_name = v;
|
||||
} else {
|
||||
status = SWITCH_STATUS_FALSE;
|
||||
}
|
||||
switch_mutex_unlock(channel->profile_mutex);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_channel_set_variable_var_check(switch_channel_t *channel,
|
||||
const char *varname, const char *value, switch_bool_t var_check)
|
||||
{
|
||||
|
Reference in New Issue
Block a user