/* $Id$ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __PJSIP_SIP_ERRNO_H__ #define __PJSIP_SIP_ERRNO_H__ /** * @file sip_errno.h * @brief PJSIP Specific Error Code */ #include PJ_BEGIN_DECL /** * @defgroup PJSIP_CORE_ERRNO PJSIP Specific Error Code * @ingroup PJSIP_BASE * @brief PJSIP specific error constants. * @{ */ /* * PJSIP error codes occupies 170000 - 219000, and mapped as follows: * - 170100 - 170799: mapped to SIP status code in response msg. * - 171000 - 171999: mapped to errors generated from PJSIP core. */ /** * Start of error code relative to PJ_ERRNO_START_USER. */ #define PJSIP_ERRNO_START (PJ_ERRNO_START_USER) /** * Create error value from SIP status code. * @param code SIP status code. * @return Error code in pj_status_t namespace. */ #define PJSIP_ERRNO_FROM_SIP_STATUS(code) (PJSIP_ERRNO_START+code) /** * Get SIP status code from error value. * If conversion to SIP status code is not available, a SIP status code * 599 will be returned. * * @param status Error code in pj_status_t namespace. * @return SIP status code. */ #define PJSIP_ERRNO_TO_SIP_STATUS(status) \ ((status>=PJSIP_ERRNO_FROM_SIP_STATUS(100) && \ status