final Lock lock = new ReentrantLock();
final Condition condition = lock.newCondition();
final Jingle[] response = new Jingle[1];
jingleSession.addJingleListener(new JingleListener() {
@Override
public void jingleReceived(JingleEvent e) {
if (e.getJingle().getAction() == Jingle.Action.SESSION_ACCEPT || e.getJingle().getAction() == Jingle.Action.SESSION_TERMINATE) {
lock.lock();
try {