bkbilly / asterisk_call_status

☎️ Connects to Asterisk and reports the status back to Home Assistant.
MIT License
8 stars 3 forks source link

After restarting asterisk, the asterisk_status.service does not work #2

Closed conrad66 closed 3 years ago

conrad66 commented 3 years ago

After restarting asterisk, the asterisk_status.service does not work.

[Jul  9 12:56:18]   == Manager unregistered action DBGet
[Jul  9 12:56:18]   == Manager unregistered action DBPut
[Jul  9 12:56:18]   == Manager unregistered action DBDel
[Jul  9 12:56:18]   == Manager unregistered action DBDelTree

The asterisk_status.service must also be restarted to connect again. Is there something you can do to automatically start the AMI manager ?

bkbilly commented 3 years ago

I've never encountered with this problem because asterisk is not meant to be restarted. Every change on the configuration has to be restarted through it's CLI. For example if you change the dialplan, then you send the command dialplan reload or if you change the sip you send the command sip reload.

I will take a look at your issue to check what can be done.

conrad66 commented 3 years ago

The problem is solved as follows: You need to add to... asterisk_status.service

[Unit]
After=asterisk.service
BindsTo=asterisk.service

to asterisk.service

[Unit]
Wants=asterisk_status.service
bkbilly commented 3 years ago

Thanks for sharing your solution. It's very helpful!