Cannot Execute AMI Tags with telnet on Asterisk 18/20


I am trying to connect to Asterisk AMI through telnet to execute AMI tags.

I can successfully conect to AMI Call Manager through telnet. But, whenever i try to excute
the Tags (Ex., Action: Login) after some time the Telnet Session will terminate with the message
“Connection closed by foreign host.” attached is the screenshot.I am connecting to AMI using
telnet on localhost.

My manager.conf file and http.conf are very simple as below.

enabled = yes
webenabled = yes
bindaddr =


enabled = yes
bindaddr =

I also modified the manager.conf and http.conf following the suggetion mentioned in the following thread but the result are the same. Every time i exceute the tags telnet throughs “Connection closed by foreign host.”

However, AMI works fine with HTTP Connection. But, i need to connect to AMI through TCP as i need this feature for performing conference with AMI using ConfBridge.

Looking forward for possible solution and suggestions.

Thanks & Regards,

You haven’t logged in. You need a blank line after the lines for an action.


Thank you so much for the timely response. After adding a blank line after the lines for an action,
i am able to login successfully and execute AMI tags.

Thanks again,

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.