From: Tri S. <tr...@us...> - 2011-03-10 08:23:27
|
libyahoo2 doesn't implement SMS yet, so you can't just set the recipient to some mobile phone number. To implement it yourself, you first need to validate the phone number (msidn) against validate.msg.yahoo.com and retrieve the correct carrier given, and then use the number and carrier to construct YMSG packet to send. As for id returned by yahoo_init, it actually is just an incremented reference count of constructed yahoo_datas, so the first init will always got 1 returned. Cheers, Tri S. On Wed, Mar 9, 2011 at 5:16 AM, pcb Eng <sys...@ya...> wrote: > > On a normal Yahoo Messenger Program that comes with the Window, I logged in, and trying to send a SMS messenge. I inputed my phone number as the receipient. I typed a brief messenge and hit send. > Voila , my phone got an messenge which is the SMS I sent through Yahoo Messenger. > So, I figure the code of libyahoo should able to do the same. > However, by using the libyahoo, I couldn't send the same SMS to my phone. what's wrong? > > I put in some generic name and phone number to cover my real ones. > Is the following sequence correct? > > > > 1)result_id I getting always =1, is that OK? > thanks for any feedback. > > register_callbacks(); > > int result_id; > > const char *username="joe"; > > const char *password="doe"; > > //int yahoo_init(const char *username, const char *password) > > result_id=yahoo_init(username, password); > > //void yahoo_login(int id, int initial) > > yahoo_login(result_id, YAHOO_STATUS_AVAILABLE); > > > > / > > const char *from="john"; > > const char *who="0123456789"; > > const char *what="hello there"; > > int utf8=1; > > int pic=1; > > //void yahoo_send_im(int id, const char *from, const char *who, const char *what, > > //int utf8, int picture) > > yahoo_send_im(result_id, from, who, what, utf8, pic); > > |