Sending Jabber/XMPP/Hangouts Messages from Asterisk Using AMI

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: blahblah@gmail.com
Message: Hello!

Response: Success
Message: Attempting to send Jabber Message

Response: Success
広告

コメントを残す

以下に詳細を記入するか、アイコンをクリックしてログインしてください。

WordPress.com ロゴ

WordPress.com アカウントを使ってコメントしています。 ログアウト / 変更 )

Twitter 画像

Twitter アカウントを使ってコメントしています。 ログアウト / 変更 )

Facebook の写真

Facebook アカウントを使ってコメントしています。 ログアウト / 変更 )

Google+ フォト

Google+ アカウントを使ってコメントしています。 ログアウト / 変更 )

%s と連携中