[Asterisk-Users] Problem with Action:Originate with ASterisk Manager

Tzafrir Cohen tzafrir at cohens.org.il
Tue Jan 10 03:12:43 MST 2006


On Mon, Jan 09, 2006 at 11:10:59PM -0800, Somesh S Shanbhag wrote:
>  Hi Asterisk-users,
>  
>  I am working with Aterisk Manager API's.
>  I can login successfuly with the following.
>  
>  char buff[256];
>  strcpy(buff, "Action: Login\r\nUsername: admin\r\nSecret: unix\r\n\r\n");
>  send(msock, buff, 255);

You can save yourself a bounch of troubles by using:

telnet localhost 5038

and type that. You'll be able to see whatever is returned.

Or, alternatively, create a text file, and:

cat text_file | nc localhost 5038

Or pipe in the output of a simple shell script

Or maybe even:

cat text_file > /dev/tcp/localhost/5038

(this fake device is "generated" by bash. Debian turns this feature off
in the package bash)

And as a rule of thumb: no need to do in C whatever you could easily do
in the shell.

You can also file unix2dos handy .

-- 
Tzafrir Cohen         | tzafrir at jbr.cohens.org.il | VIM is
http://tzafrir.org.il |                           | a Mutt's  
tzafrir at cohens.org.il |                           |  best
ICQ# 16849755         |                           | friend




More information about the asterisk-users mailing list