closeStream(mediaType);
continue;
}
// create the answer description
ContentPacketExtension ourContent
= JingleUtils.createDescription(
content.getCreator(),
content.getName(),
JingleUtils.getSenders(
direction,
!getPeer().isInitiator()),
mutuallySupportedFormats,
rtpExtensions,
getDynamicPayloadTypes(),
getRtpExtensionsRegistry());
// ZRTP
if(getPeer().getCall().isSipZrtpAttribute())
{
Map<MediaTypeSrtpControl, SrtpControl> srtpControls
= getSrtpControls();
MediaTypeSrtpControl key
= new MediaTypeSrtpControl(mediaType, SrtpControlType.ZRTP);
SrtpControl control = srtpControls.get(key);
if(control == null)
{
control
= JabberActivator.getMediaService().createZrtpControl();
srtpControls.put(key, control);
}
String helloHash[] = ((ZrtpControl)control).getHelloHashSep();
if(helloHash != null && helloHash[1].length() > 0)
{
EncryptionPacketExtension encryption = new
EncryptionPacketExtension();
ZrtpHashPacketExtension hash
= new ZrtpHashPacketExtension();
hash.setVersion(helloHash[0]);
hash.setValue(helloHash[1]);
encryption.addChildExtension(hash);
RtpDescriptionPacketExtension rtpDescription =
JingleUtils.getRtpDescription(ourContent);
rtpDescription.setEncryption(encryption);
}
}
// got an content which have inputevt, it means that peer requests
// a desktop sharing session so tell it we support inputevt
if(content.getChildExtensionsOfType(InputEvtPacketExtension.class)
!= null)
{
ourContent.addChildExtension(new InputEvtPacketExtension());
}
answer.add(ourContent);
localContentMap.put(content.getName(), ourContent);