mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-16 00:41:41 +00:00
FS-8720 #resolve [Segmentation Fault when switch_channel_str2cause is called]
This commit is contained in:
parent
4fc4c52392
commit
c01a8849a0
@ -204,8 +204,9 @@ SWITCH_DECLARE(const char *) switch_channel_cause2str(switch_call_cause_t cause)
|
||||
SWITCH_DECLARE(switch_call_cause_t) switch_channel_str2cause(const char *str)
|
||||
{
|
||||
uint8_t x;
|
||||
switch_call_cause_t cause = SWITCH_CAUSE_NONE;
|
||||
switch_call_cause_t cause = SWITCH_CAUSE_NORMAL_CLEARING;
|
||||
|
||||
if (!zstr(str)) {
|
||||
if (*str > 47 && *str < 58) {
|
||||
cause = atoi(str);
|
||||
} else {
|
||||
@ -216,6 +217,8 @@ SWITCH_DECLARE(switch_call_cause_t) switch_channel_str2cause(const char *str)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return cause;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user