Call Broadcast scheduling not working

Status
Not open for further replies.

Neyamt

Member
Nov 12, 2021
52
3
8
28
Call Broadcast is working with manual starting but using date and time to schedule it, its not working. please share your ideas and if there is any tip which can help, please ...
 

Neyamt

Member
Nov 12, 2021
52
3
8
28
I have call broadcast task created in FusionPBX with specific date and time to start but its not starting in that specific date and time (manual starting). I heard its possible to schedule or run it using crontab. but I don't know how to proceed.
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,406
376
83
I don' think there is an easy way to do this from cron - I'm sure someone will correct me if I'm wrong.

You may be able to do it with curl to call https://myfusionbox.com/app/call_broadcast/call_broadcast_send.php?id=<call broardcast uuid>
but you will need to also pass some authentication, an api key or similar.

You can probably do this yourself using the FreeSWITCH CLI and execute fs_cli -x "your command" from cron.

Call Broadcast uses sched_api, bgapi and originate, the foillowing docs may help:
https://developer.signalwire.com/fr...ed/Modules/mod_event_socket_1048924/#32-bgapi
https://developer.signalwire.com/fr...ained/Modules/mod_commands_1966741/#sched_api
https://developer.signalwire.com/fr...ained/Modules/mod_commands_1966741/#originate
https://developer.signalwire.com/fr...ained/Modules/mod_commands_1966741/#sched_del
 

Neyamt

Member
Nov 12, 2021
52
3
8
28
thanks for sharing your idea. I will check the shared documents.

when schedule the task its showing in freeswitch console that its scheduled but it never happens:

2024-02-04 15:43:27.919449 99.20% [DEBUG] switch_scheduler.c:263 Added task 8 sched_api_function (5f0c66d4-bbe3-4f34-84a2-58fd0bd5bcd8) to run at 1707061507
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,406
376
83
I assume 1707061507 is a unix epoch, in which case I would not expect it to run until Sunday, 4 February 2024 15:45:07
 

Neyamt

Member
Nov 12, 2021
52
3
8
28
Yes, i schedule it in advance even the time cross but its not happening. OS and freeswitch time is in sync (time and date is correct).
 

Neyamt

Member
Nov 12, 2021
52
3
8
28
only shows this nothing else:

2024-02-04 20:00:26.959459 98.80% [DEBUG] switch_scheduler.c:263 Added task 22 sched_api_function (1c0fef06-7512-4da0-987e-9865f6f14eba) to run at 1707076870

not more logs after. the scheduled time and date passes but nothing happens, no logs in console as well.

but when i run it without date and time (empty) its scheduling and doing call immediately.
 

Neyamt

Member
Nov 12, 2021
52
3
8
28
I got it that its related to the time. i scheduled a call broadcast in the morning and i got the call from the server after 2 PM. it looks like there is time issue with freeswitch. I need to investigate to find where is the difference. most probably its related to timezone.
 
Last edited:

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,406
376
83
I got it that its related to the time. i scheduled a call broadcast in the morning and i got the call from the server after 2 PM. it looks like there is time issue with freeswitch. I need to investigate to find where is the difference. most probably its related to timezone.
That's a good thought.
 

Neyamt

Member
Nov 12, 2021
52
3
8
28
@Adrian Fretwell, call broadcast is using universal time (I have tested when i schedule according Universal time its working perfectly) but my local time is different.


root@demopbx:/home/itadmin# timedatectl
Local time: Mon 2024-02-05 16:46:34 IST
Universal time: Mon 2024-02-05 11:16:34 UTC
RTC time: Mon 2024-02-05 16:46:34
Time zone: Asia/Kolkata (IST, +0530)
System clock synchronized: yes
NTP service: active
RTC in local TZ: yes

The FusionPBX application is also configured to use local time, how can change the call_broadcast application to use local time instead of Universal time?
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,406
376
83
In that case your issue may centre around the fact that in the call broad cast edit, the php function strtotime is used to convert the string presented in the web form to a unix timestamp.

strtotime (https://www.php.net/manual/en/function.strtotime.php) knows nothing about time zones, so the default is always UTC.

If you need this to be something else it is probably better to raise a ticket and talk to one of the developers.
 
  • Like
Reactions: Neyamt

Neyamt

Member
Nov 12, 2021
52
3
8
28
@Adrian Fretwell after checking the code, i modified call_broadcast_send.php to subtract the number of hours and minutes from the UNIX timestamp which call_broadcast convert with strtotime using my local time and its working perfectly. (In GUI the domain is using my local time)

but I think, the best practice would be to use timezone variable from domain settings and minus the number of hours and minutes from it. while the operating system local time, universal time and Freeswitch are default UTC.

1708252559235.png
 
Last edited:
Status
Not open for further replies.