AMI manager connection

hello all,

I try connect in my manager 2.7.0 but all time appears these massege Connection closed by foreign host

My configuration iis

[admin]
secret = 123456789
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.255
read=all
write=all

same one can help me

Regards

verify services running

netstat -apn | grep asterisk

also verify the iptables

iptables -L -n

Hi,

netstat -apn | grep asterisk
tcp 0 0 0.0.0.0:5038 0.0.0.0:* LISTEN 8247/asterisk
tcp 0 0 0.0.0.0:2000 0.0.0.0:* LISTEN 8247/asterisk
udp 0 0 0.0.0.0:4520 0.0.0.0:* 8247/asterisk
udp 0 0 0.0.0.0:4569 0.0.0.0:* 8247/asterisk
udp 0 0 0.0.0.0:49898 0.0.0.0:* 8247/asterisk
udp 0 0 0.0.0.0:5000 0.0.0.0:* 8247/asterisk
udp 0 0 0.0.0.0:5060 0.0.0.0:* 8247/asterisk
udp 0 0 0.0.0.0:45098 0.0.0.0:* 8247/asterisk
unix 2 [ ACC ] STREAM LISTENING 226330 8247/asterisk /var/run/asterisk/asterisk.ctl

iptables open tcp 5038

but still same message

Regards,

asterisk it is listening on port 5038, so I assume AMI service is running but just in case check your general settings for manager.conf

[general]
enabled = yes

also try to test the AMI connection directly on the Asterisk machine using loopback address, so in that way you will know if is network connection issue

You can test connectivity to the AMI using the ‘telnet’ command. For example:

| you type              | you see                                 |
|-----------------------+-----------------------------------------|
| telnet localhost 5038 |                                         |
|                       | Trying 127.0.0.1...                     |
|                       | Connected to localhost.                 |
|                       | Escape character is '^]'.               |
|                       | Asterisk Call Manager/2.9.0             |
| action: login         |                                         |
| username: test        |                                         |
| secret: secret        |                                         |
| (Press <RETURN> twice |                                         |
|                       | Response: Success                       |
|                       | Message: Authentication accepted        |
|                       | Event: FullyBooted                      |
|                       | Privilege: system,all                   |
|                       | Status: Fully Booted                    |
|                       |                                         |
|                       | Event: SuccessfulAuth                   |
|                       | Privilege: security,all                 |
|                       | EventTV: 2018-09-25T19:45:02.145-0700   |
|                       | Severity: Informational                 |
|                       | Service: AMI                            |
|                       | EventVersion: 1                         |
|                       | AccountID: test                         |
|                       | SessionID: 0x73f036f0                   |
|                       | LocalAddress: IPV4/TCP/127.0.0.1/5038   |
|                       | RemoteAddress: IPV4/TCP/127.0.0.1/46928 |
|                       | UsingPassword: 0                        |
|                       | SessionTV: 2018-09-25T19:45:02.145-0700 |
| ^]quit                |                                         |

Where 'test' is the name of the section in manager.conf (or one of
it's includes), 'secret' is the respective secret and '^]' is pressing
down the right square bracket key while holding down the CTRL key.

1 Like

Hi
i use command in my asterisk telnet ip 5038
after i do Action: login
Username: admin ( i creat these user
Secret: 123456789
enter two times
but all time appears these information Response: Error
Message: Authentication failed

Connection closed by foreign host.
Regards,

Hi
already make login

Tank you for your atencion

Regards,

Can you share the cause with us? Thanks.

Hello
Creat a user in manager.conf
like these -

[admin]
secret = 123456789
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.255
displayconnects=yes
read=all
write=all

in you terminal use command telnet 127.0.0.1 5038 enter
action: login
username: admin
secret:123456789
2x enter for login
afther
action: logoff 2x enter for exit

:fu: