Author Topic: [SOLVED] Phone line goes down?  (Read 1149 times)

brononius

  • Guru
  • ****
  • Posts: 379
  • Trying to keep it simple and centralized...
    • View Profile
    • OnIrIa - linuxMCE blog (runs on ... linuxmce server)
[SOLVED] Phone line goes down?
« on: October 25, 2012, 02:39:46 pm »
Hey,

Outgoing phones work perfect.

Incoming phones work perfect. For a while.

It's like after some time, the incoming calls are 'blocked'. My providers (WeePee) server says that the number isn't registered.
But when i trigger an outgoing call, the incoming calls are working again.

Is there somewhere a kind of timeout that needs to be retriggered?
« Last Edit: December 04, 2012, 03:11:39 pm by brononius »
Version: linuxMCE 1004 (v 2012-07-01)
Extra's: Cacti, webmin, phpmyadmin, joomla

Server: MSI MS-7519 / E7400 2,8GB / 4GB / SSD 60GB / Radeon HD4350 / RTL8111 - 3C905C-TX
Orbiters: HTC Desire Z, HP PocketPC, Samsung Galaxy S, iPAD, ASUS eeePAD
Automation: EIB technology, KNX IP ROUTER 750
Phones: Cisco 7940, Cisco 7960
Camera's: IPCAM02

cfernandes

  • Guru
  • ****
  • Posts: 290
    • View Profile
    • my company web site
Re: Phone line goes down?
« Reply #1 on: October 25, 2012, 11:46:18 pm »
HI brononius ,

is a bug  registred on asterisk forum about this.

https://issues.asterisk.org/jira/browse/ASTERISK-19720

brononius

  • Guru
  • ****
  • Posts: 379
  • Trying to keep it simple and centralized...
    • View Profile
    • OnIrIa - linuxMCE blog (runs on ... linuxmce server)
Re: Phone line goes down?
« Reply #2 on: November 20, 2012, 11:42:23 am »

