关于电子邮件中Multipart中Voice-Message的理解

--By A.TNG 2006.5.27

From RFC2421
...
关于 Multipart/Voice-Message

Multipart/Voice-Message

   This MIME multipart structure provides a mechanism for packaging a
   voice message into one container that is tagged as VPIM v2 compliant.
   The semantic of multipart/Voice-Message (defined in [V-MSG]) is
   identical to multipart/mixed and may be interpreted as that by
   systems that do not recognize this content-type.

   The Multipart/Voice-Message content-type MUST only contain the
   profiled media and content types specified in this section (i.e.
   audio/*, image/*, message/rfc822 and text/directory).  The most
   common will be: spoken name, spoken subject, the message itself,
   attached fax and directory info.  Forwarded messages are created by
   simply using the message/rfc822 construct.

   Conformant implementations MUST send the multipart/voice-message in a
   VPIM message.  In most cases, this Multipart/Voice-Message content
   will be the top level (i.e. in the Content-Type header).  Conformant
   implementations MUST recognize the Multipart/Voice-Message content
   (whether it is a top level content or below a multipart/mixed) and be
   able to separate the contents (e.g. spoken name or spoken subject).

该 MIME 复合段结构提供了一种打包声音信息的机制,通过这种方法可以把其放入符合 VPIM V2 结构的邮件中。 multipart/Voice-Message (定义在 [V-MSG]中)的含义其实是等同于 multipart/mixed 的,对于不识别子类型为 Voice-Message 的系统,可以把其处理为 Mixed 。

对于段类型为 Multipart/Voice-Message 的段,必须只包含多媒体信息或者类型为 audio/*, image/*, message/rfc822 和 text/directory 的段。通常来说还包含一些其他信息:语音作者、语音主题、语音本身信息体、传真和目录信息,当封装这些信息时必须符合 message/rfc822 格式。

构造 multipart/voice-message 类型段时必须放入符合 VPIM 结构的邮件中,通常来说, Multipart/Voice-Message 类型是作为邮件体类型(邮件头中的 content-type 字段的内容为 Multipart/Voice-Message),客户端必须能够识别 Multipart/Voice-Message 的内容(不论其是作为邮件体类型还是作为 multipart/mixed 中的子段类型),其内容比如能够区分开来。

关于其中的 text/directory
对于 audio/*, image/* 和 message/rfc822肯定都是比较熟悉和常见的,而 text/directory 则比较生疏,我们简单看看 RFC2421 中对 text/directory 的说明。

text/directory 可以看作一种比较通用的格式,可以把 Versit vCard 包含于 VPIM 邮件中,这种格式可以很方便的在各个程序和系统间进行格式转换。 vCart 必须包含于 content-type 为 text/directory 的段中, charset 必须作为其中的一个参数(例如 charset=ascii)。关于 vCard 所包含的信息中应该有: 邮箱地址、电话号码、 vCard 版本号等
vCard 至少包含以下信息:电话号码 TEL 、邮箱地址 EMAIL 、版本号 VERSION
vCard 可以包含以下信息:姓名 N 、角色 ROLE (跟姓名中罗列的内容相关联)、 声音数据 SOUND(可以是各种类型,比较典型的是32KADPCM)、校验码 REV
需要提及的是关于 SOUND 字段的内容,通常来说他会包含一个 content-id 指向邮件中其他的段内容(通常对应段的段类型为 audio/* )。

通常来说,对于 VPIM 邮件只能包含一个 vCard,如果有两个或者以上的话,则表示出错。对于包含多个 vCard 的情况,本着 one message one vcard 的原则,就需要让 message 中嵌套 message 的方式,来让一封邮件中包含多个 vCard 。

下面给出一个例子,是 RFC2421 中的,方便理解
Example:
     Content-Type: text/directory; charset=us-ascii; profile=vCard
     Content-Transfer-Encoding: 7bit

     BEGIN:VCARD
     N:Parsons;Glenn
     ORG:Northern Telecom
     TEL;TYPE=VOICE;MSG;WORK:+1-613-763-7582
     EMAIL;TYPE=INTERNET;glenn.parsons@nortel.ca
     EMAIL;TYPE=INTERNET;VPIM:6137637582@vm.nortel.ca
     SOUND;TYPE=32KADPCM;ENCODING=URI: CID:<part1@VM2-4321>
     REV:19960831T103310Z
     VERSION: 3.0
     END:VCARD

不过,从当前看来,网络中相关于 Multipart/Voice-Message 类型的邮件是比较少的,下面是示例邮件:

To: +19725551212@vm1.mycompany.com
To: +16135551234@VM1.mycompany.com
From: "Parsons, Glenn" <12145551234@VM2.mycompany.com>
Date: Mon, 26 Aug 93 10:20:20 -0700 (CDT)
MIME-Version: 1.0  (Voice 2.0)
Content-type: Multipart/Voice-Message; Version=2.0;
Boundary="MessageBoundary"
Content-Transfer-Encoding: 7bit
Message-ID: 123456789@VM2.mycompany.com
Sensitivity: Private
Importance: High

--MessageBoundary
Content-type: Audio/32KADPCM
Content-Transfer-Encoding: Base64
Content-Disposition: inline; voice=Originator-Spoken-Name
Content-Language: en-US
Content-ID: part1@VM2-4321

glslfdslsertiflkTfpgkTportrpkTpfgTpoiTpdadasssdasddasdasd
(This is a sample of the base-64 Spoken Name data)
fgdhgddlkgpokpeowrit09==

--MessageBoundary
Content-type: Audio/32KADPCM
Content-Transfer-Encoding: Base64
Content-Description: Brand X Voice Message
Content-Disposition: inline; voice=Voice-Message; filename=msg1.726
Content-Duration: 25

iIiIiIjMzN3czdze3s7d7fwfHhcvESJVe/4yEhLz8/FOQjVFRERCESL/zqrq
(This is a sample of the base64 message data) zb8tFdLTQt1PXj
u7wjOyRhws+krdns7Rju0t4tLF7cE0K0MxOTOnRW/Pn30c8uHi9==

--MessageBoundary
Content-type: text/directory; charset=us-ascii; profile=vCard
Content-Transfer-Encoding: 7bit

BEGIN:VCARD
N:Parsons;Glenn;;Mr.;
EMAIL;TYPE=INTERNET:+12145551234@VM2.mycompany.com
TEL:+1-217-555-1234
SOUND;TYPE=32KADPCM;ENCODING=URI: CID:<part1@VM2-4321>
REV:19951031T222710Z
VERSION: 3.0
END:VCARD

--MessageBoundary-- 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值