public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { try { calleeCSeq = in.readLong(); callerCSeq = in.readLong(); calleeContact = SipFactoryImpl.addressFactory.createURI(in.readUTF()); callerContact = SipFactoryImpl.addressFactory.createURI(in.readUTF()); int routeSetSize = in.readInt(); for (int i = 0; i < routeSetSize; i++) { javax.sip.address.Address route = SipFactoryImpl.addressFactory.createAddress(in.readUTF()); callerRouteSet.add(route); } routeSetSize = in.readInt(); for (int i = 0; i < routeSetSize; i++) { javax.sip.address.Address route = SipFactoryImpl.addressFactory.createAddress(in.readUTF()); calleeRouteSet.add(route); } javax.sip.address.Address toAddress = SipFactoryImpl.addressFactory.createAddress(in.readUTF()); toHeader = (To) SipFactoryImpl.headerFactory.createToHeader(toAddress, in.readUTF()); javax.sip.address.Address fromAddress = SipFactoryImpl.addressFactory.createAddress(in.readUTF()); fromHeader = (From) SipFactoryImpl.headerFactory.createFromHeader(fromAddress, in.readUTF()); callId = in.readUTF(); } catch (ParseException e) { throw new IllegalArgumentException("Problem occurred while unserializing ProxyTerminationInfo", e); } } /*
private void createFromHeader() throws ParseException { SipURI fromAddress = getAddressFactory().createSipURI(getFromUser(), getFromHost()); fromAddress.setPort(Integer.valueOf(getFromPort()).intValue()); Address fromNameAddress = addressFactory.createAddress(fromAddress); fromNameAddress.setDisplayName(getFromUser()); setFromHeader(headerFactory.createFromHeader(fromNameAddress, getFromUser() + "_Header")); }
FromHeader fromHeader = sipHeaderFactory.createFromHeader(fromNameAddress, "12345SomeTagID6789");
fromNameAddress.setDisplayName("Wake Up Service"); HeaderFactory headerFactory = sipProvider.getHeaderFactory(); FromHeader fromHeader = headerFactory.createFromHeader( fromNameAddress, null); List<ViaHeader> viaHeaders = new ArrayList<ViaHeader>(1);
fromAddress.setDisplayName(from.getDisplayName()); fromHeader = SipFactoryImpl.headerFactory.createFromHeader(fromAddress, null); } catch (Exception pe) { throw new ServletParseException("Impossoible to parse the given From " + from.toString(), pe);