Author Topic: 1004 Asterisk Issue  (Read 1740 times)

davegravy

  • Guru
  • ****
  • Posts: 490
    • View Profile
1004 Asterisk Issue
« on: January 13, 2012, 04:17:02 am »
I installed 1004 two or three months ago and never bothered trying to get Asterisk setup since I understood it wasn't working yet.

I can't access Advanced>Configuration>Phones Setup in webadmin, it gives the error: "The requested URL /admin/ was not found on this server."
There's no /var/www/admin folder on my core...

I uninstalled all asterisk-related packages and reinstalled lmce-asterisk, but didn't help. I understand we've abandoned FreePBX (which is where I used to have to do my phone lines config), so perhaps we've also abandoned the advanced phone lines config...?

I tried to configure my IAX service via Wizard>Devices>Phone Lines, but it's not coming up with a status (seems to be a blank field). No inbound or outbound call service.

I did notice that there was no 4569 port opened up in the firewall, so I added it, but still no inbound/outbound service, and still no status indicator.

No connection attempt activity showing in the asterisk console either...
« Last Edit: January 13, 2012, 05:08:56 am by davegravy »

Aviator

  • Veteran
  • ***
  • Posts: 79
    • View Profile
Re: 1004 Asterisk Issue
« Reply #1 on: January 13, 2012, 05:13:15 pm »
I can't access Advanced>Configuration>Phones Setup in webadmin, it gives the error: "The requested URL /admin/ was not found on this server."

This is normal, that link needs to be removed as we don't use FreePBX any more.

Aviator

  • Veteran
  • ***
  • Posts: 79
    • View Profile
Re: 1004 Asterisk Issue
« Reply #2 on: January 13, 2012, 05:15:08 pm »
I am not familiar with IAX configuragion, I have only used SIP.  Hopefully someone else is able to assist with your IAX registration.

davegravy

  • Guru
  • ****
  • Posts: 490
    • View Profile
Re: 1004 Asterisk Issue
« Reply #3 on: January 14, 2012, 03:57:37 pm »
I seem to remember under LinuxMCE 0810 that from a console I could run

Code: [Select]
asterisk -rvvvvvvvvvvvvvvv
And watch asterisk output relating to handshaking with my VOIP provider. Now when I run that all I see is

Code: [Select]
    -- Remote UNIX connection
    -- Remote UNIX connection disconnected

So I'm not sure yet how to get any diagnostic info out of asterisk.

I went looking for config files and noticed everything's stored in sql now. Here's my ast_config table, with the important bits censored:

