package me.streib.janis.nanhotline.web.dbobjects;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Map;

import me.streib.janis.nanhotline.web.pages.Page;

import org.cacert.gigi.output.template.Outputable;

public class ProxyCall extends Action {
    private String targetSipUri;
    private boolean accepted;
    private Phone supporterPhone;

    public ProxyCall(ResultSet res) throws SQLException {
        super(res);
        this.accepted = res.getBoolean("accepted");
        this.targetSipUri = res.getString("target_sip_uri");
        this.supporterPhone = Phone.getById(res.getInt("supporter_phone"));
    }

    @Override
    public Outputable output(Map<String, Object> vars, Supporter user)
            throws SQLException {
        vars.put("supp_sip", supporterPhone.getSipUri());
        vars.put("supp_name", Supporter
                .getSupporterById(supporterPhone.getId()).getName());
        vars.put("targ_sip", targetSipUri);
        vars.put("accpeted", accepted);
        vars.put("time", Page.DE_FROMAT_DATE.format(getTime()));
        return getDefaultTemplate();
    }
}

@@ -845,26 +845,16 @@
 p_name%22,
- Supporter
 %0A       
@@ -862,16 +862,25 @@
         
+Supporter
 .getSupp
@@ -911,13 +911,45 @@
 .get
-Id())
+Supporter())%0A                        
 .get

use wrong id for resolving supporter.. how did this ever work?