# Asterisk AMI binds to random port



## goshanecr (Sep 14, 2016)

Hi friends!

I try to research net/asterisk13, and setup it.
I have not change any configs except manager.conf.
In manager.conf I set enabled=yes and add section with user:

```
[admin]
secret=secret
read = system,call,log,verbose,agent,user,config,dtmf,reporting,cdr,dialplan
write = system,call,agent,user,config,command,reporting,originate,message
```
after that I start asterisk service, and check if it listen on AMI port:
`netstat -an | grep LISTEN`, but it is not listen on port 5038, it listen on port 

```
tcp4       0      0 10.10.10.4.25190       *.*                    LISTEN
```
Why I think that 25190 is AMI port? Because I check that with telnet:
`telnet 10.10.10.4 25190`

```
Trying 10.10.10.4...
Connected to 10.10.10.4.
Escape character is '^]'.
Asterisk Call Manager/1.3
```
And I can authorize in telnet session with credentials from manager.conf

One interesting moment is when I restart asterisk service, AMI port which it listen on are randomly changed! Every restart of service.

I add bug report on asterisk bugzilla: https://issues.asterisk.org/jira/browse/ASTERISK-26357
I check that on 2 setups. One on FreeBSD 11-STABLE amd64 and on jailed 10.3-STABLE amd64
Also I trying to install net/asterisk11, it has that problem too.

What's wrong with asterisk?


----------



## Juha Nurmela (Sep 14, 2016)

Perhaps
	
	



```
[general]
  enabled = yes
  port = 5038
  bindaddr = 0.0.0.0
  webenabled = no
```
Juha


----------



## goshanecr (Sep 14, 2016)

Juha Nurmela said:


> Perhaps
> 
> 
> 
> ...


Sorry for my non complete info. Of course I have that section in my config. And I'm trying and 0.0.0.0 and 127.0.0.1 and other addresses from local interfaces.
My complete manager.conf

```
[general]
enabled = yes
webenabled= no

port=5038
bindaddr=0.0.0.0

[admin]
secret = secret
read = system,call,log,verbose,agent,user,config,dtmf,reporting,cdr,dialplan
write = system,call,agent,user,config,command,reporting,originate,message
```


----------



## Juha Nurmela (Sep 14, 2016)

I just jumped in when a quick google showed a recent (?) *port* vs *portno* change.

Juha


----------



## goshanecr (Sep 14, 2016)

Juha Nurmela said:


> I just jumped in when a quick google showed a recent (?) *port* vs *portno* change.Juha


No, it does not helps. I'm try all variants:

```
port = 5038
portno = 5038
bindaddr = 0.0.0.0:5038
```
None of these works


----------



## goshanecr (Sep 17, 2016)

I found what causes that problem.
/etc/src.conf

```
WITHOUT_INET6=yes
```
That option and world rebuilded/installed with it gives such abnormal effect.


----------