Code: [Select]
|  60 |          0 |          0 |         0 | sip.conf         | general      | bindport         | 5060                                                        |
|  61 |          0 |          1 |         0 | sip.conf         | general      | bindaddr         | 0.0.0.0                                                     |
|  62 |          0 |          2 |         0 | sip.conf         | general      | disallow         | all                                                         |
|  63 |          0 |          3 |         0 | sip.conf         | general      | allow            | ulaw                                                        |
|  64 |          0 |          4 |         0 | sip.conf         | general      | allow            | ulaw                                                        |
|  65 |          0 |          5 |         0 | sip.conf         | general      | context          | from-sip-external                                           |
|  66 |          0 |          6 |         0 | sip.conf         | general      | callerid         | Unknown                                                     |
|  67 |          0 |          7 |         0 | sip.conf         | general      | tos              | 0x68                                                        |
|  68 |          0 |          8 |         0 | sip.conf         | general      | notifyringing    | yes                                                         |
|  69 |          0 |          9 |         0 | sip.conf         | general      | notifyhold       | yes                                                         |
|  70 |          0 |         10 |         0 | sip.conf         | general      | limitonpeers     | yes                                                         |
|  71 |          0 |         11 |         0 | sip.conf         | general      | rtcachefriends   | yes                                                         |
|  72 |          0 |         12 |         0 | sip.conf         | general      | rtupdate         | yes                                                         |
|  73 |          0 |         13 |         0 | sip.conf         | general      | tcpenable        | yes                                                         |
|  74 |          0 |         14 |         0 | sip.conf         | general      | tcpbindaddr      | 0.0.0.0                                                     |
|  75 |          0 |         15 |         0 | sip.conf         | general      | registerattempts | 0                                                           |
|  76 |          0 |         16 |         0 | sip.conf         | general      | registertimeout  | 15                                                          |
|  77 |          0 |         17 |         0 | sip.conf         | general      | language         | en                                                          |
|  78 |          0 |          0 |         0 | iax.conf         | general      | bindport         | 4569                                                        |
|  79 |          0 |          1 |         0 | iax.conf         | general      | bindaddr         | 0.0.0.0                                                     |
|  80 |          0 |          2 |         0 | iax.conf         | general      | disallow         | all                                                         |
|  81 |          0 |          3 |         0 | iax.conf         | general      | allow            | ulaw                                                        |
|  82 |          0 |          4 |         0 | iax.conf         | general      | allow            | alaw                                                        |
|  83 |          0 |          5 |         0 | iax.conf         | general      | allow            | gsm                                                         |
|  84 |          0 |          6 |         0 | iax.conf         | general      | context          | from-sip-external                                           |
|  85 |          0 |          7 |         0 | iax.conf         | general      | mailboxdetail    | yes                                                         |
|  86 |          0 |          8 |         0 | iax.conf         | general      | dtmfmode         | auto                                                        |
|  87 |          0 |          9 |         0 | iax.conf         | general      | rtcachefriends   | yes                                                         |
|  88 |          0 |         10 |         0 | iax.conf         | general      | rtupdate         | yes                                                         |
|  89 |          0 |         11 |         0 | iax.conf         | general      | tos              | 0x18                                                        |
|  90 |          0 |         12 |         0 | iax.conf         | general      | jitterbuffer     | yes                                                         |
|  91 |          0 |          0 |         0 | rtp.conf         | general      | rtpstart         | 10000                                                       |
|  92 |          0 |          1 |         0 | rtp.conf         | general      | rtpend           | 20000                                                       |
|  93 |          0 |          0 |         0 | musiconhold.conf | default      | mode             | files                                                       |
|  94 |          0 |          1 |         0 | musiconhold.conf | default      | directory        | /var/lib/asterisk/mohmp3                                    |
|  95 |          1 |          0 |         0 | musiconhold.conf | none         | mode             | files                                                       |
|  96 |          1 |          1 |         0 | musiconhold.conf | none         | directory        | /var/lib/asterisk/mohmp3/none                               |
|  97 |          0 |          0 |         0 | voicemail.conf   | general      | format           | wav|gsm                                                     |
|  98 |          0 |          1 |         0 | voicemail.conf   | general      | serveremail      | LinuxMCE@dcerouter                                          |
|  99 |          0 |          2 |         0 | voicemail.conf   | general      | maxlogins        | 3                                                           |
| 100 |          0 |          3 |         0 | voicemail.conf   | general      | emaildateformat  | %A, %B %d, %Y at %r                                         |
| 101 |          0 |          4 |         0 | voicemail.conf   | general      | sendvoicemail    | yes                                                         |
| 102 |          0 |          5 |         0 | voicemail.conf   | general      | skipms           | 3000                                                        |
| 103 |          0 |          6 |         0 | voicemail.conf   | general      | maxsilence       | 10                                                          |
| 104 |          0 |          7 |         0 | voicemail.conf   | general      | silencethreshold | 128                                                         |
| 105 |          0 |          8 |         0 | voicemail.conf   | general      | maxlogins        | 3                                                           |
| 106 |          1 |          0 |         0 | voicemail.conf   | zonemessages | eastern          | America/New_York|'vm-received' Q 'digits/at' IMp            |
| 107 |          1 |          1 |         0 | voicemail.conf   | zonemessages | central          | America/Chicago|'vm-received' Q 'digits/at' IMp             |
| 108 |          1 |          2 |         0 | voicemail.conf   | zonemessages | central24        | America/Chicago|'vm-received' q 'digits/at' H N 'hours'     |
| 109 |          1 |          3 |         0 | voicemail.conf   | zonemessages | military         | Zulu|'vm-received' q 'digits/at' H N 'hours' 'phonetic/z_p' |
| 110 |          1 |          4 |         0 | voicemail.conf   | zonemessages | european         | Europe/Copenhagen|'vm-received' a d b 'digits/at' HM        |
| 111 |          0 |          0 |         0 | jabber.conf      | general      | autoregister     | yes                                                         |
| 112 |          0 |          0 |         0 | gtalk.conf       | general      | context          | from-trunk                                                  |
| 113 |          0 |          1 |         0 | gtalk.conf       | general      | bindaddr         | 0.0.0.0                                                     |
| 114 |          0 |          2 |         0 | gtalk.conf       | general      | allowguest       | yes                                                         |
| 115 |          1 |          0 |         0 | gtalk.conf       | guest        | disallow         | all                                                         |
| 116 |          1 |          1 |         0 | gtalk.conf       | guest        | allow            | ulaw                                                        |
| 117 |          1 |          2 |         0 | gtalk.conf       | guest        | context          | from-trunk                                                  |
| 118 |          1 |          3 |         0 | gtalk.conf       | guest        | connection       | asterisk                                                    |
| 119 |          0 |        101 |         0 | iax.conf         | general      | register         | 1111111111:1111111@iax04.unlimitel.ca                     

