Asterisk on Mikrotik

  • Tutorial
image

Wondered about raising voip on mikrotik. Who remembers that in older versions of routeros there was a module for voip, then they sawed it out, which is a pity. Raising the asterisk natively on routeros will not work, however, it is possible to raise the virtual router with openwrt in metarouter mode, and here we will proceed.

A long search led me to openwrt.wk.cz (available only via ipv6), from where the openwrt image for mt-mips was downloaded. All experiments were conducted at 2011UAS-2HnD. Since not everyone has ipv6, I made a mirror for installing packages from it ( ms1.nserver.us/openwrt.wk.cz .), Where the necessary packages are. By the way, during the searches, it was not possible to find a full-fledged article on this topic, not only in Russian, but also in any other.



So, download the image for mips (openwrt-mr-mips-rootfs.tar.gz ) or for ppc ( openwrt-mr-ppc-rootfs.tar.gz ). Fill the image into our Mikrotik, in Files, go to MetaROUTER and import the image. I allocated 48 meters of memory and 24 meters of hdd, yes ... yes ... do not be surprised ... the asterisk will work on such hardware, checked, created trunks and made calls without problems.



We add the interface to the virtual router, it is easiest to create a dynamic one and add it to your local bridge. It looks like this for me:



in the preinstalled image, the network interface is configured to receive network parameters via dhcp, and if everything is okay in your LAN, then the virtual router will get a network address, if not, edit the / etc / config / file network and restart the network. Next, go to the console:



change the password to root, and see what address is received. All subsequent actions are best done by connecting via ssh.

connecting via ssh, the first thing we do is edit /etc/opkg.conf, bringing it to the following view for mips:


next:

opkg update
opkg install asterisk18 asterisk18-codec-alaw asterisk18-chan-iax2 asterisk-gui
/etc/init.d/asterisk enable


edit /etc/asterisk/manager.conf, change the password for admin on the panel and start the asterisk

/etc/init.d/asterisk start


that's all, now you can go to the address of the metarouter : 8088 / and configure the asterisk through the GUI. There are codecs alaw, ulaw, gsm. if you need to add codecs, look at the list of existing packages and install the necessary one through opkg. There are a decent number of ready-made packages for 1.8 asterisk, up to chan_dahdi. For home use, it can work reasonably well.



Everything was done as an experiment, although in principle, it can work for the house, and you can not set the GUI for an asterisk.

PS: I perfectly understand that this is a perversion, but I wanted to share such an experiment.

UPD: I know about the wiki on the mikrotik website that you can compile the image yourself and compile the packages, I started to implement the plan from it, but it's hardcore (IMHO), if there is a ready-made solution with ready-made packages. And yes, with the ready-made image downloaded from the link from the native wiki, the asterisk did not start up so normally, and a bunch of packages for voip are missing there. I also tried ready-made images from other sources, focused on the above, for the simple reason that everything started up without a tambourine, “out of the box”, so to speak.

Also popular now: