Bad magic number / Skype failed to start

A forum for Skype For Asterisk users to ask questions and get advice from other users

Moderators: twilson, pete engler

Bad magic number / Skype failed to start

Postby simoncozens » Sun Aug 02, 2009 8:40 am

Running Asterisk 1.4 from Debian (1.4.21.2~dfsg-3), with SFA 0.9.11, I'm seeing Skype engine fail to start with no further diagnostics. But I am seeing this, which is suspicious:

pbx*CLI> skype show version
Skype For Asterisk Components:
Channel Driver: 1.4_0.9.11
Library: 1.4_0.9.11
pbx*CLI> skype show users
Skype Users
[Aug 2 15:37:51] ERROR[17574]: astobj2.c:114 INTERNAL_OBJ: bad magic number 0x726573 for 0x816de00


[Aug 2 15:34:18] NOTICE[17515] core.cpp: Skype For Asterisk Host-ID: 2d:a2:47:e0:24:b8:a0:9d:58:3f:dd:3c:72:c1:ff:81:7c:46:b4:88
[Aug 2 15:34:18] NOTICE[17515] core.cpp: Found a total of 1 Skype For Asterisk licenses
[Aug 2 15:34:28] ERROR[17515] core.cpp: Skype engine failed to start.
[Aug 2 15:34:28] ERROR[17515] chan_skype.c: Unable to start Skype For Asterisk library.
simoncozens
Newsterisk
 
Posts: 2
Joined: Sun Aug 02, 2009 8:35 am

Postby Docteh » Sun Aug 02, 2009 10:06 am

I got the bad magic number error when my license file wasn't in the right place for my copy of asterisk.
Docteh
Newsterisk
 
Posts: 47
Joined: Thu Jul 30, 2009 10:52 am

Re: Bad magic number / Skype failed to start

Postby jtodd » Mon Aug 03, 2009 8:42 am

Docteh - I'd suggest looking through your process table and killing off (manually) any instances of the program "skypeforasterisk" and re-launching Asterisk.

JT
jtodd
Site Admin
 
Posts: 3
Joined: Thu Jul 03, 2008 11:53 am
Location: Portland, OR

Postby jchonig » Mon Aug 03, 2009 9:03 am

I'm seeing the same symptoms. I have a valid license for one channel.

There are no skypforasterisk processes running.

I'm running Ubuntu Gutsy: Linux mittens.honig.net 2.6.22-16-generic #1 SMP Thu Apr 2 01:27:50 GMT 2009 i686 GNU/Linux and Asterisk 1.4.26.
jchonig
Newsterisk
 
Posts: 6
Joined: Thu Dec 21, 2006 10:56 pm

Postby twilson » Mon Aug 03, 2009 9:35 am

The only time I've ever seen the bad magic number error was either skypeforasterisk was already running (ps aux|grep skype) or a license issue. But, it will happen any time the skypeforasterisk process fails to start. Could be that /tmp is mounted with noexec so the default location for the engine_directory setting in chan_skype.conf is inappropriate (we have to be able to execute from this directory).

If you could edit modules.conf and noload=>res_skypeforasterisk.so and noload=>chan_skype.so, then start asterisk and do "module load res_skypeforasterisk.so" followed by "module load chan_skype.so" and capture the output (preferably with debug and verbose > 5 and being logged), I might be able to give you some more help.
twilson
Oldsterisk
 
Posts: 87
Joined: Mon Jun 01, 2009 9:35 am

Postby simoncozens » Tue Aug 04, 2009 2:26 am

Fixed it. There's a bug in the license installer: it installed files and made directories owned by user root, not user asterisk. chown'ing them to asterisk made it load correctly.[/quote]
simoncozens
Newsterisk
 
Posts: 2
Joined: Sun Aug 02, 2009 8:35 am

Postby twilson » Tue Aug 04, 2009 8:57 am

Glad you found the issue. Although it isn't really a bug with the register utility--it is by design. If asterisk is installed someplace odd, or runs under a non-root user, it is currently up to the user to move things around to match the non-default case. RPM installs managed by the distros might be a case where their defaults and ours are different.

I'll think about ways I can make that more intuitive--but there is no way for us to be 100% certain what user asterisk is going to run as or where it is installed.
twilson
Oldsterisk
 
Posts: 87
Joined: Mon Jun 01, 2009 9:35 am

Postby jchonig » Tue Aug 04, 2009 1:54 pm

I'm still having the issue.

I had asterisk running as root, but just changed it to run as asterisk.asterisk.

Skype seems to be able to find the license:

skype show licenses
Skype For Asterisk Licensing Information
========================================
Total licensed channels: 1

Licenses Found:
File: XXXX-XXXXXXXXXXXX.lic -- Key: XXXX-XXXXXXXXXXXX -- Expires: 2009-08-31 -- Host-ID: XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX -- Channels: 1 (OK)

Working on the log information.
jchonig
Newsterisk
 
Posts: 6
Joined: Thu Dec 21, 2006 10:56 pm

Postby twilson » Tue Aug 04, 2009 2:11 pm

skypeforasterisk is not starting, so you have to figure out why that is. Common issues:
1) Hung skypeforasterisk process that needs to be killed (ps aux|grep skypeforasterisk with Asterisk not running to check)
2) License issue (which you don't seem to be having)
3) SELinux is enabled. Either disable or run chcon -t textrel_shlib_t /usr/lib/asterisk/modules/res_skypeforasterisk.so
4) /tmp is mounted with noexec and we can't execute files that are extracted there, so set engine_directory=/someplace/the/user/that/runs/asterisk/can/execute in chan_skype.conf
5) Some other reason I haven't run across yet. :-)
twilson
Oldsterisk
 
Posts: 87
Joined: Mon Jun 01, 2009 9:35 am

Postby jchonig » Tue Aug 04, 2009 2:19 pm

1) Never any skypeforasterisk process running w/or w/o asterisk

2) License issues seems OK

3) No SELinux:
mittens [746]: dmesg | grep -i selinux
[ 54.384213] SELinux: Disabled at boot.

4) /tmp is in /, which is not noexec. I moved engine_directory though:
mittens [756]: l /var/spool/asterisk/skype/engine/
total 8
6063721 drwxr-xr-x 2 asterisk asterisk 4096 2009-08-04 11:31 ./
6063678 drwxr-xr-x 4 asterisk asterisk 4096 2009-08-03 11:47 ../

Am I missing something there?

5) Happy to cause problems. Will try to help fix them too.

;-)

Thanks.

Jeff
jchonig
Newsterisk
 
Posts: 6
Joined: Thu Dec 21, 2006 10:56 pm

Postby twilson » Tue Aug 04, 2009 2:40 pm

Ok, so I guess make sure that debug=yes is set in chan_skype.conf and the console logger in /etc/asterisk/logger.conf is logging debug messages. Edit /etc/asterisk/modules.conf to do a noload => res_skypeforasterisk.so and a noload => chan_skype.so. Start Asterisk and do core set verbose 5 and core set debug 5. Then module load res_skypeforasterisk.so and module load chan_skype.so and post the output.

Maybe we can track this thing down.
twilson
Oldsterisk
 
Posts: 87
Joined: Mon Jun 01, 2009 9:35 am

Postby lamsoft » Tue Aug 04, 2009 9:35 pm

Hi all, I got the exactly same problem after i tried to make an incoming to sfa, i was successfully making an outgoing call

Here is the output from CLI by turning debug=yes in chan_skype.conf



Code: Select all
lamsoft-pbx*CLI> module load res_skypeforasterisk.so
Loading Skype For Asterisk engine
[Aug  5 11:32:07] NOTICE[5471]: res_skypeforasterisk.c:17 load_module: Skype For Asterisk module, Copyright (C) 2008-2009 Digium, Inc.
[Aug  5 11:32:07] NOTICE[5471]: res_skypeforasterisk.c:18 load_module: This module is supplied under a commercial license granted by Digium, Inc.
[Aug  5 11:32:07] NOTICE[5471]: res_skypeforasterisk.c:19 load_module: Please see the full license text supplied by the accompanying
[Aug  5 11:32:07] NOTICE[5471]: res_skypeforasterisk.c:20 load_module: "register" utility, or ask for a copy from Digium.
[Aug  5 11:32:07] NOTICE[5471]: res_skypeforasterisk.c:23 load_module: This product includes software developed by the OpenSSL Project
[Aug  5 11:32:07] NOTICE[5471]: res_skypeforasterisk.c:24 load_module: for use in the OpenSSL Toolkit. (http://www.openssl.org/)
[Aug  5 11:32:07] NOTICE[5471]: res_skypeforasterisk.c:25 load_module: Copyright (C) 1998-2008 The OpenSSL Project

Loaded res_skypeforasterisk.so => (Skype For Asterisk Engine)

Code: Select all
lamsoft-pbx*CLI> module load chan_skype
  == Parsing '/etc/asterisk/chan_skype.conf':   == Found
[Aug  5 11:33:51] DEBUG[5471]: core.cpp:1311 sfa_startup: License directory set to: /var/lib/asterisk/licenses
[Aug  5 11:33:51] NOTICE[5471]: core.cpp:1153 skype_cp_handler: Found license 'S4AB-XXXXXXXXXXXXX' providing 1 concurrent calls
[Aug  5 11:33:51] NOTICE[5471]: core.cpp:1000 display_host: Skype For Asterisk Host-ID: e9:e1:83:1b:75:0e:db:e9:41:c1:39:28:cb:ab:63:ff:dc:0c:c9:eb
[Aug  5 11:33:51] NOTICE[5471]: core.cpp:1320 sfa_startup: Found a total of 1 Skype For Asterisk licenses
[Aug  5 11:33:53] DEBUG[5502]: core.cpp:382 skyhost_watcher: pfd 0 had an error
[Aug  5 11:33:53] DEBUG[5502]: core.cpp:282 kill_skypewatcher: sending SIGTERM to 5503.
[Aug  5 11:34:01] ERROR[5471]: core.cpp:1551 sfa_startup: Skype engine failed to start.
[Aug  5 11:34:01] ERROR[5471]: chan_skype.c:3035 load_module: Unable to start Skype For Asterisk library.
  == Manager registered action SkypeBuddies
  == Manager registered action SkypeBuddy
  == Manager registered action SkypeAccountProperty
  == Manager registered action SkypeAddBuddy
  == Manager registered action SkypeRemoveBuddy
  == Manager registered action SkypeLicenseStatus
  == Manager registered action SkypeLicenseList
  == Registered custom function 'SKYPE_CALL_PROPERTY'
  == Registered custom function 'SKYPE_ACCOUNT_PROPERTY'
  == Registered custom function 'SKYPE_BUDDIES'
  == Registered custom function 'SKYPE_BUDDY_FETCH'
Loaded chan_skype => (Skype For Asterisk Channel Driver)


at cli, i typed
lamsoft-pbx*CLI> skype show users
Skype Users*CLI>
[Aug 5 11:34:54] ERROR[5471]: astobj2.c:116 INTERNAL_OBJ: bad magic number 0x69646475 for 0x88b8460
[Aug 5 11:34:54] ERROR[5471]: astobj2.c:116 INTERNAL_OBJ: bad magic number 0x69646475 for 0x88b8460
lamsoft-pbx*CLI>
lamsoft
Newsterisk
 
Posts: 10
Joined: Tue Feb 17, 2009 2:34 am

Postby lamsoft » Tue Aug 04, 2009 9:45 pm

There is a suggestion that because a process of skype engine didn't shutdown properly and still binding the port, type "ps aux|grep skype" and kill that process and restart asterisk, it solves my problem...

btw I hope that the module is able to kill the previous process, or the module is able to detect if the asterisk quits accidentally, the skype process will auto kill itself too...
lamsoft
Newsterisk
 
Posts: 10
Joined: Tue Feb 17, 2009 2:34 am

Postby twilson » Thu Aug 06, 2009 1:49 pm

Currently we spawn an external process that watches both asterisk and skypeforasterisk and should kill skypeforasterisk when it can. Also, the skypeforasterisk process tries to kill itself upon asterisk exiting, etc. I would like to know what circumstances people are getting hung skypeforasterisk processes so I could figure out what situations aren't covered.
twilson
Oldsterisk
 
Posts: 87
Joined: Mon Jun 01, 2009 9:35 am

Postby jchonig » Sun Aug 09, 2009 10:19 pm

I fixed the problem, but can't tell you what it was. I upgrade from Ubuntu Gutsy 32-bit to Ubuntu Jaunty on my server and re-installed Asterisk, SFA, ...

So, hopefully it was something to do with now unsupported Gutsy.
jchonig
Newsterisk
 
Posts: 6
Joined: Thu Dec 21, 2006 10:56 pm

Postby rudolf » Tue Aug 25, 2009 2:37 pm

It looks like there is a problem with fexecve(). Any idea?

[Aug 25 22:00:26] NOTICE[772]: core.cpp:1320 sfa_startup: Found a total of 1 Skype For Asterisk licenses
[Aug 25 22:00:26] DEBUG[818]: core.cpp:1512 sfa_startup: starting skypewatcher as: skypewatcher 819
[Aug 25 22:00:26] ERROR[818]: core.cpp:1517 sfa_startup: fexecve() returned error 'No such file or directory'
Last edited by rudolf on Tue Aug 25, 2009 2:48 pm, edited 1 time in total.
rudolf
Newsterisk
 
Posts: 14
Joined: Tue Mar 20, 2007 10:31 am

Postby twilson » Tue Aug 25, 2009 2:42 pm

fexecve() isn't missing, it is that the executable that we are extracting from res_skypeforasterisk.so doesn't appear to be there. Make sure your engine_directory in chan_skype.conf is set to someplace that exists and that you have proper read/write/execute permissions to.
twilson
Oldsterisk
 
Posts: 87
Joined: Mon Jun 01, 2009 9:35 am

Postby rudolf » Tue Aug 25, 2009 2:55 pm

Yes I was just fixing my post :)

I am sure that I have right directory and right permissions. The version of skype that i tried are 0.9.10, 0.9.11 and last 1.0.11 and problem is still there. I have a free skype licence that should expire on 31.08.2009.
rudolf
Newsterisk
 
Posts: 14
Joined: Tue Mar 20, 2007 10:31 am


Return to Skype For Asterisk

Who is online

Users browsing this forum: No registered users and 1 guest

cron