     # 转移客服接口
     transfer: ->
       @send message "<MsgType><![CDATA[transfer_customer_service]]></MsgType>"
+
+    # 响应设备发来的消息
+    device: (content) ->
+      content = base64.encode(content)
+      
+      @send message "<MsgType><![CDATA[device_text]]></MsgType>
+        <DeviceType><![CDATA[#{req.device_type}]]></DeviceType>
+        <DeviceID><![CDATA[#{req.device_id}]]></DeviceID>
+        <SessionID><![CDATA[#{req.session_id}]]></SessionID>
+        <Content><![CDATA[#{content}]]></Content>"
 
     # 不发送任何消息，仅响应`200`。
     ok: -> @status(200).end()

xml2js     = require 'xml2js'
express    = require 'express'
async      = require 'async'

# ### 接口地址
#

    # ### 注册链接处理句柄
    link: (@link_handlers...) => @

    # ### 注册设备消息处理句柄
    device: (@device_text_handlers...) => @

    # ### 注册关注与取消关注处理句柄
    subscribe   :   (@subscribe_handlers...) => @
    unsubscribe : (@unsubscribe_handlers...) => @