And my iax_devices table:

Code: [Select]
+----+------------+------------+------+---------+-----------+----------+------------+------------------+--------+--------+--------+------+-------------+----------+------------+------------+-----------+--------------------+----------+---------+------+--------+---------+----------+-----------+--------+------+------------+
| id | name       | username   | type | secret  | md5secret | dbsecret | notransfer | requirecalltoken | inkeys | outkey | setvar | auth | accountcode | amaflags | callerid   | context    | defaultip | host               | language | mailbox | deny | permit | qualify | disallow | allow     | ipaddr | port | regseconds |
+----+------------+------------+------+---------+-----------+----------+------------+------------------+--------+--------+--------+------+-------------+----------+------------+------------+-----------+--------------------+----------+---------+------+--------+---------+----------+-----------+--------+------+------------+
|  1 | 1111111111 | 1111111111 | peer | 1111111 | NULL      | NULL     | yes        | yes              | NULL   | NULL   | NULL   | NULL | NULL        | NULL     | 1111111111 | from-trunk | NULL      | iax04.unlimitel.ca | en       | NULL    | NULL | NULL   | yes     | all      | alaw;ulaw | NULL   | 4569 |          0 |
+----+------------+------------+------+---------+-----------+----------+------------+------------------+--------+--------+--------+------+-------------+----------+------------+------------+-----------+--------------------+----------+---------+------+--------+---------+----------+-----------+--------+------+------------+

davegravy

  • Guru
  • ****
  • Posts: 490
    • View Profile
Re: 1004 Asterisk Issue
« Reply #4 on: January 14, 2012, 04:51:23 pm »
My Phonelines table:

Code: [Select]
+----+---------+-------+--------+----------+-----------+--------------------+------+-------------+------------+----------+---------+----------+
| id | enabled | isfax | prefix | protocol | name      | host               | port | phonenumber | username   | password | faxmail | channels |
+----+---------+-------+--------+----------+-----------+--------------------+------+-------------+------------+----------+---------+----------+
|  1 | yes     | no    |        | IAX      | Unlimitel | iax04.unlimitel.ca | 5060 | 1111111111  | 1111111111 | 1111111  | NULL    |        5 |
+----+---------+-------+--------+----------+-----------+--------------------+------+-------------+------------+----------+---------+----------+
1 row in set (0.00 sec)

shows port 5060. This should be 4569, right? I changed it but no apparent difference.

Also,

Code: [Select]
dcerouter*CLI> core show channels
Channel              Location             State   Application(Data)
0 active channels
0 active calls
0 calls processed

and

Code: [Select]
dcerouter*CLI> module show
Module                         Description                              Use Count
0 modules loaded

