Skip to content

Instantly share code, notes, and snippets.

@arslan70
Created September 13, 2014 16:05
Show Gist options
  • Save arslan70/2095639897a52efe595f to your computer and use it in GitHub Desktop.
Save arslan70/2095639897a52efe595f to your computer and use it in GitHub Desktop.
@Override
public void processResponse(ResponseEvent arg0) {
Response response = (Response) arg0.getResponse();
ClientTransaction tid = arg0.getClientTransaction();
System.out.println(response.getStatusCode());
if (response.getStatusCode() == Response.PROXY_AUTHENTICATION_REQUIRED
|| response.getStatusCode() == Response.UNAUTHORIZED) {
AuthenticationHelper authenticationHelper = ((SipStackExt) sipStack)
.getAuthenticationHelper(new AccountManagerImpl(),
headerFactory);
try {
ClientTransaction inviteTid = authenticationHelper
.handleChallenge(response, tid, sipProvider, 5);
inviteTid.sendRequest();
} catch (NullPointerException e) {
e.printStackTrace();
} catch (SipException e) {
e.printStackTrace();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment