OpenWrt Forum Archive

Topic: releasing PBX (supporting Asterisk) interface for LuCI

The content of this topic has been archived between 6 Apr 2018 and 30 Apr 2018. Unfortunately there are posts – most likely complete pages – missing.

@rubenmoran

Yes! Please do take a look at the code. The front-end was written with the idea that it can support different voip servers, and was kept completely independent from the backend. It writes the config files with no Asterisk bias, in my opinion. All one has to do for freeswitch support is to create a script which would take the UCI config entries and cook up a bunch of template files to make an actual Freeswitch configuration that works. So in fact, there should be no need for a Freeswitch GUI, rather a PBX gui which can be instructed to manage either an Asterisk or a Freeswitch server in the back.

If you do decide to work on such a backend, please do let me know, as there are certain things I would have done better in my own Asterisk configuration-cooking script. In fact, it would be nice for us to meet in the #luci-hackers room on freenode (IRC) to discuss particulars.

Cheers!
Iordan

@dancho

My apologies, I've also been away from this end of my project, for a while.

While I do run a business from home, my reasons for the separate VM needs are not related:

I've got a wife, 2 teenagers, 1 young'un, and a roommate, each of which has their own GV account, in addition to my own personal and business GV lines.  Again, external VM is handled by GV just fine, but I'd like to be able to, utilizing OpenVPN and our Android phones, call each other via extension, and that isn't so easy to route out to GV VM system.

As well, much of my reasoning for this whole project, is the fact that we've just purchased a home, and I'm starting an informal Neighborhood Watch.  I'm also a bit of a zombie-apocalypser, in the sense that whatever may come, I want to be as ready as conceivable.  I want, via my neighborhood mesh (that I'm also building), to maintain contact with/between my family and NW participants with or without land-line / POTS / Cell infrastructure, in the case that these are no longer available.

I'm also a Ham Radio Operator, but that's difficult to convince other people to get involved in, with the Internet, VoIP, cellphones and other such technologies (horribly fallible tho they can be) pretending to replace it.  Most folks, these days, honestly believe that all that stuff will always be there, unless they were actually there for such events as Katrina, or the tornado bombardment that hit the South last year...  Also, speaking of Ham radio, I'd love to have my * server integrated with a radio, for further comms redundancy, and I don't see OpenWRT's implementation doing that, too easily...

As a result of all this, and the fact that OpenWRT seems less than capable at the moment, I'm building out via other means, for the time being.  Netbooks are cheap, and capable of offering most (if not all) of what I was hoping OpenWRT could do from my router, with the added benefit of built-in power redundancy and portability, as well as much larger system resource and storage.

Anyhow, thanx much for your help, and I'll keep my eye on this for further development!

rubenmoran wrote:

@dancho
Are you working on freeswitch version of your package?

FusionPBX is a FreeSWITCH GUI and it works just fine with LuCI. The only problem is it's written in PHP language. As such, it requires PHP5 packages.

mazilo wrote:
rubenmoran wrote:

@dancho
Are you working on freeswitch version of your package?

FusionPBX is a FreeSWITCH GUI and it works just fine with LuCI. The only problem is it's written in PHP language. As such, it requires PHP5 packages.

Yes, I know about it... but I think... If we use OpenWRT we need think on a solution working over LuCI to help us keep low the value of resources we need take from the hardware (If we talk about the kind of hardware we use to run OpenWRT). I'm runing now Freeswitch + FusionPBX over Voyage Linux and I can say the box run very well on lab (it needs Apache + PHP support). Really I think ALix or Atom + OpenWRT + LuCI + Freeswitch running PBX services can run very well on a <30 phone users office or home business.

Ruben

Hello, it could be already discussed somewhere in the forum but I would like to ask is it possible to use separete sockets for the internal network (lan) and another one if you intend to access the PBX from Internet (wan)?

As far as I looked in this setup (Advanced Settings -> Remote Usage), it seems that there is one socket created for the pbx itself (listening on all interfaces and one port). I would like to use the default configuration in my internal network(local IP:5060), but let the service available on a different publically accessible socket (wan Ip and a port different from sip:5060).

Thanks in advance,

