コード例 #1
0
 /** Set the default values in the request URI if necessary. */
 protected void setDefaults() {
   // The request line may be unparseable (set to null by the
   // exception handler.
   if (requestLine == null) return;
   String method = requestLine.getMethod();
   // The requestLine may be malformed!
   if (method == null) return;
   GenericURI u = (GenericURI) requestLine.getUri();
   if (u == null) return;
   if (method.compareTo(Request.REGISTER) == 0 || method.compareTo(Request.INVITE) == 0) {
     if (u instanceof SipUri) {
       SipUri sipUri = (SipUri) u;
       sipUri.setUserParam(DEFAULT_USER);
       try {
         sipUri.setTransportParam(DEFAULT_TRANSPORT);
       } catch (ParseException ex) {
       }
     }
   }
 }