google_talk_sms pidgin plugin

Download google_talk_sms.pl 0.2
   (requires Pidgin 2.5.2 or above)
Pidgin web site
   About Pidgin plugins
Google Talk web site
   About Google Talk SMS

google_talk_sms.pl is a plugin for Pidgin that allows it to use Google Talk‘s SMS text messaging feature, which is otherwise restricted to the official clients.

Note: If you’re on Ubuntu Lucid, its Pidgin 2.6.6 package has a bug that breaks most Perl plugins, including this one. It should be fixed in the next Pidgin release.

I originally used AIM’s SMS support to send text messages to my friends from my computer. It worked, and my friends could reply to my texts, but the phone numbers it used were only temporary. My friends couldn’t initiate conversations with me via SMS; I had to text them first.

When Google Talk added SMS support, it included a killer feature: dedicated phone numbers. It didn’t give me a unique phone number for receiving texts via IM, but it did remember which phone numbers it had used for each of my friends, so they could text that number whenever they wanted. If I was online, I’d get the text immediately, as an IM. If I was offline, I’d get it when I logged.

I loved this, so I immediately switched to Google Talk for SMSes. Sadly, other people did too, and since each SMS costs money, Google decided to restrict the feature to official clients. Other clients received the error message “SMS_ERROR_11: Sorry we don’t support free SMS messaging through this client. Visit http://gmail.com/sms for more info. (Code 405)”

The restriction is fairly simple, though. The Google Talk servers simply look for sms-v1 or sms-v1 in the ext attribute of caps:c (the XEP-0115 Capabilities extension) in the presence stanza that the client sends to the server. google_talk_sms.pl simply adds this.

Here’s an example presence stanza sent by the Google Talk web-based client:

<presence from="xxx@gmail.com to="yyy@gmail.com">
  <priority>0</priority>
  ...
  <caps:c node="http://mail.google.com/xmpp/client/caps"
          ver="1.1"
          ext="pmuc-v1 sms-v1 vavinvite-v1"
          xmlns:caps="http://jabber.org/protocol/caps"/>
   ...
 </presence>

Note the sms-v1. Here’s a similar presence stanza generated by Pidgin and annotated by google_talk_sms.pl before being sent to the Google Talk servers:

<presence>
  <priority>1</priority>
  <c xmlns='http://jabber.org/protocol/caps'
     node='http://pidgin.im/caps'
     ver='2.5.2'
     ext='moodn nickn tunen bob avatar sms-v1 sms-v2' />
</presence>

Happy texting!