p.s. dancho, great work, highly appreciated!


P.S.(2) I just found this
http://wiki.kolmisoft.com/index.php/Two … e_Asterisk
http://kb.didx.net/tiki-index.php?page= … isk+server

Is it really true? In freeswith it is possible to define something like an internal and external profiles.

(Last edited by dir2cas on 19 May 2012, 16:51)

I have some suggestions, and might be able to help some, though I am a poor programmer.  I am experienced with asterisk and have been running it on openwrt for almost 2 years.  I would like to see a music on hold configuration section.  Also, as a user of cisco 7940s I think it would be nice to have a provisioning section that cooks up some boot and config files for certain common phone types and place them in the proper boot directory.  Cisco 79XX both old and new, and Polycom soundpoint phones for instance.  Then maybe a checkbox option for modifying the dhcp server config to add the boot options 66 and 150 and install the tftp server.  A command line execution section would be nice as well

Hello
Any one has installed Luci-PBX with Asterisk in Carambola?
I did and basically it works but pbx-voicemail fails for some reason.
Does any one have the same problem?
In other hand I would like to use IVR with PBX but I have lost, since ther is not luci-pbx-ivr and I am not a Asterisk expert.
Could any one help me?
Thanks in advance.
Paco

Hey Paco,

I only now saw your post about the voicemail issue. I've fixed the voicemail over the past couple of days, and will make an announcement when the new package is available in the attitude adjustment packages.

Cheers!
Iordan

Hello dancho,
thanks for this great work... one question smile
Can I transfer calls between internals with *2 or #1?

Thanks

(Last edited by Crazy on 29 Jan 2014, 12:02)

Hey Crazy,

I have no idea! smile What happens when you try?

It's all a matter of configuration, I'm sure. I haven't looked at this project in a while, but next time I do (to update it to Asterisk 10, say), I can lump this in as well. If my PBX config doesn't work for transfering, but you have config elsewhere that does, you can post the relevant configuration here for my reference.

Thanks!
iordan

Thanks for your reply wink

dancho wrote:

What happens when you try?

nothing the call continues big_smile

I read that to work I have to add this on features.conf (empty by default)

blindxfer => #1
atxfer => *2

and tT string in dial plain but where? With this package I have

extensions.conf
extensions_blacklist.conf
extensions_callback.conf
extensions_callthrough.conf
extensions_default.conf
extensions_incoming.conf
extensions_incoming_gtalk.conf
extensions_user.conf
extensions_voicemail.conf

My config

extensions_default.conf

[default-incoming-call-context]
exten => s,1,NoOp(${CALLERID})
exten => s,n,Set(SOURCECONTEXT=default-incoming-call-context)
exten => s,n,Set(SOURCEEXTEN=s)
exten => s,n,Goto(blacklist-call-context,s,1)
exten => s,n(doneblacklist),NoOp()
exten => s,n,Goto(callback-check-call-context,s,1)
exten => s,n(donecallback),NoOp()
exten => s,n,Goto(disa-check-call-context,s,1)
exten => s,n(donedisacheck),Dial(SIP/800&SIP/801&SIP/803,${RINGTIME},r)
exten => s,n,Goto(context-voicemail,s,1)
exten => 800,1,Goto(default-incoming-call-context,s,1)
exten => 801,1,Goto(default-incoming-call-context,s,1)
exten => 803,1,Goto(default-incoming-call-context,s,1)

extensions_user.conf

[context-user-800]

exten =>     800,1,Dial(SIP/800,${RINGTIME},r)
exten =>     801,1,Dial(SIP/801,${RINGTIME},r)
exten =>     803,1,Dial(SIP/803,${RINGTIME},r)
include => context-voicemail-record-greeting
include => context-catch-all

[context-user-801]

exten =>     800,1,Dial(SIP/800,${RINGTIME},r)
exten =>     801,1,Dial(SIP/801,${RINGTIME},r)
exten =>     803,1,Dial(SIP/803,${RINGTIME},r)
include => context-voicemail-record-greeting
include => context-catch-all

[context-user-803]

