1 (edited by dancho 2011-11-30 15:05:08)

Topic: releasing PBX (supporting Asterisk) interface for LuCI

This is an announcement about the availability of a PBX interface for LuCI. The package name is luci-app-pbx.

Currently, the interface supports Asterisk, and hopefully will support Freeswitch in the future. What it allows you to do is to configure multiple Google Talk/Voice accounts, and SIP accounts (like Sipgate, any of the Betamax services which have SIP settings), and share them among multiple SIP devices (smartphones, ATA boxes, etc). The interface also has support for:

- remote usage (for remote SIP devices)
- call-through for specified numbers
- creating QoS configuration
- blacklisting of numbers

EDIT: Note that the voicemail package described below is currently not operational due to a missing app_record.so module for Asterisk. When it gets added, the package will be usable once again.

Through the installation of an additional package, luci-app-pbx-voicemail, the interface also gains voicemail to email support.

The package is currently available in the snapshot builds of OpenWRT here:

http://downloads.openwrt.org/snapshots/trunk/

Please help me test this package so it can make its way into the stable build as quickly as possible! Thanks everyone!

Re: releasing PBX (supporting Asterisk) interface for LuCI

Why not submit the package to OpenWRT?

Mazi

Re: releasing PBX (supporting Asterisk) interface for LuCI

He did. Its merely an additional announcement.

Re: releasing PBX (supporting Asterisk) interface for LuCI

@dancho

downloaded the source, unpacked in opewrt/trunk/package/luci-app-pbx but I am stuck on the mkaefile bit.
The make package/index and numerous variations thereof is not working for me. Please note, I an NOT a developer and just getting started doing my own builds.

I have also tried installing the ipk but consistently get the following erro:
"Collected errors:
* pkg_hash_fetch_best_installation_candidate: Packages for luci-app-pbx found, but incompatible with the architectures configured
* opkg_install_cmd: Cannot install package luci-app-pbx.

I am using and ar71xx based ubiquiti routerstation pro.

Change only occur when the pain of remaining in the Status Quo exceed the pain of change.

Re: releasing PBX (supporting Asterisk) interface for LuCI

@ammaree

You're right, that package was created with a particular hardware target. I have replaced the target with noarch, repackaged, and verified that it installs. You can now grab the ipk and install it!

As for why you can't get the package to *build*, I am not sure this is the right place to be addressing that unless other people also have a problem! There are many many more things that can go wrong with the build process!

6 (edited by nikescar 2011-10-18 19:04:48)

Re: releasing PBX (supporting Asterisk) interface for LuCI

I tested your application. and I also failed to compile. so I just installed your binary to my dlink dir-825.

before install luci-app-pbx, I install all of asterisk18 derivatives.

and after that configured from luci. but I tried to connect to server, it doesn't respond.

I am not sure what the problem exact it. but 'netstat -nlp' doesn't show asterisk port. even after I setup up the port number from luci.

but I have some report of log here.

/var/log/asterisk/messages

[Oct 18 17:51:49] ERROR[2722] config.c: The file 'jabber_users.conf' was listed as a #include but it does not exist.
[Oct 18 17:51:49] ERROR[2722] res_jabber.c: JABBER: Failed to load config.
[Oct 18 17:51:50] ERROR[2722] config.c: The file 'sip_registrations.conf' was listed as a #include but it does not exist.
[Oct 18 17:51:50] ERROR[2722] chan_sip.c: Contents of sip.conf are invalid and cannot be parsed
[Oct 18 17:51:50] ERROR[2722] config.c: The file 'extensions_incoming.conf' was listed as a #include but it does not exist.
[Oct 18 17:52:19] ERROR[3253] config.c: The file 'jabber_users.conf' was listed as a #include but it does not exist.
[Oct 18 17:52:19] ERROR[3253] res_jabber.c: JABBER: Failed to load config.
[Oct 18 17:52:19] ERROR[3253] config.c: The file 'sip_registrations.conf' was listed as a #include but it does not exist.
[Oct 18 17:52:19] ERROR[3253] chan_sip.c: Contents of sip.conf are invalid and cannot be parsed
[Oct 18 17:52:19] ERROR[3253] config.c: The file 'extensions_incoming.conf' was listed as a #include but it does not exist.
[Oct 18 17:52:47] ERROR[3498] config.c: The file 'sip_registrations.conf' was listed as a #include but it does not exist.
[Oct 18 17:52:47] ERROR[3498] chan_sip.c: Contents of sip.conf are invalid and cannot be parsed
[Oct 18 17:52:47] ERROR[3498] config.c: The file 'extensions_incoming.conf' was listed as a #include but it does not exist.

