Asterisk lets you interact with it through a simple text-baed TCP interface called Asterisk Manager Interface (AMI), designed much like SMTP. This page shows how you can use it to send Jabber/XMPP/Hangouts messages. It is assumed that you have already configured Asterisk with chan_motif and you already have a live Hangouts channel. You also have to have enabled Manager in manager.conf.
This is based on “ManagerAction_JabberSend – Asterisk Project – Asterisk Project Wiki,” but the real key is in the comment of the page; in the official documents everywhere, they say you need to use “JID:” to designate the target JID, but it actually has to be “Screenname:“. This page is for Asterisk 1.8, but the record of a session with AMI below was taken on an OpenWrt box running Asterisk 1.1.
Boldface denotes that that part was the output from Asterisk Call Manager.
root@OpenWrt:/etc/asterisk# telnet localhost 5038 Asterisk Call Manager/1.3 Action: Login Username: admin Secret: blah blah blah Response: Success Message: Authentication accepted Event: FullyBooted Privilege: system,all Status: Fully Booted Action: JabberSend Jabber: channel name you defined in xmpp.conf Screenname: email@example.com Message: Hello! Response: Success Message: Attempting to send Jabber Message Response: Success