public void requestVoice ( ) throws NotConnectedException , InterruptedException { DataForm form = new DataForm ( DataForm . Type . submit ) ; FormField formTypeField = new FormField ( FormField . FORM_TYPE ) ; formTypeField . addValue ( MUCInitialPresence . NAMESPACE + "#request" ) ; form . addField ( formTypeField ) ; FormField requestVoiceField = new FormField ( "muc#role" ) ; requestVoiceField . setType ( FormField . Type . text_single ) ; requestVoiceField . setLabel ( "Requested role" ) ; requestVoiceField . addValue ( "participant" ) ; form . addField ( requestVoiceField ) ; Message message = new Message ( room ) ; message . addExtension ( form ) ; connection . sendStanza ( message ) ; }
Sends a voice request to the MUC . The room moderators usually need to approve this request .