root@OpenWrt:/etc/asterisk# ls -al /etc/asterisk

drwxr-xr-x    3 root     root         4096 Oct 18 17:52 .
drwxr-xr-x   26 postgres postgres     4096 Oct 14 05:05 ..
-rw-r--r--    1 root     root          429 Oct 18 15:13 asterisk.conf
-rw-r--r--    1 root     root          742 Oct 18 17:52 extensions.conf
-rw-r--r--    1 root     root          112 Oct 18 15:13 extensions_blacklist.conf
-rw-r--r--    1 root     root          131 Oct 18 15:13 extensions_callthrough.conf
-rw-r--r--    1 root     root          585 Oct 18 17:52 extensions_incoming_gtalk.conf
-rw-r--r--    1 root     root         1680 Oct 18 17:52 extensions_user.conf
-rw-r--r--    1 root     root            0 Oct 18 15:13 features.conf
-rw-r--r--    1 root     root          153 Oct 18 15:13 gtalk.conf
-rw-r--r--    1 root     root        25247 Oct 18 15:13 indications.conf
-rw-r--r--    1 root     root           55 Oct 18 15:13 jabber.conf
-rw-r--r--    1 root     root          189 Oct 18 17:52 jabber_users.conf
-rw-r--r--    1 root     root          102 Oct 18 15:13 logger.conf
-rw-r--r--    1 root     root           57 Oct 18 15:13 manager.conf
drwxr-xr-x    2 root     root         4096 Oct 18 17:52 manager.d
-rw-r--r--    1 root     root         1709 Oct 18 15:13 modules.conf
-rw-r--r--    1 root     root           91 Oct 18 17:51 rtp.conf
-rw-r--r--    1 root     root          597 Oct 18 17:51 sip.conf
-rw-r--r--    1 root     root          400 Oct 18 17:52 sip_users.conf

Thanks for your work. It would gave more power to openwrt. I will try to find workaround myself.

Re: releasing PBX (supporting Asterisk) interface for LuCI

@nikescar, thanks for your report! I know why this is happening, and I'll address it as soon as possible. It looks as though Asterisk *requires* files which are mentioned in an #include statement to be *present*, but some files are not created if you don't have certain sections of the PBX interface filled in. In your case, you have no Google account configured (hence the missing jabber_users.conf), and no SIP accounts enabled for Incoming Calls (hence the missing sip_registrations).

This should be very easy to fix on my end, but in the meanwhile simply enable your SIP account for incoming calls, and put some bogus Google account in there (heh heh) so that the PBX interface generates those files. With the next update to the package, these requirement will go away.

Re: releasing PBX (supporting Asterisk) interface for LuCI

OK, I've fixed the issue reported by nikescar, but I've kept the version the same. Please re-download the package or source I posted above.

Cheers!

Re: releasing PBX (supporting Asterisk) interface for LuCI

WOW, everything went well with your changed binary. thank you very much.

before when there are error I could not see sip menu on 'asterisk command line'.

after setup rightly configured binary, it showed sip menu.

thank you again!

Re: releasing PBX (supporting Asterisk) interface for LuCI

Is a x86 package fpr kamikaze or backfire available?
And will it work with multiple SIP Accounts (for example 2* Sipgate)?

Re: releasing PBX (supporting Asterisk) interface for LuCI

Hi eBoy,

Well the package I've created (the file with the ipk extension) is an architecture independent package, since there is no compiled code in the interface - it's all Lua. So, install it on Backfire and all should be well. I am not sure about Kamikaze, because LuCI is an updated version in Backfire, and I rely on some of its newer features. My suspicion is that it won't work on anything older than Backfire.

