From 7c0c5caf4b30ed773e11feaf641dc256b8047a00 Mon Sep 17 00:00:00 2001 From: Stefan Sayer Date: Wed, 2 Apr 2008 10:48:00 +0000 Subject: [PATCH] fix in case of no auth loaded git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@834 8eb893ce-cfd4-0310-b710-fb5ebe64c474 --- apps/auth_b2b/AuthB2B.cpp | 17 ++++++++++++----- apps/auth_b2b/AuthB2B.h | 3 ++- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/apps/auth_b2b/AuthB2B.cpp b/apps/auth_b2b/AuthB2B.cpp index 2ae9e67f..a77e1a90 100644 --- a/apps/auth_b2b/AuthB2B.cpp +++ b/apps/auth_b2b/AuthB2B.cpp @@ -286,7 +286,8 @@ void AuthB2BDialog::createCalleeSession() AuthB2BCalleeSession::AuthB2BCalleeSession(const AmB2BCallerSession* caller, const string& user, const string& pwd) - : credentials("", user, pwd), // domain (realm) is unused in credentials + : auth(NULL), + credentials("", user, pwd), // domain (realm) is unused in credentials AmB2BCalleeSession(caller) { } @@ -298,6 +299,11 @@ inline UACAuthCred* AuthB2BCalleeSession::getCredentials() { } void AuthB2BCalleeSession::onSipReply(const AmSipReply& reply) { + if (NULL == auth) { + AmB2BCalleeSession::onSipReply(reply); + return; + } + int cseq_before = dlg.cseq; if (!auth->onSipReply(reply)) { AmB2BCalleeSession::onSipReply(reply); @@ -318,10 +324,11 @@ void AuthB2BCalleeSession::onSipReply(const AmSipReply& reply) { void AuthB2BCalleeSession::onSendRequest(const string& method, const string& content_type, const string& body, string& hdrs, int flags, unsigned int cseq) { - DBG("auth->onSendRequest cseq = %d\n", cseq); - - auth->onSendRequest(method, content_type, - body, hdrs, flags, cseq); + if (NULL != auth) { + DBG("auth->onSendRequest cseq = %d\n", cseq); + auth->onSendRequest(method, content_type, + body, hdrs, flags, cseq); + } AmB2BCalleeSession::onSendRequest(method, content_type, body, hdrs, flags, cseq); diff --git a/apps/auth_b2b/AuthB2B.h b/apps/auth_b2b/AuthB2B.h index 4e65fff6..47427fb1 100644 --- a/apps/auth_b2b/AuthB2B.h +++ b/apps/auth_b2b/AuthB2B.h @@ -1,7 +1,8 @@ /* * $Id: $ * - * Copyright (C) 2007 Sipwise GmbH + * Copyright (C) 2008 iptego GmbH + * Based on the concept of sw_prepaid_sip, Copyright (C) 2007 Sipwise GmbH * Based on the concept of mycc, Copyright (C) 2002-2003 Fhg Fokus * * This file is part of sems, a free SIP media server.