Re: Why are the header classes final?
"Jeroen van Bemmel" <[email protected]>
| Newsgroups | gmane.comp.voip.nist-sip |
|---|---|
| Message-ID | <002e01c703ca$cc3040e0$0601a8c0@BEMBUSTER> |
You could try using headerfactory.createHeader( "Contact", "Transfer <uri>" ). There is a chance that it does not change the format of what you put in Regards, Jeroen [email protected] wrote: > On Wed, 8 Nov 2006 at 20:53, Jeroen van Bemmel wrote: >> They are not all final, but in any case the public interfaces of >> this library are in javax.sip (and javax.sdp). The design is such >> that an application would only deal with those packages. > > So why is gov.nist.javax.sip.header.Contact final if not all the > headers are? Like I said, I'm new to Java so I don't know the > motivations for using final. > >> Which need do you have that it cannot be done using the public API? > > Well, we're trying to send a Response.MOVED_TEMPORARILY to Asterix > boxes, and we were told on the Asterix mailing list that Asterix > wouldn't recognize it unless the form of the Contact header > in the response was: > > Contact: Transfer <uri> > > I tried just using Transfer as the DisplayName, but that produces: > > Contact: "Transfer" <uri> > > and that doesn't seem to be good enough. Now, I'm not personally > convinced that even getting rid of the quotes is going to fix the > problem with Asterix, but I need to run the experiment. So I was > going to subclass Contact and change the toString so that there > were no quotes around Transfer, and use my custom header in > constructing the response. > > --David