Friday, November 30, 2012

Error: Device eth0 does nt seem to be present, delaying

Today I was making a couple of Clone on VMWare workstation and I got below error after cloned machine was started. as result I didn't have eth0 !


[root@mysql1 ~]#service network restart
Shutting down loopback interface: [ OK ]
Bring up loopback interface: [ OK ]
Bring up interface eth0: Device eth0 doesnt seem to be present, delaying initiatlation [ FAILED ]



So I ran :



[root@mysql1 ~]# dmesg |grep eth
e1000 0000:02:00.0: eth0: (PCI:66MHz:32-bit) 00:0c:29:9e:b4:54
e1000 0000:02:00.0: eth0: Intel(R) PRO/1000 Network Connection
udev: renamed network interface eth0 to eth1



there it was the issue that my eth got renamed, the solution is to edit:

/etc/udev/rules.d/70-persistent-net.rules 

and remove old Ethernet and rename back the new ethernet to eth0
note that I removed the first two lines below with has eth0 and renamed eth1 to eth0
the 00:0c:29:91:f2:83 is actually old MAC address from the source machine that we don't need and 00:0c:29:9e:b5:54 is the new MAC address.


before:

# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:91:f2:83", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:9e:b5:54", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

after:

# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:91:f2:83", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:9e:b5:54", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

after this you need to edit: /etc/sysconfig/networking/devices/ifcfg-eth0 and
change the :

HWADDR=[old mac address]

to

HWADDR=[new mac address]

After this you must reboot your system to get new hardware settings in place

Saturday, May 19, 2012

chan_sip.c: Received SIP subscribe for peer without mailbox: 1000

Asterisk is receiving this error:

chan_sip.c: Received SIP subscribe for peer without mailbox: 1000


To fix it: we must add "mailbox=user@default" to each user in sip.conf:

[1000]
...
...
...
mailbox=1000@default

Asterisk error: WARNING[xxxxx] app_voicemail.c: Failed to obtain database object for 'DATABASE_NAME'!


I received below error on /var/log/asterisk/message:

[2012-05-20 10:28:48] WARNING[12496] app_voicemail.c: Failed to obtain database object for 'DATABASE_NAME'!
[2012-05-20 10:28:48] WARNING[12496] app_voicemail.c: Failed to obtain database object for 'DATABASE_NAME'!
[2012-05-20 10:28:48] WARNING[12496] app_voicemail.c: Failed to obtain database object for 'DATABASE_NAME'!

to fix it we must add below lines to /etc/asterisk/res_odbc.conf


and below lines to /etc/odbc.ini
[ut_a2b]
dsn => DSN_NAME
pre-connect => yes
enabled => yes


[DSN_NAME]
Description=Asterisk voicemail odbc storage
Driver=MySQL
Server=SERVER_ADDRESS
User=DB_USER
Password=SOME_PASSWORD
Database=DB_NAME
Option=1
Trace=yes
Tracefile=/tmp/odbc.log


Asterisk voicemail error: file.c: Unable to open format wav


After upgrading asterisk to latest version on a new server our voicemail gets below error:


[2012-05-20 09:21:53] WARNING[25083] format_wav.c: Not a wav file 49
[2012-05-20 09:21:53] WARNING[25083] file.c: Unable to open format wav
[2012-05-20 09:21:53] WARNING[25083] file.c: Unable to open /var/spool/asterisk/voicemail/default/9001/unavail (format 0x4 (ulaw)): No such file or directory

To resolve this we had to fix the database name and table in voicemail.conf to make sure it is using odbc configuration same as our res_config