import { OutMsg } from './OutMsg' ; import { InMsg } from '../in/InMsg' ; export class OutVoiceMsg extends OutMsg { private mediaId : string ; constructor ( inMsg ) { super ( inMsg ) ; this . msgType = 'voice' ; } public toXml ( ) { let str = super . toXml ( ) ; if ( ! this . mediaId ) { throw new Error ( 'mediaId is null' ) ; } str += '<Voice>\n<MediaId><![CDATA[' + this . mediaId + ']]></MediaId>\n</Voice>\n</xml>\n' ; return str ; } public get getMediaId ( ) : string { return this . mediaId ; } public set setMediaId ( mediaId ) { this . mediaId = mediaId ; } }