But no solution so far for the bug at asterisk...  :(

Maybe i should create a small script that performs an outgoing call each time the server boots?
This way the line will be registred?
Version: linuxMCE 1004 (v 2012-07-01)
Extra's: Cacti, webmin, phpmyadmin, joomla

Server: MSI MS-7519 / E7400 2,8GB / 4GB / SSD 60GB / Radeon HD4350 / RTL8111 - 3C905C-TX
Orbiters: HTC Desire Z, HP PocketPC, Samsung Galaxy S, iPAD, ASUS eeePAD
Automation: EIB technology, KNX IP ROUTER 750
Phones: Cisco 7940, Cisco 7960
Camera's: IPCAM02

brononius

  • Guru
  • ****
  • Posts: 379
  • Trying to keep it simple and centralized...
    • View Profile
    • OnIrIa - linuxMCE blog (runs on ... linuxmce server)
Re: Phone line goes down?
« Reply #3 on: November 20, 2012, 06:40:09 pm »
Okay, maybe not as it should be, but this is a temporary workaround...  :-X


I've created a 'respond to event'.

Criteria
  • Day of the week: 1,2,3,4,5,6,7
  • Time of day: 6:55

Commands: Asterisk - PBX Application
  • application: ring
  • Number: 01990

This will automaticlly calls each day in the morning a number of my provider. The number gives me information about the latest caller.
I specially choose this number since it will automaticlly kill the call once it gave the information (+/- 10sec). And of course because it's a free number.

Of course, it would be nicer that it only calls once (if the line went down, if the server rebooted). But i couldn't figure out how i can trace that with 'respond to events'. So for the moment, a daily call should do it...
But if somebody could tell me how i could it elseway, glad...
Version: linuxMCE 1004 (v 2012-07-01)
Extra's: Cacti, webmin, phpmyadmin, joomla

Server: MSI MS-7519 / E7400 2,8GB / 4GB / SSD 60GB / Radeon HD4350 / RTL8111 - 3C905C-TX
Orbiters: HTC Desire Z, HP PocketPC, Samsung Galaxy S, iPAD, ASUS eeePAD
Automation: EIB technology, KNX IP ROUTER 750
Phones: Cisco 7940, Cisco 7960
Camera's: IPCAM02

brononius

  • Guru
  • ****
  • Posts: 379
  • Trying to keep it simple and centralized...
    • View Profile
    • OnIrIa - linuxMCE blog (runs on ... linuxmce server)
Re: Phone line goes down?
« Reply #4 on: December 04, 2012, 03:11:20 pm »
I've improved this workaround a bit. No longer with 'timed event', but with a real service restart check:

Intro: When LinuxMCE is restarted, the SIP provider isn't regristed anymore. You need to place 1 outgoing call, and then it's solved. Of course, when you reload the router (=restart the linuxmce service), then you need to replace an outside phonecall.

Since it's a bit hard to keep this in mind for the rest of your life, i've added a kind of check script. This script is placed in the crontab, and checks each x-minutes if the service 'asterisk' has been restarted. If it isn't, it does nothing. If it is, i'll place a file into /var/spool/asterisk/outgoing and will call this number.

In this example below, change 0123456789 with your external number. I've put my own phonenumber in here. So it's just initate the call, and drops it after 1 second.



more /scripts/sys_call_outside_org.call
Code: [Select]
Channel: Local/0123456789@trusted
WaitTime: 1
Context: outgoing
Extension: 200
Priority: 1

more /scripts/sys_call_check.sh
Code: [Select]
#!/bin/bash

if tail -20 /var/log/asterisk/full | grep "chan_sip.c: SIP channel loading"
then
  : # colon is a null and is required
  #Run Script to launch an outgoing call
sudo /scripts/sys_call_launch.sh
#Add additional log files"
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "The service for Asterisk has been apparantly been restarted." >> /var/log/asterisk/full
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "The script '/script/sys_call_check.sh' launched a outgoing call" >> /var/log/asterisk/full
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated." >> /var/log/asterisk/full
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated..." >> /var/log/asterisk/full
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated...." >> /var/log/asterisk/full
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated....." >> /var/log/asterisk/full
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated......" >> /var/log/asterisk/full
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated......." >> /var/log/asterisk/full
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated........" >> /var/log/asterisk/full
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated........." >> /var/log/asterisk/full
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated.........." >> /var/log/asterisk/full
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated..........." >> /var/log/asterisk/full
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated............" >> /var/log/asterisk/full
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated............." >> /var/log/asterisk/full
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated.............." >> /var/log/asterisk/full
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated..............." >> /var/log/asterisk/full
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated................" >> /var/log/asterisk/full
else
    echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "The script '/script/sys_call_check.sh' has nothing to do..." >> /var/log/asterisk/full
fi


if tail -100 /var/log/pluto/18_Asterisk.log | grep "Got a reload command from 0"
then
  : # colon is a null and is required
  #Run Script to launch an outgoing call
sudo /scripts/sys_call_launch.sh
#Add additional log files"
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Asterisk has been apparantly been restarted by Linxumce." >> /var/log/asterisk/full
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "The script '/script/sys_call_check.sh' launched a outgoing call" >> /var/log/asterisk/full
echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "The script '/script/sys_call_check.sh' launched a outgoing call" >> /var/log/pluto/18_Asterisk
.log
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated." >> /var/log/pluto/18_Asterisk.log
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated.." >> /var/log/pluto/18_Asterisk.log
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated..." >> /var/log/pluto/18_Asterisk.log
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated...." >> /var/log/pluto/18_Asterisk.log
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated....." >> /var/log/pluto/18_Asterisk.log
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated......" >> /var/log/pluto/18_Asterisk.log
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated......." >> /var/log/pluto/18_Asterisk.log
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated........" >> /var/log/pluto/18_Asterisk.log
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated........." >> /var/log/pluto/18_Asterisk.log
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated.........." >> /var/log/pluto/18_Asterisk.log
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated..........." >> /var/log/pluto/18_Asterisk.log
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated............" >> /var/log/pluto/18_Asterisk.log
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated............." >> /var/log/pluto/18_Asterisk.log
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated.............." >> /var/log/pluto/18_Asterisk.log
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated..............." >> /var/log/pluto/18_Asterisk.log
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated................" >> /var/log/pluto/18_Asterisk.log
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated................." >> /var/log/pluto/18_Asterisk.log
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated.................." >> /var/log/pluto/18_Asterisk.log
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated..................." >> /var/log/pluto/18_Asterisk.log
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated...................." >> /var/log/pluto/18_Asterisk.log
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated....................." >> /var/log/pluto/18_Asterisk.log
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated......................" >> /var/log/pluto/18_Asterisk.log
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated......................." >> /var/log/pluto/18_Asterisk.log
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated........................" >> /var/log/pluto/18_Asterisk.log
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated........................." >> /var/log/pluto/18_Asterisk.log
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated.........................." >> /var/log/pluto/18_Asterisk.log
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated..........................." >> /var/log/pluto/18_Asterisk.log
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated............................" >> /var/log/pluto/18_Asterisk.log
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated............................." >> /var/log/pluto/18_Asterisk.log
        echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "Systemcall was initiated.............................." >> /var/log/pluto/18_Asterisk.log

else
    echo "[""$(date +%h)" "$(date +%d)" "$(date +%T)""]" "The script '/script/sys_call_check.sh' has nothing to do..." >> /var/log/pluto/18_Asterisk.log
fi

more /scripts/sys_call_launch.sh
Code: [Select]
#!/bin/bash
sleep 60
cp /scripts/sys_call_outside_org.call /scripts/sys_call_outside.call
mv /scripts/sys_call_outside.call /var/spool/asterisk/outgoing/.

more /etc/crontab
Code: [Select]
<knip>
*/7 * * * *     root    /scripts/sys_call_check.sh &> /dev/null
</knip>


Comments to improve this more are of course welcome...
Version: linuxMCE 1004 (v 2012-07-01)
Extra's: Cacti, webmin, phpmyadmin, joomla

Server: MSI MS-7519 / E7400 2,8GB / 4GB / SSD 60GB / Radeon HD4350 / RTL8111 - 3C905C-TX
Orbiters: HTC Desire Z, HP PocketPC, Samsung Galaxy S, iPAD, ASUS eeePAD
Automation: EIB technology, KNX IP ROUTER 750
Phones: Cisco 7940, Cisco 7960
Camera's: IPCAM02