mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-17 01:02:12 +00:00
refactoring.... Found by Klockwork (www.klocwork.com)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8436 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
4f65f1300c
commit
7bab5df1c8
@ -217,6 +217,8 @@ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_resurrect_channel(const
|
|||||||
if (session) {
|
if (session) {
|
||||||
channel = switch_core_session_get_channel(session);
|
channel = switch_core_session_get_channel(session);
|
||||||
|
|
||||||
|
switch_assert(channel != NULL);
|
||||||
|
|
||||||
forwardvar = switch_channel_get_variable(channel, SWITCH_MAX_FORWARDS_VARIABLE);
|
forwardvar = switch_channel_get_variable(channel, SWITCH_MAX_FORWARDS_VARIABLE);
|
||||||
if (!switch_strlen_zero(forwardvar)) {
|
if (!switch_strlen_zero(forwardvar)) {
|
||||||
forwardval = atoi(forwardvar) - 1;
|
forwardval = atoi(forwardvar) - 1;
|
||||||
@ -267,20 +269,20 @@ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_resurrect_channel(const
|
|||||||
switch_caller_profile_t *profile = NULL, *peer_profile = NULL, *cloned_profile = NULL;
|
switch_caller_profile_t *profile = NULL, *peer_profile = NULL, *cloned_profile = NULL;
|
||||||
switch_event_t *event;
|
switch_event_t *event;
|
||||||
switch_channel_t *peer_channel = switch_core_session_get_channel(*new_session);
|
switch_channel_t *peer_channel = switch_core_session_get_channel(*new_session);
|
||||||
|
|
||||||
|
switch_assert(peer_channel);
|
||||||
|
|
||||||
|
peer_profile = switch_channel_get_caller_profile(peer_channel);
|
||||||
|
|
||||||
if (session && channel) {
|
if (channel) {
|
||||||
profile = switch_channel_get_caller_profile(channel);
|
|
||||||
}
|
|
||||||
if (peer_channel) {
|
|
||||||
peer_profile = switch_channel_get_caller_profile(peer_channel);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (channel && peer_channel) {
|
|
||||||
const char *export_vars, *val;
|
const char *export_vars, *val;
|
||||||
switch_codec_t *read_codec = switch_core_session_get_read_codec(session);
|
switch_codec_t *read_codec = switch_core_session_get_read_codec(session);
|
||||||
const char *max_forwards = switch_core_session_sprintf(session, "%d", forwardval);
|
const char *max_forwards = switch_core_session_sprintf(session, "%d", forwardval);
|
||||||
|
|
||||||
switch_channel_set_variable(peer_channel, SWITCH_MAX_FORWARDS_VARIABLE, max_forwards);
|
switch_channel_set_variable(peer_channel, SWITCH_MAX_FORWARDS_VARIABLE, max_forwards);
|
||||||
|
|
||||||
|
profile = switch_channel_get_caller_profile(channel);
|
||||||
|
|
||||||
if (read_codec) {
|
if (read_codec) {
|
||||||
char tmp[80];
|
char tmp[80];
|
||||||
switch_codec2str(read_codec, tmp, sizeof(tmp));
|
switch_codec2str(read_codec, tmp, sizeof(tmp));
|
||||||
@ -336,7 +338,7 @@ SWITCH_DECLARE(switch_call_cause_t) switch_core_session_resurrect_channel(const
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (peer_profile) {
|
if (peer_profile) {
|
||||||
if (session && (cloned_profile = switch_caller_profile_clone(session, peer_profile)) != 0) {
|
if ((cloned_profile = switch_caller_profile_clone(session, peer_profile)) != 0) {
|
||||||
switch_channel_set_originatee_caller_profile(channel, cloned_profile);
|
switch_channel_set_originatee_caller_profile(channel, cloned_profile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user