Cheers,
Iordan

12 (edited by eBoy 2011-10-22 20:37:25)

Re: releasing PBX (supporting Asterisk) interface for LuCI

Doesn't work for me :-(
Have problems with more than one sip accounts! I tested it with 3 sipgate accounts and all calls received via account 1 but all Sipgate accounts are registered. Same issue than “asterisk gui“. Could you please fix the gateway register problem (same src and dst ip with different accounts)?

Re: releasing PBX (supporting Asterisk) interface for LuCI

@eBoy this really sounds like an Asterisk + Sipgate issue to me. This PBX inteface is "pure Asterisk" underneath - it doesn't add magic, it just cooks a configuration.

If I manage to create a couple of Sipgate accounts, I'll test your setup and if I confirm it, I guess a bug-report to Asterisk would be in order.

Re: releasing PBX (supporting Asterisk) interface for LuCI

No, it's a problem how a account will be registered to the provider. It works fine if I use Asterisk without GUI (old and no more existing OpenWRT Kamikaze) or Asterisk/ Freeswitch with FusionPBX (but have some dialplan problems, Voyage Linux).
I think the register string/ option have to be modified?

Re: releasing PBX (supporting Asterisk) interface for LuCI

there would be various issues with sip registering or other usage in asterisk. I think "eBoy" is better stick to console configuration.

because this luci-pbx has basic own configuration made by luci input data that overwriting existing astierisk configuration.

or you could look for big asterisk configuration framework such as freepbx.

Re: releasing PBX (supporting Asterisk) interface for LuCI

dancho wrote:

Here are links to both a ready-made ipk (which is architecture-independent since there are no binaries), and the "source", which you can unpack into backfire/package/, and then run "make package/index". The app will show up under LuCI/Applications when you run "make menuconfig" next time.

http://dancho.no-ip.com/pbx/luci-app-pbx_0.11.ipk
http://dancho.no-ip.com/pbx/luci-app-pbx-0.11.tar.gz

NOTE: I've edited the post to indicate a new version is available. In 0.11, there are only slight usability changes, no new features. Instead of empty boxes, in pbx-calls, one now sees a message about what the PBX is doing when no custom values are entered into the boxes (e.g. stuff like Dials all numbers, Rings all users, and Uses all providers). Also I've dealt with a situation where the OpenWRT box has no static IP address (as reported by Jow).

When luci-app-pbx-0.11.tar.gz file is extracted, its luci-app-pbx/Makefile file still has PKG_RELEASE:=0.10.

Mazi

Re: releasing PBX (supporting Asterisk) interface for LuCI

@eBoy, this is what I found as the first result of my search "asterisk two sipgate accounts". I believe it's relevant because I know the way my PBX cooks the Asterisk configuration. There is a suggested "workaround" near the end of the thread which seems to work for the original poster. The trick in this case seems to be to have both accounts configured to put incoming calls in the *same context*, and then use two different extensions within that "incoming context" to distinguish calls made to each of the accounts. The way my PBX cooks the configuration is different, makes more sense, and is what the original poster in the thread did, which is to put incoming calls in contexts unique to each account. This doesn't work for Asterisk+Sipgate for whatever reason, and in my opinion, after confirming it, one *should* report it as a bug to Digium rather than bear the consequence of requiring the workaround for the rest of existence.

@mazilo, thanks for reporting that! big_smile

Re: releasing PBX (supporting Asterisk) interface for LuCI

@nikescar, if you are still using my PBX interface, how is it working out so far?

Re: releasing PBX (supporting Asterisk) interface for LuCI

@dancho

Registering and others are work fine. though I cannot connect when i am outside from wan. When both sip phone is outside of network. registering and signaling(phone rining) are fine. but voice is not sent. I am lookint rtp signal handling through rtp debugging and sip debugging. but I can't find any clue. smile
when I find the answer, I will report you.

Re: releasing PBX (supporting Asterisk) interface for LuCI

@nikescar

