mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-02-08 08:51:50 +00:00
fix crash on zstr
This commit is contained in:
parent
0e37c99cd6
commit
887999e540
@ -70,9 +70,16 @@ SWITCH_STANDARD_APP(sonar_app)
|
|||||||
{
|
{
|
||||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||||
char *tone = "%(500,0,1004)";
|
char *tone = "%(500,0,1004)";
|
||||||
int loops = atoi(data);
|
const char *arg = (char *) data;
|
||||||
|
int loops;
|
||||||
|
|
||||||
if ( ! loops ) {
|
if (zstr(arg)) {
|
||||||
|
loops = 5;
|
||||||
|
} else {
|
||||||
|
loops = atoi(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (loops < 0) {
|
||||||
loops = 5;
|
loops = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user