[asterisk-dev] C Code to connect to Asterisk Manager
Soumya Kat
myth.war.mage at gmail.com
Mon Mar 3 00:03:43 CST 2008
Russell Bryant wrote:
>
> connect(sd,(struct sockaddr *) &serveraddr, sizeof(serveraddr));
>
> strcpy(msg,"Action: Login\r\nUsername: admin\r\nSecret: admin\r\n\r\n");
> send(sd,msg,strlen(msg)+1,0);
>>
>>... this is. Take off the "+1" here and in your next call to send().
>>
>>Be sure to try to understand why these changes have been necessary and
don't
>>just make them. :)
Thank you so much. Not only the code is working correctly now, I now
understand the portion of the code that did not work and also why it did not
work.
Thank you again for helping me out and also making we aware of coding
correctly. :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20080303/7c0e5eae/attachment.htm
More information about the asterisk-dev
mailing list