It will be of particular interest whether the RTP firewall rules that the PBX inserts automatically are (1) in place, and if so (2) functioning. Also, it will be of interest whether this PBX is running on a device which is directly attached to the Internet or not. If not, you'd have to put the necessary NAT rules on the router which is actually attached to the Net.

If this is indeed your router to the Net, head over to the firewall configuration of OpenWRT, and look for the PBX-SIP and PBX-RTP rules. If they are there, then, get into asterisk with "asterisk -r", and use the "rtp set debug on" command and make a call. You should see packets flying across the screen during a conversation. If there are no packets, then the firewall rules are likely not functioning. If there are packets, then they may be going to the "wrong place"! Look at the IP addresses, and tell us what they are, and perhaps we can have a clue as to why this is happening.

Oh, and just a side-note about codecs. This PBX uses only ulaw for simplicity. I think it may be a good idea to also allow alaw, but I can't think of a service which doesn't support both. In any case, conversion between the two is computationally "free", so may as well.

Cheers,
Iordan

21 (edited by tekoholic 2011-11-22 06:02:35)

Re: releasing PBX (supporting Asterisk) interface for LuCI

I would like to thank you for this GUI, also!

Just a coupla' issues, from my limited use of it:

1.  I, for some reason, cannot even register from outside the network.  In my case, the router upon which it's installed directly takes a public IP via PPPoE from my DSL modem, no ports are blocked in- or outgoing, external reg is allowed in GUI, and firewall rules are present.

2.  Might I ask a simple feature request?  How about making IAX2 user configs available from the GUI as well as just SIP?  Maybe give a drop-down or radio-button for each user, that would present the option?  I've been under the impression, for quite some time, that IAX2 is quite superior to SIP anyhow, for NAT traversal and many other reasons, and it'd be nice to have it as an option (I'm working on learning the CLI end of it)...

I'll attempt to determine, as suggested above, if my firewall rules are operating as expected, and report back on that info, as soon as I'm able.

edit:  Results so far:  I called into my asterisk from one internally connected user to another, each routed to different google voice #'s.  This resulted in an error:  "[Jan 30 03:39:12] ERROR[4636]: pbx.c:3522 ast_func_read: Function CUT not registered", and an error in my ear about number not in service.

When attempting to register from the WAN iface, there's nothing shown under the asterisk CLI

Re: releasing PBX (supporting Asterisk) interface for LuCI

@tekoholic,

Thanks for the report. For the CUT function error, the reason this is happening is that func_cut.so is either not included in /etc/asterisk/modules.conf (please check that), or it is not present in  /usr/lib/asterisk/modules/func_cut.so (please check that as well).

Thanks!
Iordan

23 (edited by tekoholic 2011-11-22 15:11:39)

Re: releasing PBX (supporting Asterisk) interface for LuCI

It was not listed or located in either of those locations.  What got left out of the install, or what must I install in addition, to fix this?  Or, is this even relevant to the bigger issues, or consequential in any way?

dancho wrote:

@tekoholic,

Thanks for the report. For the CUT function error, the reason this is happening is that func_cut.so is either not included in /etc/asterisk/modules.conf (please check that), or it is not present in  /usr/lib/asterisk/modules/func_cut.so (please check that as well).

Thanks!
Iordan

Re: releasing PBX (supporting Asterisk) interface for LuCI

I'm trying to sort out the problems one at a time. Did you build our firmware image, or install a pre-made one? Which asterisk packages do you have installed?

opkg list_installed | grep asterisk

Cheers!

Re: releasing PBX (supporting Asterisk) interface for LuCI

OK, here's the setup:

Attitude Adjustment (r28475) on a Netgear WNDR3700v2, installed from model-specific image, Luci and a few other packages installed per instructions.

# opkg list_installed | grep asterisk
asterisk18 - 1.8.7.1-1
asterisk18-app-sms - 1.8.7.1-1
asterisk18-chan-gtalk - 1.8.7.1-1
asterisk18-chan-iax2 - 1.8.7.1-1
asterisk18-codec-alaw - 1.8.7.1-1
asterisk18-codec-g722 - 1.8.7.1-1
asterisk18-codec-g726 - 1.8.7.1-1
asterisk18-res-crypto - 1.8.7.1-1
#