and

Code: [Select]
dcerouter*CLI> module load chan_iax2.so
Unable to load module chan_iax2.so
Command 'module load chan_iax2.so' failed.

and


Code: [Select]
PBX Core settings
-----------------
  Version:                     1.8.7.1-1digium2~lucid
  Build Options:               LOADABLE_MODULES
  Maximum calls:               Not set
  Maximum open file handles:   Not set
  Verbosity:                   14
  Debug level:                 7
  Maximum load average:        0.000000
  Minimum free memory:         0 MB
  Startup time:                10:44:55
  Last reload time:            10:44:55
  System:                      Linux/2.6.32-31-generic built by pbuilder on x86_64 2011-10-18 16:25:39 UTC
  System name:
  Entity ID:                   00:1f:c6:c4:91:a2
  Default language:            en
  Language prefix:             Enabled
  User name and group:         /
  Executable includes:         Disabled
  Transcode via SLIN:          Enabled
  Internal timing:             Disabled
  Transmit silence during rec: Disabled
  Generic PLC:                 Disabled

* Subsystems
  -------------
  Manager (AMI):               Disabled
  Web Manager (AMI/HTTP):      Disabled
  Call data records:           Enabled
  Realtime Architecture (ARA): Disabled

* Directories
  -------------
  Configuration file:
  Configuration directory:     /etc/asterisk
  Module directory:            /usr/lib/asterisk/modules
  Spool directory:             /var/spool/asterisk
  Log directory:               /var/log/asterisk
  Run/Sockets directory:       /var/run/asterisk
  PID file:                    /var/run/asterisk/asterisk.pid
  VarLib directory:            /var/lib/asterisk
  Data directory:              /usr/share/asterisk
  ASTDB:                       /var/lib/asterisk/astdb
  IAX2 Keys directory:         /usr/share/asterisk/keys
  AGI Scripts directory:       /usr/share/asterisk/agi-bin

davegravy

  • Guru
  • ****
  • Posts: 490
    • View Profile
Re: 1004 Asterisk Issue
« Reply #5 on: January 14, 2012, 07:21:26 pm »
Ended up going on a hunt...

All I have in my /etc/asterisk directory is empty except for

Code: [Select]
extensions-lmce-trunks.conf  hints.conf
from SVN it looks like there's a whole bunch of .conf files I should have. downloading them.

davegravy

  • Guru
  • ****
  • Posts: 490
    • View Profile
Re: 1004 Asterisk Issue
« Reply #6 on: January 14, 2012, 08:45:09 pm »
After downloading .conf files, got my IAX trunk registered. After some fiddling with iax.conf in the asterisk database to suit my VOIP provider, I can call in and get IVR

