Package org.zoolu.sip.header

Examples of org.zoolu.sip.header.StatusLine


      //if (event.equals("refer"))
       if (event.substring(0,5).equals("refer"))
      {  Message fragment=new Message(sipfragment);
         printLog("Notify: "+sipfragment,LogLevel.LOW);
         if (fragment.isResponse())
         {  StatusLine status_line=fragment.getStatusLine();
            int code=status_line.getCode();
            String reason=status_line.getReason();
            if (code>=180 && code<300)
            {  printLog("Call successfully transferred",LogLevel.LOW);
               if(xcall_listener!=null) xcall_listener.onCallTransferSuccess(this,msg);
            }
            else
View Full Code Here


      int code=getInt();
      int begin=getPos();
      int end=indexOfEOH();
      String reason=getString(end-begin).trim();
      goToNextLine();
      return new StatusLine(code,reason);
   }
View Full Code Here

               callees.put(call_id,callee);
               eventlog(time,call_id,SipMethods.INVITE,caller,callee);
            }
         }
         else
         StatusLine status_line=msg.getStatusLine();
            int code=status_line.getCode();
            if (code>=200 && code<300 && !accepted_dates.containsKey(call_id))
            {  Date time=new Date();
               insert(accepted_dates,call_id,time);
               String reason=status_line.getReason();    
               eventlog(time,call_id,String.valueOf(code)+" "+reason,"","");
            }
            else
            if (code>=300 && !refused_dates.containsKey(call_id))
            {  Date time=new Date();
               insert(refused_dates,call_id,time);
               String reason=status_line.getReason();    
               eventlog(time,call_id,String.valueOf(code)+" "+reason,"","");
            }
         }
      }
      else
View Full Code Here

        }

        launchMediaApplication();

        if (call == callTransfer) {
            StatusLine statusLine = resp.getStatusLine();
            int code = statusLine.getCode();
            String reason = statusLine.getReason();
            this.call.notify(code, reason);
        }

        notifyListenersOfOnOutgoingCallAccepted();
    }
View Full Code Here

     
        log.debug("REFUSED (" + reason + ").");
        changeStatus(CallState.UA_IDLE);

        if (call == callTransfer) {
            StatusLine status_line = resp.getStatusLine();
            int code = status_line.getCode();
            // String reason=status_line.getReason();
            this.call.notify(code, reason);
            callTransfer = null;
        }
View Full Code Here

   }


   /** Sends a new NOTIFY within the dialog */
   public void notify(int code, String reason)
   {  notify((new StatusLine(code,reason)).toString());
   }
View Full Code Here

   public void onTransFailureResponse(TransactionClient tc, Message msg)
   {
printLog("onTransFailureResponse 1",LogLevel.HIGH);
     printLog("inside onTransFailureResponse("+tc.getTransactionId()+",msg)",LogLevel.LOW);
      String method=tc.getTransactionMethod();
      StatusLine status_line=msg.getStatusLine();
      int code=status_line.getCode();
      String reason=status_line.getReason();

      // AUTHENTICATION-BEGIN
      if ((code==401 && attempts<MAX_ATTEMPTS && msg.hasWwwAuthenticateHeader() && msg.getWwwAuthenticateHeader().getRealmParam().equalsIgnoreCase(realm))
       || (code==407 && attempts<MAX_ATTEMPTS && msg.hasProxyAuthenticateHeader() && msg.getProxyAuthenticateHeader().getRealmParam().equalsIgnoreCase(realm)))
      {  attempts++;
View Full Code Here

     * When an TransactionClientListener goes into the "Terminated" state, receiving a 2xx response  */
   public void onTransSuccessResponse(TransactionClient t, Message msg)
   {  printLog("inside onTransSuccessResponse("+t.getTransactionId()+",msg)",LogLevel.LOW);
      attempts=0;
      String method=t.getTransactionMethod();
      StatusLine status_line=msg.getStatusLine();
      int code=status_line.getCode();
      String reason=status_line.getReason();

      if (method.equals(SipMethods.INVITE) || method.equals(SipMethods.CANCEL) || method.equals(SipMethods.BYE))
      {  super.onTransSuccessResponse(t,msg);
      }
      else
View Full Code Here

      if (listener!=null) listener.onUaCallAccepted(this);

      launchMediaApplication();
     
      if (call==call_transfer)
      {  StatusLine status_line=resp.getStatusLine();
         int code=status_line.getCode();
         String reason=status_line.getReason();
         this.call.notify(code,reason);
      }
   }
View Full Code Here

   printLog("onCallRefused()",LogLevel.LOW);
      if (call!=this.call) {  printLog("NOT the current call",LogLevel.LOW)return}
      printLog("REFUSED ("+reason+")",LogLevel.HIGH);
      changeStatus(UA_IDLE);
      if (call==call_transfer)
      {  StatusLine status_line=resp.getStatusLine();
         int code=status_line.getCode();
         //String reason=status_line.getReason();
         this.call.notify(code,reason);
         call_transfer=null;
      }
      // play "off" sound
View Full Code Here

TOP

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

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.