@@ -95,7 +95,6 @@ enum CallDirection {
9595
9696 private ListeningPoint udpListeningPoint ;
9797 private SipProfile sipProfile ;
98- //private String latestProxyIp;
9998 private Dialog dialog ;
10099
101100 private ArrayList <ISipEventListener > sipEventListenerList = new ArrayList <ISipEventListener >();
@@ -111,7 +110,6 @@ enum CallDirection {
111110 // could also use dialog.isServer() flag but have found mixed opinions about it)
112111 CallDirection direction = CallDirection .NONE ;
113112 private int remoteRtpPort ;
114- //private Thread.UncaughtExceptionHandler exceptionHandler;
115113
116114 // Constructors/Initializers
117115 public SipManager (SipProfile sipProfile , boolean connectivity ) {
@@ -143,8 +141,8 @@ private boolean initialize(boolean connectivity)
143141 // You need 16 for logging traces. 32 for debug + traces.
144142 // Your code will limp at 32 but it is best for debugging.
145143 //properties.setProperty("android.gov.nist.javax.sip.TRACE_LEVEL", "32");
146- //properties.setProperty("android.gov.nist.javax.sip.DEBUG_LOG", "/storage/emulated/legacy/Download/debug.log");
147- //properties.setProperty("android.gov.nist.javax.sip.SERVER_LOG", "/storage/emulated/legacy/Download/server.log");
144+ //properties.setProperty("android.gov.nist.javax.sip.DEBUG_LOG", "/storage/emulated/legacy/Download/debug-1 .log");
145+ //properties.setProperty("android.gov.nist.javax.sip.SERVER_LOG", "/storage/emulated/legacy/Download/server-1 .log");
148146
149147 try {
150148 if (udpListeningPoint != null ) {
@@ -418,20 +416,6 @@ public void Register(int expiry) throws ParseException, TransactionUnavailableEx
418416 if (sipProvider == null ) {
419417 return ;
420418 }
421- /*
422- if (!latestProxyIp.equals(sipProfile.getRemoteIp())) {
423- // proxy ip address has been updated, need to re-initialize
424- if (initialized) {
425- RCLogger.i(TAG, "Registrar changed, reinitializing stack");
426- shutdown();
427- initialize(true);
428- }
429- else {
430- return;
431- }
432- }
433- */
434-
435419 Register registerRequest = new Register ();
436420 try {
437421 final Request r = registerRequest .MakeRequest (this , expiry , null );
@@ -447,11 +431,6 @@ public void run() {
447431 dispatchSipError (ISipEventListener .ErrorContext .ERROR_CONTEXT_NON_CALL , RCClient .ErrorCodes .SIGNALLING_REGISTER_ERROR ,
448432 e .getMessage ());
449433 }
450- /*
451- catch (SipException e) {
452- e.printStackTrace();
453- }
454- */
455434 }
456435 };
457436 thread .start ();
@@ -469,20 +448,6 @@ public void Unregister(Address contact) throws ParseException, TransactionUnavai
469448 return ;
470449 }
471450
472- /*
473- if (!latestProxyIp.equals(sipProfile.getRemoteIp())) {
474- // proxy ip address has been updated, need to re-initialize
475- if (initialized) {
476- RCLogger.i(TAG, "Registrar changed, reinitializing stack");
477- shutdown();
478- initialize(true);
479- }
480- else {
481- return;
482- }
483- }
484- */
485-
486451 Register registerRequest = new Register ();
487452 try {
488453 final Request r = registerRequest .MakeRequest (this , 0 , contact );
@@ -498,11 +463,6 @@ public void run() {
498463 dispatchSipError (ISipEventListener .ErrorContext .ERROR_CONTEXT_NON_CALL , RCClient .ErrorCodes .SIGNALLING_REGISTER_ERROR ,
499464 e .getMessage ());
500465 }
501- /*
502- catch (SipException e) {
503- e.printStackTrace();
504- }
505- */
506466 }
507467 };
508468 thread .start ();
@@ -537,13 +497,6 @@ public void run() {
537497 dispatchSipError (ISipEventListener .ErrorContext .ERROR_CONTEXT_CALL , RCClient .ErrorCodes .SIGNALLING_CALL_ERROR ,
538498 e .getMessage ());
539499 }
540- /*
541- catch (SipException e) {
542- //e.printStackTrace();
543- dispatchSipError(ISipEventListener.ErrorContext.ERROR_CONTEXT_CALL, RCClient.ErrorCodes.SIGNALLING_TIMEOUT,
544- e.getMessage());
545- }
546- */
547500 }
548501 };
549502 thread .start ();
@@ -572,13 +525,6 @@ public void run() {
572525 dispatchSipError (ISipEventListener .ErrorContext .ERROR_CONTEXT_CALL , RCClient .ErrorCodes .SIGNALLING_CALL_ERROR ,
573526 e .getMessage ());
574527 }
575- /*
576- catch (SipException e) {
577- //e.printStackTrace();
578- dispatchSipError(ISipEventListener.ErrorContext.ERROR_CONTEXT_CALL, RCClient.ErrorCodes.SIGNALLING_TIMEOUT,
579- e.getMessage());
580- }
581- */
582528 }
583529 };
584530 thread .start ();
@@ -758,19 +704,11 @@ public void processResponse(ResponseEvent arg0) {
758704 Response response = (Response ) arg0 .getResponse ();
759705 RCLogger .i (TAG , "processResponse(), status code: " + response .getStatusCode ());
760706
761- //Dialog responseDialog = null;
762707 ClientTransaction tid = arg0 .getClientTransaction ();
763- if (tid != null ) {
764- //responseDialog = tid.getDialog();
765- } else {
766- //responseDialog = arg0.getDialog();
767- }
768708 CSeqHeader cseq = (CSeqHeader ) response .getHeader (CSeqHeader .NAME );
769709 if (response .getStatusCode () == Response .PROXY_AUTHENTICATION_REQUIRED
770710 || response .getStatusCode () == Response .UNAUTHORIZED ) {
771711 try {
772- //Address remoteParty = responseDialog.getRemoteParty();
773- //SipURI remoteUri = (SipURI)remoteParty.getURI();
774712 AuthenticationHelper authenticationHelper = ((SipStackExt ) sipStack )
775713 .getAuthenticationHelper (
776714 new AccountManagerImpl (sipProfile .getSipUserName (),
@@ -804,19 +742,11 @@ public void processResponse(ResponseEvent arg0) {
804742 } catch (SipException e ) {
805743 e .printStackTrace ();
806744 }
807- /*
808- catch (ParseException e) {
809- e.printStackTrace();
810- }
811- */
812-
813-
814745 } else if (response .getStatusCode () == Response .OK ) {
815746 if (cseq .getMethod ().equals (Request .INVITE )) {
816747 RCLogger .i (TAG , "Dialog after 200 OK " + dialog );
817748 try {
818749 RCLogger .i (TAG , "Sending ACK" );
819- //Request ackRequest = dialog.createAck(cseq.getSeqNumber());
820750 Request ackRequest = dialog .createAck (((CSeqHeader )response .getHeader (CSeqHeader .NAME )).getSeqNumber ());
821751 dialog .sendAck (ackRequest );
822752 byte [] rawContent = response .getRawContent ();
@@ -1156,7 +1086,6 @@ private void sendOk(RequestEvent requestEvt) {
11561086 // is different -at some point we should merge those methods
11571087 private void sendByeClient (Transaction transaction ) {
11581088 RCLogger .i (TAG , "sendByeClient()" );
1159- //final Dialog dialog = transaction.getDialog();
11601089 if (dialog == null ) {
11611090 RCLogger .i (TAG , "Hmm, weird: dialog is already terminated -avoiding BYE" );
11621091 }
0 commit comments