exten =>     800,1,Dial(SIP/800,${RINGTIME},r)
exten =>     801,1,Dial(SIP/801,${RINGTIME},r)
exten =>     803,1,Dial(SIP/803,${RINGTIME},r)
include => context-voicemail-record-greeting
include => context-catch-all

sip_users.conf

[800]
fullname     = Test
defaultuser  = 800
secret       = TestAsterisk123
hassip       = yes
hasvoicemail = no
host         = dynamic
type         = friend
context      = context-user-800
qualify      = no

[801]
fullname     = Test2
defaultuser  = 801
secret       = TestAsterisk123
hassip       = yes
hasvoicemail = no
host         = dynamic
type         = friend
context      = context-user-801
qualify      = no

[803]
fullname     = Test3
defaultuser  = 803
secret       = TestAsterisk123
hassip       = yes
hasvoicemail = no
host         = dynamic
type         = friend
context      = context-user-803
qualify      = no

It would be nice to have something like this
http://s7.postimg.org/rr0ntnaxn/Bildschirmfoto_2012_12_12_um_15_54_23.png

Thanks again

PS. module pbx-transfer is necessary?

(Last edited by Crazy on 30 Jan 2014, 10:27)

Hi,

1) Add a file

    /etc/pbx-asterisk/features.conf.TEMPLATE

containing what you posted.

2) Edit /etc/init.d/pbx-asterisk, and at line 44, add:
TMPL_FEATURES= $TEMPLATEDIR/features.conf.TEMPLATE

3) Again in the same file, at line 127, in function copy_unedited_templates_over(), add:
    cp $TMPL_FEATURES      $WORKDIR/features.conf

4) Save and restart the router (there are things you can do so you don't have to restart the router, but for simplicity...).

How does it work?

Cheers!
iordan

unfortunately no

root@OpenWrt:/etc/init.d# ./pbx-asterisk start
/etc/pbx-asterisk/features.conf.TEMPLATE: line 1: syntax error: unexpected newline
BusyBox v1.19.4 (2014-01-25 15:34:30 CET) multi-call binary.

Usage: cp [OPTIONS] SOURCE DEST

Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY

    -a    Same as -dpR
    -R,-r    Recurse
    -d,-P    Preserve symlinks (default if -R)
    -L    Follow all symlinks
    -H    Follow symlinks on command line
    -p    Preserve file attributes if possible
    -f    Overwrite
    -i    Prompt before overwrite
    -l,-s    Create (sym)links

mv: can't rename '/tmp/pbx.1595/inext.TMP': No such file or directory
mv: can't rename '/tmp/pbx.1595/sip_regs.TMP': No such file or directory
mv: can't rename '/tmp/pbx.1595/sip_peers.TMP': No such file or directory
mv: can't rename '/tmp/pbx.1595/jabber.TMP': No such file or directory
chown: /var/run/asterisk: No such file or directory
chown: /var/log/asterisk: No such file or directory
chown: /var/spool/asterisk: No such file or directory
root@OpenWrt:/etc/init.d# 

/etc/pbx-asterisk/features.conf.TEMPLATE contains

blindxfer => #1
atxfer => *2

Thanks for your help!

PS. Soon I will try with clean asterisk11 so I can understand where is the problem.

With asterisk11 works but need:
- pbx-transfer (ulaw,alaw and gsm)
- music on hold directory and sounds (download), in musiconhold.conf change directory setting in /usr/lib/asterisk/moh

Hey Crazy,

You clearly introduced a syntax error after editing pbx-asterisk in step (2) of my instructions. See the error message you pasted:

/etc/pbx-asterisk/features.conf.TEMPLATE: line 1: syntax error: unexpected newline

Please try to post your pbx-asterisk for me to see if I can spot where the mistake is.

dancho wrote:

2) Edit /etc/init.d/pbx-asterisk, and at line 44, add:
TMPL_FEATURES= $TEMPLATEDIR/features.conf.TEMPLATE

Found!

TMPL_FEATURES=$TEMPLATEDIR/features.conf.TEMPLATE
No space before the $
I will try again tomorrow, thanks again!!

Hi, thanks for letting me know. I don't know how that space got in there, I was copy-pasting most of the time... smile.

Let me know if things work now.

