Page 1 of 1

New phones aren't activated without reloading asterisk

PostPosted: Sat Jul 15, 2023 9:05 am
by bronson
Hello,

According to the manual, after creating a new phone we should simply "Click the submit button to create this phone record. After one minute, the phone will be active in the system."

I log in to the server and do 'sip show peers' after one minute but new phones do not show up. In fact after several hours they still do not appear.

I tried doing "Reload dialplan on server" in the Vicidial admin and that also does not activate the new phones.

Whenever we create a new phone on the system, it does not get activated unless I log in to my server and do a 'core restart now' in asterisk.

We're using vici webphone.

My system specs:
ViciBox v.10.0.1 220503
Version: 2.14b0.5
SVN Version: 3612
DB Schema Version: 1662

How do I investigate the issue and fix it so that phones are activated automatically.

Thanks!

Re: New phones aren't activated without reloading asterisk

PostPosted: Wed Aug 23, 2023 5:15 pm
by martinch
Oh hey bronson,

It is a weird one. Have you debugged the keep alive by chance? There may be an error in there that may help.

Re: New phones aren't activated without reloading asterisk

PostPosted: Wed Aug 23, 2023 9:28 pm
by carpenox
It's a big on v10, add an entry to crontab by typing: crontab -e
Add this at the top:

* * * * * /usr/sbin/asterisk -rx 'sip reload'

Image

Chris

Re: New phones aren't activated without reloading asterisk

PostPosted: Mon Aug 28, 2023 8:12 am
by bronson
carpenox wrote:It's a big on v10, add an entry to crontab by typing: crontab -e
Add this at the top:

* * * * * /usr/sbin/asterisk -rx 'sip reload'

Image

Chris


Thanks!

Re: New phones aren't activated without reloading asterisk

PostPosted: Tue Aug 29, 2023 1:56 pm
by kashyapking
I dont think to do "sip reload" every minute is good idea, I suggest if you can watch on rebuild_conf_files field on servers table and if it is set to "Y" then you can do "module reload", so it will apply all latest changes to asterisk.

Re: New phones aren't activated without reloading asterisk

PostPosted: Sun Sep 03, 2023 2:34 pm
by martinch
kashyapking makes a good point and that is the correct ViCiDial way of doing sip reload...although I'm not aware of any potential issues off the top of my head with running sip reload every minute via cron but yeah...potentially something could get messed up...I couldn't say but it shouldn't affect live calls though but yeah. Glad it's all sorted though.

Re: New phones aren't activated without reloading asterisk

PostPosted: Thu Sep 07, 2023 3:06 am
by kashyapking
martinch wrote:kashyapking makes a good point and that is the correct ViCiDial way of doing sip reload...although I'm not aware of any potential issues off the top of my head with running sip reload every minute via cron but yeah...potentially something could get messed up...I couldn't say but it shouldn't affect live calls though but yeah. Glad it's all sorted though.


Thanks, either we can make some small php script to check and reload sip or we can put command direct via mysql command prompt with cron and do reload, both methods are fine for checking and reload sip.

Re: New phones aren't activated without reloading asterisk

PostPosted: Thu Sep 07, 2023 6:20 am
by carpenox
A PHP script isn't a bad idea, but the MySQL method would kind of be along the same lines as my cronjob. If 1 minute is to much just change the first * (asterisk) to 5 for every 5 minutes or adjust accordingly.

Chris

Re: New phones aren't activated without reloading asterisk

PostPosted: Sun Sep 10, 2023 4:18 am
by martinch
I sense some kind of Admin Utility that has a bunch of buttons to do ad-hoc stuff instantly?

  • Reload Configs
  • Restart Asterisk
  • Restart screens
  • etc

Maybe that's overkill but it's an idea that came to mind when reading this thread. Maybe I'll do a proof of concept and post it in Features to see if people vibe with it or not. :)

Either way you slice it, Chris' cronjob or The Reload Config option, you'll get your sips reloaded. :)

Re: New phones aren't activated without reloading asterisk

PostPosted: Tue Sep 19, 2023 3:58 pm
by ccabrera
@Bronson,

The problem you refer to usually happens when Asterisk isn't running inside its own screen process, and so the keepalive script can't trigger the reload properly. Maybe Asterisk is running because of the "service asterisk start" command instead of running inside its screen?

Re: New phones aren't activated without reloading asterisk

PostPosted: Mon Oct 02, 2023 6:19 am
by bronson
ccabrera wrote:@Bronson,

The problem you refer to usually happens when Asterisk isn't running inside its own screen process, and so the keepalive script can't trigger the reload properly. Maybe Asterisk is running because of the "service asterisk start" command instead of running inside its screen?


How would I investigate this and resolve?

Re: New phones aren't activated without reloading asterisk

PostPosted: Mon Oct 02, 2023 12:03 pm
by RBecker
bronson wrote:
How would I investigate this and resolve?


Run "screen -r". You should get several things returned, one being asterisk and another being astshell. If those aren't listed, Asterisk is running outside of the screen. On ViciBox, you should be using "systemctl restart vicidial" to restart Asterisk and all associated screens.

Re: New phones aren't activated without reloading asterisk

PostPosted: Wed Jan 10, 2024 4:42 pm
by bronson
RBecker wrote:
bronson wrote:
How would I investigate this and resolve?


Run "screen -r". You should get several things returned, one being asterisk and another being astshell. If those aren't listed, Asterisk is running outside of the screen. On ViciBox, you should be using "systemctl restart vicidial" to restart Asterisk and all associated screens.


I ran "screen -r" and got this.

Code: Select all
vcc:~ # screen -r
There are several suitable screens on:
        9284.ASTemail   (Detached)
        19151.ASTVDadapt        (Detached)
        4657.ASTVDremote        (Detached)
        17034.ASTVDauto (Detached)
        17031.ASTlisten (Detached)
        17028.ASTsend   (Detached)
        17025.ASTupdate (Detached)
        14914.ASTVDadFILL       (Detached)
        14911.ASTfastlog        (Detached)
Type "screen [-d] -r [pid.]tty.host" to resume one of them.


I didn't see asterisk or astshell so I ran "systemctl restart vicidial" and it shows asterisk and astshell as detached.

Code: Select all
vcc:~ # screen -r
There are several suitable screens on:
        26549.asterisk  (Detached)
        26543.astshell20240110163818    (Detached)
        9284.ASTemail   (Detached)
        19151.ASTVDadapt        (Detached)
        14914.ASTVDadFILL       (Detached)
        14911.ASTfastlog        (Detached)
Type "screen [-d] -r [pid.]tty.host" to resume one of them.


Should this solve the issue?

Also, do I need to run "systemctl restart vicidial" every time I reboot?

Thanks!