60 Comments

  1. Ryan
    5/15/2009 #

    I love this idea, I just don’t know how to add my SMS contacts to Pidgin.  I’ve tried adding XXX-XXX-XXXX and XXX-XXX-XXXX@gmail.com but neither of those seem to be working.

    Do you know the format for adding numbers you’d like to send SMS messages?

  2. 5/15/2009 #

    good question! yeah, this confused me at first too. the format is +1XXXXXXXXXX@sms.talk.google.com, where XXXXXXXXXX is the area code and phone number.

  3. Ryan
    5/16/2009 #

    THANK YOU!! So much… I’ve been using Google SMS and Pidgin for a while, but integration is what Pidgin is all about.  Your solution seems to be working great for me.

  4. DOH!
    5/19/2009 #

    Well seems Google got wind of your fix and now it is blocked. Just tried it today (dropped the .pl to the plugins), read my Gtalk SMS number I already had saved, but as soon as I tried to send : same blocking notice as you said.

  5. 5/19/2009 #

    hmm. silly question, but did you enable the plugin in the Tools -> Plugins window?

  6. Daniel
    6/7/2009 #

    Works for me, except the contact that I’ve added is always considered Offline, and “Not Authorized”.  Is there anyway to get the contact to appear online?

  7. 6/7/2009 #

    sorry, no, that’s an inherent limitation of google talk’s sms implementation. they support sending and receiving messages, but not presence.

  8. AishaLove
    6/8/2009 #

    I’m using pidgin  portable 2.5.5 and when I plop the .pl into my plugins folder it won’t show in the plugins list,  all my other plugins are in .dll format.

    I’m on vista

  9. Ro
    6/19/2009 #

    Like the above, I put the .pl in the plugins and it wouldnt show up in plugins list. All other plugins are .dll, what’s goin on here

  10. 6/19/2009 #

    aishalove, ro, it sounds like you’re both on windows. unfortunately, i’ve only tested on linux, not windows or mac.

    i’m guessing the windows version of pidgin doesn’t support perl plugins? or maybe you have to do something extra? i’m not sure.

    ah, the docs say you need ActivePerl installed. try that?

  11. Ryan
    6/20/2009 #

    I’ll confirm it works on Windows.  Just have to install ActivePerl (x86, not x64) as ryan said.

  12. Ro
    6/21/2009 #

    Thanks Ryan, merely installing ActivePerl is all it takes guys. I kept thinking I had to use that program to convert the pl to a dll or something, but then checked the plugins list and there it was!

  13. AishaLove
    6/21/2009 #

    thanks allot, I’m  sure that is what II needed, I was unaware that the .pl extension meant “pearl” thought it stood for “plugin”

  14. AishaLove
    6/21/2009 #

    Well seems google changed their authentication for SMS or I’m  jus unlucky, because this won’t work even after enabling the plugin. and adding the contact correctly.

  15. 6/22/2009 #

    aishalove, I’m still using it and it works perfectly fine. Perhaps you didn’t input the contacts in the correct format “+1XXXXXXXXXX@sms.talk.google.com”.

    Now for the rest of you, an easy way to streamline the contacts into the buddylist is to put all your sms contacts into one group, and then right click the group and select “Show when Offline”. That way all the contacts in the group shows up (since there’s no presence detection and they would always be shown as offline).

  16. AishaLove
    6/23/2009 #

    Rechecking the number did it, I had 2 number wrong

  17. koko
    7/1/2009 #

    Does this work outside of US?

  18. 7/1/2009 #

    @koko, i expect it does, but i don’t know for sure. are you outside the US? does it work for you?

  19. koko
    7/5/2009 #

    Yes, I am outside of US and I’m receiving this error

    “Message delivery to +160169999999@sms.talk.google.com failed: SMS_ERROR_3: invalid mobile number +160169999999 (Code 400)”

    What would be my mistake?

  20. 7/10/2009 #

    Well straight from google they said their SMS is US Only.

  21. iconoclast
    7/15/2009 #

    its not working for me. I always get the error…

    XMPP Message Error
    Message delivery to +17773334444@sms.talk.google.com failed: SMS_ERROR_11: Sorry we don’t support free SMS messaging through this client. Visit http://gmail.com/sms for more info. (Code 405)

    perhaps I’ve configured it incorrectly? I only enabled the plugin and added a contact/cell# buddy for google talk

  22. thenktor
    7/16/2009 #

    Hi, same error for me:

    Nachrichtenzustellung an +19146613XYZ@sms.talk.google.com fehlgeschlagen: SMS_ERROR_11: Sorry we don’t support free SMS messaging through this client. Visit http://gmail.com/sms for more info. (Code 405)

    (means message delivery failed)

    PS: I’m living in Germany and want to write SMS to a mobile phone number in New York.

  23. koko
    7/16/2009 #

    I knew that the SMS feature was for US only, I just wanted to know if anyone was able to get it working outside the US since I’m able to receive SMS notification from Google’s Calendar. Anyway thanks for the explanation though :)

  24. Ryan
    7/17/2009 #

    Interesting… Google Chat doesn’t allow sending a SMS to a Google Voice number in this manner.  Perhaps GV will open up APIs to allow sending SMS via your associated GV account/number?

    Regardless, I love the work you’ve done ryan.

  25. thenktor
    7/19/2009 #

    no error messages any more. let’s see if the messages have been transfered :-)

  26. Drew
    7/26/2009 #

    Thenktor — I just installed the plug-in and got the same Code 405 error.  Did you do something to fix it?

    Also, apparently when I add a new number to my buddy list (but before I actually try to send an SMS) the phone will receive a message saying “<my_name>@gmail.com sent you a text message…”.  There is no way to read the message, so I don’t know what it might be.  Then if I actually try to send an SMS to the new “buddy”, I get the error message and nothing is sent.

  27. thenktor
    7/27/2009 #

    I did not change anything, but it only worked2 or 3 times. Now I’m getting this error:

    SMS_ERROR_1: Free messages to mobile number +1914661xxxx reached limit. (Code 500)

  28. 7/29/2009 #

    I am using linux, dropped the .pl file in the plugins folder (which I created) in ~/.purple and it is not showing up in pidgin’s plugins list… I have v2.5.5 installed… is it too old or something?

  29. 7/29/2009 #

    I am using linux, dropped the .pl file in the plugins folder (which I created) in ~/.purple and it is not showing up in pidgin’s plugins list… I have v2.5.5 installed… is it too old or something?

  30. 7/29/2009 #

    I am using linux, dropped the .pl file in the plugins folder (which I created) in ~/.purple and it is not showing up in pidgin’s plugins list… I have v2.5.5 installed… is it too old or something?

  31. 7/29/2009 #

    not sure why it posted my message multiple times… sorry for the unintentional spam…

  32. Denis
    7/30/2009 #

    This is awesome. Thank you I hated having gmail up to get sms’s I’d always miss them.  To people having issues on windows here’s one thing that fixed it for me I think.  After downloading activeperl and saving the script in the right dir I got the error message about not being a valid client even though I had restarted pidgin and enabled the plugin.  I edited the script and saw that it had unix style cr/lf which show up as [] I deleted them and replaced them with returns in wordpad and saved it.  Restarted pidgin and the sms went through.

    Again.  Very cool.  Thanks.

  33. KevDog
    8/15/2009 #

    I would just like to reiterate that for anyone using windows, you either need to modify the google_talk_sms.pl file and replace the squares with carriage returns, or simply replace the contents with the following (I’ve modified the file below):

    !/usr/bin/perl -w


    File: google_talk_sms.pl

    Author: Ryan Barrett <pidgin@ryanb.org>


    This is a Perl plugin for Pidgin that works around Google Talk’s

    restriction of its SMS feature to official clients by by reporting that

    Pidgin supports the ‘sms-v1′ XMPP capabilities (XEP-0115) extension.


    Details in http://snarfed.org/space/google_talk_sms+pidgin+plugin


    Thanks to Michael Braun’s Perl plugin for XEP-0027 (encryption), which

    provided a great example of how to use pidgin’s xmlnode data structure in

    Perl: https://www.zuhauseall.homeip.net/~michael/pidgin-xep0027/


    use strict;
    use Purple;

    our %PLUGIN_INFO = (
      perl_api_version => 2,
      name => “Google Talk SMS”,
      version => “0.1″,
      summary => “Enables Google Talk’s SMS feature, which is normally restricted to official clients.”,
      description => “Works around Google Talk’s restriction of its SMS feature to official clients by reporting that Pidgin supports the ‘sms-v1′ XMPP capabilities (XEP-0115) extension.”,
      author => “Ryan Barrett <pidgin\@ryanb.org>”,
      url => “http://snarfed.org/space/google_talk_sms+pidgin+plugin”,
      load => “plugin_load”,
      unload => “plugin_unload”
    );

    sub plugin_init {
      return %PLUGIN_INFO;
    }

    sub plugin_load {
      my $plugin = shift;
      my $jabber = Purple::Find::prpl(“prpl-jabber”);
      Purple::Signal::connect($jabber, “jabber-sending-xmlnode”, $plugin,
      \&jabber_sending_xmlnode_cb, “unused userdata”);
    }

    sub plugin_unload {
      my $plugin = shift;
    }

    sub jabber_sending_xmlnode_cb {
      my ($connection, $xmlnode, $userdata) = @;

      my $c = $xmlnode->get_child(“c”);
      if (not defined($c)) {
      return;
      }

      my $ext = $c->get_attrib(“ext”);
      if (not defined($c)) {
      $ext = “”;
      }
      $c->set_attrib(“ext”, $ext . ” sms-v1″);

      $
    [1] = $xmlnode;
    }

  34. KevDog
    8/15/2009 #

    Its actually too bad that ActivePerl is required because this then doesn’t make this app truly portable that you could run from a USB drive — or is there another way for a work-around to make this a portable app?

  35. thatguy
    8/26/2009 #

    “Its actually too bad that ActivePerl is required because this then doesn’t make this app truly portable that you could run from a USB drive — or is there another way for a work-around to make this a portable app?”

    This is exactly what I came in here to say.  Is there a way to convert the .PL into the required .DLL file?  Excuse my programming ignorance if this is not possible.  I tried to google a way to do this but couldn’t find much.

    I really want to get this running on my USB portable pidgin install without needing to install activeperl.

    Any help would be greatly appreciated.

  36. thatguy
    8/26/2009 #

    “Its actually too bad that ActivePerl is required because this then doesn’t make this app truly portable that you could run from a USB drive — or is there another way for a work-around to make this a portable app?”

    This is exactly what I came in here to say.  Is there a way to convert the .PL into the required .DLL file?  Excuse my programming ignorance if this is not possible.  I tried to google a way to do this but couldn’t find much.

    I really want to get this running on my USB portable pidgin install without needing to install activeperl.

    Any help would be greatly appreciated.

  37. thatguy
    8/26/2009 #

    I definitely didn’t post that twice, I swear I’m not that dumb.

  38. Dave
    8/27/2009 #

    Um, what great deal is this plugin if people can’t reply back to you through SMS?

  39. Ryan
    8/28/2009 #

    Dave, they can.

  40. Ryan Hayle
    10/7/2009 #

    This little plugin works great, thanks!  I just hope Google will give us proper Google Voice integration soon!

  41. aerosmith
    10/19/2009 #

    just curious if this plugin is still working. I tried to use it and I get the error mesage: Message delivery to <myNumber>@sms.talk.google.com failed: SMS_ERROR_4: Mobile carrier of <myNumber> is not supported. (Code 503). Any help is really appreciated.

  42. Daniel
    12/4/2009 #

    works for me.

  43. Greg
    12/14/2009 #

    I installed this and tried it and got the message that Google was not supporting sms through this client. What are people who have it working doing differently?

  44. varun
    12/20/2009 #

    how to install this plugin?

  45. KingMooCow
    1/14/2010 #

    I got this all installed and working perfectly on Windows 7, using 2.5.8.  Had to install ActivePerl, and replace the text i nthe file with the format that KevDog posted above. Dropped the modified file in the plugin directory, restarted Pidgen, and it was there!

    But – I have a question:  All my SMS’s have a signature  “-myaddress@gmail.com” taking up a whole bunch of SMS characters…  How can I cut those out?

  46. Saad
    2/4/2010 #

    I’m getting the error now with the plugin installed:
    SMS_ERROR_11: Sorry we don’t support free SMS messaging through this client. Visit http://gmail.com/sms for more info. (Code 405)”

  47. Ivan
    2/11/2010 #

    Also getting the error now =( Time to fire up fiddler =D

  48. Ivan
    2/11/2010 #

    Ok here’s a fix. Change this line in the perl file:

    $c->set_attrib(“ext”, $ext . ” sms-v1″);

    to


    ” Edit: Ivan Shevanski 2/12/2010 sms- v1 -> sms-v2
    $c->set_attrib(“ext”, $ext . ” sms-v2″);


    Works perfectly for me. Thanks for writing the plugin!

  49. 2/12/2010 #

    @Ivan, hmm, interesting. it works for me with sms-v1, but actually gives me that error message with sms-v2, ie with the edit you mentioned.

    funny. i wonder if there’s something different between our accounts.

  50. Ivan
    2/12/2010 #

    That is interesting. You could always just append both of them, since it doesn’t seem like google cares about the other arguments. Try using ” sms-v1 sms-v2″. It works for me anyway, how about you give it a try?

  51. 2/13/2010 #

    good point! that does work, so i’ve updated the plugin. thanks!

  52. Ivan
    2/20/2010 #

    No problem. Glad I could help out.

  53. manny
    3/1/2010 #

    Ryan, first of all, thanks for this awesome plugin. But, are you aware that Pidgin version 2.6.6 broke it? Thanks.

  54. MMA
    3/3/2010 #

    Yep. I’m in the same boat as manny. Running Ubuntu-Linux (Lucid).

  55. no1here
    3/4/2010 #

    ditto manny & MMA.  Also on Ubuntu, though old (8.10), and Pidgin 2.6.6.  Given the change log for 2.6.6 I’d just roll back to 2.6.5 if it was still in the PPA repository (or I knew how to roll it back some other way!).

    Thanks for the plug-in, Ryan!

  56. Lord Nurgle
    3/4/2010 #

    So, I’ve did everything listed above, but still can’t get it to work. I don’t get an error message or anything, Pidgin just crashes.

    I have ActivePerl x86
    I have the Plugin installed in the proper directory.
    I have my gmail account enabled and working properly.
    I’m running Windows 7 x64.

    I don’t know what the issue is, but everytime I put the plugin into the directory and load Pidgin, Pidgin crashes. I remove the plugin from the directory and Pidgin runs fine. Has things changed or something?

  57. Lord Nurgle
    3/4/2010 #

    Hey, I fixed it. Rolled back to an older version of Pidgin. Apparently 2.6.6 borks everything.

  58. 4/4/2010 #

    just wanted to say thank you.  thank you.  thank you.  all you brilliant anonymous people – ryan barrett, kevdog – who know how to do this and then post it out there for the rest of us.  thank you!

  59. 0160
    4/20/2010 #

    RUNNING UBUNTU 9.10 Pidgin 2.6.6
    (libpurple 2.6.6)
    PLUGIN FAILS – caused pidgin to crash upon startup.

    any chance this will be fixed any time soon? its a great concept but unfortunately it isnt working now.

    would it be easier to just edit the pidgin source and recompile?

    thanks to dev and those who contributed feedback!

    currently only aim/aol is successfully delivering my sms’s.

  60. 5/22/2010 #

    I have it working on XP service pack 3. I did have to install active perl as mentioned above. The curious matter was that the plugin got stuck and would not succeed in sending and receiving texts without changing the edited line from above to $c->set_attrib(“ext”, $ext . ” sms-v1″);
    once i changed it, it worked fine and still does
    Thanks for the marvelous plugin.

Post a Comment

Post a comment...

Your email is never published nor shared.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


  • home
    about
    pictures
    software
    index
    feed