Package org.zoolu.sip.header

Examples of org.zoolu.sip.header.ViaHeader


         msg.setHeader(new Header(Loop_Tag,loop_tag));
         // check for loop
         if (!msg.hasRouteHeader())
         {  Vector v=msg.getVias().getHeaders();
            for (int i=0; i<v.size(); i++)
            {  ViaHeader vh=new ViaHeader((Header)v.elementAt(i));
               if (sip_provider.getViaAddress().equals(vh.getHost()) && sip_provider.getPort()==vh.getPort())
               {  // possible loop
                  if (!vh.hasBranch()) err_code=482;
                  else
                  // check branch
                     String branch=vh.getBranch();
                     if (branch.indexOf(loop_tag,branch.length()-loop_tag.length())>=0) err_code=482;
                  }
               }
            }
         }
View Full Code Here


      }
      else proto=msg.getRequestLine().getAddress().getTransport();
      if (proto==null) proto=sip_provider.getDefaultTransport();
     
      // add Via
      ViaHeader via=new ViaHeader(proto,sip_provider.getViaAddress(),sip_provider.getPort());
      if (sip_provider.isRportSet()) via.setRport();
      String branch=sip_provider.pickBranch(msg);
      if (server_profile.loop_detection)
      {  String loop_tag=msg.getHeader(Loop_Tag).getValue();
         if (loop_tag!=null)
         {  msg.removeHeader(Loop_Tag);
            branch+=loop_tag;
         }
      }
      via.setBranch(branch);
      msg.addViaHeader(via);

      // decrement Max-Forwards
      MaxForwardsHeader maxfwd=msg.getMaxForwardsHeader();
      if (maxfwd!=null) maxfwd.decrement();
View Full Code Here

  
   /** Processes the Proxy headers of the response.
     * Such headers are: Via, .. */
   protected Message updateProxingResponse(Message resp)
   {  printLog("inside updateProxingResponse(resp)",LogLevel.MEDIUM);
      ViaHeader vh=new ViaHeader((Header)resp.getVias().getHeaders().elementAt(0));
      if (vh.getHost().equals(sip_provider.getViaAddress())) resp.removeViaHeader();
      return resp;
   }
View Full Code Here

     //transactions.put(acktc.getTransactionId(),acktc);
     acktc.request();

         Message req=tc.getRequestMessage();
         // select a new branch - rfc3261 says should be new on each request
         ViaHeader via=req.getViaHeader();
         req.removeViaHeader();
         via.setBranch(SipProvider.pickBranch());
         req.addViaHeader(via);
         req.setCSeqHeader(req.getCSeqHeader().incSequenceNumber());
         WwwAuthenticateHeader wah;
         if (code==401) wah=msg.getWwwAuthenticateHeader();
         else wah=msg.getProxyAuthenticateHeader();
View Full Code Here

TOP

Related Classes of org.zoolu.sip.header.ViaHeader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.