aboutsip / pkts

Pure java based pcap library capable of reading and writing to/from pcaps.
Other
196 stars 91 forks source link

Force usage of Quotes #109

Open danielzt opened 5 years ago

danielzt commented 5 years ago

I had some difficult times with old routers due to not usage of Quotes <> on SIP Addresses (At least by default).

Routes that do some kind of SIP parsing sometimes route the Sip message, sometimes they silent discard it.

To fix this, I inserted a "forceQuotes" variable to allow me controlling it, but I'm clearly doing the wrong way. What is a proper way to configure this parameter in a class wide manner?

        public Address build() throws SipParseException {
            ...
            final Boolean forceQuotes = true;*
            final boolean yesAngleQuoteIt = yesDisplayName || uriBuilder.hasParameters() || forceQuotes;
            ...
            }

Thanks!