# Certified Asterisk installation failed



## Yandri Loor (Nov 29, 2020)

hi i am trying to install Certified Asterisk 16 - LTS but i have a crypt_r error



```
ld: error: undefined symbol: crypt_r

>>> referenced by crypt.c:124

>>>               crypt.o:(ast_crypt)

>>> referenced by crypt.c:139

>>>               crypt.o:(ast_crypt_validate)

>>> referenced by crypt.c:124

>>>               crypt.o:(ast_crypt_encrypt)

c++: error: linker command failed with exit code 1 (use -v to see invocation)

gmake[2]: *** [Makefile:320: asterisk] Error 1

gmake[1]: *** [Makefile:383: main] Error 2
```


----------



## richardtoohey2 (Nov 29, 2020)

How are you trying to install it?  What commands are you using?


----------



## Yandri Loor (Nov 29, 2020)

richardtoohey2 said:


> How are you trying to install it?  What commands are you using?


1. I downloaded the source code
2. I did the ./configure
3. make (here comes that error)


----------



## Phishfry (Nov 29, 2020)

You need to use the FreeBSD ports & package system for our specific patches.
net/asterisk18
The older port
net/asterisk16


----------



## Yandri Loor (Nov 29, 2020)

Phishfry said:


> You need to use the FreeBSD ports & package system for our specific patches.
> net/asterisk18
> The older port
> net/asterisk16


or if you want more detailed:
1. I downloaded the source code from http://downloads.asterisk.org/pub/t...terisk/asterisk-certified-16.8-current.tar.gz


			http://downloads.asterisk.org/pub/telephony/certified-asterisk/asterisk-certified-16.8-current.tar.gz
		


```
wget http://downloads.asterisk.org/pub/telephony/certified-asterisk/asterisk-certified-16.8-current.tar.gz
```
2. unzipped the tar file

```
tar xvf asterisk-certified-16.8-current.tar.gz
```
3. installed the dependencies

```
cd asterisk-certified-16.8-cert5
cd contrib/scripts
./install-prereq test
```
3.1 I built each of the dependencies from the ports tree
4. I configured Asterisk

```
cd ../..
./configure
```
5. I tried to build and there the error came up


----------



## Phishfry (Nov 30, 2020)

Please look at the official Git repository for asterick








						asterisk/asterisk
					

Mirror of the official Asterisk (https://www.asterisk.org) Project repository. No pull requests here please.  Use Gerrit: - asterisk/asterisk




					github.com
				



Notice how it says:
SUPPORTED OPERATING SYSTEMS​Linux​
So you are trying to compile Linux based code on FreeBSD.
That requires patches.
So you need to run the FreeBSD port/package system.
It has patches applied for this to build.

Easy way to do this is `pkg install asterisk18`

I don't know what Certified Asterisk means. For FreeBSD you are best off using our ports and packages.
Building from ports if you want but it is a harder operation.

You may also look at the Asterisk18 patches by browsing the ports directory: /usr/ports/net/asterisk18/files
With the patches manually applied from this directory you could build from Asterisk supplied source code.

Here is a good video with instructions for installing via packages.


----------



## richardtoohey2 (Nov 30, 2020)

Phishfry said:


> Easy way to do this is `pkg install asterick18`


s/rick18/risk18


----------



## sidetone (Nov 30, 2020)

Chapter 4. Installing Applications: Packages and Ports
					

FreeBSD provides two complementary technologies for installing third-party software: the FreeBSD Ports Collection, for installing from source, and packages, for installing from pre-built binaries




					www.freebsd.org
				




If you still want to build Asterisk:
Use `portsnap` to get the ports collection. Go to /usr/ports/net/asterisk18/, and use `make` commands (including `make config`) from there.

All are according to the instructions in that link. This is the standard way to build it on FreeBSD from source code. It bypasses the trial and error approach from building it from scratch, and includes necessary patches (as someone mentioned above).


----------