But still no outbound, and LMCE seems completely disconnected from asterisk (can't see active calls, etc).




davegravy

  • Guru
  • ****
  • Posts: 490
    • View Profile
Re: 1004 Asterisk Issue
« Reply #7 on: January 17, 2012, 03:16:40 pm »
Foxi very helpfully advised me that if no config files are being generated during package install then I need to do a:

Code: [Select]
apt-get remove lmce-asterisk --purge
and then install again. Thank you Foxi. I did this, and seem to have all the proper .conf files, but I do now get an error on install: at the very end.

Code: [Select]
asterisk: unrecognized service
dpkg: error processing lmce-asterisk (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of asterisk:
 asterisk depends on asterisk-config (= 1:1.8.7.1-1digium2~lucid) | asterisk-con
  Package asterisk-config is not installed.
  Package asterisk-config-custom is not installed.
  Package lmce-asterisk which provides asterisk-config-custom is not configured
dpkg: error processing asterisk (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of asterisk-voicemail:
 asterisk-voicemail depends on asterisk; however:
  Package asterisk is not configured yet.
dpkg: error processing asterisk-voicemail (--configure):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
No apport report written because the error message indicates its a followup erro

                                                                                                                                                                                                                                             hile processing:
 lmce-asterisk
 asterisk
 asterisk-voicemail
E: Sub-process /usr/bin/dpkg returned an error code (1)

Unlike before, there's no asterisk binary in /etc/init.d, instead a file called asterisk.dpkg-new, so asterisk isn't starting automatically.

I started asterisk manually using

Code: [Select]
asterisk -vvvvvvvvvvdddddddddgc
It registers the trunk, and also now registers my MD as a SIP peer (unlike before) but not my hybrid. For inbound calls, it now reports:

Code: [Select]
[Jan 17 09:00:39] NOTICE[27267]: [font=Verdana]chan_iax2.c:10905 socket_process: Host xxx.xxx.xxx.xxx failed to authenticate as [10 digit phone# omitted][/font]

And I can't make any outbound calls. I'll play with it more later after work.

heinola

  • Veteran
  • ***
  • Posts: 50
    • View Profile
Re: 1004 Asterisk Issue
« Reply #8 on: January 17, 2012, 05:49:28 pm »
this is off topic  but  love the handle  dave  lol

davegravy

  • Guru
  • ****
  • Posts: 490
    • View Profile
Re: 1004 Asterisk Issue
« Reply #9 on: January 18, 2012, 03:32:11 pm »
Regarding the error I'm getting on inbound calls:

Code: [Select]
[Jan 17 09:00:39] NOTICE[27267]: chan_iax2.c:10905 socket_process: Host xxx.xxx.xxx.xxx failed to authenticate as [10 digit phone# omitted]
I discovered that if I load iax.conf as a flat-file, instead of through the mysql asterisk database, it fixes the problem. Very strange.

I posted on the asterisk forum about this: http://forums.digium.com/viewtopic.php?f=1&t=81336&sid=b16bac849ef43d19d85fa6e6fa63385d

Foxi352

  • Veteran
  • ***
  • Posts: 52
    • View Profile
Re: 1004 Asterisk Issue
« Reply #10 on: January 26, 2012, 05:39:12 pm »
Sorry for late reply, but i was on a leave for nearly two weeks.

I corrected the asterisk.asterisk bug, and added check if group exists.

But you should know how it was supposed to work: During 10.04 install we have to install lmce-asterisk BEFORE asterisk itself as it provides asterisk-config files. If we do install asterisk first it will install it's default config package which conflicts with lmce-asterisk. But some parts of asterisk postinst need asterisk to be installed to work. That's while the second half of the postinst script checks if the asterisk binary is already there, which is not the case on a new install where lmce-asterisk is installed during mce-install.sh progress. So it installs lmce-asterisk without doing some of the config, and then installs asterisk itself. During firstboot script (on, as you might imagine, your first reboot after installation) the postinst is called once again, but this time asterisk binary exists and lmce-asterisk does the rest of it config tasks. Asterisk package installs group and user, so it should never happen that this part of script is run and that user of group does not exist.

Of course i only speak of new installations above. Older 10.04 installations which already had broken freepbx installed these scripts will not work. Purge (PURGE, not simply remove) everything that has to do with asterisk (pluto-asterisk, asterisk-pluto, asterisk, freepbx, ...) and only install lmce-asterisk should do the trick for the older cores ...

So may i ask if it's possible that  all of you that run into trouble with group not existing had a core where asterisk was already installed before installing lmce-asterisk package ?

davegravy

  • Guru
  • ****
  • Posts: 490
    • View Profile
Re: 1004 Asterisk Issue
« Reply #11 on: January 27, 2012, 04:39:53 am »
Sorry for late reply, but i was on a leave for nearly two weeks.

I corrected the asterisk.asterisk bug, and added check if group exists.

But you should know how it was supposed to work: During 10.04 install we have to install lmce-asterisk BEFORE asterisk itself as it provides asterisk-config files. If we do install asterisk first it will install it's default config package which conflicts with lmce-asterisk. But some parts of asterisk postinst need asterisk to be installed to work. That's while the second half of the postinst script checks if the asterisk binary is already there, which is not the case on a new install where lmce-asterisk is installed during mce-install.sh progress. So it installs lmce-asterisk without doing some of the config, and then installs asterisk itself. During firstboot script (on, as you might imagine, your first reboot after installation) the postinst is called once again, but this time asterisk binary exists and lmce-asterisk does the rest of it config tasks. Asterisk package installs group and user, so it should never happen that this part of script is run and that user of group does not exist.

Of course i only speak of new installations above. Older 10.04 installations which already had broken freepbx installed these scripts will not work. Purge (PURGE, not simply remove) everything that has to do with asterisk (pluto-asterisk, asterisk-pluto, asterisk, freepbx, ...) and only install lmce-asterisk should do the trick for the older cores ...

So may i ask if it's possible that  all of you that run into trouble with group not existing had a core where asterisk was already installed before installing lmce-asterisk package ?

Thanks Foxi.

I have an older install, but I had purged all the asterisk-related packages. Neither lmce-asterisk nor asterisk were creating an asterisk user for me... Now that i've done so manually the user/group related errors are gone when I run the install. The issues earlier in the thread still exist, as does the following:

Code: [Select]
asterisk: unrecognized service
dpkg: error processing lmce-asterisk (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of asterisk:
 asterisk depends on asterisk-config (= 1:1.8.7.1-1digium2~lucid) | asterisk-config-custom; however:
  Package asterisk-config is not installed.
  Package asterisk-config-custom is not installed.
  Package lmce-asterisk which provides asterisk-config-custom is not configured yet.
dpkg: error processing asterisk (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          dpkg: dependency problems prevent configuration of asterisk-voicemail:
 asterisk-voicemail depends on asterisk; however:
  Package asterisk is not configured yet.
dpkg: error processing asterisk-voicemail (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Errors were encountered while processing:
 lmce-asterisk
 asterisk
 asterisk-voicemail



rages

  • Guru
  • ****
  • Posts: 182
    • View Profile
Re: 1004 Asterisk Issue
« Reply #12 on: January 27, 2012, 01:15:04 pm »
hi,
I solved this by downloading an older version of asterisk-lmce.deb, and then upgrading to the new.


Emanuele

davegravy

  • Guru
  • ****
  • Posts: 490
    • View Profile
Re: 1004 Asterisk Issue
« Reply #13 on: January 27, 2012, 09:14:34 pm »
hi,
I solved this by downloading an older version of asterisk-lmce.deb, and then upgrading to the new.


Emanuele

I tried 3 different versions:

  • lmce-asterisk_0+0.1.0-1_i386.deb
  • lmce-asterisk_0+0.2.0-1_i386.deb
  • lmce-asterisk_0+0.3.0-1_i386.deb

1 and 3 had dependency issues. 2 installed, but when I upgraded to latest I got the same errors as before.

EDIT:

Ok, I got it to work. I had to

1. apt-get remove lmce-asterisk --purge
2. dpkg -i lmce-asterisk_0+0.1.0-1_i386.deb
3. apt-get install asterisk asterisk-mysql
5. apt-get install lmce-asterisk
6. run the fixed postinst

And voila, no more errors on install.

EDIT2:

Core still isn't registering in sip peers (MD is tho) and still getting this error on inbound calls:

Code: [Select]
[Jan 17 09:00:39] NOTICE[27267]: chan_iax2.c:10905 socket_process: Host xxx.xxx.xxx.xxx failed to authenticate as [10 digit phone# omitted]
« Last Edit: January 27, 2012, 09:30:35 pm by davegravy »

posde

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2925
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: 1004 Asterisk Issue
« Reply #14 on: January 28, 2012, 12:34:26 pm »
davegravy,

next time, when you have an issue like that, feel free to drop by in the irc channel and ping foxi, so you two can sort this out the way it is meant to be.

It is nice that you've got it partly working, but it should not be the norm.

Usually, on an existing install, I would
* dpkg -l \*asterisk\*

make a note of all packages listed, and apt-get remove --purge said packages.

After that, I would apt-get install lmce-asterisk.

That's how it is meant to work.

Of course, apt-get update should be executed before all that.