Cheers!
iordan

I think there is a bug with openwrt - Asterisk 1.8 and transfer because I always get "core segmentation fault" when I do *2 or #1 during a call.
I installed also musiconhold and sound but when I press *2 or #1 during the call I hear "transfer" and then "core segmentation fault".
Also tried with a clean install of Asterisk 1.8 (without luci-pbx) but same problem so I think is a openwrt-asterisk 1.8 bug
With Asterisk 11 (without luci-pbx) everything works fine.

Another small problem .. every time I change something luci-pbx delete the string "tT" by extensions_users.conf

Hey Crazy,

If you want something to remain when luci-pbx changes something, that something has to be in one of the TEMPLATE files. Which file it needs to be in depends on what it is. What does a valid "tT" entry look like, and which section of the dial-plan does it go into?

Thanks!
iordan

dancho wrote:

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

I just noticed this package is tied to asterisk18. If I use asterisk11, then I can't use this GUI even though I manually select asterisk-gui package, can I?

Hey mazi,

I haven't yet ported the pbx interface to asterisk11. Jiri and I were looking into whether it would be possible to fit asterisk11 and luci-pbx and all prerequisites onto 8MB, and last time I tried it didn't fit, but now Jiri may have shrunk asterisk11 enough to fit. I have to test.

iordan

dancho wrote:

which section of the dial-plan does it go into?

Hi, here
extensions_user.conf

[context-user-800]

exten =>     800,1,Dial(SIP/800,${RINGTIME},rtT)
exten =>     801,1,Dial(SIP/801,${RINGTIME},rtT)
exten =>     803,1,Dial(SIP/803,${RINGTIME},rtT)
include => context-voicemail-record-greeting
include => context-catch-all

[context-user-801]

exten =>     800,1,Dial(SIP/800,${RINGTIME},rtT)
exten =>     801,1,Dial(SIP/801,${RINGTIME},rtT)
exten =>     803,1,Dial(SIP/803,${RINGTIME},rtT)
include => context-voicemail-record-greeting
include => context-catch-all


etc etc

Note that with asterisk 1.8 I get always core segmentation fault error (OK with asterisk 11) and no errors on log sad

(Last edited by Crazy on 9 Feb 2014, 10:24)

dancho wrote:

I haven't yet ported the pbx interface to asterisk11.

OK. I thought asterisk11 and asterisk1.8 are the same. If that is the case, you can include a choice for user to select which asterisk to include.

Jiri and I were looking into whether it would be possible to fit asterisk11 and luci-pbx and all prerequisites onto 8MB, and last time I tried it didn't fit, but now Jiri may have shrunk asterisk11 enough to fit. I have to test.

That will be cool.

Thank you.

Hey everyone,

I've created new test packages which configure asterisk11 rather than 1.8. I need you guys to test out as many aspects of the functionality as possible and give feedback here!

The first important point, please uninstall all asterisk 1.8 packages and the old luci-app-pbx and luci-app-pbx-voicemail packages before installing these, or else you may have problems, and in any case, I'm not responsible wink

A second important point is that I've tested this with OpenWRT Barrier Breaker (available in the snapshots directory), and haven't tested it with Attitude Adjustment (12.09). Feedback is appreciated.

A third important point is that with a clean install of Barrier Breaker snapshot, all of the required packages, and additionally luci-app-qos and luci-app-ddns fit on an 8MB device with 250kb to spare. I can't guarantee what would happen if you've installed other packages (like Asterisk 1.8) previously and have removed them. If you have more than 8MB of space, you're not affected.

The PBX:
http://iiordanov.com/files/pbx/luci-app-pbx-11.ipk

The voicemail package:
http://iiordanov.com/files/pbx/luci-app … ail-11.ipk

Thanks in advance for all the feedback. And one more thing, no this version does not include transfer capability.

(Last edited by dancho on 21 Feb 2014, 00:48)

Thanks, soon begin tests big_smile

dancho wrote:

And one more thing, no this version does not include transfer capability.

Nooo ...
http://images.zaazu.com/img/male19-male-crying-tears-smiley-emoticon-000061-medium.gif

Thanks anyway wink