fix crash on zstr
This commit is contained in:
parent
7081f11ab2
commit
e09cdf9c3a
|
@ -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…
Reference in New Issue