Source:
<code>public IQ handleIQ(IQ iq, CallContext ctx) throws Exception { try { String fromBareJid = StringUtils.parseBareAddress(iq.getFrom()); if (allowedJid != null && !allowedJid.equals(fromBareJid)) { return IQ.createErrorResponse( iq, new XMPPError(XMPPError.Condition.not_allowed)); } else if (allowedJid == null) { logger.warn("Requests are not secured by JID filter!"); } if (iq instanceof DialIq) { DialIq dialIq = (DialIq) iq; String from = dialIq.getSource(); String to = dialIq.getDestination(); ctx.setDestination(to); String roomName = dialIq.getHeader(ROOM_NAME_HEADER); ctx.setRoomName(roomName); String roomPassword = dialIq.getHeader(ROOM_PASSWORD_HEADER); ctx.setRoomPassword(roomPassword); if (roomName == null) throw new RuntimeException("No JvbRoomName header found"); logger.info( "Got dial request " + from + " -> " + to + " room: " + roomName); String callResource = ctx.getCallResource(); <START> if("transcribe:".equals(to)) <END> { transcriptionGateway.createOutgoingCall(ctx); } else { sipGateway.createOutgoingCall(ctx); } callResource = "xmpp:" + callResource; return RefIq.createResult(iq, callResource); } else if (iq instanceof HangUp) { HangUp hangUp = (HangUp) iq; String callResource = hangUp.getTo(); SipGatewaySession session = sipGateway.getSession(callResource); if (session == null) throw new RuntimeException( "No sipGateway for call: " + callResource); session.hangUp(); return IQ.createResultIQ(iq); } else { return null; } } catch (Exception e) { logger.error(e, e); throw e; } }</code><technical_language>move this a constant somewhere, name is a sip address (e.g. jitsi_transcribe)? This hidden a UI anyway</technical_language>

Target:
public IQ handleIQ(IQ iq, CallContext ctx) throws Exception { try { String fromBareJid = StringUtils.parseBareAddress(iq.getFrom()); if (allowedJid != null && !allowedJid.equals(fromBareJid)) { return IQ.createErrorResponse( iq, new XMPPError(XMPPError.Condition.not_allowed)); } else if (allowedJid == null) { logger.warn("Requests are not secured by JID filter!"); } if (iq instanceof DialIq) { DialIq dialIq = (DialIq) iq; String from = dialIq.getSource(); String to = dialIq.getDestination(); ctx.setDestination(to); String roomName = dialIq.getHeader(ROOM_NAME_HEADER); ctx.setRoomName(roomName); String roomPassword = dialIq.getHeader(ROOM_PASSWORD_HEADER); ctx.setRoomPassword(roomPassword); if (roomName == null) throw new RuntimeException("No JvbRoomName header found"); logger.info( "Got dial request " + from + " -> " + to + " room: " + roomName); String callResource = ctx.getCallResource(); if(TRANSCRIPTION_DIAL_IQ_DESTINATION.equals(to)) { transcriptionGateway.createOutgoingCall(ctx); } else { sipGateway.createOutgoingCall(ctx); } callResource = "xmpp:" + callResource; return RefIq.createResult(iq, callResource); } else if (iq instanceof HangUp) { HangUp hangUp = (HangUp) iq; String callResource = hangUp.getTo(); SipGatewaySession session = sipGateway.getSession(callResource); if (session == null) throw new RuntimeException( "No sipGateway for call: " + callResource); session.hangUp(); return IQ.createResultIQ(iq); } else { return null; } } catch (Exception e) { logger.error(e, e); throw e; } }