Makefile.am   Makefile.am 
pkginclude_HEADERS = \
portaudiocpp/AutoSystem.hxx \
portaudiocpp/BlockingStream.hxx \
portaudiocpp/CallbackInterface.hxx \
portaudiocpp/CallbackStream.hxx \
portaudiocpp/CFunCallbackStream.hxx \
portaudiocpp/CppFunCallbackStream.hxx \
portaudiocpp/Device.hxx \
portaudiocpp/DirectionSpecificStreamParameters.hxx \
portaudiocpp/Exception.hxx \
portaudiocpp/HostApi.hxx \
portaudiocpp/InterfaceCallbackStream.hxx \
portaudiocpp/MemFunCallbackStream.hxx \
portaudiocpp/PortAudioCpp.hxx \
portaudiocpp/SampleDataFormat.hxx \
portaudiocpp/Stream.hxx \
portaudiocpp/StreamParameters.hxx \
portaudiocpp/SystemDeviceIterator.hxx \
portaudiocpp/SystemHostApiIterator.hxx \
portaudiocpp/System.hxx
# portaudiocpp/AsioDeviceAdapter.hxx SUBDIRS = speex
 End of changes. 2 change blocks. 
20 lines changed or deleted 0 lines changed or added


 assert.h   assert.h 
/* $Id: assert.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: assert.h 1334 2007-06-01 09:58:57Z bennylp $ */
/* /*
* Copyright (C)2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C)2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 47 skipping to change at line 47
/** /**
* @hideinitializer * @hideinitializer
* Check during debug build that an expression is true. If the expression * Check during debug build that an expression is true. If the expression
* computes to false during run-time, then the program will stop at the * computes to false during run-time, then the program will stop at the
* offending statements. * offending statements.
* For release build, this macro will not do anything. * For release build, this macro will not do anything.
* *
* @param expr The expression to be evaluated. * @param expr The expression to be evaluated.
*/ */
#define pj_assert(expr) assert(expr) #ifndef pj_assert
# define pj_assert(expr) assert(expr)
#endif
/** /**
* @hideinitializer * @hideinitializer
* If #PJ_ENABLE_EXTRA_CHECK is declared and the value is non-zero, then * If #PJ_ENABLE_EXTRA_CHECK is declared and the value is non-zero, then
* #PJ_ASSERT_RETURN macro will evaluate the expression in @a expr during * #PJ_ASSERT_RETURN macro will evaluate the expression in @a expr during
* run-time. If the expression yields false, assertion will be triggered * run-time. If the expression yields false, assertion will be triggered
* and the current function will return with the specified return value. * and the current function will return with the specified return value.
* *
* If #PJ_ENABLE_EXTRA_CHECK is not declared or is zero, then no run-time * If #PJ_ENABLE_EXTRA_CHECK is not declared or is zero, then no run-time
* checking will be performed. The macro simply evaluates to pj_assert(expr ). * checking will be performed. The macro simply evaluates to pj_assert(expr ).
 End of changes. 2 change blocks. 
2 lines changed or deleted 4 lines changed or added


 cc_msvc.h   cc_msvc.h 
/* $Id: cc_msvc.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: cc_msvc.h 1405 2007-07-20 08:08:30Z bennylp $ */
/* /*
* Copyright (C)2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C)2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 56 skipping to change at line 56
# pragma warning(disable: 4710) // function is not inlined. # pragma warning(disable: 4710) // function is not inlined.
# pragma warning(disable: 4711) // function selected for auto inline expan sion # pragma warning(disable: 4711) // function selected for auto inline expan sion
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
# define PJ_INLINE_SPECIFIER inline # define PJ_INLINE_SPECIFIER inline
#else #else
# define PJ_INLINE_SPECIFIER static __inline # define PJ_INLINE_SPECIFIER static __inline
#endif #endif
#define PJ_EXPORT_DECL_SPECIFIER __declspec(dllexport)
#define PJ_EXPORT_DEF_SPECIFIER __declspec(dllexport)
#define PJ_IMPORT_DECL_SPECIFIER __declspec(dllimport)
#define PJ_THREAD_FUNC #define PJ_THREAD_FUNC
#define PJ_NORETURN __declspec(noreturn) #define PJ_NORETURN __declspec(noreturn)
#define PJ_ATTR_NORETURN #define PJ_ATTR_NORETURN
#define PJ_HAS_INT64 1 #define PJ_HAS_INT64 1
typedef __int64 pj_int64_t; typedef __int64 pj_int64_t;
typedef unsigned __int64 pj_uint64_t; typedef unsigned __int64 pj_uint64_t;
#define PJ_INT64(val) val##i64 #define PJ_INT64(val) val##i64
 End of changes. 2 change blocks. 
1 lines changed or deleted 5 lines changed or added


 config.h   config.h 
/* $Id: config.h 1246 2007-05-03 13:31:21Z bennylp $ */ /* $Id: config.h 1410 2007-07-28 02:44:55Z bennylp $ */
/* /*
* Copyright (C)2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C)2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 383 skipping to change at line 383
/** /**
* Colorfull terminal (for logging etc). * Colorfull terminal (for logging etc).
* *
* Default: 1 * Default: 1
*/ */
#ifndef PJ_TERM_HAS_COLOR #ifndef PJ_TERM_HAS_COLOR
# define PJ_TERM_HAS_COLOR 1 # define PJ_TERM_HAS_COLOR 1
#endif #endif
/** /**
* Set this flag to non-zero to enable various checking for pool
* operations. When this flag is set, assertion must be enabled
* in the application.
*
* This will slow down pool creation and destruction and will add
* few bytes of overhead, so application would normally want to
* disable this feature on release build.
*
* Default: 0
*/
#ifndef PJ_SAFE_POOL
# define PJ_SAFE_POOL 0
#endif
/**
* If pool debugging is used, then each memory allocation from the pool * If pool debugging is used, then each memory allocation from the pool
* will call malloc(), and pool will release all memory chunks when it * will call malloc(), and pool will release all memory chunks when it
* is destroyed. This works better when memory verification programs * is destroyed. This works better when memory verification programs
* such as Rational Purify is used. * such as Rational Purify is used.
* *
* Default: 0 * Default: 0
*/ */
#ifndef PJ_POOL_DEBUG #ifndef PJ_POOL_DEBUG
# define PJ_POOL_DEBUG 0 # define PJ_POOL_DEBUG 0
#endif #endif
skipping to change at line 624 skipping to change at line 639
# define PJ_HAS_STRICMP_ALNUM 0 # define PJ_HAS_STRICMP_ALNUM 0
#endif #endif
/** @} */ /** @} */
/******************************************************************** /********************************************************************
* General macros. * General macros.
*/ */
/** /**
* Guide for building dynamic link libraries (DLL).
*
* The libraries support generation of dynamic link libraries for
* Symbian ABIv2 target (.dso files, in S60 3rd Edition). Similar
* procedures may be applied for Win32 DLL too, with some modification.
*
* Macros related for building DLL/DSO files:
* - For platforms that supports dynamic link libraries generation,
* it must declare PJ_EXPORT_SPECIFIER macro which value contains
* the prefix to be added to symbol definition, to export this
* symbol in the DLL/DSO. For example, on Win32/Visual Studio, the
* value of this macro is "__declspec(dllexport)", and for ARM
* ABIv2/Symbian, the value is \a EXPORT_C.
* - For platforms that supports linking with dynamic link libraries,
* it must declare PJ_IMPORT_SPECIFIER macro which value contains
* the prefix to be added to symbol declaration, to import this
* symbol from a DLL/DSO. For example, on Win32/Visual Studio, the
* value of this macro is "__declspec(dllimport)", and for ARM
* ABIv2/Symbian, the value is \a IMPORT_C.
* - When PJLIB is built as DLL/DSO, both \a PJ_DLL and \a PJ_EXPORTING
* macros must be declared, so that PJ_EXPORT_SPECIFIER prefix will be
* added into function definition.
* - When application wants to link dynamically with PJLIB, then it
* must declare \a PJ_DLL macro when using/including PJLIB header,
* so that PJ_IMPORT_SPECIFIER is properly added into symbol
* declarations.
*
* When \a PJ_DLL macro is not declared, static linking is assumed.
*/
/**
* @def PJ_INLINE(type) * @def PJ_INLINE(type)
* @param type The return type of the function. * @param type The return type of the function.
* Expand the function as inline. * Expand the function as inline.
*/ */
#define PJ_INLINE(type) PJ_INLINE_SPECIFIER type #define PJ_INLINE(type) PJ_INLINE_SPECIFIER type
/** /**
* @def PJ_DECL(type)
* @param type The return type of the function.
* Declare a function.
*/
/**
* @def PJ_DECL_NO_RETURN(type) * @def PJ_DECL_NO_RETURN(type)
* @param type The return type of the function. * @param type The return type of the function.
* Declare a function that will not return. * Declare a function that will not return.
*/ */
/** /**
* @def PJ_BEGIN_DECL * @def PJ_BEGIN_DECL
* Mark beginning of declaration section in a header file. * Mark beginning of declaration section in a header file.
*/ */
/** /**
* @def PJ_END_DECL * @def PJ_END_DECL
* Mark end of declaration section in a header file. * Mark end of declaration section in a header file.
*/ */
#ifdef __cplusplus #ifdef __cplusplus
# define PJ_DECL(type) type
# define PJ_DECL_NO_RETURN(type) type PJ_NORETURN # define PJ_DECL_NO_RETURN(type) type PJ_NORETURN
# define PJ_IDECL_NO_RETURN(type) PJ_INLINE(type) PJ_NORETURN # define PJ_IDECL_NO_RETURN(type) PJ_INLINE(type) PJ_NORETURN
# define PJ_BEGIN_DECL extern "C" { # define PJ_BEGIN_DECL extern "C" {
# define PJ_END_DECL } # define PJ_END_DECL }
#else #else
# define PJ_DECL(type) extern type
# define PJ_DECL_NO_RETURN(type) PJ_NORETURN type # define PJ_DECL_NO_RETURN(type) PJ_NORETURN type
# define PJ_IDECL_NO_RETURN(type) PJ_NORETURN PJ_INLINE(type) # define PJ_IDECL_NO_RETURN(type) PJ_NORETURN PJ_INLINE(type)
# define PJ_BEGIN_DECL # define PJ_BEGIN_DECL
# define PJ_END_DECL # define PJ_END_DECL
#endif #endif
/** /**
* This macro declares platform/compiler specific specifier prefix
* to be added to symbol declaration to export the symbol when PJLIB
* is built as dynamic library.
*
* This macro should have been added by platform specific headers,
* if the platform supports building dynamic library target.
*/
#ifndef PJ_EXPORT_DECL_SPECIFIER
# define PJ_EXPORT_DECL_SPECIFIER
#endif
/**
* This macro declares platform/compiler specific specifier prefix
* to be added to symbol definition to export the symbol when PJLIB
* is built as dynamic library.
*
* This macro should have been added by platform specific headers,
* if the platform supports building dynamic library target.
*/
#ifndef PJ_EXPORT_DEF_SPECIFIER
# define PJ_EXPORT_DEF_SPECIFIER
#endif
/**
* This macro declares platform/compiler specific specifier prefix
* to be added to symbol declaration to import the symbol.
*
* This macro should have been added by platform specific headers,
* if the platform supports building dynamic library target.
*/
#ifndef PJ_IMPORT_DECL_SPECIFIER
# define PJ_IMPORT_DECL_SPECIFIER
#endif
/**
* This macro has been deprecated. It will evaluate to nothing.
*/
#ifndef PJ_EXPORT_SYMBOL
# define PJ_EXPORT_SYMBOL(x)
#endif
/**
* @def PJ_DECL(type)
* @param type The return type of the function.
* Declare a function.
*/
#if defined(PJ_DLL)
# if defined(PJ_EXPORTING)
# define PJ_DECL(type) PJ_EXPORT_DECL_SPECIFIER type
# else
# define PJ_DECL(type) PJ_IMPORT_DECL_SPECIFIER type
# endif
#elif !defined(PJ_DECL)
# if defined(__cplusplus)
# define PJ_DECL(type) type
# else
# define PJ_DECL(type) extern type
# endif
#endif
/**
* @def PJ_DEF(type) * @def PJ_DEF(type)
* @param type The return type of the function. * @param type The return type of the function.
* Define a function. * Define a function.
*/ */
#define PJ_DEF(type) type #if defined(PJ_DLL) && defined(PJ_EXPORTING)
# define PJ_DEF(type) PJ_EXPORT_DEF_SPECIFIER type
#elif !defined(PJ_DEF)
# define PJ_DEF(type) type
#endif
/** /**
* @def PJ_EXPORT_SYMBOL(sym) * @def PJ_DECL_DATA(type)
* @param sym The symbol to export. * @param type The data type.
* Export the specified symbol in compilation type that requires export * Declare a global data.
* (e.g. Linux kernel).
*/ */
#ifdef __PJ_EXPORT_SYMBOL #if defined(PJ_DLL)
# define PJ_EXPORT_SYMBOL(sym) __PJ_EXPORT_SYMBOL(sym) # if defined(PJ_EXPORTING)
#else # define PJ_DECL_DATA(type) PJ_EXPORT_DECL_SPECIFIER extern type
# define PJ_EXPORT_SYMBOL(sym) # else
# define PJ_DECL_DATA(type) PJ_IMPORT_DECL_SPECIFIER extern type
# endif
#elif !defined(PJ_DECL_DATA)
# define PJ_DECL_DATA(type) extern type
#endif
/**
* @def PJ_DEF_DATA(type)
* @param type The data type.
* Define a global data.
*/
#if defined(PJ_DLL) && defined(PJ_EXPORTING)
# define PJ_DEF_DATA(type) PJ_EXPORT_DEF_SPECIFIER type
#elif !defined(PJ_DEF_DATA)
# define PJ_DEF_DATA(type) type
#endif #endif
/** /**
* @def PJ_IDECL(type) * @def PJ_IDECL(type)
* @param type The function's return type. * @param type The function's return type.
* Declare a function that may be expanded as inline. * Declare a function that may be expanded as inline.
*/ */
/** /**
* @def PJ_IDEF(type) * @def PJ_IDEF(type)
* @param type The function's return type. * @param type The function's return type.
skipping to change at line 758 skipping to change at line 876
# error "PJ_THREAD_SET_STACK_SIZE should be defined in compat/os_xx.h" # error "PJ_THREAD_SET_STACK_SIZE should be defined in compat/os_xx.h"
#endif #endif
#if !defined(PJ_THREAD_ALLOCATE_STACK) #if !defined(PJ_THREAD_ALLOCATE_STACK)
# error "PJ_THREAD_ALLOCATE_STACK should be defined in compat/os_xx.h" # error "PJ_THREAD_ALLOCATE_STACK should be defined in compat/os_xx.h"
#endif #endif
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /**
* PJLIB version string. * PJLIB version string constant. @see pj_get_version()
*/
PJ_DECL_DATA(const char*) PJ_VERSION;
/**
* Get PJLIB version string.
*
* @return #PJ_VERSION constant.
*/ */
extern const char *PJ_VERSION; PJ_DECL(const char*) pj_get_version(void);
/** /**
* Dump configuration to log with verbosity equal to info(3). * Dump configuration to log with verbosity equal to info(3).
*/ */
PJ_DECL(void) pj_dump_config(void); PJ_DECL(void) pj_dump_config(void);
PJ_END_DECL PJ_END_DECL
#endif /* __PJ_CONFIG_H__ */ #endif /* __PJ_CONFIG_H__ */
 End of changes. 12 change blocks. 
19 lines changed or deleted 144 lines changed or added


 config_site_sample.h   config_site_sample.h 
skipping to change at line 17 skipping to change at line 17
* settings that I use for certain settings. * settings that I use for certain settings.
*/ */
/* /*
* Typical configuration for WinCE target. * Typical configuration for WinCE target.
*/ */
#if defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE!=0 #if defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE!=0
# define PJ_HAS_FLOATING_POINT 0 # define PJ_HAS_FLOATING_POINT 0
# define PJMEDIA_HAS_G711_PLC 0 # define PJMEDIA_HAS_G711_PLC 0
# define PJMEDIA_HAS_SMALL_FILTER 1 //# define PJMEDIA_HAS_SMALL_FILTER 1
# define PJMEDIA_HAS_LARGE_FILTER 0 //# define PJMEDIA_HAS_LARGE_FILTER 0
# define PJMEDIA_HAS_L16_CODEC 0 # define PJMEDIA_HAS_L16_CODEC 0
/*# define PJMEDIA_HAS_GSM_CODEC 0*/ /*# define PJMEDIA_HAS_GSM_CODEC 0*/
/*# define PJMEDIA_HAS_ILBC_CODEC 0*/ /*# define PJMEDIA_HAS_ILBC_CODEC 0*/
/*# define PJMEDIA_HAS_SPEEX_CODEC 0*/ /*# define PJMEDIA_HAS_SPEEX_CODEC 0*/
# define PJMEDIA_HAS_SPEEX_AEC 0 # define PJMEDIA_HAS_SPEEX_AEC 0
# undef PJMEDIA_RESAMPLE_IMP
# define PJMEDIA_RESAMPLE_IMP PJMEDIA_RESAMPLE_LIBRESAMPLE
#endif #endif
/* /*
* Typical configuration for Symbian OS target * Typical configuration for Symbian OS target
*/ */
#if defined(PJ_SYMBIAN) && PJ_SYMBIAN!=0 #if defined(PJ_SYMBIAN) && PJ_SYMBIAN!=0
/* We don't want to use float, for now */ /* We don't want to use float, for now */
# undef PJ_HAS_FLOATING_POINT # undef PJ_HAS_FLOATING_POINT
# define PJ_HAS_FLOATING_POINT 0 # define PJ_HAS_FLOATING_POINT 0
# define PJMEDIA_SOUND_IMPLEMENTATION PJMEDIA_SOUND_NULL_SOUND # define PJMEDIA_SOUND_IMPLEMENTATION PJMEDIA_SOUND_NULL_SOUND
/* Disable these */ /* Disable these */
# define PJMEDIA_HAS_LIBRESAMPLE 0 # define PJMEDIA_RESAMPLE_IMP PJMEDIA_RESAMPLE_NONE
# define PJMEDIA_HAS_SPEEX_AEC 0 # define PJMEDIA_HAS_SPEEX_AEC 0
/* Disable all codecs but G.711, for now */ /* Disable all codecs but G.711, for now */
# define PJMEDIA_HAS_L16_CODEC 0 # define PJMEDIA_HAS_L16_CODEC 0
# define PJMEDIA_HAS_GSM_CODEC 0 # define PJMEDIA_HAS_GSM_CODEC 0
# define PJMEDIA_HAS_ILBC_CODEC 0 # define PJMEDIA_HAS_ILBC_CODEC 0
# define PJMEDIA_HAS_SPEEX_CODEC 0 # define PJMEDIA_HAS_SPEEX_CODEC 0
/* Disable safe module access */ /* Disable safe module access */
# define PJSIP_SAFE_MODULE 0 # define PJSIP_SAFE_MODULE 0
 End of changes. 3 change blocks. 
3 lines changed or deleted 5 lines changed or added


 crc32.h   crc32.h 
/* $Id: crc32.h 1003 2007-02-26 22:31:06Z bennylp $ */ /* $Id: crc32.h 1374 2007-06-19 09:04:58Z bennylp $ */
/* /*
* Copyright (C) 2003-2005 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 ctype.h   ctype.h 
/* $Id: ctype.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: ctype.h 1410 2007-07-28 02:44:55Z bennylp $ */
/* /*
* Copyright (C)2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C)2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 138 skipping to change at line 138
* an hexadecimal digit character. * an hexadecimal digit character.
* @param c The integer character to test. * @param c The integer character to test.
* @return Non-zero value if c is a particular representation of * @return Non-zero value if c is a particular representation of
* an hexadecimal digit character. * an hexadecimal digit character.
*/ */
PJ_INLINE(int) pj_isxdigit(int c){ return isxdigit(c); } PJ_INLINE(int) pj_isxdigit(int c){ return isxdigit(c); }
/** /**
* Array of hex digits, in lowerspace. * Array of hex digits, in lowerspace.
*/ */
extern char pj_hex_digits[]; /*extern char pj_hex_digits[];*/
#define pj_hex_digits "0123456789abcdef"
/** /**
* Convert a value to hex representation. * Convert a value to hex representation.
* @param value Integral value to convert. * @param value Integral value to convert.
* @param p Buffer to hold the hex representation, which must be * @param p Buffer to hold the hex representation, which must be
* at least two bytes length. * at least two bytes length.
*/ */
PJ_INLINE(void) pj_val_to_hex_digit(unsigned value, char *p) PJ_INLINE(void) pj_val_to_hex_digit(unsigned value, char *p)
{ {
*p++ = pj_hex_digits[ (value & 0xF0) >> 4 ]; *p++ = pj_hex_digits[ (value & 0xF0) >> 4 ];
 End of changes. 2 change blocks. 
2 lines changed or deleted 3 lines changed or added


 doxygen.h   doxygen.h 
/* $Id: doxygen.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: doxygen.h 1450 2007-09-24 19:46:41Z bennylp $ */
/* /*
* Copyright (C)2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C)2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 58 skipping to change at line 58
* *
* *
* @section how_to_use_sec About This Documentation * @section how_to_use_sec About This Documentation
* *
* This document is generated directly from PJLIB source file using * This document is generated directly from PJLIB source file using
* \a doxygen (http://www.doxygen.org). Doxygen is a great (and free!) * \a doxygen (http://www.doxygen.org). Doxygen is a great (and free!)
* tools for generating such documentation. * tools for generating such documentation.
* *
* @subsection doc_ver_subsec Version * @subsection doc_ver_subsec Version
* *
* This document corresponds to PJLIB version 0.5.10. * This document corresponds to PJLIB version 0.7.0-trunk.
* *
* *
* @subsection find_samples_subsec How to Read This Document * @subsection find_samples_subsec How to Read This Document
* *
* This documentation is laid out more to be a reference guide instead * This documentation is laid out more to be a reference guide instead
* of tutorial, therefore first time users may find it difficult to * of tutorial, therefore first time users may find it difficult to
* grasp PJLIB by reading this document alone. * grasp PJLIB by reading this document alone.
* *
* However, we've tried our best to make this document easy to follow. * However, we've tried our best to make this document easy to follow.
* For first time users, we would suggest that you follow these steps * For first time users, we would suggest that you follow these steps
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 errno.h   errno.h 
/* $Id: errno.h 1269 2007-05-12 15:03:23Z bennylp $ */ /* $Id: errno.h 1469 2007-10-03 18:28:49Z bennylp $ */
/* /*
* Copyright (C)2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C)2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 303 skipping to change at line 303
* @hideinitializer * @hideinitializer
* Error in gethostbyname(). This is a generic error returned when * Error in gethostbyname(). This is a generic error returned when
* gethostbyname() has returned an error. * gethostbyname() has returned an error.
*/ */
#define PJ_ERESOLVE (PJ_ERRNO_START_STATUS + 18)/* 70018 */ #define PJ_ERESOLVE (PJ_ERRNO_START_STATUS + 18)/* 70018 */
/** /**
* @hideinitializer * @hideinitializer
* Size is too small. * Size is too small.
*/ */
#define PJ_ETOOSMALL (PJ_ERRNO_START_STATUS + 19)/* 70019 */ #define PJ_ETOOSMALL (PJ_ERRNO_START_STATUS + 19)/* 70019 */
/**
* @hideinitializer
* Ignored
*/
#define PJ_EIGNORED (PJ_ERRNO_START_STATUS + 20)/* 70020 */
/** @} */ /* pj_errnum */ /** @} */ /* pj_errnum */
/** @} */ /* pj_errno */ /** @} */ /* pj_errno */
/** /**
* PJ_ERRNO_START is where PJLIB specific error values start. * PJ_ERRNO_START is where PJLIB specific error values start.
*/ */
#define PJ_ERRNO_START 20000 #define PJ_ERRNO_START 20000
skipping to change at line 348 skipping to change at line 353
/* /*
* Below are list of error spaces that have been taken so far: * Below are list of error spaces that have been taken so far:
* - PJSIP_ERRNO_START (PJ_ERRNO_START_USER) * - PJSIP_ERRNO_START (PJ_ERRNO_START_USER)
* - PJMEDIA_ERRNO_START (PJ_ERRNO_START_USER + PJ_ERRNO_SPACE_SIZE) * - PJMEDIA_ERRNO_START (PJ_ERRNO_START_USER + PJ_ERRNO_SPACE_SIZE)
* - PJSIP_SIMPLE_ERRNO_START (PJ_ERRNO_START_USER + PJ_ERRNO_SPACE_SIZE*2 ) * - PJSIP_SIMPLE_ERRNO_START (PJ_ERRNO_START_USER + PJ_ERRNO_SPACE_SIZE*2 )
* - PJLIB_UTIL_ERRNO_START (PJ_ERRNO_START_USER + PJ_ERRNO_SPACE_SIZE*3 ) * - PJLIB_UTIL_ERRNO_START (PJ_ERRNO_START_USER + PJ_ERRNO_SPACE_SIZE*3 )
* - PJNATH_ERRNO_START (PJ_ERRNO_START_USER + PJ_ERRNO_SPACE_SIZE*4 ) * - PJNATH_ERRNO_START (PJ_ERRNO_START_USER + PJ_ERRNO_SPACE_SIZE*4 )
*/ */
PJ_END_DECL
/* Internal */ /* Internal */
void pj_errno_clear_handlers(void); void pj_errno_clear_handlers(void);
PJ_END_DECL
#endif /* __PJ_ERRNO_H__ */ #endif /* __PJ_ERRNO_H__ */
 End of changes. 4 change blocks. 
3 lines changed or deleted 8 lines changed or added


 evsub.h   evsub.h 
/* $Id: evsub.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: evsub.h 1417 2007-08-16 10:11:44Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 198 skipping to change at line 198
void (*on_server_timeout)(pjsip_evsub *sub); void (*on_server_timeout)(pjsip_evsub *sub);
}; };
/** /**
* @see pjsip_evsub_user * @see pjsip_evsub_user
*/ */
typedef struct pjsip_evsub_user pjsip_evsub_user; typedef struct pjsip_evsub_user pjsip_evsub_user;
/** /**
* SUBSCRIBE method constant. @see pjsip_get_subscribe_method()
*/
PJ_DECL_DATA(const pjsip_method) pjsip_subscribe_method;
/**
* NOTIFY method constant. @see pjsip_get_notify_method()
*/
PJ_DECL_DATA(const pjsip_method) pjsip_notify_method;
/**
* SUBSCRIBE method constant. * SUBSCRIBE method constant.
*/ */
extern const pjsip_method pjsip_subscribe_method; PJ_DECL(const pjsip_method*) pjsip_get_subscribe_method();
/** /**
* NOTIFY method constant. * NOTIFY method constant.
*/ */
extern const pjsip_method pjsip_notify_method; PJ_DECL(const pjsip_method*) pjsip_get_notify_method();
/** /**
* Initialize the event subscription module and register the module to the * Initialize the event subscription module and register the module to the
* specified endpoint. * specified endpoint.
* *
* @param endpt The endpoint instance. * @param endpt The endpoint instance.
* *
* @return PJ_SUCCESS if module can be created and registered * @return PJ_SUCCESS if module can be created and registered
* successfully. * successfully.
*/ */
 End of changes. 4 change blocks. 
3 lines changed or deleted 13 lines changed or added


 evsub_msg.h   evsub_msg.h 
/* $Id: evsub_msg.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: evsub_msg.h 1417 2007-08-16 10:11:44Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 103 skipping to change at line 103
* *
* @param pool The pool. * @param pool The pool.
* *
* @return Subscription-State header. * @return Subscription-State header.
*/ */
PJ_DECL(pjsip_sub_state_hdr*) pjsip_sub_state_hdr_create(pj_pool_t *pool); PJ_DECL(pjsip_sub_state_hdr*) pjsip_sub_state_hdr_create(pj_pool_t *pool);
/** /**
* Initialize parser for event notify module. * Initialize parser for event notify module.
*/ */
PJ_DEF(void) pjsip_evsub_init_parser(void); PJ_DECL(void) pjsip_evsub_init_parser(void);
PJ_END_DECL PJ_END_DECL
/** /**
* @} * @}
*/ */
#endif /* __PJSIP_SIMPLE_EVENT_NOTIFY_MSG_H__ */ #endif /* __PJSIP_SIMPLE_EVENT_NOTIFY_MSG_H__ */
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 guid.h   guid.h 
skipping to change at line 54 skipping to change at line 54
/** /**
* PJ_GUID_STRING_LENGTH specifies length of GUID string. The value is * PJ_GUID_STRING_LENGTH specifies length of GUID string. The value is
* dependent on the algorithm used internally to generate the GUID string. * dependent on the algorithm used internally to generate the GUID string.
* If real GUID generator is used, then the length will be between 32 and * If real GUID generator is used, then the length will be between 32 and
* 36 bytes. If shadow GUID generator is used, then the length * 36 bytes. If shadow GUID generator is used, then the length
* will be 20 bytes. Application should not assume which algorithm will * will be 20 bytes. Application should not assume which algorithm will
* be used by GUID generator. * be used by GUID generator.
* *
* Regardless of the actual length of the GUID, it will not exceed * Regardless of the actual length of the GUID, it will not exceed
* PJ_GUID_MAX_LENGTH characters. * PJ_GUID_MAX_LENGTH characters.
*
* @see pj_GUID_STRING_LENGTH()
* @see PJ_GUID_MAX_LENGTH
*/
PJ_DECL_DATA(const unsigned) PJ_GUID_STRING_LENGTH;
/**
* Get #PJ_GUID_STRING_LENGTH constant.
*/ */
extern const unsigned PJ_GUID_STRING_LENGTH; PJ_DECL(unsigned) pj_GUID_STRING_LENGTH();
/** /**
* PJ_GUID_MAX_LENGTH specifies the maximum length of GUID string, * PJ_GUID_MAX_LENGTH specifies the maximum length of GUID string,
* regardless of which algorithm to use. * regardless of which algorithm to use.
*/ */
#define PJ_GUID_MAX_LENGTH 36 #define PJ_GUID_MAX_LENGTH 36
/** /**
* Create a globally unique string, which length is PJ_GUID_STRING_LENGTH * Create a globally unique string, which length is PJ_GUID_STRING_LENGTH
* characters. Caller is responsible for preallocating the storage used * characters. Caller is responsible for preallocating the storage used
 End of changes. 2 change blocks. 
1 lines changed or deleted 9 lines changed or added


 hmac_md5.h   hmac_md5.h 
/* $Id: hmac_md5.h 1265 2007-05-11 10:37:14Z bennylp $ */ /* $Id: hmac_md5.h 1374 2007-06-19 09:04:58Z bennylp $ */
/* /*
* Copyright (C) 2003-2005 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 hmac_sha1.h   hmac_sha1.h 
/* $Id: hmac_sha1.h 1265 2007-05-11 10:37:14Z bennylp $ */ /* $Id: hmac_sha1.h 1374 2007-06-19 09:04:58Z bennylp $ */
/* /*
* Copyright (C) 2003-2005 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 ice_session.h   ice_session.h 
/* $Id: ice_session.h 1242 2007-05-02 11:29:37Z bennylp $ */ /* $Id: ice_session.h 1487 2007-10-07 12:51:15Z bennylp $ */
/* /*
* Copyright (C) 2003-2005 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 47 skipping to change at line 47
/** /**
* @defgroup PJNATH_ICE_SESSION ICE Session * @defgroup PJNATH_ICE_SESSION ICE Session
* @brief Transport Independent ICE Session * @brief Transport Independent ICE Session
* @ingroup PJNATH_ICE * @ingroup PJNATH_ICE
* @{ * @{
* *
* This module describes #pj_ice_sess, a transport independent ICE session, * This module describes #pj_ice_sess, a transport independent ICE session,
* part of PJNATH - the Open Source NAT helper library. * part of PJNATH - the Open Source NAT helper library.
* *
* \section pj_ice_sess_sec ICE Session
*
* An ICE session, represented by #pj_ice_sess structure, is the lowest * An ICE session, represented by #pj_ice_sess structure, is the lowest
* abstraction of ICE in PJNATH, and it is used to perform and manage * abstraction of ICE in PJNATH, and it is used to perform and manage
* connectivity checks of transport address candidates <b>within a * connectivity checks of transport address candidates <b>within a
* single media stream</b> (note: this differs from what is described * single media stream</b> (note: this differs from what is described
* in ICE draft, where an ICE session manages the whole media sessions * in ICE draft, where an ICE session manages the whole media sessions
* rather than just a single stream). * rather than just a single stream).
* *
* The ICE session described here is independent from any transports, * The ICE session described here is independent from any transports,
* meaning that the actual network I/O for this session would have to * meaning that the actual network I/O for this session would have to
* be performed by the application, or higher layer abstraction. * be performed by the application, or higher layer abstraction.
* Using this framework, application would give any incoming packets to * Using this framework, application would give any incoming packets to
* the ICE session, and it would provide the ICE session with a callback * the ICE session, and it would provide the ICE session with a callback
* to send outgoing message. * to send outgoing message.
* *
* For higher abstraction of ICE where transport is included, please * For higher abstraction of ICE where transport is included, please
* see \ref PJNATH_ICE_STREAM_TRANSPORT. * see \ref PJNATH_ICE_STREAM_TRANSPORT.
*
* \subsection pj_ice_sess_using_sec Using The ICE Session
*
* The steps below describe how to use ICE session. Alternatively applicati
on
* can use the higher level ICE API, \ref PJNATH_ICE_STREAM_TRANSPORT,
* which has provided the integration of ICE with socket transport.
*
* The steps to use ICE session is similar for both offerer and
* answerer:
* - create ICE session with #pj_ice_sess_create(). Among other things,
* application needs to specify:
* - STUN configuration (pj_stun_config), containing STUN settings
* such as timeout values and the instances of timer heap and
* ioqueue.
* - Session name, useful for identifying this session in the log.
* - Initial ICE role (#pj_ice_sess_role). The role can be changed
* at later time with #pj_ice_sess_change_role(), and ICE session
* can also change its role automatically when it detects role
* conflict.
* - Number of components in the media session.
* - Callback to receive ICE events (#pj_ice_sess_cb)
* - Optional local ICE username and password. If these arguments
* are NULL, they will be generated randomly.
* - Add local candidates for each component, with #pj_ice_sess_add_cand().
* A candidate is represented with #pj_ice_sess_cand structure.
* Each component must be provided with at least one candidate, and
* all components must have the same number of candidates. Failing
* to comply with this will cause failure during pairing process.
* - Create offer to describe local ICE candidates. ICE session does not
* provide a function to create such offer, but application should be
* able to create one since it knows about all components and candidates.
* If application uses \ref PJNATH_ICE_STREAM_TRANSPORT, it can
* enumerate local candidates by calling #pj_ice_strans_enum_cands().
* Application may use #pj_ice_sess_find_default_cand() to let ICE
* session chooses the default transport address to be used in SDP
* c= and m= lines.
* - Send the offer to remote endpoint using signaling such as SIP.
* - Once application has received the answer, it should parse this
* answer, build array of remote candidates, and create check lists by
* calling #pj_ice_sess_create_check_list(). This process is known as
* pairing the candidates, and will result in the creation of check lists
.
* - Once checklist has been created, application then can call
* #pj_ice_sess_start_check() to instruct ICE session to start
* performing connectivity checks. The ICE session performs the
* connectivity checks by processing each check in the checklists.
* - Application will be notified about the result of ICE connectivity
* checks via the callback that was given in #pj_ice_sess_create()
* above.
*
* To send data, application calls #pj_ice_sess_send_data(). If ICE
* negotiation has not completed, ICE session would simply drop the data,
* and return error to caller. If ICE negotiation has completed
* successfully, ICE session will in turn call the \a on_tx_pkt
* callback of #pj_ice_sess_cb instance that was previously registered
* in #pj_ice_sess_create() above.
*
* When application receives any packets on the underlying sockets, it
* must call #pj_ice_sess_on_rx_pkt(). The ICE session will inspect the
* packet to decide whether to process it locally (if the packet is a
* STUN message and is part of ICE session) or otherwise pass it back to
* application via \a on_rx_data callback.
*/ */
/** /**
* This enumeration describes the type of an ICE candidate. * This enumeration describes the type of an ICE candidate.
*/ */
typedef enum pj_ice_cand_type typedef enum pj_ice_cand_type
{ {
/** /**
* ICE host candidate. A host candidate represents the actual local * ICE host candidate. A host candidate represents the actual local
* transport address in the host. * transport address in the host.
skipping to change at line 454 skipping to change at line 517
char obj_name[PJ_MAX_OBJ_NAME]; /**< Object name. */ char obj_name[PJ_MAX_OBJ_NAME]; /**< Object name. */
pj_pool_t *pool; /**< Pool instance. */ pj_pool_t *pool; /**< Pool instance. */
void *user_data; /**< App. data. */ void *user_data; /**< App. data. */
pj_mutex_t *mutex; /**< Mutex. */ pj_mutex_t *mutex; /**< Mutex. */
pj_ice_sess_role role; /**< ICE role. */ pj_ice_sess_role role; /**< ICE role. */
pj_timestamp tie_breaker; /**< Tie breaker value */ pj_timestamp tie_breaker; /**< Tie breaker value */
pj_uint8_t *prefs; /**< Type preference. */ pj_uint8_t *prefs; /**< Type preference. */
pj_bool_t is_complete; /**< Complete? */ pj_bool_t is_complete; /**< Complete? */
pj_status_t ice_status; /**< Error statu s. */ pj_status_t ice_status; /**< Error statu s. */
pj_timer_entry completion_timer; /**< To call callback. */
pj_ice_sess_cb cb; /**< Callback. */ pj_ice_sess_cb cb; /**< Callback. */
pj_stun_config stun_cfg; /**< STUN settings. */ pj_stun_config stun_cfg; /**< STUN settings. */
/* STUN credentials */ /* STUN credentials */
pj_str_t tx_ufrag; /**< Remote ufrag. */ pj_str_t tx_ufrag; /**< Remote ufrag. */
pj_str_t tx_uname; /**< Uname for TX. */ pj_str_t tx_uname; /**< Uname for TX. */
pj_str_t tx_pass; /**< Remote password. */ pj_str_t tx_pass; /**< Remote password. */
pj_str_t rx_ufrag; /**< Local ufrag. */ pj_str_t rx_ufrag; /**< Local ufrag. */
pj_str_t rx_uname; /**< Uname for RX */ pj_str_t rx_uname; /**< Uname for RX */
 End of changes. 5 change blocks. 
2 lines changed or deleted 68 lines changed or added


 ice_strans.h   ice_strans.h 
/* $Id: ice_strans.h 1242 2007-05-02 11:29:37Z bennylp $ */ /* $Id: ice_strans.h 1487 2007-10-07 12:51:15Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 35 skipping to change at line 35
*/ */
#include <pjnath/ice_session.h> #include <pjnath/ice_session.h>
#include <pjlib-util/resolver.h> #include <pjlib-util/resolver.h>
#include <pj/ioqueue.h> #include <pj/ioqueue.h>
#include <pj/timer.h> #include <pj/timer.h>
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /**
* @defgroup PJNATH_ICE_STREAM_TRANSPORT ICE Stream Transport * @defgroup PJNATH_ICE_STREAM_TRANSPORT ICE Stream Transport
* @brief Transport for media stream using ICE * @brief Transport for media streams using ICE
* @ingroup PJNATH_ICE * @ingroup PJNATH_ICE
* @{ * @{
* *
* This module describes ICE stream transport, as represented by #pj_ice_st rans * This module describes ICE stream transport, as represented by #pj_ice_st rans
* structure, and is part of PJNATH - the Open Source NAT traversal helper * structure, and is part of PJNATH - the Open Source NAT traversal helper
* library. * library.
* *
* ICE stream transport, as represented by #pj_ice_strans structure, is an ICE * ICE stream transport, as represented by #pj_ice_strans structure, is an ICE
* capable component for transporting media within a media stream. * capable component for transporting media streams within a media session.
* It consists of one or more transport sockets (typically two for RTP * It consists of one or more transport sockets (typically two for RTP
* based communication - one for RTP and one for RTCP), and an * based communication - one for RTP and one for RTCP), and an
* \ref PJNATH_ICE_SESSION for performing connectivity checks among the. * \ref PJNATH_ICE_SESSION for performing connectivity checks among the.
* various candidates of the transport addresses. * various candidates of the transport addresses.
* *
* \section PJNATH_ICE_STREAM_TRANSPORT_USING Using the ICE Stream Transpor t * \section PJNATH_ICE_STREAM_TRANSPORT_USING Using the ICE Stream Transpor t
* *
* Application may use the ICE stream transport in two ways: * Application may use the ICE stream transport in two ways:
* - it can create the ICE stream transports once during application * - it can create the ICE stream transports once during application
* initialization and keep them alive throughout application lifetime, o r * initialization and keep them alive throughout application lifetime, o r
skipping to change at line 67 skipping to change at line 67
* *
* Keeping the ICE stream transport alive throughout * Keeping the ICE stream transport alive throughout
* application's lifetime is normally preferable, as initializing the * application's lifetime is normally preferable, as initializing the
* ICE stream transport may incur delay because the ICE stream transport * ICE stream transport may incur delay because the ICE stream transport
* would need to communicate with the STUN/TURN server to get the * would need to communicate with the STUN/TURN server to get the
* server reflexive and relayed candidates for the transports. * server reflexive and relayed candidates for the transports.
* *
* Regardless of which usage scenario is being used, the ICE stream * Regardless of which usage scenario is being used, the ICE stream
* transport is capable for restarting the ICE session being used and to * transport is capable for restarting the ICE session being used and to
* send STUN keep-alives for its STUN server reflexive and relayed * send STUN keep-alives for its STUN server reflexive and relayed
* candidates. * candidates. When ICE stream transport detects that the STUN mapped
* address has changed in the keep-alive response, it will automatically
* update its address to the new address, and notify the application via
* \a on_addr_change() function of the #pj_ice_strans_cb callback.
* *
* \subsection PJNATH_ICE_ST_TRA_INIT Stream Transport Initialization * \subsection PJNATH_ICE_ST_TRA_INIT Initialization
* *
* Application creates the ICE stream transport by calling * Application creates the ICE stream transport by calling
* #pj_ice_strans_create() function. * #pj_ice_strans_create() function. Among other things, application needs
* to specify:
* - STUN configuration (pj_stun_config), containing STUN settings
* such as timeout values and the instances of timer heap and
* ioqueue.
* - Session name, useful for identifying this session in the log.
* - Number of ICE components.
* - Arbitrary user data, useful when associating the ICE session
* with some application's data structure.
* - A callback (#pj_ice_strans_cb) to receive events from the ICE
* stream transport. Two of the most important fields in this
* callback structure are \a on_rx_data() to notify application
* about incoming data (perhaps RTP or RTCP packet), and
* \a on_ice_complete() to notify application that ICE negotiation
* has completed, either successfully or with failure.
* *
* After the ICE stream transport is created, application may set up the * After the ICE stream transport is created, application may set up the
* STUN servers to be used to obtain STUN server reflexive and relayed * STUN servers to be used to obtain STUN server reflexive and relayed
* candidate, by calling #pj_ice_strans_set_stun_domain() or * candidate, by calling #pj_ice_strans_set_stun_domain() or
* #pj_ice_strans_set_stun_srv(). Then it has to create each component by * #pj_ice_strans_set_stun_srv().
* calling #pj_ice_strans_create_comp(); this would create an actual socket *
* Application then creates each component by calling
* #pj_ice_strans_create_comp(); this would create an actual socket
* which listens to the specified local address, and it would also * which listens to the specified local address, and it would also
* perform lookup to find various transport address candidates for this * perform lookup to find various transport address candidates for this
* socket. * socket.
* *
* \subsection PJNATH_ICE_ST_TRA_INIT_ICE ICE Session Initialization * Adding component may involve contacting STUN and TURN servers to get
* STUN mapped address and allocate TURN relay channel, and this process
* may take some time to complete. Once application has added all
* components, it can check whether server reflexive and relayed
* candidates have been acquired, by calling #pj_ice_strans_get_comps_statu
s().
*
* \subsection PJNATH_ICE_ST_TRA_INIT_ICE Starting ICE Session
* *
* When application is about to send an offer containing ICE capability, * When application is about to send an offer containing ICE capability,
* or when it receives an offer containing ICE capability, it would * or when it receives an offer containing ICE capability, it would
* create the ICE session by calling #pj_ice_strans_init_ice(). This would * create the ICE session by calling #pj_ice_strans_init_ice(). This would
* register all transport address aliases for each component to the ICE * register all transport address aliases for each component to the ICE
* session as candidates. After this application can enumerate all local * session as candidates. After this application can enumerate all local
* candidates by calling #pj_ice_strans_enum_cands(), and encode these * candidates by calling #pj_ice_strans_enum_cands(), and encode these
* candidates in the SDP to be sent to remote agent. * candidates in the SDP to be sent to remote agent.
* *
* \subsection PJNATH_ICE_ST_TRA_START Starting Connectivity Checks * \subsection PJNATH_ICE_ST_TRA_START Starting Connectivity Checks
* *
* Once application receives the SDP from remote, it can start ICE * Once application receives the SDP from remote, it pairs local candidates
* connectivity checks by calling #pj_ice_strans_start_ice(), specifying * with remote candidates, and can start ICE connectivity checks. This is
* the username, password, and candidates of the remote agent. The ICE * done by calling #pj_ice_strans_start_ice(), specifying
* session/transport will then notify the application via the callback * the remote candidate list, and remote username and password. If the
* when ICE connectivity checks completes, either successfully or with * pairing process is successful, ICE connectivity checks will begin
* failure. * immediately. The ICE session/transport will then notify the application
* via the callback when ICE connectivity checks completes, either
* successfully or with failure.
*
* \subsection PJNATH_ICE_ST_TRA_SEND_RECV Sending and Receiving Data
*
* Application can send data (normally RTP or RTCP packets) at any time
* by calling #pj_ice_strans_sendto(). This function takes a destination
* address as one of the arguments, and this destination address should
* be taken from the default transport address of the component (that is
* the address in SDP c= and m= lines, or in a=rtcp attribute).
* If ICE negotiation is in progress, this function will send the data
* to the destination address. Otherwise if ICE negotiation has completed
* successfully, this function will send the data to the nominated remote
* address, as negotiated by ICE.
*
* Upon receiving incoming data (that is a non-STUN message), the ICE
* stream transport will notify the application by calling \a on_rx_data()
* of the #pj_ice_strans_cb callback.
* *
* \subsection PJNATH_ICE_ST_TRA_STOP Stopping ICE Session * \subsection PJNATH_ICE_ST_TRA_STOP Stopping ICE Session
* *
* Once the call is terminated, application no longer needs to keep the * Once the call is terminated, application no longer needs to keep the
* ICE session, so it should call #pj_ice_strans_stop_ice() to destroy the * ICE session, so it should call #pj_ice_strans_stop_ice() to destroy the
* ICE session within this ICE stream transport. Note that this WILL NOT * ICE session within this ICE stream transport. Note that this WILL NOT
* destroy the sockets/transports, it only destroys the ICE session * destroy the sockets/transports, it only destroys the ICE session
* within this ICE stream transport. * within this ICE stream transport. It is recommended that application
* retains the ICE stream transport to speed up the process of setting up
* the next call. The ICE stream transport will continue to send STUN
* keep-alive packets to keep the NAT binding open and to detect change
* in STUN mapped address.
* *
* \subsection PJNATH_ICE_ST_TRA_RESTART Restarting ICE Session * \subsection PJNATH_ICE_ST_TRA_RESTART Restarting ICE Session
* *
* When a new call is made, application can repeat the above * When a new call is made, application can repeat the above
* #pj_ice_strans_init_ice() to #pj_ice_strans_stop_ice() cycle for * #pj_ice_strans_init_ice() to #pj_ice_strans_stop_ice() cycle for
* the new call, using this same ICE stream transport. * the new call, using this same ICE stream transport.
* *
* \subsection PJNATH_ICE_ST_TRA_DESTROY Destroying ICE Stream Transport * \subsection PJNATH_ICE_ST_TRA_DESTROY Destroying ICE Stream Transport
* *
* Finally, when the ICE stream transport itself is no longer needed, * Finally, when the ICE stream transport itself is no longer needed,
skipping to change at line 162 skipping to change at line 209
/** /**
* This callback will be called when ICE checks have completed. * This callback will be called when ICE checks have completed.
* This callback is optional. * This callback is optional.
* *
* @param ice_st The ICE stream transport. * @param ice_st The ICE stream transport.
* @param status The ICE connectivity check status. * @param status The ICE connectivity check status.
*/ */
void (*on_ice_complete)(pj_ice_strans *ice_st, void (*on_ice_complete)(pj_ice_strans *ice_st,
pj_status_t status); pj_status_t status);
/**
* This callback will be called when ICE transport has detected that
* the STUN mapped address of a candidate has changed.
*
* @param ice_st The ICE stream transport.
* @param comp_id Component ID.
* @param cand_id Candidate ID.
*/
void (*on_addr_change)(pj_ice_strans *ice_st,
unsigned comp_id,
unsigned cand_id);
} pj_ice_strans_cb; } pj_ice_strans_cb;
/** /**
* Various flags that can be specified when creating a component with * Various flags that can be specified when creating a component with
* #pj_ice_strans_create_comp(). These options may be combined together * #pj_ice_strans_create_comp(). These options may be combined together
* with bitmask operation. * with bitmask operation.
*/ */
enum pj_ice_strans_option enum pj_ice_strans_option
{ {
/** /**
skipping to change at line 550 skipping to change at line 609
* *
* @param ice_st The ICE stream transport. * @param ice_st The ICE stream transport.
* *
* @return PJ_SUCCESS, or the appropriate error code. * @return PJ_SUCCESS, or the appropriate error code.
*/ */
PJ_DECL(pj_status_t) pj_ice_strans_stop_ice(pj_ice_strans *ice_st); PJ_DECL(pj_status_t) pj_ice_strans_stop_ice(pj_ice_strans *ice_st);
/** /**
* Send outgoing packet using this transport. If ICE checks have not * Send outgoing packet using this transport. If ICE checks have not
* produced a valid check for the specified component ID, this function * produced a valid check for the specified component ID, this function
* will return with failure. Otherwise it will send the packet to remote * send to the destination address. Otherwise it will send the packet to
* destination using the nominated local candidate as have been checked * remote destination using the nominated local candidate as have been chec
ked
* previously. * previously.
* *
* @param ice_st The ICE stream transport. * @param ice_st The ICE stream transport.
* @param comp_id Component ID. * @param comp_id Component ID.
* @param data The data or packet to be sent. * @param data The data or packet to be sent.
* @param data_len Size of data or packet, in bytes. * @param data_len Size of data or packet, in bytes.
* @param dst_addr The destination address. * @param dst_addr The destination address.
* @param dst_addr_len Length of destination address. * @param dst_addr_len Length of destination address.
* *
* @return PJ_SUCCESS if data is sent successfully. * @return PJ_SUCCESS if data is sent successfully.
 End of changes. 12 change blocks. 
18 lines changed or deleted 79 lines changed or added


 ioqueue.h   ioqueue.h 
/* $Id: ioqueue.h 974 2007-02-19 01:13:53Z bennylp $ /* $Id: ioqueue.h 1405 2007-07-20 08:08:30Z bennylp $
*/ */
/* /*
* Copyright (C)2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C)2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
skipping to change at line 472 skipping to change at line 472
*/ */
PJ_DECL(pj_status_t) pj_ioqueue_connect( pj_ioqueue_key_t *key, PJ_DECL(pj_status_t) pj_ioqueue_connect( pj_ioqueue_key_t *key,
const pj_sockaddr_t *addr, const pj_sockaddr_t *addr,
int addrlen ); int addrlen );
#endif /* PJ_HAS_TCP */ #endif /* PJ_HAS_TCP */
/** /**
* Poll the I/O Queue for completed events. * Poll the I/O Queue for completed events.
* *
* Note: polling the ioqueue is not necessary in Symbian. Please see
* @ref PJ_SYMBIAN_OS for more info.
*
* @param ioque the I/O Queue. * @param ioque the I/O Queue.
* @param timeout polling timeout, or NULL if the thread wishes to wai t * @param timeout polling timeout, or NULL if the thread wishes to wai t
* indefinetely for the event. * indefinetely for the event.
* *
* @return * @return
* - zero if timed out (no event). * - zero if timed out (no event).
* - (<0) if error occured during polling. Callback will NOT be called. * - (<0) if error occured during polling. Callback will NOT be called.
* - (>1) to indicate numbers of events. Callbacks have been called. * - (>1) to indicate numbers of events. Callbacks have been called.
*/ */
PJ_DECL(int) pj_ioqueue_poll( pj_ioqueue_t *ioque, PJ_DECL(int) pj_ioqueue_poll( pj_ioqueue_t *ioque,
 End of changes. 2 change blocks. 
1 lines changed or deleted 4 lines changed or added


 list_i.h   list_i.h 
/* $Id: list_i.h 1235 2007-04-30 21:03:32Z bennylp $ */ /* $Id: list_i.h 1405 2007-07-20 08:08:30Z bennylp $ */
/* /*
* Copyright (C)2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C)2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A
*/ */
/* Internal */ /* Internal */
PJ_IDEF(void) pj_link_node(pj_list_type *prev, pj_list_type *next) PJ_INLINE(void) pj_link_node(pj_list_type *prev, pj_list_type *next)
{ {
((pj_list*)prev)->next = next; ((pj_list*)prev)->next = next;
((pj_list*)next)->prev = prev; ((pj_list*)next)->prev = prev;
} }
/* PJ_IDEF(void) pj_list_insert_after(pj_list_type *pos, pj_list_type *node)
PJ_IDEF(void)
pj_list_init(pj_list_type * node)
{
((pj_list*)node)->next = ((pj_list*)node)->prev = node;
}
PJ_IDEF(int) pj_list_empty(const pj_list_type * node)
{
return ((pj_list*)node)->next == node;
}
*/
PJ_IDEF(void)
pj_list_insert_after(pj_list_type *pos, pj_list_type *node)
{ {
((pj_list*)node)->prev = pos; ((pj_list*)node)->prev = pos;
((pj_list*)node)->next = ((pj_list*)pos)->next; ((pj_list*)node)->next = ((pj_list*)pos)->next;
((pj_list*) ((pj_list*)pos)->next) ->prev = node; ((pj_list*) ((pj_list*)pos)->next) ->prev = node;
((pj_list*)pos)->next = node; ((pj_list*)pos)->next = node;
} }
PJ_IDEF(void) PJ_IDEF(void) pj_list_insert_before(pj_list_type *pos, pj_list_type *node)
pj_list_insert_before(pj_list_type *pos, pj_list_type *node)
{ {
pj_list_insert_after(((pj_list*)pos)->prev, node); pj_list_insert_after(((pj_list*)pos)->prev, node);
} }
PJ_IDEF(void) PJ_IDEF(void) pj_list_insert_nodes_after(pj_list_type *pos, pj_list_type *l
pj_list_insert_nodes_after(pj_list_type *pos, pj_list_type *lst) st)
{ {
pj_list *lst_last = (pj_list *) ((pj_list*)lst)->prev; pj_list *lst_last = (pj_list *) ((pj_list*)lst)->prev;
pj_list *pos_next = (pj_list *) ((pj_list*)pos)->next; pj_list *pos_next = (pj_list *) ((pj_list*)pos)->next;
pj_link_node(pos, lst); pj_link_node(pos, lst);
pj_link_node(lst_last, pos_next); pj_link_node(lst_last, pos_next);
} }
PJ_IDEF(void) PJ_IDEF(void) pj_list_insert_nodes_before(pj_list_type *pos, pj_list_type *
pj_list_insert_nodes_before(pj_list_type *pos, pj_list_type *lst) lst)
{ {
pj_list_insert_nodes_after(((pj_list*)pos)->prev, lst); pj_list_insert_nodes_after(((pj_list*)pos)->prev, lst);
} }
PJ_IDEF(void) PJ_IDEF(void) pj_list_merge_last(pj_list_type *lst1, pj_list_type *lst2)
pj_list_merge_last(pj_list_type *lst1, pj_list_type *lst2)
{ {
if (!pj_list_empty(lst2)) { if (!pj_list_empty(lst2)) {
pj_link_node(((pj_list*)lst1)->prev, ((pj_list*)lst2)->next); pj_link_node(((pj_list*)lst1)->prev, ((pj_list*)lst2)->next);
pj_link_node(((pj_list*)lst2)->prev, lst1); pj_link_node(((pj_list*)lst2)->prev, lst1);
pj_list_init(lst2); pj_list_init(lst2);
} }
} }
PJ_IDEF(void) PJ_IDEF(void) pj_list_merge_first(pj_list_type *lst1, pj_list_type *lst2)
pj_list_merge_first(pj_list_type *lst1, pj_list_type *lst2)
{ {
if (!pj_list_empty(lst2)) { if (!pj_list_empty(lst2)) {
pj_link_node(((pj_list*)lst2)->prev, ((pj_list*)lst1)->next); pj_link_node(((pj_list*)lst2)->prev, ((pj_list*)lst1)->next);
pj_link_node(((pj_list*)lst1), ((pj_list*)lst2)->next); pj_link_node(((pj_list*)lst1), ((pj_list*)lst2)->next);
pj_list_init(lst2); pj_list_init(lst2);
} }
} }
PJ_IDEF(void) PJ_IDEF(void) pj_list_erase(pj_list_type *node)
pj_list_erase(pj_list_type *node)
{ {
pj_link_node( ((pj_list*)node)->prev, ((pj_list*)node)->next); pj_link_node( ((pj_list*)node)->prev, ((pj_list*)node)->next);
} }
PJ_IDEF(pj_list_type*) PJ_IDEF(pj_list_type*) pj_list_find_node(pj_list_type *list, pj_list_type *
pj_list_find_node(pj_list_type *list, pj_list_type *node) node)
{ {
pj_list *p = (pj_list *) ((pj_list*)list)->next; pj_list *p = (pj_list *) ((pj_list*)list)->next;
while (p != list && p != node) while (p != list && p != node)
p = (pj_list *) p->next; p = (pj_list *) p->next;
return p==node ? p : NULL; return p==node ? p : NULL;
} }
PJ_IDEF(pj_list_type*) PJ_IDEF(pj_list_type*) pj_list_search(pj_list_type *list, void *value,
pj_list_search(pj_list_type *list, void *value, int (*comp)(void *value, const pj_list_type *node))
int (*comp)(void *value, const pj_list_type *node))
{ {
pj_list *p = (pj_list *) ((pj_list*)list)->next; pj_list *p = (pj_list *) ((pj_list*)list)->next;
while (p != list && (*comp)(value, p) != 0) while (p != list && (*comp)(value, p) != 0)
p = (pj_list *) p->next; p = (pj_list *) p->next;
return p==list ? NULL : p; return p==list ? NULL : p;
} }
PJ_IDEF(pj_size_t) pj_list_size(pj_list_type *list) PJ_IDEF(pj_size_t) pj_list_size(pj_list_type *list)
{ {
 End of changes. 11 change blocks. 
34 lines changed or deleted 15 lines changed or added


 log.h   log.h 
/* $Id: log.h 1061 2007-03-14 11:50:02Z bennylp $ */ /* $Id: log.h 1405 2007-07-20 08:08:30Z bennylp $ */
/* /*
* Copyright (C)2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C)2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 176 skipping to change at line 176
* @param level The maximum level of verbosity of the logging * @param level The maximum level of verbosity of the logging
* messages (6=very detailed..1=error only, 0=disabled) * messages (6=very detailed..1=error only, 0=disabled)
*/ */
PJ_DECL(void) pj_log_set_level(int level); PJ_DECL(void) pj_log_set_level(int level);
/** /**
* Get current maximum log verbositylevel. * Get current maximum log verbositylevel.
* *
* @return Current log maximum level. * @return Current log maximum level.
*/ */
#if 0 #if 1
PJ_DECL(int) pj_log_get_level(void); PJ_DECL(int) pj_log_get_level(void);
#else #else
extern int pj_log_max_level; PJ_DECL_DATA(int) pj_log_max_level;
#define pj_log_get_level() pj_log_max_level #define pj_log_get_level() pj_log_max_level
#endif #endif
/** /**
* Set log decoration. The log decoration flag controls what are printed * Set log decoration. The log decoration flag controls what are printed
* to output device alongside the actual message. For example, application * to output device alongside the actual message. For example, application
* can specify that date/time information should be displayed with each * can specify that date/time information should be displayed with each
* log message. * log message.
* *
* @param decor Bitmask combination of #pj_log_decoration to con trol * @param decor Bitmask combination of #pj_log_decoration to con trol
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added


 md5.h   md5.h 
/* $Id: md5.h 1001 2007-02-25 15:38:32Z bennylp $ */ /* $Id: md5.h 1374 2007-06-19 09:04:58Z bennylp $ */
/* /*
* Copyright (C) 2003-2005 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 os.h   os.h 
/* $Id: os.h 1124 2007-04-02 11:28:41Z bennylp $ */ /* $Id: os.h 1525 2007-10-26 05:25:35Z bennylp $ */
/* /*
* Copyright (C)2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C)2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 234 skipping to change at line 234
/** pj_thread_get_stack_info() for the thread */ /** pj_thread_get_stack_info() for the thread */
# define pj_thread_get_stack_info(thread,f,l) (*(f)="",*(l)=0) # define pj_thread_get_stack_info(thread,f,l) (*(f)="",*(l)=0)
#endif /* PJ_OS_HAS_CHECK_STACK */ #endif /* PJ_OS_HAS_CHECK_STACK */
/** /**
* @} * @}
*/ */
/* ************************************************************************ **/ /* ************************************************************************ **/
/** /**
* @defgroup PJ_SYMBIAN_OS Symbian OS Specific
* @ingroup PJ_OS
* @{
* Functionalities specific to Symbian OS.
*
* Symbian OS strongly discourages the use of polling since this wastes
* CPU power, and instead provides Active Object and Active Scheduler
* pattern to allow application (in this case, PJLIB) to register asynchron
ous
* tasks. PJLIB port for Symbian complies to this recommended behavior.
* As the result, few things have been changed in PJLIB for Symbian:
* - the timer heap (see @ref PJ_TIMER) is implemented with active
* object framework, and each timer entry registered to the timer
* heap will register an Active Object to the Active Scheduler.
* Because of this, polling the timer heap with pj_timer_heap_poll()
* is no longer necessary, and this function will just evaluate
* to nothing.
* - the ioqueue (see @ref PJ_IOQUEUE) is also implemented with
* active object framework, with each asynchronous operation will
* register an Active Object to the Active Scheduler. Because of
* this, polling the ioqueue with pj_ioqueue_poll() is no longer
* necessary, and this function will just evaluate to nothing.
*
* Since timer heap and ioqueue polling are no longer necessary, Symbian
* application can now poll for all events by calling
* \a User::WaitForAnyRequest() and \a CActiveScheduler::RunIfReady().
* PJLIB provides a thin wrapper which calls these two functions,
* called pj_symbianos_poll().
*/
/**
* Wait the completion of any Symbian active objects. When the timeout
* value is not specified (the \a ms_timeout argument is -1), this
* function is a thin wrapper which calls \a User::WaitForAnyRequest()
* and \a CActiveScheduler::RunIfReady(). If the timeout value is
* specified, this function will schedule a timer entry to the timer
* heap (which is an Active Object), to limit the wait time for event
* occurences. Scheduling a timer entry is an expensive operation,
* therefore application should only specify a timeout value when it's
* really necessary (for example, when it's not sure there are other
* Active Objects currently running in the application).
*
* @param priority The minimum priority of the Active Objects to
* poll, which values are from CActive::TPriority
* constants. If -1 is given, CActive::EPriorityStandar
d.
* priority will be used.
* @param ms_timeout Optional timeout to wait. Application should
* specify -1 to let the function wait indefinitely
* for any events.
*
* @return PJ_TRUE if there have been any events executed
* during the polling. This function will only return
* PJ_FALSE if \a ms_timeout argument is specified
* (i.e. the value is not -1) and there was no event
* executed when the timeout timer elapsed.
*/
PJ_DECL(pj_bool_t) pj_symbianos_poll(int priority, int ms_timeout);
/**
* This structure declares Symbian OS specific parameters that can be
* specified when calling #pj_symbianos_set_params().
*/
typedef struct pj_symbianos_params
{
/**
* Optional RSocketServ instance to be used by PJLIB. If this
* value is NULL, PJLIB will create a new RSocketServ instance
* when pj_init() is called.
*/
void *rsocketserv;
/**
* Optional RConnection instance to be used by PJLIB when creating
* sockets. If this value is NULL, no RConnection will be
* specified when creating sockets.
*/
void *rconnection;
/**
* Optional RHostResolver instance to be used by PJLIB. If this value
* is NULL, a new RHostResolver instance will be created when
* pj_init() is called.
*/
void *rhostresolver;
} pj_symbianos_params;
/**
* Specify Symbian OS parameters to be used by PJLIB. This function MUST
* be called before #pj_init() is called.
*
* @param prm Symbian specific parameters.
*
* @return PJ_SUCCESS if the parameters can be applied
* successfully.
*/
PJ_DECL(pj_status_t) pj_symbianos_set_params(pj_symbianos_params *prm);
/**
* @}
*/
/* ************************************************************************
**/
/**
* @defgroup PJ_TLS Thread Local Storage. * @defgroup PJ_TLS Thread Local Storage.
* @ingroup PJ_OS * @ingroup PJ_OS
* @{ * @{
*/ */
/** /**
* Allocate thread local storage index. The initial value of the variable a t * Allocate thread local storage index. The initial value of the variable a t
* the index is zero. * the index is zero.
* *
* @param index Pointer to hold the return value. * @param index Pointer to hold the return value.
skipping to change at line 400 skipping to change at line 503
* *
* Mutex manipulation. Alternatively, application can use higher abstractio n * Mutex manipulation. Alternatively, application can use higher abstractio n
* for lock objects, which provides uniform API for all kinds of lock * for lock objects, which provides uniform API for all kinds of lock
* mechanisms, including mutex. See @ref PJ_LOCK for more information. * mechanisms, including mutex. See @ref PJ_LOCK for more information.
*/ */
/** /**
* Mutex types: * Mutex types:
* - PJ_MUTEX_DEFAULT: default mutex type, which is system dependent. * - PJ_MUTEX_DEFAULT: default mutex type, which is system dependent.
* - PJ_MUTEX_SIMPLE: non-recursive mutex. * - PJ_MUTEX_SIMPLE: non-recursive mutex.
* - PJ_MUTEX_RECURSIVE: recursive mutex. * - PJ_MUTEX_RECURSE: recursive mutex.
*/ */
typedef enum pj_mutex_type_e typedef enum pj_mutex_type_e
{ {
PJ_MUTEX_DEFAULT, PJ_MUTEX_DEFAULT,
PJ_MUTEX_SIMPLE, PJ_MUTEX_SIMPLE,
PJ_MUTEX_RECURSE PJ_MUTEX_RECURSE
} pj_mutex_type_e; } pj_mutex_type_e;
/** /**
* Create mutex of the specified type. * Create mutex of the specified type.
 End of changes. 3 change blocks. 
2 lines changed or deleted 108 lines changed or added


 os_symbian.h   os_symbian.h 
/* $Id: os_symbian.h 1269 2007-05-12 15:03:23Z bennylp $ */ /* $Id: os_symbian.h 1405 2007-07-20 08:08:30Z bennylp $ */
/* /*
* Copyright (C)2003-2006 Benny Prijono <benny@prijono.org> * Copyright (C)2003-2006 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 149 skipping to change at line 149
#define PJ_THREAD_ALLOCATE_STACK 0 #define PJ_THREAD_ALLOCATE_STACK 0
/* Missing socklen_t */ /* Missing socklen_t */
#define PJ_HAS_SOCKLEN_T 1 #define PJ_HAS_SOCKLEN_T 1
typedef unsigned int socklen_t; typedef unsigned int socklen_t;
#ifndef __GCCE__ #ifndef __GCCE__
#include <e32def.h> #include <e32def.h>
#endif #endif
/* #define PJ_EXPORT_DECL_SPECIFIER IMPORT_C
#if defined(PJ_EXPORTING) //#define PJ_EXPORT_DECL_SPECIFIER
# define PJ_EXPORT_IMPORT EXPORT_C #define PJ_EXPORT_DEF_SPECIFIER EXPORT_C
#elif defined(PJ_IMPORTING) #define PJ_IMPORT_DECL_SPECIFIER IMPORT_C
# define PJ_EXPORT_IMPORT IMPORT_C
#else
# error "Must define either PJ_EXPORTING or PJ_IMPORTING"
#endif
*/
#endif /* __PJ_COMPAT_OS_SYMBIAN_H__ */ #endif /* __PJ_COMPAT_OS_SYMBIAN_H__ */
 End of changes. 2 change blocks. 
10 lines changed or deleted 5 lines changed or added


 pjlib-util.h   pjlib-util.h 
/* $Id: pjlib-util.h 1242 2007-05-02 11:29:37Z bennylp $ */ /* $Id: pjlib-util.h 1490 2007-10-10 13:12:37Z bennylp $ */
/* /*
* Copyright (C)2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C)2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 35 skipping to change at line 35
*/ */
/* Base */ /* Base */
#include <pjlib-util/errno.h> #include <pjlib-util/errno.h>
#include <pjlib-util/types.h> #include <pjlib-util/types.h>
/* Getopt */ /* Getopt */
#include <pjlib-util/getopt.h> #include <pjlib-util/getopt.h>
/* Crypto */ /* Crypto */
#include <pjlib-util/base64.h>
#include <pjlib-util/crc32.h> #include <pjlib-util/crc32.h>
#include <pjlib-util/hmac_md5.h> #include <pjlib-util/hmac_md5.h>
#include <pjlib-util/hmac_sha1.h> #include <pjlib-util/hmac_sha1.h>
#include <pjlib-util/md5.h> #include <pjlib-util/md5.h>
#include <pjlib-util/sha1.h> #include <pjlib-util/sha1.h>
/* DNS and resolver */ /* DNS and resolver */
#include <pjlib-util/dns.h> #include <pjlib-util/dns.h>
#include <pjlib-util/resolver.h> #include <pjlib-util/resolver.h>
#include <pjlib-util/srv_resolver.h> #include <pjlib-util/srv_resolver.h>
 End of changes. 2 change blocks. 
1 lines changed or deleted 2 lines changed or added


 pjnath.h   pjnath.h 
/* $Id: pjnath.h 1111 2007-03-28 15:49:48Z bennylp $ */ /* $Id: pjnath.h 1495 2007-10-12 12:14:27Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 24 skipping to change at line 24
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A
*/ */
#include <pjnath/config.h> #include <pjnath/config.h>
#include <pjnath/errno.h> #include <pjnath/errno.h>
#include <pjnath/ice_session.h> #include <pjnath/ice_session.h>
#include <pjnath/ice_strans.h> #include <pjnath/ice_strans.h>
#include <pjnath/nat_detect.h>
#include <pjnath/stun_auth.h> #include <pjnath/stun_auth.h>
#include <pjnath/stun_config.h> #include <pjnath/stun_config.h>
#include <pjnath/stun_msg.h> #include <pjnath/stun_msg.h>
#include <pjnath/stun_session.h> #include <pjnath/stun_session.h>
#include <pjnath/stun_transaction.h> #include <pjnath/stun_transaction.h>
#include <pjnath/types.h> #include <pjnath/types.h>
 End of changes. 2 change blocks. 
1 lines changed or deleted 2 lines changed or added


 pjsip.h   pjsip.h 
/* $Id: pjsip.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: pjsip.h 1488 2007-10-10 11:37:56Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 48 skipping to change at line 48
/* Transport layer */ /* Transport layer */
#include <pjsip/sip_transport.h> #include <pjsip/sip_transport.h>
#include <pjsip/sip_transport_udp.h> #include <pjsip/sip_transport_udp.h>
#include <pjsip/sip_transport_loop.h> #include <pjsip/sip_transport_loop.h>
#include <pjsip/sip_transport_tcp.h> #include <pjsip/sip_transport_tcp.h>
#include <pjsip/sip_transport_tls.h> #include <pjsip/sip_transport_tls.h>
#include <pjsip/sip_resolve.h> #include <pjsip/sip_resolve.h>
/* Authentication. */ /* Authentication. */
#include <pjsip/sip_auth.h> #include <pjsip/sip_auth.h>
#include <pjsip/sip_auth_aka.h>
/* Transaction layer. */ /* Transaction layer. */
#include <pjsip/sip_transaction.h> #include <pjsip/sip_transaction.h>
/* UA Layer. */ /* UA Layer. */
#include <pjsip/sip_ua_layer.h> #include <pjsip/sip_ua_layer.h>
#include <pjsip/sip_dialog.h> #include <pjsip/sip_dialog.h>
#endif /* __PJSIP_H__ */ #endif /* __PJSIP_H__ */
 End of changes. 2 change blocks. 
1 lines changed or deleted 2 lines changed or added


 pjsip_ua.h   pjsip_ua.h 
/* $Id: pjsip_ua.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: pjsip_ua.h 1463 2007-09-30 16:50:27Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 26 skipping to change at line 26
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A
*/ */
#ifndef __PJSIP_UA_H__ #ifndef __PJSIP_UA_H__
#define __PJSIP_UA_H__ #define __PJSIP_UA_H__
#include <pjsip-ua/sip_inv.h> #include <pjsip-ua/sip_inv.h>
#include <pjsip-ua/sip_regc.h> #include <pjsip-ua/sip_regc.h>
#include <pjsip-ua/sip_replaces.h> #include <pjsip-ua/sip_replaces.h>
#include <pjsip-ua/sip_xfer.h> #include <pjsip-ua/sip_xfer.h>
#include <pjsip-ua/sip_100rel.h>
#endif /* __PJSIP_UA_H__ */ #endif /* __PJSIP_UA_H__ */
 End of changes. 2 change blocks. 
1 lines changed or deleted 2 lines changed or added


 pjsua.h   pjsua.h 
/* $Id: pjsua.h 1285 2007-05-21 13:48:35Z bennylp $ */ /* $Id: pjsua.h 1561 2007-11-08 09:24:30Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 42 skipping to change at line 42
/* Include all PJMEDIA-CODEC headers. */ /* Include all PJMEDIA-CODEC headers. */
#include <pjmedia-codec.h> #include <pjmedia-codec.h>
/* Include all PJSIP-UA headers */ /* Include all PJSIP-UA headers */
#include <pjsip_ua.h> #include <pjsip_ua.h>
/* Include all PJSIP-SIMPLE headers */ /* Include all PJSIP-SIMPLE headers */
#include <pjsip_simple.h> #include <pjsip_simple.h>
/* Include all PJNATH headers */
#include <pjnath.h>
/* Include all PJLIB-UTIL headers. */ /* Include all PJLIB-UTIL headers. */
#include <pjlib-util.h> #include <pjlib-util.h>
/* Include all PJLIB headers. */ /* Include all PJLIB headers. */
#include <pjlib.h> #include <pjlib.h>
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /**
* @defgroup PJSUA_LIB PJSUA API - High Level Softphone API for C/C++ and P ython * @defgroup PJSUA_LIB PJSUA API - High Level Softphone API for C/C++ and P ython
skipping to change at line 461 skipping to change at line 464
* Use this function to initialize logging config. * Use this function to initialize logging config.
* *
* @param cfg The logging config to be initialized. * @param cfg The logging config to be initialized.
* *
* \par Python Syntax: * \par Python Syntax:
* The Python function instantiates and initialize the logging config: * The Python function instantiates and initialize the logging config:
* \code * \code
logging_cfg = py_pjsua.logging_config_default() logging_cfg = py_pjsua.logging_config_default()
* \endcode * \endcode
*/ */
PJ_INLINE(void) pjsua_logging_config_default(pjsua_logging_config *cfg) PJ_DECL(void) pjsua_logging_config_default(pjsua_logging_config *cfg);
{
pj_bzero(cfg, sizeof(*cfg));
cfg->msg_logging = PJ_TRUE;
cfg->level = 5;
cfg->console_level = 4;
cfg->decor = PJ_LOG_HAS_SENDER | PJ_LOG_HAS_TIME |
PJ_LOG_HAS_MICRO_SEC | PJ_LOG_HAS_NEWLINE;
}
/** /**
* Use this function to duplicate logging config. * Use this function to duplicate logging config.
* *
* @param pool Pool to use. * @param pool Pool to use.
* @param dst Destination config. * @param dst Destination config.
* @param src Source config. * @param src Source config.
* *
* \par Python Syntax: * \par Python Syntax:
* Not available (for now). Ideally we should be able to just assign * Not available (for now). Ideally we should be able to just assign
* one config to another, but this has not been tested. * one config to another, but this has not been tested.
*/ */
PJ_INLINE(void) pjsua_logging_config_dup(pj_pool_t *pool, PJ_DECL(void) pjsua_logging_config_dup(pj_pool_t *pool,
pjsua_logging_config *dst, pjsua_logging_config *dst,
const pjsua_logging_config *src) const pjsua_logging_config *src);
{
pj_memcpy(dst, src, sizeof(*src));
pj_strdup_with_null(pool, &dst->log_filename, &src->log_filename);
}
/** /**
* This structure describes application callback to receive various event * This structure describes application callback to receive various event
* notification from PJSUA-API. All of these callbacks are OPTIONAL, * notification from PJSUA-API. All of these callbacks are OPTIONAL,
* although definitely application would want to implement some of * although definitely application would want to implement some of
* the important callbacks (such as \a on_incoming_call). * the important callbacks (such as \a on_incoming_call).
* *
* \par Python Syntax: * \par Python Syntax:
* This callback structure is embedded on pjsua_config structure. * This callback structure is embedded on pjsua_config structure.
*/ */
skipping to change at line 543 skipping to change at line 533
# rdata: an opaque object # rdata: an opaque object
def on_incoming_call(acc_id, call_id, rdata): def on_incoming_call(acc_id, call_id, rdata):
return return
* \endcode * \endcode
*/ */
void (*on_incoming_call)(pjsua_acc_id acc_id, pjsua_call_id call_id, void (*on_incoming_call)(pjsua_acc_id acc_id, pjsua_call_id call_id,
pjsip_rx_data *rdata); pjsip_rx_data *rdata);
/** /**
* This is a general notification callback which is called whenever
* a transaction within the call has changed state. Application can
* implement this callback for example to monitor the state of
* outgoing requests, or to answer unhandled incoming requests
* (such as INFO) with a final response.
*
* @param call_id Call identification.
* @param tsx The transaction which has changed state.
* @param e Transaction event that caused the state chan
ge.
*/
void (*on_call_tsx_state)(pjsua_call_id call_id,
pjsip_transaction *tsx,
pjsip_event *e);
/**
* Notify application when media state in the call has changed. * Notify application when media state in the call has changed.
* Normal application would need to implement this callback, e.g. * Normal application would need to implement this callback, e.g.
* to connect the call's media to sound device. * to connect the call's media to sound device. When ICE is used,
* this callback will also be called to report ICE negotiation
* failure.
* *
* @param call_id The call index. * @param call_id The call index.
* *
* \par Python Syntax: * \par Python Syntax:
* \code * \code
# call_id: integer # call_id: integer
def on_call_media_state(call_id): def on_call_media_state(call_id):
return return
* \endcode * \endcode
skipping to change at line 568 skipping to change at line 575
/** /**
* Notify application upon incoming DTMF digits. * Notify application upon incoming DTMF digits.
* *
* @param call_id The call index. * @param call_id The call index.
* @param digit DTMF ASCII digit. * @param digit DTMF ASCII digit.
* *
* \par Python Syntax: * \par Python Syntax:
* \code * \code
# call_id: integer # call_id: integer
# digit: integer # digit: digit string
def on_dtmf_digit(call_id, digit): def on_dtmf_digit(call_id, digit):
return return
* \endcode * \endcode
*/ */
void (*on_dtmf_digit)(pjsua_call_id call_id, int digit); void (*on_dtmf_digit)(pjsua_call_id call_id, int digit);
/** /**
* Notify application on call being transfered (i.e. REFER is received) . * Notify application on call being transfered (i.e. REFER is received) .
* Application can decide to accept/reject transfer request * Application can decide to accept/reject transfer request
skipping to change at line 782 skipping to change at line 789
* @param body The message content. * @param body The message content.
* @param rdata The incoming MESSAGE request. * @param rdata The incoming MESSAGE request.
*/ */
void (*on_pager2)(pjsua_call_id call_id, const pj_str_t *from, void (*on_pager2)(pjsua_call_id call_id, const pj_str_t *from,
const pj_str_t *to, const pj_str_t *contact, const pj_str_t *to, const pj_str_t *contact,
const pj_str_t *mime_type, const pj_str_t *body, const pj_str_t *mime_type, const pj_str_t *body,
pjsip_rx_data *rdata); pjsip_rx_data *rdata);
/** /**
* Notify application about the delivery status of outgoing pager * Notify application about the delivery status of outgoing pager
* request. * request. See also on_pager_status2() callback for the version with
* \a pjsip_rx_data in the argument list.
* *
* @param call_id Containts the ID of the call where the IM was * @param call_id Containts the ID of the call where the IM was
* sent, or PJSUA_INVALID_ID if the IM was sent * sent, or PJSUA_INVALID_ID if the IM was sent
* outside call context. * outside call context.
* @param to Destination URI. * @param to Destination URI.
* @param body Message body. * @param body Message body.
* @param user_data Arbitrary data that was specified when s ending * @param user_data Arbitrary data that was specified when s ending
* IM message. * IM message.
* @param status Delivery status. * @param status Delivery status.
* @param reason Delivery status reason. * @param reason Delivery status reason.
skipping to change at line 815 skipping to change at line 823
* \endcode * \endcode
*/ */
void (*on_pager_status)(pjsua_call_id call_id, void (*on_pager_status)(pjsua_call_id call_id,
const pj_str_t *to, const pj_str_t *to,
const pj_str_t *body, const pj_str_t *body,
void *user_data, void *user_data,
pjsip_status_code status, pjsip_status_code status,
const pj_str_t *reason); const pj_str_t *reason);
/** /**
* Notify application about the delivery status of outgoing pager
* request.
*
* @param call_id Containts the ID of the call where the IM was
* sent, or PJSUA_INVALID_ID if the IM was sent
* outside call context.
* @param to Destination URI.
* @param body Message body.
* @param user_data Arbitrary data that was specified when s
ending
* IM message.
* @param status Delivery status.
* @param reason Delivery status reason.
* @param tdata The original MESSAGE request.
* @param rdata The incoming MESSAGE response, or NULL if the
* message transaction fails because of time out
* or transport error.
*/
void (*on_pager_status2)(pjsua_call_id call_id,
const pj_str_t *to,
const pj_str_t *body,
void *user_data,
pjsip_status_code status,
const pj_str_t *reason,
pjsip_tx_data *tdata,
pjsip_rx_data *rdata);
/**
* Notify application about typing indication. * Notify application about typing indication.
* *
* @param call_id Containts the ID of the call where the IM was * @param call_id Containts the ID of the call where the IM was
* sent, or PJSUA_INVALID_ID if the IM was sent * sent, or PJSUA_INVALID_ID if the IM was sent
* outside call context. * outside call context.
* @param from URI of the sender. * @param from URI of the sender.
* @param to URI of the destination message. * @param to URI of the destination message.
* @param contact The Contact URI of the sender, if present. * @param contact The Contact URI of the sender, if present.
* @param is_typing Non-zero if peer is typing, or zero if p eer * @param is_typing Non-zero if peer is typing, or zero if p eer
* has stopped typing a message. * has stopped typing a message.
skipping to change at line 842 skipping to change at line 877
# is_typing: integer # is_typing: integer
def on_typing(call_id, from, to, contact, is_typing): def on_typing(call_id, from, to, contact, is_typing):
return return
* \endcode * \endcode
*/ */
void (*on_typing)(pjsua_call_id call_id, const pj_str_t *from, void (*on_typing)(pjsua_call_id call_id, const pj_str_t *from,
const pj_str_t *to, const pj_str_t *contact, const pj_str_t *to, const pj_str_t *contact,
pj_bool_t is_typing); pj_bool_t is_typing);
/**
* Callback when the library has finished performing NAT type
* detection.
*
* @param res NAT detection result.
*/
void (*on_nat_detect)(const pj_stun_nat_detect_result *res);
} pjsua_callback; } pjsua_callback;
/** /**
* This structure describes the settings to control the API and * This structure describes the settings to control the API and
* user agent behavior, and can be specified when calling #pjsua_init(). * user agent behavior, and can be specified when calling #pjsua_init().
* Before setting the values, application must call #pjsua_config_default() * Before setting the values, application must call #pjsua_config_default()
* to initialize this structure with the default values. * to initialize this structure with the default values.
* *
* \par Python Sample Syntax: * \par Python Sample Syntax:
* The pjsua_config type in Python is <tt>py_pjsua.Config</tt>. Application * The pjsua_config type in Python is <tt>py_pjsua.Config</tt>. Application
skipping to change at line 927 skipping to change at line 970
* not specified, default port 3478 will be used. * not specified, default port 3478 will be used.
*/ */
pj_str_t stun_host; pj_str_t stun_host;
/** /**
* Specify STUN relay server to be used. * Specify STUN relay server to be used.
*/ */
pj_str_t stun_relay_host; pj_str_t stun_relay_host;
/** /**
* Support for adding and parsing NAT type in the SDP to assist
* troubleshooting. The valid values are:
* - 0: no information will be added in SDP, and parsing is disabled.
* - 1: only the NAT type number is added.
* - 2: add both NAT type number and name.
*
* Default: 1
*/
int nat_type_in_sdp;
/**
* Specify whether support for reliable provisional response (100rel an
d
* PRACK) should be required by default. Note that this setting can be
* further customized in account configuration (#pjsua_acc_config).
*
* Default: PJ_FALSE
*/
pj_bool_t require_100rel;
/**
* Number of credentials in the credential array. * Number of credentials in the credential array.
*/ */
unsigned cred_count; unsigned cred_count;
/** /**
* Array of credentials. These credentials will be used by all accounts , * Array of credentials. These credentials will be used by all accounts ,
* and can be used to authenticate against outbound proxies. If the * and can be used to authenticate against outbound proxies. If the
* credential is specific to the account, then application should set * credential is specific to the account, then application should set
* the credential in the pjsua_acc_config rather than the credential * the credential in the pjsua_acc_config rather than the credential
* here. * here.
skipping to change at line 967 skipping to change at line 1030
* @param cfg pjsua config to be initialized. * @param cfg pjsua config to be initialized.
* *
* \par Python Sample Syntax: * \par Python Sample Syntax:
* The corresponding Python function creates an instance of the config and * The corresponding Python function creates an instance of the config and
* initializes it to the default settings: * initializes it to the default settings:
* \code * \code
cfg = py_pjsua.config_default() cfg = py_pjsua.config_default()
* \endcode * \endcode
*/ */
PJ_INLINE(void) pjsua_config_default(pjsua_config *cfg) PJ_DECL(void) pjsua_config_default(pjsua_config *cfg);
{
pj_bzero(cfg, sizeof(*cfg));
cfg->max_calls = 4;
cfg->thread_cnt = 1;
}
/**
* Duplicate credential.
*
* @param pool The memory pool.
* @param dst Destination credential.
* @param src Source credential.
*
* \par Python:
* Not applicable (for now). Probably we could just assign one credential
* variable to another, but this has not been tested.
*/
PJ_INLINE(void) pjsip_cred_dup( pj_pool_t *pool,
pjsip_cred_info *dst,
const pjsip_cred_info *src)
{
pj_strdup_with_null(pool, &dst->realm, &src->realm);
pj_strdup_with_null(pool, &dst->scheme, &src->scheme);
pj_strdup_with_null(pool, &dst->username, &src->username);
pj_strdup_with_null(pool, &dst->data, &src->data);
} /* The implementation has been moved to sip_auth.h */
#define pjsip_cred_dup pjsip_cred_info_dup
/** /**
* Duplicate pjsua_config. * Duplicate pjsua_config.
* *
* @param pool The pool to get memory from. * @param pool The pool to get memory from.
* @param dst Destination config. * @param dst Destination config.
* @param src Source config. * @param src Source config.
*/ */
PJ_INLINE(void) pjsua_config_dup(pj_pool_t *pool, PJ_DECL(void) pjsua_config_dup(pj_pool_t *pool,
pjsua_config *dst, pjsua_config *dst,
const pjsua_config *src) const pjsua_config *src);
{
unsigned i;
pj_memcpy(dst, src, sizeof(*src));
for (i=0; i<src->outbound_proxy_cnt; ++i) {
pj_strdup_with_null(pool, &dst->outbound_proxy[i],
&src->outbound_proxy[i]);
}
for (i=0; i<src->cred_count; ++i) {
pjsip_cred_dup(pool, &dst->cred_info[i], &src->cred_info[i]);
}
pj_strdup_with_null(pool, &dst->user_agent, &src->user_agent);
pj_strdup_with_null(pool, &dst->stun_domain, &src->stun_domain);
pj_strdup_with_null(pool, &dst->stun_host, &src->stun_host);
pj_strdup_with_null(pool, &dst->stun_relay_host, &src->stun_relay_host)
;
}
/** /**
* This structure describes additional information to be sent with * This structure describes additional information to be sent with
* outgoing SIP message. It can (optionally) be specified for example * outgoing SIP message. It can (optionally) be specified for example
* with #pjsua_call_make_call(), #pjsua_call_answer(), #pjsua_call_hangup() , * with #pjsua_call_make_call(), #pjsua_call_answer(), #pjsua_call_hangup() ,
* #pjsua_call_set_hold(), #pjsua_call_send_im(), and many more. * #pjsua_call_set_hold(), #pjsua_call_send_im(), and many more.
* *
* Application MUST call #pjsua_msg_data_init() to initialize this * Application MUST call #pjsua_msg_data_init() to initialize this
* structure before setting its values. * structure before setting its values.
* *
* \par Python Syntax * \par Python Syntax
* The data type in Python is <tt>py_pjsua.Msg_Data</tt>. Application is * The data type in Python is <tt>py_pjsua.Msg_Data</tt>. Application is
* recommended to instantiate the structure by using this construct: * recommended to instantiate the structure by using this construct:
* \code * \code
msg_data = py_pjsua.msg_data_init() msg_data = py_pjsua.msg_data_init()
* \endcode * \endcode
*/ */
typedef struct pjsua_msg_data typedef struct pjsua_msg_data
{ {
/** /**
* Additional message headers as linked list. * Additional message headers as linked list. Application can add
* headers to the list by creating the header, either from the heap/poo
l
* or from temporary local variable, and add the header using
* linked list operation. See pjsip_apps.c for some sample codes.
* *
* \par Python: * \par Python:
* This field is implemented as string linked-list in Python, where eac h * This field is implemented as string linked-list in Python, where eac h
* string describes the header. For example: * string describes the header. For example:
\code \code
msg_data = py_pjsua.Msg_Data() msg_data = py_pjsua.Msg_Data()
msg_data.hdr_list = ["Subject: Hello py_pjsua!", "Priority: very low "] msg_data.hdr_list = ["Subject: Hello py_pjsua!", "Priority: very low "]
\endcode \endcode
*/ */
pjsip_hdr hdr_list; pjsip_hdr hdr_list;
skipping to change at line 1081 skipping to change at line 1103
* Initialize message data. * Initialize message data.
* *
* @param msg_data Message data to be initialized. * @param msg_data Message data to be initialized.
* *
* \par Python * \par Python
* The corresponding Python function creates and initializes the structure: * The corresponding Python function creates and initializes the structure:
* \code * \code
msg_data = py_pjsua.msg_data_init() msg_data = py_pjsua.msg_data_init()
* \endcode * \endcode
*/ */
PJ_INLINE(void) pjsua_msg_data_init(pjsua_msg_data *msg_data) PJ_DECL(void) pjsua_msg_data_init(pjsua_msg_data *msg_data);
{
pj_bzero(msg_data, sizeof(*msg_data));
pj_list_init(&msg_data->hdr_list);
}
/** /**
* Instantiate pjsua application. Application must call this function befor e * Instantiate pjsua application. Application must call this function befor e
* calling any other functions, to make sure that the underlying libraries * calling any other functions, to make sure that the underlying libraries
* are properly initialized. Once this function has returned success, * are properly initialized. Once this function has returned success,
* application must call pjsua_destroy() before quitting. * application must call pjsua_destroy() before quitting.
* *
* @return PJ_SUCCESS on success, or the appropriate error code . * @return PJ_SUCCESS on success, or the appropriate error code .
* *
* \par Python: * \par Python:
skipping to change at line 1281 skipping to change at line 1299
* any use for Python scripts. * any use for Python scripts.
*/ */
PJ_DECL(pj_pool_factory*) pjsua_get_pool_factory(void); PJ_DECL(pj_pool_factory*) pjsua_get_pool_factory(void);
/************************************************************************** *** /************************************************************************** ***
* Utilities. * Utilities.
* *
*/ */
/** /**
* This is a utility function to detect NAT type in front of this
* endpoint. Once invoked successfully, this function will complete
* asynchronously and report the result in \a on_nat_detect() callback
* of pjsua_callback.
*
* After NAT has been detected and the callback is called, application can
* get the detected NAT type by calling #pjsua_get_nat_type(). Application
* can also perform NAT detection by calling #pjsua_detect_nat_type()
* again at later time.
*
* Note that STUN must be enabled to run this function successfully.
*
* @return PJ_SUCCESS on success, or the appropriate error code
.
*/
PJ_DECL(pj_status_t) pjsua_detect_nat_type(void);
/**
* Get the NAT type as detected by #pjsua_detect_nat_type() function.
* This function will only return useful NAT type after #pjsua_detect_nat_t
ype()
* has completed successfully and \a on_nat_detect() callback has been call
ed.
*
* @param type NAT type.
*
* @return When detection is in progress, this function will
* return PJ_EPENDING and \a type will be set to
* PJ_STUN_NAT_TYPE_UNKNOWN. After NAT type has been
* detected successfully, this function will return
* PJ_SUCCESS and \a type will be set to the correct
* value. Other return values indicate error and
* \a type will be set to PJ_STUN_NAT_TYPE_ERR_UNKNOWN.
*
* @see pjsua_call_get_rem_nat_type()
*/
PJ_DECL(pj_status_t) pjsua_get_nat_type(pj_stun_nat_type *type);
/**
* This is a utility function to verify that valid SIP url is given. If the * This is a utility function to verify that valid SIP url is given. If the
* URL is valid, PJ_SUCCESS will be returned. * URL is valid, PJ_SUCCESS will be returned.
* *
* @param url The URL, as NULL terminated string. * @param url The URL, as NULL terminated string.
* *
* @return PJ_SUCCESS on success, or the appropriate error code . * @return PJ_SUCCESS on success, or the appropriate error code .
* *
* \par Python: * \par Python:
* \code * \code
status = py_pjsua.verify_sip_url(url) status = py_pjsua.verify_sip_url(url)
skipping to change at line 1410 skipping to change at line 1464
* Call this function to initialize UDP config with default values. * Call this function to initialize UDP config with default values.
* *
* @param cfg The UDP config to be initialized. * @param cfg The UDP config to be initialized.
* *
* \par Python: * \par Python:
* The corresponding Python function is rather different: * The corresponding Python function is rather different:
* \code * \code
transport_cfg = py_pjsua.transport_config_default() transport_cfg = py_pjsua.transport_config_default()
* \endcode * \endcode
*/ */
PJ_INLINE(void) pjsua_transport_config_default(pjsua_transport_config *cfg) PJ_DECL(void) pjsua_transport_config_default(pjsua_transport_config *cfg);
{
pj_bzero(cfg, sizeof(*cfg));
pjsip_tls_setting_default(&cfg->tls_setting);
}
/** /**
* Duplicate transport config. * Duplicate transport config.
* *
* @param pool The pool. * @param pool The pool.
* @param dst The destination config. * @param dst The destination config.
* @param src The source config. * @param src The source config.
* *
* \par Python: * \par Python:
* Not applicable. One should be able to just copy one variable instance * Not applicable. One should be able to just copy one variable instance
* to another in Python. * to another in Python.
*/ */
PJ_INLINE(void) pjsua_transport_config_dup(pj_pool_t *pool, PJ_DECL(void) pjsua_transport_config_dup(pj_pool_t *pool,
pjsua_transport_config *dst, pjsua_transport_config *dst,
const pjsua_transport_config *src const pjsua_transport_config *src);
)
{
PJ_UNUSED_ARG(pool);
pj_memcpy(dst, src, sizeof(*src));
}
/** /**
* This structure describes transport information returned by * This structure describes transport information returned by
* #pjsua_transport_get_info() function. * #pjsua_transport_get_info() function.
* *
* \par Python: * \par Python:
* The corresponding data type in Python is <tt>py_pjsua.Transport_Info</tt >. * The corresponding data type in Python is <tt>py_pjsua.Transport_Info</tt >.
*/ */
typedef struct pjsua_transport_info typedef struct pjsua_transport_info
{ {
skipping to change at line 1665 skipping to change at line 1711
* Maximum accounts. * Maximum accounts.
*/ */
#ifndef PJSUA_MAX_ACC #ifndef PJSUA_MAX_ACC
# define PJSUA_MAX_ACC 8 # define PJSUA_MAX_ACC 8
#endif #endif
/** /**
* Default registration interval. * Default registration interval.
*/ */
#ifndef PJSUA_REG_INTERVAL #ifndef PJSUA_REG_INTERVAL
# define PJSUA_REG_INTERVAL 55 # define PJSUA_REG_INTERVAL 300
#endif #endif
/** /**
* Default PUBLISH expiration * Default PUBLISH expiration
*/ */
#ifndef PJSUA_PUBLISH_EXPIRATION #ifndef PJSUA_PUBLISH_EXPIRATION
# define PJSUA_PUBLISH_EXPIRATION 600 # define PJSUA_PUBLISH_EXPIRATION 600
#endif #endif
/** /**
* Default account priority. * Default account priority.
*/ */
#ifndef PJSUA_DEFAULT_ACC_PRIORITY #ifndef PJSUA_DEFAULT_ACC_PRIORITY
# define PJSUA_DEFAULT_ACC_PRIORITY 0 # define PJSUA_DEFAULT_ACC_PRIORITY 0
#endif #endif
/** /**
* This macro specifies the URI scheme to use in Contact header
* when secure transport such as TLS is used. Application can specify
* either "sip" or "sips".
*/
#ifndef PJSUA_SECURE_SCHEME
# define PJSUA_SECURE_SCHEME "sips"
#endif
/**
* This structure describes account configuration to be specified when * This structure describes account configuration to be specified when
* adding a new account with #pjsua_acc_add(). Application MUST initialize * adding a new account with #pjsua_acc_add(). Application MUST initialize
* this structure first by calling #pjsua_acc_config_default(). * this structure first by calling #pjsua_acc_config_default().
* *
* \par Python: * \par Python:
* The data type in Python is <tt>py_pjsua.Acc_Config</tt>, but normally * The data type in Python is <tt>py_pjsua.Acc_Config</tt>, but normally
* application can just use the snippet below to create and initialize * application can just use the snippet below to create and initialize
* the account config: * the account config:
* \code * \code
acc_cfg = py_pjsua.acc_config_default() acc_cfg = py_pjsua.acc_config_default()
skipping to change at line 1724 skipping to change at line 1779
* and will look something like "sip:serviceprovider". * and will look something like "sip:serviceprovider".
* *
* This field should be specified if registration is desired. If the * This field should be specified if registration is desired. If the
* value is empty, no account registration will be performed. * value is empty, no account registration will be performed.
*/ */
pj_str_t reg_uri; pj_str_t reg_uri;
/** /**
* If this flag is set, the presence information of this account will * If this flag is set, the presence information of this account will
* be PUBLISH-ed to the server where the account belongs. * be PUBLISH-ed to the server where the account belongs.
*
* Default: PJ_FALSE
*/ */
pj_bool_t publish_enabled; pj_bool_t publish_enabled;
/** /**
* Authentication preference.
*/
pjsip_auth_clt_pref auth_pref;
/**
* Optional PIDF tuple ID for outgoing PUBLISH and NOTIFY. If this valu
e
* is not specified, a random string will be used.
*/
pj_str_t pidf_tuple_id;
/**
* Optional URI to be put as Contact for this account. It is recommende d * Optional URI to be put as Contact for this account. It is recommende d
* that this field is left empty, so that the value will be calculated * that this field is left empty, so that the value will be calculated
* automatically based on the transport address. * automatically based on the transport address.
*/ */
pj_str_t force_contact; pj_str_t force_contact;
/** /**
* Specify whether support for reliable provisional response (100rel an
d
* PRACK) should be required for all sessions of this account.
*
* Default: PJ_FALSE
*/
pj_bool_t require_100rel;
/**
* Number of proxies in the proxy array below. * Number of proxies in the proxy array below.
* *
* \par Python: * \par Python:
* Not applicable, as \a proxy is implemented as list of strings. * Not applicable, as \a proxy is implemented as list of strings.
*/ */
unsigned proxy_cnt; unsigned proxy_cnt;
/** /**
* Optional URI of the proxies to be visited for all outgoing requests * Optional URI of the proxies to be visited for all outgoing requests
* that are using this account (REGISTER, INVITE, etc). Application nee d * that are using this account (REGISTER, INVITE, etc). Application nee d
skipping to change at line 1762 skipping to change at line 1838
* then these account proxies will be placed after the global outbound * then these account proxies will be placed after the global outbound
* proxies in the routeset. * proxies in the routeset.
* *
* \par Python: * \par Python:
* This will be list of strings. * This will be list of strings.
*/ */
pj_str_t proxy[PJSUA_ACC_MAX_PROXIES]; pj_str_t proxy[PJSUA_ACC_MAX_PROXIES];
/** /**
* Optional interval for registration, in seconds. If the value is zero , * Optional interval for registration, in seconds. If the value is zero ,
* default interval will be used (PJSUA_REG_INTERVAL, 55 seconds). * default interval will be used (PJSUA_REG_INTERVAL, 300 seconds).
*/ */
unsigned reg_timeout; unsigned reg_timeout;
/** /**
* Number of credentials in the credential array. * Number of credentials in the credential array.
* *
* \par Python: * \par Python:
* Not applicable, since \a cred_info is a list of credentials. * Not applicable, since \a cred_info is a list of credentials.
*/ */
unsigned cred_count; unsigned cred_count;
skipping to change at line 1799 skipping to change at line 1875
* any available transports according to the destination. But some * any available transports according to the destination. But some
* application may want to have explicit control over the transport to * application may want to have explicit control over the transport to
* use, so in that case it can set this field. * use, so in that case it can set this field.
* *
* Default: -1 (PJSUA_INVALID_ID) * Default: -1 (PJSUA_INVALID_ID)
* *
* @see pjsua_acc_set_transport() * @see pjsua_acc_set_transport()
*/ */
pjsua_transport_id transport_id; pjsua_transport_id transport_id;
/**
* This option is useful for keeping the UDP transport address up to
* date with the NAT public mapped address. When this option is
* enabled and STUN is configured, the library will keep track of
* the public IP address from the response of REGISTER request. Once
* it detects that the address has changed, it will unregister current
* Contact, update the UDP transport address, and register a new
* Contact to the registrar.
*
* Default: 1 (yes)
*/
pj_bool_t auto_update_nat;
/**
* Set the interval for periodic keep-alive transmission for this accou
nt.
* If this value is zero, keep-alive will be disabled for this account.
* The keep-alive transmission will be sent to the registrar's address,
* after successful registration.
*
* Even if this setting is enabled, keep-alive transmission is only don
e
* when STUN is enabled in the global #pjsua_config, and the transport
* used for registration is UDP. For TCP and TLS transports, keep-alive
* is done by the transport themselves.
*
* Default: 15 (seconds)
*/
unsigned ka_interval;
/**
* Specify the data to be transmitted as keep-alive packets.
*
* Default: CR-LF
*/
pj_str_t ka_data;
} pjsua_acc_config; } pjsua_acc_config;
/** /**
* Call this function to initialize account config with default values. * Call this function to initialize account config with default values.
* *
* @param cfg The account config to be initialized. * @param cfg The account config to be initialized.
* *
* \par Python: * \par Python:
* In Python, this function both creates and initializes the account * In Python, this function both creates and initializes the account
* config: * config:
* \code * \code
acc_cfg = py_pjsua.acc_config_default() acc_cfg = py_pjsua.acc_config_default()
* \endcode * \endcode
*/ */
PJ_INLINE(void) pjsua_acc_config_default(pjsua_acc_config *cfg) PJ_DECL(void) pjsua_acc_config_default(pjsua_acc_config *cfg);
{
pj_bzero(cfg, sizeof(*cfg));
cfg->reg_timeout = PJSUA_REG_INTERVAL; /**
cfg->transport_id = PJSUA_INVALID_ID; * Duplicate account config.
} *
* @param pool Pool to be used for duplicating the config.
* @param dst Destination configuration.
* @param src Source configuration.
*/
PJ_DECL(void) pjsua_acc_config_dup(pj_pool_t *pool,
pjsua_acc_config *dst,
const pjsua_acc_config *src);
/** /**
* Account info. Application can query account info by calling * Account info. Application can query account info by calling
* #pjsua_acc_get_info(). * #pjsua_acc_get_info().
* *
* \par Python: * \par Python:
* The data type in Python is <tt>py_pjsua.Acc_Info</tt>. * The data type in Python is <tt>py_pjsua.Acc_Info</tt>.
*/ */
typedef struct pjsua_acc_info typedef struct pjsua_acc_info
{ {
skipping to change at line 1874 skipping to change at line 1990
* String describing the registration status. * String describing the registration status.
*/ */
pj_str_t status_text; pj_str_t status_text;
/** /**
* Presence online status for this account. * Presence online status for this account.
*/ */
pj_bool_t online_status; pj_bool_t online_status;
/** /**
* Presence online status text.
*/
pj_str_t online_status_text;
/**
* Extended RPID online status information.
*/
pjrpid_element rpid;
/**
* Buffer that is used internally to store the status text. * Buffer that is used internally to store the status text.
*/ */
char buf_[PJ_ERR_MSG_SIZE]; char buf_[PJ_ERR_MSG_SIZE];
} pjsua_acc_info; } pjsua_acc_info;
/** /**
* Get number of current accounts. * Get number of current accounts.
* *
* @return Current number of accounts. * @return Current number of accounts.
skipping to change at line 2027 skipping to change at line 2153
* \code * \code
status = py_pjsua.acc_modify(acc_id, acc_cfg) status = py_pjsua.acc_modify(acc_id, acc_cfg)
* \endcode * \endcode
*/ */
PJ_DECL(pj_status_t) pjsua_acc_modify(pjsua_acc_id acc_id, PJ_DECL(pj_status_t) pjsua_acc_modify(pjsua_acc_id acc_id,
const pjsua_acc_config *acc_cfg); const pjsua_acc_config *acc_cfg);
/** /**
* Modify account's presence status to be advertised to remote/presence * Modify account's presence status to be advertised to remote/presence
* subscribers. This would trigger the sending of outgoing NOTIFY request * subscribers. This would trigger the sending of outgoing NOTIFY request
* if there are server side presence subscription for this account. * if there are server side presence subscription for this account, and/or
* outgoing PUBLISH if presence publication is enabled for this account.
*
* @see pjsua_acc_set_online_status2()
* *
* @param acc_id The account ID. * @param acc_id The account ID.
* @param is_online True of false. * @param is_online True of false.
* *
* @return PJ_SUCCESS on success, or the appropriate error code . * @return PJ_SUCCESS on success, or the appropriate error code .
* *
* \par Python: * \par Python:
* \code * \code
status = py_pjsua.acc_set_online_status(acc_id, is_online) status = py_pjsua.acc_set_online_status(acc_id, is_online)
* \endcode * \endcode
*/ */
PJ_DECL(pj_status_t) pjsua_acc_set_online_status(pjsua_acc_id acc_id, PJ_DECL(pj_status_t) pjsua_acc_set_online_status(pjsua_acc_id acc_id,
pj_bool_t is_online); pj_bool_t is_online);
/** /**
* Modify account's presence status to be advertised to remote/presence
* subscribers. This would trigger the sending of outgoing NOTIFY request
* if there are server side presence subscription for this account, and/or
* outgoing PUBLISH if presence publication is enabled for this account.
*
* @see pjsua_acc_set_online_status()
*
* @param acc_id The account ID.
* @param is_online True of false.
* @param pr Extended information in subset of RPID format
* which allows setting custom presence text.
*
* @return PJ_SUCCESS on success, or the appropriate error code
.
*/
PJ_DECL(pj_status_t) pjsua_acc_set_online_status2(pjsua_acc_id acc_id,
pj_bool_t is_online,
const pjrpid_element *pr);
/**
* Update registration or perform unregistration. If registration is * Update registration or perform unregistration. If registration is
* configured for this account, then initial SIP REGISTER will be sent * configured for this account, then initial SIP REGISTER will be sent
* when the account is added with #pjsua_acc_add(). Application normally * when the account is added with #pjsua_acc_add(). Application normally
* only need to call this function if it wants to manually update the * only need to call this function if it wants to manually update the
* registration or to unregister from the server. * registration or to unregister from the server.
* *
* @param acc_id The account ID. * @param acc_id The account ID.
* @param renew If renew argument is zero, this will start * @param renew If renew argument is zero, this will start
* unregistration process. * unregistration process.
* *
skipping to change at line 2275 skipping to change at line 2423
/** The media is active */ /** The media is active */
PJSUA_CALL_MEDIA_ACTIVE, PJSUA_CALL_MEDIA_ACTIVE,
/** The media is currently put on hold by local endpoint */ /** The media is currently put on hold by local endpoint */
PJSUA_CALL_MEDIA_LOCAL_HOLD, PJSUA_CALL_MEDIA_LOCAL_HOLD,
/** The media is currently put on hold by remote endpoint */ /** The media is currently put on hold by remote endpoint */
PJSUA_CALL_MEDIA_REMOTE_HOLD, PJSUA_CALL_MEDIA_REMOTE_HOLD,
/** The media has reported error (e.g. ICE negotiation) */
PJSUA_CALL_MEDIA_ERROR
} pjsua_call_media_status; } pjsua_call_media_status;
/** /**
* This structure describes the information and current status of a call. * This structure describes the information and current status of a call.
* *
* \par Python: * \par Python:
* The type name is <tt>py_pjsua.Call_Info</tt>. * The type name is <tt>py_pjsua.Call_Info</tt>.
*/ */
typedef struct pjsua_call_info typedef struct pjsua_call_info
{ {
skipping to change at line 2520 skipping to change at line 2671
* *
* \par Python: * \par Python:
* \code * \code
user_data = py_pjsua.call_get_user_data(call_id) user_data = py_pjsua.call_get_user_data(call_id)
* \endcode * \endcode
* The \a user_data is an integer. * The \a user_data is an integer.
*/ */
PJ_DECL(void*) pjsua_call_get_user_data(pjsua_call_id call_id); PJ_DECL(void*) pjsua_call_get_user_data(pjsua_call_id call_id);
/** /**
* Get the NAT type of remote's endpoint. This is a proprietary feature
* of PJSUA-LIB which sends its NAT type in the SDP when \a nat_type_in_sdp
* is set in #pjsua_config.
*
* This function can only be called after SDP has been received from remote
,
* which means for incoming call, this function can be called as soon as
* call is received as long as incoming call contains SDP, and for outgoing
* call, this function can be called only after SDP is received (normally i
n
* 200/OK response to INVITE). As a general case, application should call
* this function after or in \a on_call_media_state() callback.
*
* @param call_id Call identification.
* @param p_type Pointer to store the NAT type. Application can then
* retrieve the string description of the NAT type
* by calling pj_stun_get_nat_name().
*
* @return PJ_SUCCESS on success.
*
* @see pjsua_get_nat_type(), nat_type_in_sdp
*/
PJ_DECL(pj_status_t) pjsua_call_get_rem_nat_type(pjsua_call_id call_id,
pj_stun_nat_type *p_type);
/**
* Send response to incoming INVITE request. Depending on the status * Send response to incoming INVITE request. Depending on the status
* code specified as parameter, this function may send provisional * code specified as parameter, this function may send provisional
* response, establish the call, or terminate the call. * response, establish the call, or terminate the call.
* *
* @param call_id Incoming call identification. * @param call_id Incoming call identification.
* @param code Status code, (100-699). * @param code Status code, (100-699).
* @param reason Optional reason phrase. If NULL, default text * @param reason Optional reason phrase. If NULL, default text
* will be used. * will be used.
* @param msg_data Optional list of headers etc to be added to outgoing * @param msg_data Optional list of headers etc to be added to outgoing
* response message. * response message.
skipping to change at line 2621 skipping to change at line 2796
* \code * \code
status = py_pjsua.call_reinvite(call_id, unhold, msg_data) status = py_pjsua.call_reinvite(call_id, unhold, msg_data)
* \endcode * \endcode
* Argument \a msg_data may be set to None if not required. * Argument \a msg_data may be set to None if not required.
*/ */
PJ_DECL(pj_status_t) pjsua_call_reinvite(pjsua_call_id call_id, PJ_DECL(pj_status_t) pjsua_call_reinvite(pjsua_call_id call_id,
pj_bool_t unhold, pj_bool_t unhold,
const pjsua_msg_data *msg_data); const pjsua_msg_data *msg_data);
/** /**
* Send UPDATE request.
*
* @param call_id Call identification.
* @param options Must be zero for now.
* @param msg_data Optional message components to be sent with
* the request.
*
* @return PJ_SUCCESS on success, or the appropriate error code
.
*/
PJ_DECL(pj_status_t) pjsua_call_update(pjsua_call_id call_id,
unsigned options,
const pjsua_msg_data *msg_data);
/**
* Initiate call transfer to the specified address. This function will send * Initiate call transfer to the specified address. This function will send
* REFER request to instruct remote call party to initiate a new INVITE * REFER request to instruct remote call party to initiate a new INVITE
* session to the specified destination/target. * session to the specified destination/target.
* *
* If application is interested to monitor the successfulness and * If application is interested to monitor the successfulness and
* the progress of the transfer request, it can implement * the progress of the transfer request, it can implement
* \a on_call_transfer_status() callback which will report the progress * \a on_call_transfer_status() callback which will report the progress
* of the call transfer request. * of the call transfer request.
* *
* @param call_id The call id to be transfered. * @param call_id The call id to be transfered.
skipping to change at line 2747 skipping to change at line 2936
* \code * \code
status = py_pjsua.call_send_typing_ind(call_id, is_typing, msg_data) status = py_pjsua.call_send_typing_ind(call_id, is_typing, msg_data)
* \endcode * \endcode
* Argument \a msg_data may be set to None if not required. * Argument \a msg_data may be set to None if not required.
*/ */
PJ_DECL(pj_status_t) pjsua_call_send_typing_ind(pjsua_call_id call_id, PJ_DECL(pj_status_t) pjsua_call_send_typing_ind(pjsua_call_id call_id,
pj_bool_t is_typing, pj_bool_t is_typing,
const pjsua_msg_data*msg_dat a); const pjsua_msg_data*msg_dat a);
/** /**
* Send arbitrary request with the call. This is useful for example to send
* INFO request. Note that application should not use this function to send
* requests which would change the invite session's state, such as re-INVIT
E,
* UPDATE, PRACK, and BYE.
*
* @param call_id Call identification.
* @param method SIP method of the request.
* @param msg_data Optional message body and/or list of headers to be
* included in outgoing request.
*
* @return PJ_SUCCESS on success, or the appropriate error code
.
*/
PJ_DECL(pj_status_t) pjsua_call_send_request(pjsua_call_id call_id,
const pj_str_t *method,
const pjsua_msg_data *msg_data)
;
/**
* Terminate all calls. This will initiate #pjsua_call_hangup() for all * Terminate all calls. This will initiate #pjsua_call_hangup() for all
* currently active calls. * currently active calls.
* *
* \par Python: * \par Python:
* \code * \code
py_pjsua.call_hangup_all() py_pjsua.call_hangup_all()
* \endcode * \endcode
*/ */
PJ_DECL(void) pjsua_call_hangup_all(void); PJ_DECL(void) pjsua_call_hangup_all(void);
skipping to change at line 2806 skipping to change at line 3012
*/ */
/** /**
* Max buddies in buddy list. * Max buddies in buddy list.
*/ */
#ifndef PJSUA_MAX_BUDDIES #ifndef PJSUA_MAX_BUDDIES
# define PJSUA_MAX_BUDDIES 256 # define PJSUA_MAX_BUDDIES 256
#endif #endif
/** /**
* This specifies how long the library should retry resending SUBSCRIBE
* if the previous SUBSCRIBE failed.
*
* Default: 300 seconds
*/
#ifndef PJSUA_PRES_TIMER
# define PJSUA_PRES_TIMER 300
#endif
/**
* This structure describes buddy configuration when adding a buddy to * This structure describes buddy configuration when adding a buddy to
* the buddy list with #pjsua_buddy_add(). Application MUST initialize * the buddy list with #pjsua_buddy_add(). Application MUST initialize
* the structure with #pjsua_buddy_config_default() to initialize this * the structure with #pjsua_buddy_config_default() to initialize this
* structure with default configuration. * structure with default configuration.
* *
* \par Python: * \par Python:
* In Python this structure is <tt>py_pjsua.Buddy_Config</tt>. However * In Python this structure is <tt>py_pjsua.Buddy_Config</tt>. However
* it is recommended that application instantiates the buddy config * it is recommended that application instantiates the buddy config
* by calling: * by calling:
* \code * \code
skipping to change at line 2898 skipping to change at line 3114
*/ */
pj_str_t status_text; pj_str_t status_text;
/** /**
* Flag to indicate that we should monitor the presence information for * Flag to indicate that we should monitor the presence information for
* this buddy (normally yes, unless explicitly disabled). * this buddy (normally yes, unless explicitly disabled).
*/ */
pj_bool_t monitor_pres; pj_bool_t monitor_pres;
/** /**
* Extended RPID information about the person.
*/
pjrpid_element rpid;
/**
* Internal buffer. * Internal buffer.
*/ */
char buf_[256]; char buf_[512];
} pjsua_buddy_info; } pjsua_buddy_info;
/** /**
* Set default values to the buddy config. * Set default values to the buddy config.
* *
* \par Python: * \par Python:
* \code * \code
buddy_cfg = py_pjsua.buddy_config_default() buddy_cfg = py_pjsua.buddy_config_default()
* \endcode * \endcode
*/ */
PJ_INLINE(void) pjsua_buddy_config_default(pjsua_buddy_config *cfg) PJ_DECL(void) pjsua_buddy_config_default(pjsua_buddy_config *cfg);
{
pj_bzero(cfg, sizeof(*cfg));
}
/** /**
* Get total number of buddies. * Get total number of buddies.
* *
* @return Number of buddies. * @return Number of buddies.
* *
* \par Python: * \par Python:
* \code * \code
buddy_count = py_pjsua.get_buddy_count() buddy_count = py_pjsua.get_buddy_count()
* \endcode * \endcode
skipping to change at line 3035 skipping to change at line 3253
* *
* \par Python: * \par Python:
* \code * \code
status = py_pjsua.buddy_subscribe_pres(buddy_id, subscribe) status = py_pjsua.buddy_subscribe_pres(buddy_id, subscribe)
* \endcode * \endcode
*/ */
PJ_DECL(pj_status_t) pjsua_buddy_subscribe_pres(pjsua_buddy_id buddy_id, PJ_DECL(pj_status_t) pjsua_buddy_subscribe_pres(pjsua_buddy_id buddy_id,
pj_bool_t subscribe); pj_bool_t subscribe);
/** /**
* Update the presence information for the buddy. Although the library
* periodically refreshes the presence subscription for all buddies, some
* application may want to refresh the buddy's presence subscription
* immediately, and in this case it can use this function to accomplish
* this.
*
* Note that the buddy's presence subscription will only be initiated
* if presence monitoring is enabled for the buddy. See
* #pjsua_buddy_subscribe_pres() for more info. Also if presence subscripti
on
* for the buddy is already active, this function will not do anything.
*
* Once the presence subscription is activated successfully for the buddy,
* application will be notified about the buddy's presence status in the
* on_buddy_state() callback.
*
* @param buddy_id Buddy identification.
*
* @return PJ_SUCCESS on success, or the appropriate error code
.
*/
PJ_DECL(pj_status_t) pjsua_buddy_update_pres(pjsua_buddy_id buddy_id);
/**
* Dump presence subscriptions to log. * Dump presence subscriptions to log.
* *
* @param verbose Yes or no. * @param verbose Yes or no.
* *
* \par Python: * \par Python:
* \code * \code
py_pjsua.pres_dump() py_pjsua.pres_dump()
* \endcode * \endcode
*/ */
PJ_DECL(void) pjsua_pres_dump(pj_bool_t verbose); PJ_DECL(void) pjsua_pres_dump(pj_bool_t verbose);
skipping to change at line 3206 skipping to change at line 3446
* Default iLBC mode. * Default iLBC mode.
*/ */
#ifndef PJSUA_DEFAULT_ILBC_MODE #ifndef PJSUA_DEFAULT_ILBC_MODE
# define PJSUA_DEFAULT_ILBC_MODE 20 # define PJSUA_DEFAULT_ILBC_MODE 20
#endif #endif
/** /**
* The default echo canceller tail length. * The default echo canceller tail length.
*/ */
#ifndef PJSUA_DEFAULT_EC_TAIL_LEN #ifndef PJSUA_DEFAULT_EC_TAIL_LEN
# define PJSUA_DEFAULT_EC_TAIL_LEN 800 # define PJSUA_DEFAULT_EC_TAIL_LEN 200
#endif #endif
/** /**
* The maximum file player. * The maximum file player.
*/ */
#ifndef PJSUA_MAX_PLAYERS #ifndef PJSUA_MAX_PLAYERS
# define PJSUA_MAX_PLAYERS 32 # define PJSUA_MAX_PLAYERS 32
#endif #endif
/** /**
skipping to change at line 3246 skipping to change at line 3486
struct pjsua_media_config struct pjsua_media_config
{ {
/** /**
* Clock rate to be applied to the conference bridge. * Clock rate to be applied to the conference bridge.
* If value is zero, default clock rate will be used * If value is zero, default clock rate will be used
* (PJSUA_DEFAULT_CLOCK_RATE, which by default is 16KHz). * (PJSUA_DEFAULT_CLOCK_RATE, which by default is 16KHz).
*/ */
unsigned clock_rate; unsigned clock_rate;
/** /**
* Specify audio frame ptime. The value here will affect the
* samples per frame of both the sound device and the conference
* bridge. Specifying lower ptime will normally reduce the
* latency.
*
* Default: 10 (miliseconds)
*/
unsigned audio_frame_ptime;
/**
* Specify maximum number of media ports to be created in the * Specify maximum number of media ports to be created in the
* conference bridge. Since all media terminate in the bridge * conference bridge. Since all media terminate in the bridge
* (calls, file player, file recorder, etc), the value must be * (calls, file player, file recorder, etc), the value must be
* large enough to support all of them. However, the larger * large enough to support all of them. However, the larger
* the value, the more computations are performed. * the value, the more computations are performed.
*/ */
unsigned max_media_ports; unsigned max_media_ports;
/** /**
* Specify whether the media manager should manage its own * Specify whether the media manager should manage its own
skipping to change at line 3285 skipping to change at line 3535
* 3-4: resampling use small filter, * 3-4: resampling use small filter,
* 1-2: resampling use linear. * 1-2: resampling use linear.
* The media quality also sets speex codec quality/complexity to the * The media quality also sets speex codec quality/complexity to the
* number. * number.
* *
* Default: 5 (PJSUA_DEFAULT_CODEC_QUALITY). * Default: 5 (PJSUA_DEFAULT_CODEC_QUALITY).
*/ */
unsigned quality; unsigned quality;
/** /**
* Specify default ptime. * Specify default codec ptime.
* *
* Default: 0 (codec specific) * Default: 0 (codec specific)
*/ */
unsigned ptime; unsigned ptime;
/** /**
* Disable VAD? * Disable VAD?
* *
* Default: 0 (no (meaning VAD is enabled)) * Default: 0 (no (meaning VAD is enabled))
*/ */
skipping to change at line 3385 skipping to change at line 3635
/** /**
* Use this function to initialize media config. * Use this function to initialize media config.
* *
* @param cfg The media config to be initialized. * @param cfg The media config to be initialized.
* *
* \par Python: * \par Python:
* \code * \code
media_cfg = py_pjsua.media_config_default() media_cfg = py_pjsua.media_config_default()
* \endcode * \endcode
*/ */
PJ_INLINE(void) pjsua_media_config_default(pjsua_media_config *cfg) PJ_DECL(void) pjsua_media_config_default(pjsua_media_config *cfg);
{
pj_bzero(cfg, sizeof(*cfg));
cfg->clock_rate = PJSUA_DEFAULT_CLOCK_RATE;
cfg->max_media_ports = 32;
cfg->has_ioqueue = PJ_TRUE;
cfg->thread_cnt = 1;
cfg->quality = PJSUA_DEFAULT_CODEC_QUALITY;
cfg->ilbc_mode = PJSUA_DEFAULT_ILBC_MODE;
cfg->ec_tail_len = PJSUA_DEFAULT_EC_TAIL_LEN;
cfg->jb_init = cfg->jb_min_pre = cfg->jb_max_pre = cfg->jb_max = -1;
}
/** /**
* This structure describes codec information, which can be retrieved by * This structure describes codec information, which can be retrieved by
* calling #pjsua_enum_codecs(). * calling #pjsua_enum_codecs().
*/ */
typedef struct pjsua_codec_info typedef struct pjsua_codec_info
{ {
/** /**
* Codec unique identification. * Codec unique identification.
*/ */
 End of changes. 44 change blocks. 
120 lines changed or deleted 376 lines changed or added


 pjsua_internal.h   pjsua_internal.h 
/* $Id: pjsua_internal.h 1311 2007-05-29 00:33:09Z bennylp $ */ /* $Id: pjsua_internal.h 1536 2007-10-31 13:28:08Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 55 skipping to change at line 55
pjsua_acc_id acc_id; /**< Account index being used. */ pjsua_acc_id acc_id; /**< Account index being used. */
pjsua_call_media_status media_st;/**< Media state. */ pjsua_call_media_status media_st;/**< Media state. */
pjmedia_dir media_dir; /**< Media direction. */ pjmedia_dir media_dir; /**< Media direction. */
pjmedia_session *session; /**< The media session. */ pjmedia_session *session; /**< The media session. */
int conf_slot; /**< Slot # in conference bridge . */ int conf_slot; /**< Slot # in conference bridge . */
pjsip_evsub *xfer_sub; /**< Xfer server subscription, i f this pjsip_evsub *xfer_sub; /**< Xfer server subscription, i f this
call was triggered by xfer. */ call was triggered by xfer. */
pjmedia_transport *med_tp; /**< Media transport. */ pjmedia_transport *med_tp; /**< Media transport. */
pj_timer_entry refresh_tm;/**< Timer to send re-INVITE. */ pj_timer_entry refresh_tm;/**< Timer to send re-INVITE. */
pj_timer_entry hangup_tm; /**< Timer to hangup call. */ pj_timer_entry hangup_tm; /**< Timer to hangup call. */
pj_stun_nat_type rem_nat_type; /**< NAT type of remote endpoint. */
char last_text_buf_[128]; /**< Buffer for last_text. */ char last_text_buf_[128]; /**< Buffer for last_text. */
} pjsua_call; } pjsua_call;
/** /**
* Server presence subscription list head. * Server presence subscription list head.
*/ */
typedef struct pjsua_srv_pres typedef struct pjsua_srv_pres
{ {
skipping to change at line 86 skipping to change at line 87
pj_bool_t valid; /**< Is this account valid? */ pj_bool_t valid; /**< Is this account valid? */
int index; /**< Index in accounts array. */ int index; /**< Index in accounts array. */
pj_str_t display; /**< Display name, if any. */ pj_str_t display; /**< Display name, if any. */
pj_str_t user_part; /**< User part of local URI. */ pj_str_t user_part; /**< User part of local URI. */
pj_str_t srv_domain; /**< Host part of reg server. */ pj_str_t srv_domain; /**< Host part of reg server. */
int srv_port; /**< Port number of reg server. */ int srv_port; /**< Port number of reg server. */
pjsip_regc *regc; /**< Client registration session. */ pjsip_regc *regc; /**< Client registration session. */
pj_timer_entry reg_timer; /**< Registration timer. */
pj_status_t reg_last_err; /**< Last registration error. */ pj_status_t reg_last_err; /**< Last registration error. */
int reg_last_code; /**< Last status last register. */ int reg_last_code; /**< Last status last register. */
pj_timer_entry ka_timer; /**< Keep-alive timer for UDP. */
pjsip_transport *ka_transport; /**< Transport for keep-alive. */
pj_sockaddr ka_target; /**< Destination address for K-A
*/
unsigned ka_target_len; /**< Length of ka_target. */
pjsip_route_hdr route_set; /**< Complete route set inc. out bnd.*/ pjsip_route_hdr route_set; /**< Complete route set inc. out bnd.*/
unsigned cred_cnt; /**< Number of credentials. */ unsigned cred_cnt; /**< Number of credentials. */
pjsip_cred_info cred[PJSUA_ACC_MAX_PROXIES]; /**< Complete creds. */ pjsip_cred_info cred[PJSUA_ACC_MAX_PROXIES]; /**< Complete creds. */
pj_bool_t online_status; /**< Our online status. */ pj_bool_t online_status; /**< Our online status. */
pjrpid_element rpid; /**< RPID element information. */
pjsua_srv_pres pres_srv_list; /**< Server subscription list. */ pjsua_srv_pres pres_srv_list; /**< Server subscription list. */
pjsip_publishc *publish_sess; /**< Client publication session. */ pjsip_publishc *publish_sess; /**< Client publication session. */
pj_bool_t publish_state; /**< Last published online status */ pj_bool_t publish_state; /**< Last published online status */
} pjsua_acc; } pjsua_acc;
/** /**
*Transport. *Transport.
*/ */
typedef struct pjsua_transport_data typedef struct pjsua_transport_data
skipping to change at line 132 skipping to change at line 138
typedef struct pjsua_buddy typedef struct pjsua_buddy
{ {
unsigned index; /**< Buddy index. */ unsigned index; /**< Buddy index. */
pj_str_t uri; /**< Buddy URI. */ pj_str_t uri; /**< Buddy URI. */
pj_str_t contact; /**< Contact learned from subscrp. */ pj_str_t contact; /**< Contact learned from subscrp. */
pj_str_t name; /**< Buddy name. */ pj_str_t name; /**< Buddy name. */
pj_str_t display; /**< Buddy display name. */ pj_str_t display; /**< Buddy display name. */
pj_str_t host; /**< Buddy host. */ pj_str_t host; /**< Buddy host. */
unsigned port; /**< Buddy port. */ unsigned port; /**< Buddy port. */
pj_bool_t monitor; /**< Should we monitor? */ pj_bool_t monitor; /**< Should we monitor? */
pjsip_dialog *dlg; /**< The underlying dialog. */
pjsip_evsub *sub; /**< Buddy presence subscription */ pjsip_evsub *sub; /**< Buddy presence subscription */
pjsip_pres_status status; /**< Buddy presence status. */ pjsip_pres_status status; /**< Buddy presence status. */
} pjsua_buddy; } pjsua_buddy;
/** /**
* File player/recorder data. * File player/recorder data.
*/ */
typedef struct pjsua_file_data typedef struct pjsua_file_data
{ {
pj_bool_t type; /* 0=player, 1=playlist */ pj_bool_t type; /* 0=player, 1=playlist */
pjmedia_port *port; pjmedia_port *port;
pj_pool_t *pool;
unsigned slot; unsigned slot;
} pjsua_file_data; } pjsua_file_data;
/** /**
* Additional parameters for conference bridge. * Additional parameters for conference bridge.
*/ */
typedef struct pjsua_conf_setting typedef struct pjsua_conf_setting
{ {
unsigned channel_count; unsigned channel_count;
unsigned samples_per_frame; unsigned samples_per_frame;
skipping to change at line 187 skipping to change at line 195
/* Threading: */ /* Threading: */
pj_bool_t thread_quit_flag; /**< Thread quit flag. */ pj_bool_t thread_quit_flag; /**< Thread quit flag. */
pj_thread_t *thread[4]; /**< Array of threads. */ pj_thread_t *thread[4]; /**< Array of threads. */
/* STUN and resolver */ /* STUN and resolver */
pj_stun_config stun_cfg; /**< Global STUN settings. */ pj_stun_config stun_cfg; /**< Global STUN settings. */
pj_sockaddr stun_srv; /**< Resolved STUN server addres s */ pj_sockaddr stun_srv; /**< Resolved STUN server addres s */
pj_status_t stun_status; /**< STUN server status. */ pj_status_t stun_status; /**< STUN server status. */
pj_dns_resolver *resolver; /**< DNS resolver. */ pj_dns_resolver *resolver; /**< DNS resolver. */
/* Detected NAT type */
pj_stun_nat_type nat_type; /**< NAT type. */
pj_status_t nat_status; /**< Detection status.
*/
pj_bool_t nat_in_progress; /**< Detection in progress */
/* Account: */ /* Account: */
unsigned acc_cnt; /**< Number of accounts. */ unsigned acc_cnt; /**< Number of accounts. */
pjsua_acc_id default_acc; /**< Default account ID */ pjsua_acc_id default_acc; /**< Default account ID */
pjsua_acc acc[PJSUA_MAX_ACC]; /**< Account array. */ pjsua_acc acc[PJSUA_MAX_ACC]; /**< Account array. */
pjsua_acc_id acc_ids[PJSUA_MAX_ACC]; /**< Acc sorted by prio*/ pjsua_acc_id acc_ids[PJSUA_MAX_ACC]; /**< Acc sorted by prio*/
/* Calls: */ /* Calls: */
pjsua_config ua_cfg; /**< UA config. */ pjsua_config ua_cfg; /**< UA config. */
unsigned call_cnt; /**< Call counter. */ unsigned call_cnt; /**< Call counter. */
pjsua_call calls[PJSUA_MAX_CALLS];/**< Calls array. */ pjsua_call calls[PJSUA_MAX_CALLS];/**< Calls array. */
skipping to change at line 229 skipping to change at line 242
pjsua_file_data player[PJSUA_MAX_PLAYERS];/**< Array of players.*/ pjsua_file_data player[PJSUA_MAX_PLAYERS];/**< Array of players.*/
/* File recorders: */ /* File recorders: */
unsigned rec_cnt; /**< Number of file recorders. */ unsigned rec_cnt; /**< Number of file recorders. */
pjsua_file_data recorder[PJSUA_MAX_RECORDERS];/**< Array of recs.*/ pjsua_file_data recorder[PJSUA_MAX_RECORDERS];/**< Array of recs.*/
}; };
extern struct pjsua_data pjsua_var; extern struct pjsua_data pjsua_var;
/** /**
* Get the instance of pjsua
*/
PJ_DECL(struct pjsua_data*) pjsua_get_var(void);
/**
* IM callback data. * IM callback data.
*/ */
typedef struct pjsua_im_data typedef struct pjsua_im_data
{ {
pjsua_acc_id acc_id; pjsua_acc_id acc_id;
pjsua_call_id call_id; pjsua_call_id call_id;
pj_str_t to; pj_str_t to;
pj_str_t body; pj_str_t body;
void *user_data; void *user_data;
} pjsua_im_data; } pjsua_im_data;
skipping to change at line 307 skipping to change at line 325
* Start presence subsystem. * Start presence subsystem.
*/ */
pj_status_t pjsua_pres_start(void); pj_status_t pjsua_pres_start(void);
/** /**
* Refresh presence subscriptions * Refresh presence subscriptions
*/ */
void pjsua_pres_refresh(void); void pjsua_pres_refresh(void);
/* /*
* Update server subscription (e.g. when our online status has changed)
*/
void pjsua_pres_update_acc(int acc_id, pj_bool_t force);
/*
* Shutdown presence. * Shutdown presence.
*/ */
void pjsua_pres_shutdown(void); void pjsua_pres_shutdown(void);
/** /**
* Init presence for aoocunt. * Init presence for aoocunt.
*/ */
pj_status_t pjsua_pres_init_acc(int acc_id); pj_status_t pjsua_pres_init_acc(int acc_id);
/** /**
skipping to change at line 402 skipping to change at line 425
void pjsua_parse_media_type( pj_pool_t *pool, void pjsua_parse_media_type( pj_pool_t *pool,
const pj_str_t *mime, const pj_str_t *mime,
pjsip_media_type *media_type); pjsip_media_type *media_type);
/* /*
* Internal function to init transport selector from transport id. * Internal function to init transport selector from transport id.
*/ */
void pjsua_init_tpselector(pjsua_transport_id tp_id, void pjsua_init_tpselector(pjsua_transport_id tp_id,
pjsip_tpselector *sel); pjsip_tpselector *sel);
pj_status_t acquire_call(const char *title,
pjsua_call_id call_id,
pjsua_call **p_call,
pjsip_dialog **p_dlg);
const char *good_number(char *buf, pj_int32_t val);
void print_call(const char *title,
int call_id,
char *buf, pj_size_t size);
PJ_END_DECL PJ_END_DECL
#endif /* __PJSUA_INTERNAL_H__ */ #endif /* __PJSUA_INTERNAL_H__ */
 End of changes. 11 change blocks. 
2 lines changed or deleted 36 lines changed or added


 pool.h   pool.h 
/* $Id: pool.h 1040 2007-03-05 00:58:24Z bennylp $ */ /* $Id: pool.h 1417 2007-08-16 10:11:44Z bennylp $ */
/* /*
* Copyright (C)2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C)2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 229 skipping to change at line 229
pj_caching_pool cp; pj_caching_pool cp;
pj_status_t status; pj_status_t status;
// Must init PJLIB before anything else // Must init PJLIB before anything else
status = pj_init(); status = pj_init();
if (status != PJ_SUCCESS) { if (status != PJ_SUCCESS) {
my_perror("Error initializing PJLIB", status); my_perror("Error initializing PJLIB", status);
return 1; return 1;
} }
// Create the pool factory, in this case, a caching pool. // Create the pool factory, in this case, a caching pool,
pj_caching_pool_init(&cp, &pj_pool_factory_default_policy, // using default pool policy.
1024*1024 ); pj_caching_pool_init(&cp, NULL, 1024*1024 );
// Do a demo // Do a demo
pool_demo_1(&cp.factory); pool_demo_1(&cp.factory);
// Done with demos, destroy caching pool before exiting app. // Done with demos, destroy caching pool before exiting app.
pj_caching_pool_destroy(&cp); pj_caching_pool_destroy(&cp);
return 0; return 0;
} }
skipping to change at line 501 skipping to change at line 501
* type-casted to the specified type. * type-casted to the specified type.
* *
* @param pool The pool * @param pool The pool
* @param type The type of object to be allocated * @param type The type of object to be allocated
* *
* @return Memory buffer of the specified type. * @return Memory buffer of the specified type.
*/ */
#define PJ_POOL_ZALLOC_T(pool,type) \ #define PJ_POOL_ZALLOC_T(pool,type) \
((type*)pj_pool_zalloc(pool, sizeof(type))) ((type*)pj_pool_zalloc(pool, sizeof(type)))
/*
* Internal functions
*/
PJ_IDECL(void*) pj_pool_alloc_from_block(pj_pool_block *block, pj_size_t si
ze);
PJ_DECL(void*) pj_pool_allocate_find(pj_pool_t *pool, unsigned size);
/** /**
* @} // PJ_POOL * @} // PJ_POOL
*/ */
/* ************************************************************************ **/ /* ************************************************************************ **/
/** /**
* @defgroup PJ_POOL_FACTORY Pool Factory and Policy * @defgroup PJ_POOL_FACTORY Pool Factory and Policy
* @ingroup PJ_POOL_GROUP * @ingroup PJ_POOL_GROUP
* @brief * @brief
* A pool object must be created through a factory. A factory not only prov ides * A pool object must be created through a factory. A factory not only prov ides
skipping to change at line 602 skipping to change at line 608
/** /**
* Option flags. * Option flags.
*/ */
unsigned flags; unsigned flags;
} pj_pool_factory_policy; } pj_pool_factory_policy;
/** /**
* This constant denotes the exception number that will be thrown by defaul t * This constant denotes the exception number that will be thrown by defaul t
* memory factory policy when memory allocation fails. * memory factory policy when memory allocation fails.
*
* @see pj_NO_MEMORY_EXCEPTION()
*/
PJ_DECL_DATA(int) PJ_NO_MEMORY_EXCEPTION;
/**
* Get #PJ_NO_MEMORY_EXCEPTION constant.
*/ */
extern int PJ_NO_MEMORY_EXCEPTION; PJ_DECL(int) pj_NO_MEMORY_EXCEPTION();
/** /**
* This global variable points to default memory pool factory policy. * This global variable points to default memory pool factory policy.
* The behaviour of the default policy is: * The behaviour of the default policy is:
* - block allocation and deallocation use malloc() and free(). * - block allocation and deallocation use malloc() and free().
* - callback will raise PJ_NO_MEMORY_EXCEPTION exception. * - callback will raise PJ_NO_MEMORY_EXCEPTION exception.
* - access to pool factory is not serialized (i.e. not thread safe). * - access to pool factory is not serialized (i.e. not thread safe).
*
* @see pj_pool_factory_get_default_policy
*/
PJ_DECL_DATA(pj_pool_factory_policy) pj_pool_factory_default_policy;
/**
* Get the default pool factory policy.
*
* @return the pool policy.
*/ */
extern pj_pool_factory_policy pj_pool_factory_default_policy; PJ_DECL(const pj_pool_factory_policy*) pj_pool_factory_get_default_policy(v oid);
/** /**
* This structure contains the declaration for pool factory interface. * This structure contains the declaration for pool factory interface.
*/ */
struct pj_pool_factory struct pj_pool_factory
{ {
/** /**
* Memory pool policy. * Memory pool policy.
*/ */
pj_pool_factory_policy policy; pj_pool_factory_policy policy;
 End of changes. 7 change blocks. 
6 lines changed or deleted 29 lines changed or added


 pool_i.h   pool_i.h 
/* $Id: pool_i.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: pool_i.h 1405 2007-07-20 08:08:30Z bennylp $ */
/* /*
* Copyright (C)2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C)2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A
*/ */
#include <pj/string.h> #include <pj/string.h>
PJ_DECL(void*) pj_pool_allocate_find(pj_pool_t *pool, unsigned size);
PJ_IDEF(pj_size_t) pj_pool_get_capacity( pj_pool_t *pool ) PJ_IDEF(pj_size_t) pj_pool_get_capacity( pj_pool_t *pool )
{ {
return pool->capacity; return pool->capacity;
} }
PJ_IDEF(pj_size_t) pj_pool_get_used_size( pj_pool_t *pool ) PJ_IDEF(pj_size_t) pj_pool_get_used_size( pj_pool_t *pool )
{ {
pj_pool_block *b = pool->block_list.next; pj_pool_block *b = pool->block_list.next;
pj_size_t used_size = sizeof(pj_pool_t); pj_size_t used_size = sizeof(pj_pool_t);
while (b != &pool->block_list) { while (b != &pool->block_list) {
 End of changes. 2 change blocks. 
3 lines changed or deleted 1 lines changed or added


 presence.h   presence.h 
/* $Id: presence.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: presence.h 1424 2007-08-25 13:36:15Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 29 skipping to change at line 29
#ifndef __PJSIP_SIMPLE_PRESENCE_H__ #ifndef __PJSIP_SIMPLE_PRESENCE_H__
#define __PJSIP_SIMPLE_PRESENCE_H__ #define __PJSIP_SIMPLE_PRESENCE_H__
/** /**
* @file presence.h * @file presence.h
* @brief SIP Extension for Presence (RFC 3856) * @brief SIP Extension for Presence (RFC 3856)
*/ */
#include <pjsip-simple/evsub.h> #include <pjsip-simple/evsub.h>
#include <pjsip-simple/pidf.h> #include <pjsip-simple/pidf.h>
#include <pjsip-simple/xpidf.h> #include <pjsip-simple/xpidf.h>
#include <pjsip-simple/rpid.h>
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /**
* @defgroup PJSIP_SIMPLE_PRES SIP Extension for Presence (RFC 3856) * @defgroup PJSIP_SIMPLE_PRES SIP Extension for Presence (RFC 3856)
* @ingroup PJSIP_SIMPLE * @ingroup PJSIP_SIMPLE
* @brief Support for SIP Extension for Presence (RFC 3856) * @brief Support for SIP Extension for Presence (RFC 3856)
* @{ * @{
* *
* This module contains the implementation of SIP Presence Extension as * This module contains the implementation of SIP Presence Extension as
skipping to change at line 79 skipping to change at line 80
/** /**
* This structure describes presence status of a presentity. * This structure describes presence status of a presentity.
*/ */
struct pjsip_pres_status struct pjsip_pres_status
{ {
unsigned info_cnt; /**< Number of info in the status. */ unsigned info_cnt; /**< Number of info in the status. */
struct { struct {
pj_bool_t basic_open; /**< Basic status/availability. */ pj_bool_t basic_open; /**< Basic status/availability. */
pjrpid_element rpid; /**< Optional RPID info.
*/
pj_str_t id; /**< Tuple id. */ pj_str_t id; /**< Tuple id. */
pj_str_t contact; /**< Optional contact address. */ pj_str_t contact; /**< Optional contact address. */
} info[PJSIP_PRES_STATUS_MAX_INFO]; /**< Array of info. */ } info[PJSIP_PRES_STATUS_MAX_INFO]; /**< Array of info. */
pj_bool_t _is_valid; /**< Internal flag. */ pj_bool_t _is_valid; /**< Internal flag. */
}; };
/** /**
* @see pjsip_pres_status * @see pjsip_pres_status
 End of changes. 3 change blocks. 
1 lines changed or deleted 5 lines changed or added


 print_util.h   print_util.h 
/* $Id: print_util.h 1240 2007-05-01 16:54:54Z bennylp $ */ /* $Id: print_util.h 1500 2007-10-15 07:04:59Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 53 skipping to change at line 53
printed = len1+str2.slen+2; \ printed = len1+str2.slen+2; \
if (printed >= (endbuf-buf)) return -1; \ if (printed >= (endbuf-buf)) return -1; \
pj_memcpy(buf,str1,len1); \ pj_memcpy(buf,str1,len1); \
*(buf+len1)=quotebegin; \ *(buf+len1)=quotebegin; \
pj_memcpy(buf+len1+1, str2.ptr, str2.slen); \ pj_memcpy(buf+len1+1, str2.ptr, str2.slen); \
*(buf+printed-1) = quoteend; \ *(buf+printed-1) = quoteend; \
buf += printed; \ buf += printed; \
} \ } \
} while (0) } while (0)
#define copy_advance_pair_quote(buf,str1,len1,str2,quotebegin,quoteend) \
do { \
printed = len1+str2.slen+2; \
if (printed >= (endbuf-buf)) return -1; \
pj_memcpy(buf,str1,len1); \
*(buf+len1)=quotebegin; \
pj_memcpy(buf+len1+1, str2.ptr, str2.slen); \
*(buf+printed-1) = quoteend; \
buf += printed; \
} while (0)
#define copy_advance_pair_escape(buf,str1,len1,str2,unres) \ #define copy_advance_pair_escape(buf,str1,len1,str2,unres) \
do { \ do { \
if (str2.slen) { \ if (str2.slen) { \
if (len1+str2.slen >= (endbuf-buf)) return -1; \ if (len1+str2.slen >= (endbuf-buf)) return -1; \
pj_memcpy(buf,str1,len1); \ pj_memcpy(buf,str1,len1); \
printed=pj_strncpy2_escape(buf+len1,&str2,(endbuf-buf-len1),&unr es);\ printed=pj_strncpy2_escape(buf+len1,&str2,(endbuf-buf-len1),&unr es);\
if (printed < 0) return -1; \ if (printed < 0) return -1; \
buf += (printed+len1); \ buf += (printed+len1); \
} \ } \
} while (0) } while (0)
skipping to change at line 87 skipping to change at line 98
#define copy_advance_pair_no_check(buf,str1,len1,str2) \ #define copy_advance_pair_no_check(buf,str1,len1,str2) \
if (str2.slen) { \ if (str2.slen) { \
pj_memcpy(buf,str1,len1); \ pj_memcpy(buf,str1,len1); \
pj_memcpy(buf+len1, str2.ptr, str2.slen); \ pj_memcpy(buf+len1, str2.ptr, str2.slen); \
buf += len1+str2.slen; \ buf += len1+str2.slen; \
} }
#define copy_advance copy_advance_check #define copy_advance copy_advance_check
#define copy_advance_pair copy_advance_pair_check #define copy_advance_pair copy_advance_pair_check
#define copy_advance_pair_quote copy_advance_pair_quote_check
#define copy_advance_pair_quote_cond(buf,str1,len1,str2,quotebegin,quoteend ) \ #define copy_advance_pair_quote_cond(buf,str1,len1,str2,quotebegin,quoteend ) \
do { \ do { \
if (str2.slen && *str2.ptr!=quotebegin) \ if (str2.slen && *str2.ptr!=quotebegin) \
copy_advance_pair_quote(buf,str1,len1,str2,quotebegin,quoteend); \ copy_advance_pair_quote(buf,str1,len1,str2,quotebegin,quoteend); \
else \ else \
copy_advance_pair(buf,str1,len1,str2); \ copy_advance_pair(buf,str1,len1,str2); \
} while (0) } while (0)
/* /*
* Internal type declarations. * Internal type declarations.
*/ */
typedef void* (*pjsip_hdr_clone_fptr)(pj_pool_t *, const void*); typedef void* (*pjsip_hdr_clone_fptr)(pj_pool_t *, const void*);
typedef int (*pjsip_hdr_print_fptr)(void *hdr, char *buf, pj_size_t len); typedef int (*pjsip_hdr_print_fptr)(void *hdr, char *buf, pj_size_t len);
extern const pj_str_t pjsip_hdr_names[]; typedef struct pjsip_hdr_name_info_t
{
char *name;
unsigned name_len;
char *sname;
} pjsip_hdr_name_info_t;
extern const pjsip_hdr_name_info_t pjsip_hdr_names[];
PJ_INLINE(void) init_hdr(void *hptr, pjsip_hdr_e htype, void *vptr) PJ_INLINE(void) init_hdr(void *hptr, pjsip_hdr_e htype, void *vptr)
{ {
pjsip_hdr *hdr = (pjsip_hdr*) hptr; pjsip_hdr *hdr = (pjsip_hdr*) hptr;
hdr->type = htype; hdr->type = htype;
hdr->name = hdr->sname = pjsip_hdr_names[htype]; hdr->name.ptr = pjsip_hdr_names[htype].name;
hdr->name.slen = pjsip_hdr_names[htype].name_len;
if (pjsip_hdr_names[htype].sname) {
hdr->sname.ptr = pjsip_hdr_names[htype].sname;
hdr->sname.slen = 1;
} else {
hdr->sname = hdr->name;
}
hdr->vptr = (pjsip_hdr_vptr*) vptr; hdr->vptr = (pjsip_hdr_vptr*) vptr;
pj_list_init(hdr); pj_list_init(hdr);
} }
#endif /* __PJSIP_PRINT_H__ */ #endif /* __PJSIP_PRINT_H__ */
 End of changes. 5 change blocks. 
4 lines changed or deleted 28 lines changed or added


 resolver.h   resolver.h 
/* $Id: resolver.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: resolver.h 1356 2007-06-11 16:47:51Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 191 skipping to change at line 191
/** /**
* This structure describes resolver settings. * This structure describes resolver settings.
*/ */
typedef struct pj_dns_settings typedef struct pj_dns_settings
{ {
unsigned options; /**< Options flags. */ unsigned options; /**< Options flags. */
unsigned qretr_delay; /**< Query retransmit delay in msec. */ unsigned qretr_delay; /**< Query retransmit delay in msec. */
unsigned qretr_count; /**< Query maximum retransmission count. */ unsigned qretr_count; /**< Query maximum retransmission count. */
unsigned cache_max_ttl; /**< Maximum TTL for cached responses. If th e unsigned cache_max_ttl; /**< Maximum TTL for cached responses. If th e
value is zero, caching is disabled. */ value is zero, caching is disabled. */
unsigned good_ns_ttl; /**< See #PJ_DNS_RESOLVER_GOOD_NS_TTL
*/
unsigned bad_ns_ttl; /**< See #PJ_DNS_RESOLVER_BAD_NS_TTL
*/
} pj_dns_settings; } pj_dns_settings;
/** /**
* This structure represents DNS A record, as the result of parsing
* DNS response packet using #pj_dns_parse_a_response().
*/
typedef struct pj_dns_a_record
{
/** The target name being queried. */
pj_str_t name;
/** If target name corresponds to a CNAME entry, the alias contains
* the value of the CNAME entry, otherwise it will be empty.
*/
pj_str_t alias;
/** Number of IP addresses. */
unsigned addr_count;
/** IP addresses of the host found in the response */
pj_in_addr addr[PJ_DNS_MAX_IP_IN_A_REC];
/** Internal buffer for hostname and alias. */
char buf_[128];
} pj_dns_a_record;
/**
* Set default values to the DNS settings.
*
* @param s The DNS settings to be initialized.
*/
PJ_DECL(void) pj_dns_settings_default(pj_dns_settings *s);
/**
* Create DNS resolver instance. After the resolver is created, application * Create DNS resolver instance. After the resolver is created, application
* MUST configure the nameservers with #pj_dns_resolver_set_ns(). * MUST configure the nameservers with #pj_dns_resolver_set_ns().
* *
* When creating the resolver, application may specify both timer heap * When creating the resolver, application may specify both timer heap
* and ioqueue instance, so that it doesn't need to poll the resolver * and ioqueue instance, so that it doesn't need to poll the resolver
* periodically. * periodically.
* *
* @param pf Pool factory where the memory pool will be created from . * @param pf Pool factory where the memory pool will be created from .
* @param name Optional resolver name to identify the instance in * @param name Optional resolver name to identify the instance in
* the log. * the log.
skipping to change at line 348 skipping to change at line 382
* @param query The pending asynchronous query to be cancelled. * @param query The pending asynchronous query to be cancelled.
* @param notify If non-zero, the callback will be called with failure * @param notify If non-zero, the callback will be called with failure
* status to notify that the query has been cancelled. * status to notify that the query has been cancelled.
* *
* @return PJ_SUCCESS on success, or the appropriate error code, * @return PJ_SUCCESS on success, or the appropriate error code,
*/ */
PJ_DECL(pj_status_t) pj_dns_resolver_cancel_query(pj_dns_async_query *query , PJ_DECL(pj_status_t) pj_dns_resolver_cancel_query(pj_dns_async_query *query ,
pj_bool_t notify); pj_bool_t notify);
/** /**
* A utility function to parse a DNS response containing A records into
* DNS A record.
*
* @param pkt The DNS response packet.
* @param rec The structure to be initialized with the parsed
* DNS A record from the packet.
*
* @return PJ_SUCCESS if response can be parsed successfully.
*/
PJ_DECL(pj_status_t) pj_dns_parse_a_response(const pj_dns_parsed_packet *pk
t,
pj_dns_a_record *rec);
/**
* Put the specified DNS packet into DNS cache. This function is mainly use d * Put the specified DNS packet into DNS cache. This function is mainly use d
* for testing the resolver, however it can also be used to inject entries * for testing the resolver, however it can also be used to inject entries
* into the resolver. * into the resolver.
* *
* The packet MUST contain either answer section or query section so that * The packet MUST contain either answer section or query section so that
* it can be indexed. * it can be indexed.
* *
* @param resolver The resolver instance. * @param resolver The resolver instance.
* @param pkt DNS packet to be added to the DNS cache. If the packet * @param pkt DNS packet to be added to the DNS cache. If the packet
* matches existing entry, it will update the entry. * matches existing entry, it will update the entry.
 End of changes. 4 change blocks. 
1 lines changed or deleted 51 lines changed or added


 rtcp.h   rtcp.h 
/* $Id: rtcp.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: rtcp.h 1444 2007-09-20 11:30:59Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 59 skipping to change at line 59
* #pjmedia_stream_get_stat() function. * #pjmedia_stream_get_stat() function.
*/ */
#pragma pack(1) #pragma pack(1)
/** /**
* RTCP sender report. * RTCP sender report.
*/ */
struct pjmedia_rtcp_sr struct pjmedia_rtcp_sr
{ {
pj_uint32_t ssrc; /**< SSRC identification. */
pj_uint32_t ntp_sec; /**< NTP time, seconds part. */ pj_uint32_t ntp_sec; /**< NTP time, seconds part. */
pj_uint32_t ntp_frac; /**< NTP time, fractions part. */ pj_uint32_t ntp_frac; /**< NTP time, fractions part. */
pj_uint32_t rtp_ts; /**< RTP timestamp. */ pj_uint32_t rtp_ts; /**< RTP timestamp. */
pj_uint32_t sender_pcount; /**< Sender packet cound. */ pj_uint32_t sender_pcount; /**< Sender packet cound. */
pj_uint32_t sender_bcount; /**< Sender octet/bytes count. */ pj_uint32_t sender_bcount; /**< Sender octet/bytes count. */
}; };
/** /**
* @see pjmedia_rtcp_sr * @see pjmedia_rtcp_sr
*/ */
skipping to change at line 117 skipping to change at line 116
unsigned p:1; /**< padding flag */ unsigned p:1; /**< padding flag */
unsigned count:5; /**< varies by payload type */ unsigned count:5; /**< varies by payload type */
unsigned pt:8; /**< payload type */ unsigned pt:8; /**< payload type */
#else #else
unsigned count:5; /**< varies by payload type */ unsigned count:5; /**< varies by payload type */
unsigned p:1; /**< padding flag */ unsigned p:1; /**< padding flag */
unsigned version:2; /**< packet type */ unsigned version:2; /**< packet type */
unsigned pt:8; /**< payload type */ unsigned pt:8; /**< payload type */
#endif #endif
unsigned length:16; /**< packet length */ unsigned length:16; /**< packet length */
pj_uint32_t ssrc; /**< SSRC identification */
}; };
/** /**
* @see pjmedia_rtcp_common * @see pjmedia_rtcp_common
*/ */
typedef struct pjmedia_rtcp_common pjmedia_rtcp_common; typedef struct pjmedia_rtcp_common pjmedia_rtcp_common;
/** /**
* This structure declares default RTCP packet (SR) that is sent by pjmedia . * This structure declares default RTCP packet (SR) that is sent by pjmedia .
* Incoming RTCP packet may have different format, and must be parsed * Incoming RTCP packet may have different format, and must be parsed
* manually by application. * manually by application.
*/ */
struct pjmedia_rtcp_pkt typedef struct pjmedia_rtcp_sr_pkt
{ {
pjmedia_rtcp_common common; /**< Common header. */ pjmedia_rtcp_common common; /**< Common header. */
pjmedia_rtcp_sr sr; /**< Sender report. */ pjmedia_rtcp_sr sr; /**< Sender report. */
pjmedia_rtcp_rr rr; /**< variable-length list */ pjmedia_rtcp_rr rr; /**< variable-length list */
}; } pjmedia_rtcp_sr_pkt;
/** /**
* @see pjmedia_rtcp_pkt * This structure declares RTCP RR (Receiver Report) packet.
*/ */
typedef struct pjmedia_rtcp_pkt pjmedia_rtcp_pkt; typedef struct pjmedia_rtcp_rr_pkt
{
pjmedia_rtcp_common common; /**< Common header. */
pjmedia_rtcp_rr rr; /**< variable-length list */
} pjmedia_rtcp_rr_pkt;
#pragma pack() #pragma pack()
/** /**
* NTP time representation. * NTP time representation.
*/ */
struct pjmedia_rtcp_ntp_rec struct pjmedia_rtcp_ntp_rec
{ {
pj_uint32_t hi; /**< High order 32-bit part. */ pj_uint32_t hi; /**< High order 32-bit part. */
pj_uint32_t lo; /**< Lo order 32-bit part. */ pj_uint32_t lo; /**< Lo order 32-bit part. */
skipping to change at line 240 skipping to change at line 244
typedef pj_uint32_t PJMEDIA_AVG_JITTER_TYPE; typedef pj_uint32_t PJMEDIA_AVG_JITTER_TYPE;
#endif #endif
/** /**
* RTCP session is used to monitor the RTP session of one endpoint. There * RTCP session is used to monitor the RTP session of one endpoint. There
* should only be one RTCP session for a bidirectional RTP streams. * should only be one RTCP session for a bidirectional RTP streams.
*/ */
struct pjmedia_rtcp_session struct pjmedia_rtcp_session
{ {
char *name; /**< Name identification. */ char *name; /**< Name identification. */
pjmedia_rtcp_pkt rtcp_pkt; /**< Cached RTCP packet. pjmedia_rtcp_sr_pkt rtcp_sr_pkt;/**< Cached RTCP packet.
*/ */
pjmedia_rtcp_rr_pkt rtcp_rr_pkt;/**< Cached RTCP RR packet.
*/
pjmedia_rtp_seq_session seq_ctrl; /**< RTCP sequence number control. */ pjmedia_rtp_seq_session seq_ctrl; /**< RTCP sequence number control. */
unsigned rtp_last_ts;/**< Last timestamp in RX RTP pkt. */ unsigned rtp_last_ts;/**< Last timestamp in RX RTP pkt. */
unsigned clock_rate; /**< Clock rate of the stream */ unsigned clock_rate; /**< Clock rate of the stream */
unsigned pkt_size; /**< Avg pkt size, in samples. */ unsigned pkt_size; /**< Avg pkt size, in samples. */
pj_uint32_t received; /**< # pkt received */ pj_uint32_t received; /**< # pkt received */
pj_uint32_t exp_prior; /**< # pkt expected at last interval*/ pj_uint32_t exp_prior; /**< # pkt expected at last interval*/
pj_uint32_t rx_prior; /**< # pkt received at last interval*/ pj_uint32_t rx_prior; /**< # pkt received at last interval*/
pj_int32_t transit; /**< Rel transit time for prev pkt */ pj_int32_t transit; /**< Rel transit time for prev pkt */
skipping to change at line 297 skipping to change at line 302
pj_uint32_t ssrc ); pj_uint32_t ssrc );
/** /**
* Utility function to retrieve current NTP timestamp. * Utility function to retrieve current NTP timestamp.
* *
* @param sess RTCP session. * @param sess RTCP session.
* @param ntp NTP record. * @param ntp NTP record.
* *
* @return PJ_SUCCESS on success. * @return PJ_SUCCESS on success.
*/ */
PJ_DEF(pj_status_t) pjmedia_rtcp_get_ntp_time(const pjmedia_rtcp_session *s PJ_DECL(pj_status_t) pjmedia_rtcp_get_ntp_time(const pjmedia_rtcp_session *
ess, sess,
pjmedia_rtcp_ntp_rec *ntp); pjmedia_rtcp_ntp_rec *ntp);
/** /**
* Deinitialize RTCP session. * Deinitialize RTCP session.
* *
* @param session The session. * @param session The session.
*/ */
PJ_DECL(void) pjmedia_rtcp_fini( pjmedia_rtcp_session *session); PJ_DECL(void) pjmedia_rtcp_fini( pjmedia_rtcp_session *session);
/** /**
* Call this function everytime an RTP packet is received to let the RTCP * Call this function everytime an RTP packet is received to let the RTCP
skipping to change at line 346 skipping to change at line 351
* *
* @param session RTCP session. * @param session RTCP session.
* @param rtcp_pkt The received RTCP packet. * @param rtcp_pkt The received RTCP packet.
* @param size Size of the incoming packet. * @param size Size of the incoming packet.
*/ */
PJ_DECL(void) pjmedia_rtcp_rx_rtcp( pjmedia_rtcp_session *session, PJ_DECL(void) pjmedia_rtcp_rx_rtcp( pjmedia_rtcp_session *session,
const void *rtcp_pkt, const void *rtcp_pkt,
pj_size_t size); pj_size_t size);
/** /**
* Build a RTCP SR+RR packet to be transmitted to remote RTP peer. * Build a RTCP packet to be transmitted to remote RTP peer. This will
* create RTCP Sender Report (SR) or Receiver Report (RR) depending on
* whether the endpoint has been transmitting RTP since the last interval.
* Note that this function will reset the interval counters (such as * Note that this function will reset the interval counters (such as
* the ones to calculate fraction lost) in the session. * the ones to calculate fraction lost) in the session.
* *
* @param session The RTCP session. * @param session The RTCP session.
* @param rtcp_pkt Upon return, it will contain pointer to the * @param rtcp_pkt Upon return, it will contain pointer to the
* RTCP packet. * RTCP packet, which can be RTCP SR or RR.
* @param len Upon return, it will indicate the size of * @param len Upon return, it will indicate the size of
* the RTCP packet. * the RTCP packet.
*/ */
PJ_DECL(void) pjmedia_rtcp_build_rtcp( pjmedia_rtcp_session *session, PJ_DECL(void) pjmedia_rtcp_build_rtcp( pjmedia_rtcp_session *session,
pjmedia_rtcp_pkt **rtcp_pkt, void **rtcp_pkt, int *len);
int *len);
/** /**
* @} * @}
*/ */
PJ_END_DECL PJ_END_DECL
#endif /* __PJMEDIA_RTCP_H__ */ #endif /* __PJMEDIA_RTCP_H__ */
 End of changes. 12 change blocks. 
15 lines changed or deleted 22 lines changed or added


 scanner.h   scanner.h 
/* $Id: scanner.h 1145 2007-04-04 10:15:27Z bennylp $ */ /* $Id: scanner.h 1374 2007-06-19 09:04:58Z bennylp $ */
/* /*
* Copyright (C) 2003-2005 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 scanner_cis_bitwise.h   scanner_cis_bitwise.h 
/* $Id: scanner_cis_bitwise.h 142 2006-02-07 19:01:58Z bennylp $ */ /* $Id: scanner_cis_bitwise.h 1374 2007-06-19 09:04:58Z bennylp $ */
/* /*
* Copyright (C) 2003-2005 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 scanner_cis_uint.h   scanner_cis_uint.h 
/* $Id: scanner_cis_uint.h 142 2006-02-07 19:01:58Z bennylp $ */ /* $Id: scanner_cis_uint.h 1374 2007-06-19 09:04:58Z bennylp $ */
/* /*
* Copyright (C) 2003-2005 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 sdp_neg.h   sdp_neg.h 
/* $Id: sdp_neg.h 1072 2007-03-15 22:05:39Z bennylp $ */ /* $Id: sdp_neg.h 1379 2007-06-20 10:03:46Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 52 skipping to change at line 52
* \section sdpneg_state_dia SDP Negotiator State Diagram * \section sdpneg_state_dia SDP Negotiator State Diagram
* *
* The following diagram describes the state transition diagram of the * The following diagram describes the state transition diagram of the
* SDP negotiator. * SDP negotiator.
* *
* <pre> * <pre>
* *
* modify_local_offer() * modify_local_offer()
* create_w_local_offer() +-------------+ send_local_offer() * create_w_local_offer() +-------------+ send_local_offer()
* ----------------------->| LOCAL_OFFER |<----------------------- * ----------------------->| LOCAL_OFFER |<-----------------------
* | +-------------+ | * | +-------------+______ |
* | | | * | | \______ cancel() |
* | set_remote_answer() | | * | set_remote_answer() | \______ |
* | V | * | V \ |
* +--+---+ +-----------+ negotiate() +------+ * +--+---+ +-----------+ negotiate() +-~----+
* | NULL | | WAIT_NEGO |-------------------->| DONE | * | NULL | | WAIT_NEGO |-------------------->| DONE |
* +------+ +-----------+ +------+ * +------+ +-----------+ +------+
* | A | * | A |
* | set_local_answer() | | * | set_local_answer() | |
* | | | * | | |
* | +--------------+ set_remote_offer() | * | +--------------+ set_remote_offer() |
* ----------------------->| REMOTE_OFFER |<---------------------- * ----------------------->| REMOTE_OFFER |<----------------------
* create_w_remote_offer() +--------------+ * create_w_remote_offer() +--------------+
* *
* </pre> * </pre>
skipping to change at line 175 skipping to change at line 175
* #pjmedia_sdp_neg_get_active_local(), and active remote SDP by calling * #pjmedia_sdp_neg_get_active_local(), and active remote SDP by calling
* #pjmedia_sdp_neg_get_active_remote(). * #pjmedia_sdp_neg_get_active_remote().
* *
* If #pjmedia_sdp_neg_negotiate() returns failure (i.e. not PJ_SUCCESS), * If #pjmedia_sdp_neg_negotiate() returns failure (i.e. not PJ_SUCCESS),
* it WILL NOT update its active local and active remote SDP. * it WILL NOT update its active local and active remote SDP.
* *
* Regardless of the return status of the #pjmedia_sdp_neg_negotiate(), * Regardless of the return status of the #pjmedia_sdp_neg_negotiate(),
* the negotiator state will move to PJMEDIA_SDP_NEG_STATE_DONE. * the negotiator state will move to PJMEDIA_SDP_NEG_STATE_DONE.
* *
* *
* \subsection sdpneg_cancel_offer Cancelling an Offer
*
* In other case, after an offer is generated (negotiator state is in
* PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER), the answer may not be received, and
* application wants the negotiator to reset itself to its previous state.
* Consider this example:
*
* - media has been established, and negotiator state is
* PJMEDIA_SDP_NEG_STATE_DONE.
* - application generates a new offer for re-INVITE, so in this case
* it would either call #pjmedia_sdp_neg_send_local_offer() or
* #pjmedia_sdp_neg_modify_local_offer()
* - the negotiator state moves to PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER
* - the re-INVITE was rejected with an error
*
* Since an answer is not received, it is necessary to reset the negotiator
* state back to PJMEDIA_SDP_NEG_STATE_DONE so that the negotiator can
* create or receive new offer.
*
* This can be accomplished by calling #pjmedia_sdp_neg_cancel_offer(),
* to reset the negotiator state back to PJMEDIA_SDP_NEG_STATE_DONE. In
* this case, both active local and active remote will not be modified.
*
* \subsection sdpneg_create_answer Generating SDP Answer * \subsection sdpneg_create_answer Generating SDP Answer
* *
* After remote offer has been set in the negotiator, application can * After remote offer has been set in the negotiator, application can
* request the SDP negotiator to generate appropriate answer based on local * request the SDP negotiator to generate appropriate answer based on local
* capability. * capability.
* *
* To do this, first the application MUST have an SDP describing its local * To do this, first the application MUST have an SDP describing its local
* capabilities. This SDP can be built manually, or application can generat e * capabilities. This SDP can be built manually, or application can generat e
* SDP to describe local media endpoint capability by calling * SDP to describe local media endpoint capability by calling
* #pjmedia_endpt_create_sdp(). When the application is a SIP B2BUA, * #pjmedia_endpt_create_sdp(). When the application is a SIP B2BUA,
skipping to change at line 586 skipping to change at line 609
* remote). * remote).
* *
* @param neg The negotiator. * @param neg The negotiator.
* *
* @return PJ_TRUE if it is local is answering an offer, PJ_FAL SE * @return PJ_TRUE if it is local is answering an offer, PJ_FAL SE
* if remote has answered local offer. * if remote has answered local offer.
*/ */
PJ_DECL(pj_bool_t) pjmedia_sdp_neg_has_local_answer(pjmedia_sdp_neg *neg); PJ_DECL(pj_bool_t) pjmedia_sdp_neg_has_local_answer(pjmedia_sdp_neg *neg);
/** /**
* Cancel previously sent offer, and move negotiator state back to
* previous stable state (PJMEDIA_SDP_NEG_STATE_DONE). The negotiator
* must be in PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER state.
*
* @param neg The negotiator.
*
* @return PJ_SUCCESS or the appropriate error code.
*/
PJ_DECL(pj_status_t) pjmedia_sdp_neg_cancel_offer(pjmedia_sdp_neg *neg);
/**
* Negotiate local and remote answer. Before calling this function, the * Negotiate local and remote answer. Before calling this function, the
* SDP negotiator must be in PJMEDIA_SDP_NEG_STATE_WAIT_NEGO state. * SDP negotiator must be in PJMEDIA_SDP_NEG_STATE_WAIT_NEGO state.
* After calling this function, the negotiator state will move to * After calling this function, the negotiator state will move to
* PJMEDIA_SDP_NEG_STATE_DONE regardless whether the negotiation has * PJMEDIA_SDP_NEG_STATE_DONE regardless whether the negotiation has
* been successfull or not. * been successfull or not.
* *
* If the negotiation succeeds (i.e. the return value is PJ_SUCCESS), * If the negotiation succeeds (i.e. the return value is PJ_SUCCESS),
* the active local and remote SDP will be replaced with the new SDP * the active local and remote SDP will be replaced with the new SDP
* from the negotiation process. * from the negotiation process.
* *
 End of changes. 4 change blocks. 
6 lines changed or deleted 40 lines changed or added


 sha1.h   sha1.h 
/* $Id: sha1.h 1001 2007-02-25 15:38:32Z bennylp $ */ /* $Id: sha1.h 1374 2007-06-19 09:04:58Z bennylp $ */
/* /*
* Copyright (C) 2003-2005 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 sip_auth.h   sip_auth.h 
/* $Id: sip_auth.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: sip_auth.h 1561 2007-11-08 09:24:30Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 48 skipping to change at line 48
/** /**
* @defgroup PJSIP_AUTH_API Authentication API's * @defgroup PJSIP_AUTH_API Authentication API's
* @ingroup PJSIP_AUTH * @ingroup PJSIP_AUTH
* @brief Structures and functions to perform authentication. * @brief Structures and functions to perform authentication.
* @{ * @{
*/ */
/** Length of digest string. */ /** Length of digest string. */
#define PJSIP_MD5STRLEN 32 #define PJSIP_MD5STRLEN 32
/** Type of data in the credential information. */ /** Type of data in the credential information in #pjsip_cred_info. */
typedef enum pjsip_cred_data_type typedef enum pjsip_cred_data_type
{ {
PJSIP_CRED_DATA_PLAIN_PASSWD, /**< Plain text password. */ PJSIP_CRED_DATA_PLAIN_PASSWD=0, /**< Plain text password. */
PJSIP_CRED_DATA_DIGEST /**< Hashed digest. */ PJSIP_CRED_DATA_DIGEST =1, /**< Hashed digest. */
PJSIP_CRED_DATA_EXT_AKA =16 /**< Extended AKA info is available */
} pjsip_cred_data_type; } pjsip_cred_data_type;
/** Authentication's quality of protection (qop) type. */ /** Authentication's quality of protection (qop) type. */
typedef enum pjsip_auth_qop_type typedef enum pjsip_auth_qop_type
{ {
PJSIP_AUTH_QOP_NONE, /**< No quality of protection. */ PJSIP_AUTH_QOP_NONE, /**< No quality of protection. */
PJSIP_AUTH_QOP_AUTH, /**< Authentication. */ PJSIP_AUTH_QOP_AUTH, /**< Authentication. */
PJSIP_AUTH_QOP_AUTH_INT, /**< Authentication with integrity prote ction. */ PJSIP_AUTH_QOP_AUTH_INT, /**< Authentication with integrity prote ction. */
PJSIP_AUTH_QOP_UNKNOWN /**< Unknown protection. */ PJSIP_AUTH_QOP_UNKNOWN /**< Unknown protection. */
} pjsip_auth_qop_type; } pjsip_auth_qop_type;
/** /**
* Type of callback function to create authentication response.
* Application can specify this callback in \a cb field of the credential i
nfo
* (#pjsip_cred_info) and specifying PJSIP_CRED_DATA_DIGEST_CALLBACK as
* \a data_type. When this function is called, most of the fields in the
* \a auth authentication response will have been filled by the framework.
* Application normally should just need to calculate the response digest
* of the authentication response.
*
* @param pool Pool to allocate memory from if application needs to.
* @param chal The authentication challenge sent by server in 401
* or 401 response, in either Proxy-Authenticate or
* WWW-Authenticate header.
* @param cred The credential that has been selected by the framework
* to authenticate against the challenge.
* @param auth The authentication response which application needs to
* calculate the response digest.
*
* @return Application may return non-PJ_SUCCESS to abort the
* authentication process. When this happens, the
* framework will return failure to the original function
* that requested authentication.
*/
typedef pj_status_t (*pjsip_cred_cb)(pj_pool_t *pool,
const pjsip_digest_challenge *chal,
const pjsip_cred_info *cred,
const pj_str_t *method,
pjsip_digest_credential *auth);
/**
* This structure describes credential information. * This structure describes credential information.
* A credential information is a static, persistent information that identi fies * A credential information is a static, persistent information that identi fies
* username and password required to authorize to a specific realm. * username and password required to authorize to a specific realm.
*
* Note that since PJSIP 0.7.0.1, it is possible to make a credential that
is
* valid for any realms, by setting the realm to star/wildcard character,
* i.e. realm = pj_str("*");.
*/ */
struct pjsip_cred_info struct pjsip_cred_info
{ {
pj_str_t realm; /**< Realm. */ pj_str_t realm; /**< Realm. Use "*" to make a credential tha
pj_str_t scheme; /**< Scheme. */ t
pj_str_t username; /**< User name. */ can be used to authenticate against any
int data_type; /**< Type of data. */ challenges.
*/
pj_str_t scheme; /**< Scheme (e.g. "digest").
*/
pj_str_t username; /**< User name.
*/
int data_type; /**< Type of data (0 for plaintext p
asswd). */
pj_str_t data; /**< The data, which can be a plaintext pj_str_t data; /**< The data, which can be a plaintext
password or a hashed digest. */ password or a hashed digest.
*/
/** Extended data */
union {
/** Digest AKA credential information. Note that when AKA credential
* is being used, the \a data field of this #pjsip_cred_info is
* not used, but it still must be initialized to an empty string.
* Please see \ref PJSIP_AUTH_AKA_API for more information.
*/
struct {
pj_str_t k; /**< Permanent subscriber key. */
pj_str_t op; /**< Operator variant key. */
pj_str_t amf; /**< Authentication Management Field */
pjsip_cred_cb cb; /**< Callback to create AKA digest. */
} aka;
} ext;
}; };
/** /**
* This structure describes cached value of previously sent Authorization * This structure describes cached value of previously sent Authorization
* or Proxy-Authorization header. The authentication framework keeps a list * or Proxy-Authorization header. The authentication framework keeps a list
* of this structure and will resend the same header to the same server * of this structure and will resend the same header to the same server
* as long as the method, uri, and nonce stays the same. * as long as the method, uri, and nonce stays the same.
*/ */
typedef struct pjsip_cached_auth_hdr typedef struct pjsip_cached_auth_hdr
{ {
skipping to change at line 127 skipping to change at line 181
#endif #endif
pjsip_www_authenticate_hdr *last_chal; /**< Last challenge seen. */ pjsip_www_authenticate_hdr *last_chal; /**< Last challenge seen. */
#if PJSIP_AUTH_HEADER_CACHING #if PJSIP_AUTH_HEADER_CACHING
pjsip_cached_auth_hdr cached_hdr;/**< List of cached header for pjsip_cached_auth_hdr cached_hdr;/**< List of cached header for
each method. */ each method. */
#endif #endif
} pjsip_cached_auth; } pjsip_cached_auth;
/** /**
* This structure describes client authentication session preference.
* The preference can be set by calling #pjsip_auth_clt_set_prefs().
*/
typedef struct pjsip_auth_clt_pref
{
/**
* If this flag is set, the authentication client framework will
* send an empty Authorization header in each initial request.
* Default is no.
*/
pj_bool_t initial_auth;
/**
* Specify the algorithm to use when empty Authorization header
* is to be sent for each initial request (see above)
*/
pj_str_t algorithm;
} pjsip_auth_clt_pref;
/**
* This structure describes client authentication sessions. It keeps * This structure describes client authentication sessions. It keeps
* all the information needed to authorize the client against all downstrea m * all the information needed to authorize the client against all downstrea m
* servers. * servers.
*/ */
typedef struct pjsip_auth_clt_sess typedef struct pjsip_auth_clt_sess
{ {
pj_pool_t *pool; /**< Pool to use. */ pj_pool_t *pool; /**< Pool to use. */
pjsip_endpoint *endpt; /**< Endpoint where this belongs. */ pjsip_endpoint *endpt; /**< Endpoint where this belongs. */
pjsip_auth_clt_pref pref; /**< Preference/options. */
unsigned cred_cnt; /**< Number of credentials. */ unsigned cred_cnt; /**< Number of credentials. */
pjsip_cred_info *cred_info; /**< Array of credential information */ pjsip_cred_info *cred_info; /**< Array of credential information */
pjsip_cached_auth cached_auth; /**< Cached authorization info. */ pjsip_cached_auth cached_auth; /**< Cached authorization info. */
} pjsip_auth_clt_sess; } pjsip_auth_clt_sess;
/** /**
* Duplicate a credential info.
*
* @param pool The memory pool.
* @param dst Destination credential.
* @param src Source credential.
*/
PJ_DECL(void) pjsip_cred_info_dup(pj_pool_t *pool,
pjsip_cred_info *dst,
const pjsip_cred_info *src);
/**
* Type of function to lookup credential for the specified name. * Type of function to lookup credential for the specified name.
* *
* @param pool Pool to initialize the credential info. * @param pool Pool to initialize the credential info.
* @param realm Realm to find the account. * @param realm Realm to find the account.
* @param acc_name Account name to look for. * @param acc_name Account name to look for.
* @param cred_info The structure to put the credential when it's found. * @param cred_info The structure to put the credential when it's found.
* *
* @return The function MUST return PJ_SUCCESS when it found * @return The function MUST return PJ_SUCCESS when it found
* a correct credential for the specified account and * a correct credential for the specified account and
* realm. Otherwise it may return PJSIP_EAUTHACCNOTFOUN D * realm. Otherwise it may return PJSIP_EAUTHACCNOTFOUN D
skipping to change at line 218 skipping to change at line 305
* @param cred_cnt Number of credentials. * @param cred_cnt Number of credentials.
* @param c Array of credentials. * @param c Array of credentials.
* *
* @return PJ_SUCCESS on success. * @return PJ_SUCCESS on success.
*/ */
PJ_DECL(pj_status_t) pjsip_auth_clt_set_credentials( pjsip_auth_clt_sess *s ess, PJ_DECL(pj_status_t) pjsip_auth_clt_set_credentials( pjsip_auth_clt_sess *s ess,
int cred_cnt, int cred_cnt,
const pjsip_cred_info * c); const pjsip_cred_info * c);
/** /**
* Set the preference for the client authentication session.
*
* @param sess The client authentication session.
* @param p Preference.
*
* @return PJ_SUCCESS on success.
*/
PJ_DECL(pj_status_t) pjsip_auth_clt_set_prefs(pjsip_auth_clt_sess *sess,
const pjsip_auth_clt_pref *p);
/**
* Get the preference for the client authentication session.
*
* @param sess The client authentication session.
* @param p Pointer to receive the preference.
*
* @return PJ_SUCCESS on success.
*/
PJ_DECL(pj_status_t) pjsip_auth_clt_get_prefs(pjsip_auth_clt_sess *sess,
pjsip_auth_clt_pref *p);
/**
* Initialize new request message with authorization headers. * Initialize new request message with authorization headers.
* This function will put Authorization/Proxy-Authorization headers to the * This function will put Authorization/Proxy-Authorization headers to the
* outgoing request message. If caching is enabled (PJSIP_AUTH_HEADER_CACHI NG) * outgoing request message. If caching is enabled (PJSIP_AUTH_HEADER_CACHI NG)
* and the session has previously sent Authorization/Proxy-Authorization he ader * and the session has previously sent Authorization/Proxy-Authorization he ader
* with the same method, then the same Authorization/Proxy-Authorization he ader * with the same method, then the same Authorization/Proxy-Authorization he ader
* will be resent from the cache only if qop is not present. If the stack i s * will be resent from the cache only if qop is not present. If the stack i s
* configured to automatically generate next Authorization/Proxy-Authorizat ion * configured to automatically generate next Authorization/Proxy-Authorizat ion
* headers (PJSIP_AUTH_AUTO_SEND_NEXT flag), then new Authorization/Proxy- * headers (PJSIP_AUTH_AUTO_SEND_NEXT flag), then new Authorization/Proxy-
* Authorization headers are calculated and generated when they are not pre sent * Authorization headers are calculated and generated when they are not pre sent
* in the case or if authorization session has qop. * in the case or if authorization session has qop.
skipping to change at line 336 skipping to change at line 445
* @return PJ_SUCCESS on success. * @return PJ_SUCCESS on success.
*/ */
PJ_DECL(pj_status_t) pjsip_auth_srv_challenge( pjsip_auth_srv *auth_srv, PJ_DECL(pj_status_t) pjsip_auth_srv_challenge( pjsip_auth_srv *auth_srv,
const pj_str_t *qop, const pj_str_t *qop,
const pj_str_t *nonce, const pj_str_t *nonce,
const pj_str_t *opaque, const pj_str_t *opaque,
pj_bool_t stale, pj_bool_t stale,
pjsip_tx_data *tdata); pjsip_tx_data *tdata);
/** /**
* Helper function to create MD5 digest out of the specified
* parameters.
*
* @param result String to store the response digest. This string
* must have been preallocated by caller with the
* buffer at least PJSIP_MD5STRLEN (32 bytes) in size.
* @param nonce Optional nonce.
* @param nc Nonce count.
* @param cnonce Optional cnonce.
* @param qop Optional qop.
* @param uri URI.
* @param realm Realm.
* @param cred_info Credential info.
* @param method SIP method.
*/
PJ_DECL(void) pjsip_auth_create_digest(pj_str_t *result,
const pj_str_t *nonce,
const pj_str_t *nc,
const pj_str_t *cnonce,
const pj_str_t *qop,
const pj_str_t *uri,
const pj_str_t *realm,
const pjsip_cred_info *cred_info,
const pj_str_t *method);
/**
* @} * @}
*/ */
PJ_END_DECL PJ_END_DECL
#endif /* __PJSIP_AUTH_SIP_AUTH_H__ */ #endif /* __PJSIP_AUTH_SIP_AUTH_H__ */
 End of changes. 12 change blocks. 
9 lines changed or deleted 152 lines changed or added


 sip_config.h   sip_config.h 
/* $Id: sip_config.h 1244 2007-05-02 18:54:19Z bennylp $ */ /* $Id: sip_config.h 1575 2007-11-11 07:14:47Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 125 skipping to change at line 125
/** /**
* Maximum packet length. We set it more than MTU since a SIP PDU * Maximum packet length. We set it more than MTU since a SIP PDU
* containing presence information can be quite large (>1500). * containing presence information can be quite large (>1500).
*/ */
#ifndef PJSIP_MAX_PKT_LEN #ifndef PJSIP_MAX_PKT_LEN
# define PJSIP_MAX_PKT_LEN 2000 # define PJSIP_MAX_PKT_LEN 2000
#endif #endif
/** /**
* Encode SIP headers in their short forms to reduce size. By default,
* SIP headers in outgoing messages will be encoded in their full names.
* If this option is enabled, then SIP headers for outgoing messages
* will be encoded in their short forms, to reduce message size.
* Note that this does not affect the ability of PJSIP to parse incoming
* SIP messages, as the parser always supports parsing both the long
* and short version of the headers.
*
* Note that there is also an undocumented variable defined in sip_msg.c
* to control whether compact form should be used for encoding SIP
* headers. The default value of this variable is PJSIP_ENCODE_SHORT_HNAME.
* To change PJSIP behavior during run-time, application can use the
* following construct:
*
\verbatim
extern pj_bool_t pjsip_use_compact_form;
// enable compact form
pjsip_use_compact_form = PJ_TRUE;
\endverbatim
*
* Default is 0 (no)
*/
#ifndef PJSIP_ENCODE_SHORT_HNAME
# define PJSIP_ENCODE_SHORT_HNAME 0
#endif
/**
* Send Allow header in dialog establishing requests?
* RFC 3261 Allow header SHOULD be included in dialog establishing
* requests to inform remote agent about which SIP requests are
* allowed within dialog.
*
* Note that there is also an undocumented variable defined in sip_dialog.c
* to control whether Allow header should be included. The default value
* of this variable is PJSIP_INCLUDE_ALLOW_HDR_IN_DLG.
* To change PJSIP behavior during run-time, application can use the
* following construct:
*
\verbatim
extern pj_bool_t pjsip_include_allow_hdr_in_dlg;
// do not transmit Allow header
pjsip_include_allow_hdr_in_dlg = PJ_FALSE;
\endverbatim
*
* Default is 1 (Yes)
*/
#ifndef PJSIP_INCLUDE_ALLOW_HDR_IN_DLG
# define PJSIP_INCLUDE_ALLOW_HDR_IN_DLG 1
#endif
/**
* Allow SIP modules removal or insertions during operation? * Allow SIP modules removal or insertions during operation?
* If yes, then locking will be employed when endpoint need to * If yes, then locking will be employed when endpoint need to
* access module. * access module.
*/ */
#ifndef PJSIP_SAFE_MODULE #ifndef PJSIP_SAFE_MODULE
# define PJSIP_SAFE_MODULE 1 # define PJSIP_SAFE_MODULE 1
#endif #endif
/** /**
* Perform Via sent-by checking as specified in RFC 3261 Section 18.1.2,
* which says that UAC MUST silently discard responses with Via sent-by
* containing values that the UAC doesn't recognize as its transport
* address.
*
* In PJSIP, this will cause response to be discarded and a message is
* written to the log, saying something like:
* "Dropping response Response msg 200/INVITE/cseq=608594373 (rdata00A99EF
4)
* from 1.2.3.4:5060 because sent-by is mismatch"
*
* The default behavior is yes, but when the UA supports IP address change
* for the SIP transport, it will need to turn this checking off since
* when the transport address is changed between request is sent and
* response is received, the response will be discarded since its Via
* sent-by now contains address that is different than the transport
* address.
*/
#ifndef PJSIP_CHECK_VIA_SENT_BY
# define PJSIP_CHECK_VIA_SENT_BY 1
#endif
/**
* If non-zero, SIP parser will unescape the escape characters ('%') * If non-zero, SIP parser will unescape the escape characters ('%')
* in the original message, which means that it will modify the * in the original message, which means that it will modify the
* original message. Otherwise the parser will create a copy of * original message. Otherwise the parser will create a copy of
* the string and store the unescaped string to the new location. * the string and store the unescaped string to the new location.
* *
* Unescaping in-place is faster, but less elegant (and it may * Unescaping in-place is faster, but less elegant (and it may
* break certain applications). So normally it's disabled, unless * break certain applications). So normally it's disabled, unless
* when benchmarking (to show off big performance). * when benchmarking (to show off big performance).
* *
* Default: 0 * Default: 0
skipping to change at line 179 skipping to change at line 254
* Default: 10 * Default: 10
*/ */
#ifndef PJSIP_MAX_TIMED_OUT_ENTRIES #ifndef PJSIP_MAX_TIMED_OUT_ENTRIES
# define PJSIP_MAX_TIMED_OUT_ENTRIES 10 # define PJSIP_MAX_TIMED_OUT_ENTRIES 10
#endif #endif
/** /**
* Idle timeout interval to be applied to transports with no usage * Idle timeout interval to be applied to transports with no usage
* before the transport is destroyed. Value is in seconds. * before the transport is destroyed. Value is in seconds.
* *
* Default: 60 * Default: 600
*/ */
#ifndef PJSIP_TRANSPORT_IDLE_TIME #ifndef PJSIP_TRANSPORT_IDLE_TIME
# define PJSIP_TRANSPORT_IDLE_TIME 60 # define PJSIP_TRANSPORT_IDLE_TIME 600
#endif #endif
/** /**
* Maximum number of usages for a transport before a new transport is * Maximum number of usages for a transport before a new transport is
* created. This only applies for ephemeral transports such as TCP. * created. This only applies for ephemeral transports such as TCP.
* *
* Currently this is not used. * Currently this is not used.
* *
* Default: -1 * Default: -1
*/ */
skipping to change at line 209 skipping to change at line 284
* *
* Default: 5 * Default: 5
* *
* @see PJSIP_TLS_TRANSPORT_BACKLOG * @see PJSIP_TLS_TRANSPORT_BACKLOG
*/ */
#ifndef PJSIP_TCP_TRANSPORT_BACKLOG #ifndef PJSIP_TCP_TRANSPORT_BACKLOG
# define PJSIP_TCP_TRANSPORT_BACKLOG 5 # define PJSIP_TCP_TRANSPORT_BACKLOG 5
#endif #endif
/** /**
* Set the interval to send keep-alive packet for TCP transports.
* If the value is zero, keep-alive will be disabled for TCP.
*
* Default: 90 (seconds)
*
* @see PJSIP_TCP_KEEP_ALIVE_DATA
*/
#ifndef PJSIP_TCP_KEEP_ALIVE_INTERVAL
# define PJSIP_TCP_KEEP_ALIVE_INTERVAL 90
#endif
/**
* Set the payload of the TCP keep-alive packet.
*
* Default: CRLF
*/
#ifndef PJSIP_TCP_KEEP_ALIVE_DATA
# define PJSIP_TCP_KEEP_ALIVE_DATA { "\r\n", 2 }
#endif
/**
* Set the interval to send keep-alive packet for TLS transports.
* If the value is zero, keep-alive will be disabled for TLS.
*
* Default: 90 (seconds)
*
* @see PJSIP_TLS_KEEP_ALIVE_DATA
*/
#ifndef PJSIP_TLS_KEEP_ALIVE_INTERVAL
# define PJSIP_TLS_KEEP_ALIVE_INTERVAL 90
#endif
/**
* Set the payload of the TLS keep-alive packet.
*
* Default: CRLF
*/
#ifndef PJSIP_TLS_KEEP_ALIVE_DATA
# define PJSIP_TLS_KEEP_ALIVE_DATA { "\r\n", 2 }
#endif
/**
* This macro specifies whether full DNS resolution should be used. * This macro specifies whether full DNS resolution should be used.
* When enabled, #pjsip_resolve() will perform asynchronous DNS SRV and * When enabled, #pjsip_resolve() will perform asynchronous DNS SRV and
* A (or AAAA, when IPv6 is supported) resolution to resolve the SIP * A (or AAAA, when IPv6 is supported) resolution to resolve the SIP
* domain. * domain.
* *
* Note that even when this setting is enabled, asynchronous DNS resolution * Note that even when this setting is enabled, asynchronous DNS resolution
* will only be done when application calls #pjsip_endpt_create_resolver(), * will only be done when application calls #pjsip_endpt_create_resolver(),
* configure the nameservers with #pj_dns_resolver_set_ns(), and configure * configure the nameservers with #pj_dns_resolver_set_ns(), and configure
* the SIP endpoint's DNS resolver with #pjsip_endpt_set_resolver(). If * the SIP endpoint's DNS resolver with #pjsip_endpt_set_resolver(). If
* these steps are not followed, the domain will be resolved with normal * these steps are not followed, the domain will be resolved with normal
skipping to change at line 372 skipping to change at line 489
# define PJSIP_POOL_TSX_INC 256 # define PJSIP_POOL_TSX_INC 256
#endif #endif
#define PJSIP_MAX_TSX_KEY_LEN (PJSIP_MAX_URL_SIZE*2) #define PJSIP_MAX_TSX_KEY_LEN (PJSIP_MAX_URL_SIZE*2)
/* User agent. */ /* User agent. */
#define PJSIP_POOL_LEN_USER_AGENT 1024 #define PJSIP_POOL_LEN_USER_AGENT 1024
#define PJSIP_POOL_INC_USER_AGENT 1024 #define PJSIP_POOL_INC_USER_AGENT 1024
/* Message/URL related constants. */ /* Message/URL related constants. */
#define PJSIP_MAX_CALL_ID_LEN PJ_GUID_STRING_LENGTH #define PJSIP_MAX_CALL_ID_LEN pj_GUID_STRING_LENGTH()
#define PJSIP_MAX_TAG_LEN PJ_GUID_STRING_LENGTH #define PJSIP_MAX_TAG_LEN pj_GUID_STRING_LENGTH()
#define PJSIP_MAX_BRANCH_LEN (PJSIP_RFC3261_BRANCH_LEN + PJ_GUID_ #define PJSIP_MAX_BRANCH_LEN (PJSIP_RFC3261_BRANCH_LEN + pj_GUID_
STRING_LENGTH + 2) STRING_LENGTH() + 2)
#define PJSIP_MAX_HNAME_LEN 64 #define PJSIP_MAX_HNAME_LEN 64
/* Dialog related constants. */ /* Dialog related constants. */
#define PJSIP_POOL_LEN_DIALOG 1200 #define PJSIP_POOL_LEN_DIALOG 1200
#define PJSIP_POOL_INC_DIALOG 512 #define PJSIP_POOL_INC_DIALOG 512
/* Maximum header types. */ /* Maximum header types. */
#define PJSIP_MAX_HEADER_TYPES 64 #define PJSIP_MAX_HEADER_TYPES 64
/* Maximum URI types. */ /* Maximum URI types. */
skipping to change at line 425 skipping to change at line 542
/** /**
* If this flag is set, the stack will keep the Authorization/Proxy-Authori zation * If this flag is set, the stack will keep the Authorization/Proxy-Authori zation
* headers that are sent in a cache. Future requests with the same realm an d * headers that are sent in a cache. Future requests with the same realm an d
* the same method will use the headers in the cache (as long as no qop is * the same method will use the headers in the cache (as long as no qop is
* required by server). * required by server).
* *
* Turning on this flag will make authorization process goes faster, but * Turning on this flag will make authorization process goes faster, but
* will grow the memory usage undefinitely until the dialog/registration * will grow the memory usage undefinitely until the dialog/registration
* session is terminated. * session is terminated.
* *
* Default: 1 * Default: 0
*/ */
#if !defined(PJSIP_AUTH_HEADER_CACHING) #if !defined(PJSIP_AUTH_HEADER_CACHING)
# define PJSIP_AUTH_HEADER_CACHING 0 # define PJSIP_AUTH_HEADER_CACHING 0
#endif #endif
/** /**
* If this flag is set, the stack will proactively send Authorization/Proxy - * If this flag is set, the stack will proactively send Authorization/Proxy -
* Authorization header for next requests. If next request has the same met hod * Authorization header for next requests. If next request has the same met hod
* with any of previous requests, then the last header which is saved in * with any of previous requests, then the last header which is saved in
* the cache will be used (if PJSIP_AUTH_CACHING is set). Otherwise a fresh * the cache will be used (if PJSIP_AUTH_CACHING is set). Otherwise a fresh
* header will be recalculated. If a particular server has requested qop, t hen * header will be recalculated. If a particular server has requested qop, t hen
* a fresh header will always be calculated. * a fresh header will always be calculated.
* *
* If this flag is NOT set, then the stack will only send Authorization/Pro xy- * If this flag is NOT set, then the stack will only send Authorization/Pro xy-
* Authorization headers when it receives 401/407 response from server. * Authorization headers when it receives 401/407 response from server.
* *
* Turning ON this flag will grow memory usage of a dialog/registration poo l * Turning ON this flag will grow memory usage of a dialog/registration poo l
* indefinitely until it is terminated, because the stack needs to keep the * indefinitely until it is terminated, because the stack needs to keep the
* last WWW-Authenticate/Proxy-Authenticate challenge. * last WWW-Authenticate/Proxy-Authenticate challenge.
* *
* Default: 1 * Default: 0
*/ */
#if !defined(PJSIP_AUTH_AUTO_SEND_NEXT) #if !defined(PJSIP_AUTH_AUTO_SEND_NEXT)
# define PJSIP_AUTH_AUTO_SEND_NEXT 0 # define PJSIP_AUTH_AUTO_SEND_NEXT 0
#endif #endif
/** /**
* Support qop="auth" directive. * Support qop="auth" directive.
* This option also requires client to cache the last challenge offered by * This option also requires client to cache the last challenge offered by
* server. * server.
* *
* Default: 1 * Default: 1
*/ */
#if !defined(PJSIP_AUTH_QOP_SUPPORT) #if !defined(PJSIP_AUTH_QOP_SUPPORT)
# define PJSIP_AUTH_QOP_SUPPORT 1 # define PJSIP_AUTH_QOP_SUPPORT 1
#endif #endif
/** /**
* Maximum number of stale retries when server keeps rejecting our request * Maximum number of stale retries when server keeps rejecting our request
* with stale=true. * with stale=true.
*
* Default: 3
*/ */
#ifndef PJSIP_MAX_STALE_COUNT #ifndef PJSIP_MAX_STALE_COUNT
# define PJSIP_MAX_STALE_COUNT 3 # define PJSIP_MAX_STALE_COUNT 3
#endif #endif
/** /**
* Specify support for IMS/3GPP digest AKA authentication version 1 and 2
* (AKAv1-MD5 and AKAv2-MD5 respectively).
*
* Default: 0 (for now)
*/
#ifndef PJSIP_HAS_DIGEST_AKA_AUTH
# define PJSIP_HAS_DIGEST_AKA_AUTH 0
#endif
/**
* @} * @}
*/ */
#include <pj/config.h> #include <pj/config.h>
#endif /* __PJSIP_SIP_CONFIG_H__ */ #endif /* __PJSIP_SIP_CONFIG_H__ */
 End of changes. 11 change blocks. 
9 lines changed or deleted 139 lines changed or added


 sip_dialog.h   sip_dialog.h 
/* $Id: sip_dialog.h 979 2007-02-19 16:55:42Z bennylp $ */ /* $Id: sip_dialog.h 1537 2007-10-31 15:52:09Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 125 skipping to change at line 125
/* Dialog's session properties. */ /* Dialog's session properties. */
pjsip_dialog_state state; /**< Dialog state. */ pjsip_dialog_state state; /**< Dialog state. */
pjsip_uri *target; /**< Current target. */ pjsip_uri *target; /**< Current target. */
pjsip_hdr inv_hdr; /**< Headers from hparam in dest URL */ pjsip_hdr inv_hdr; /**< Headers from hparam in dest URL */
pjsip_dlg_party local; /**< Local party info. */ pjsip_dlg_party local; /**< Local party info. */
pjsip_dlg_party remote; /**< Remote party info. */ pjsip_dlg_party remote; /**< Remote party info. */
pjsip_role_e role; /**< Initial role. */ pjsip_role_e role; /**< Initial role. */
pj_bool_t uac_has_2xx;/**< UAC has received 2xx response? */ pj_bool_t uac_has_2xx;/**< UAC has received 2xx response? */
pj_bool_t secure; /**< Use secure transport? */ pj_bool_t secure; /**< Use secure transport? */
pj_bool_t add_allow; /**< Add Allow header in requests? */
pjsip_cid_hdr *call_id; /**< Call-ID header. */ pjsip_cid_hdr *call_id; /**< Call-ID header. */
pjsip_route_hdr route_set; /**< Route set. */ pjsip_route_hdr route_set; /**< Route set. */
pj_bool_t route_set_frozen; /**< Route set has been set. */
pjsip_auth_clt_sess auth_sess; /**< Client authentication sessi on. */ pjsip_auth_clt_sess auth_sess; /**< Client authentication sessi on. */
/** Session counter. */ /** Session counter. */
int sess_count; /**< Number of sessions. */ int sess_count; /**< Number of sessions. */
/** Transaction counter. */ /** Transaction counter. */
int tsx_count; /**< Number of pending transacti ons. */ int tsx_count; /**< Number of pending transacti ons. */
/** Transport selector. */ /** Transport selector. */
pjsip_tpselector tp_sel; pjsip_tpselector tp_sel;
 End of changes. 3 change blocks. 
1 lines changed or deleted 3 lines changed or added


 sip_errno.h   sip_errno.h 
/* $Id: sip_errno.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: sip_errno.h 1539 2007-11-03 01:46:03Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 222 skipping to change at line 222
*/ */
#define PJSIP_EBUFDESTROYED (PJSIP_ERRNO_START_PJSIP + 63) /* 171063 */ #define PJSIP_EBUFDESTROYED (PJSIP_ERRNO_START_PJSIP + 63) /* 171063 */
/** /**
* @hideinitializer * @hideinitializer
* Unsuitable transport selected. This error occurs when application * Unsuitable transport selected. This error occurs when application
* has explicitly requested to use a particular transport/listener, * has explicitly requested to use a particular transport/listener,
* but the selected transport is not suitable to send request to * but the selected transport is not suitable to send request to
* the specified destination. * the specified destination.
*/ */
#define PJSIP_ETPNOTSUITABLE (PJSIP_ERRNO_START_PJSIP + 64) /* 171064 */ #define PJSIP_ETPNOTSUITABLE (PJSIP_ERRNO_START_PJSIP + 64) /* 171064 */
/**
* @hideinitializer
* Transport not available. This error occurs for example when the SIP stac
k
* is trying to use a SIP transport while the transport is being paused by
* application.
*/
#define PJSIP_ETPNOTAVAIL (PJSIP_ERRNO_START_PJSIP + 65) /* 171065 */
/************************************************************ /************************************************************
* TRANSACTION ERRORS * TRANSACTION ERRORS
***********************************************************/ ***********************************************************/
/** /**
* @hideinitializer * @hideinitializer
* Transaction has just been destroyed. * Transaction has just been destroyed.
*/ */
#define PJSIP_ETSXDESTROYED (PJSIP_ERRNO_START_PJSIP + 70) /* 171070 */ #define PJSIP_ETSXDESTROYED (PJSIP_ERRNO_START_PJSIP + 70) /* 171070 */
/** /**
skipping to change at line 372 skipping to change at line 379
* @hideinitializer * @hideinitializer
* Invalid digest. * Invalid digest.
*/ */
#define PJSIP_EAUTHINVALIDDIGEST (PJSIP_ERRNO_START_PJSIP+110) /* 171110 */ #define PJSIP_EAUTHINVALIDDIGEST (PJSIP_ERRNO_START_PJSIP+110) /* 171110 */
/** /**
* @hideinitializer * @hideinitializer
* Maximum number of stale retries exceeded. This happens when server * Maximum number of stale retries exceeded. This happens when server
* keeps rejecting our authorization request with stale=true. * keeps rejecting our authorization request with stale=true.
*/ */
#define PJSIP_EAUTHSTALECOUNT (PJSIP_ERRNO_START_PJSIP + 111) /* 171111 */ #define PJSIP_EAUTHSTALECOUNT (PJSIP_ERRNO_START_PJSIP + 111) /* 171111 */
/**
* @hideinitializer
* Invalid nonce value in the challenge.
*/
#define PJSIP_EAUTHINNONCE (PJSIP_ERRNO_START_PJSIP + 112) /* 171112 */
/**
* @hideinitializer
* Invalid AKA credential.
*/
#define PJSIP_EAUTHINAKACRED (PJSIP_ERRNO_START_PJSIP + 113) /* 171113 */
/**
* No challenge is found in the challenge.
*/
#define PJSIP_EAUTHNOCHAL (PJSIP_ERRNO_START_PJSIP + 114) /* 171114 */
/************************************************************ /************************************************************
* UA AND DIALOG ERRORS * UA AND DIALOG ERRORS
***********************************************************/ ***********************************************************/
/** /**
* @hideinitializer * @hideinitializer
* Missing From/To tag. * Missing From/To tag.
*/ */
#define PJSIP_EMISSINGTAG (PJSIP_ERRNO_START_PJSIP+120) /* 171120 */ #define PJSIP_EMISSINGTAG (PJSIP_ERRNO_START_PJSIP+120) /* 171120 */
/** /**
skipping to change at line 475 skipping to change at line 496
* @hideinitializer * @hideinitializer
* Unknown error when reading SSL data * Unknown error when reading SSL data
*/ */
#define PJSIP_TLS_EREAD (PJSIP_ERRNO_START_PJSIP+171) /* 1 71171 */ #define PJSIP_TLS_EREAD (PJSIP_ERRNO_START_PJSIP+171) /* 1 71171 */
/** /**
* @hideinitializer * @hideinitializer
* SSL negotiation has exceeded the maximum configured timeout. * SSL negotiation has exceeded the maximum configured timeout.
*/ */
#define PJSIP_TLS_ETIMEDOUT (PJSIP_ERRNO_START_PJSIP+172) /* 171172 */ #define PJSIP_TLS_ETIMEDOUT (PJSIP_ERRNO_START_PJSIP+172) /* 171172 */
/**
* Get error message for the specified error code. Note that this
* function is only able to decode PJSIP specific error code.
* Application should use pj_strerror(), which should be able to
* decode all error codes belonging to all subsystems (e.g. pjlib,
* pjmedia, pjsip, etc).
*
* @param status The error code.
* @param buffer The buffer where to put the error message.
* @param bufsize Size of the buffer.
*
* @return The error message as NULL terminated string,
* wrapped with pj_str_t.
*/
PJ_DECL(pj_str_t) pjsip_strerror(pj_status_t status,
char *buffer, pj_size_t bufsize);
PJ_END_DECL PJ_END_DECL
/** /**
* @} * @}
*/ */
#endif /* __PJSIP_SIP_ERRNO_H__ */ #endif /* __PJSIP_SIP_ERRNO_H__ */
 End of changes. 4 change blocks. 
1 lines changed or deleted 40 lines changed or added


 sip_event.h   sip_event.h 
/* $Id: sip_event.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: sip_event.h 1417 2007-08-16 10:11:44Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 219 skipping to change at line 219
(event).body.user.user2 = (void*)u2; \ (event).body.user.user2 = (void*)u2; \
(event).body.user.user3 = (void*)u3; \ (event).body.user.user3 = (void*)u3; \
(event).body.user.user4 = (void*)u4; \ (event).body.user.user4 = (void*)u4; \
} while (0) } while (0)
/** /**
* Get the event string from the event ID. * Get the event string from the event ID.
* @param e the event ID. * @param e the event ID.
* @note defined in sip_util.c * @note defined in sip_util.c
*/ */
PJ_DEF(const char *) pjsip_event_str(pjsip_event_id_e e); PJ_DECL(const char *) pjsip_event_str(pjsip_event_id_e e);
/** /**
* @} * @}
*/ */
PJ_END_DECL PJ_END_DECL
#endif /* __PJSIP_SIP_EVENT_H__ */ #endif /* __PJSIP_SIP_EVENT_H__ */
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 sip_inv.h   sip_inv.h 
/* $Id: sip_inv.h 1319 2007-05-30 04:26:40Z bennylp $ */ /* $Id: sip_inv.h 1477 2007-10-05 09:12:26Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 131 skipping to change at line 131
* @param inv The new invite session. * @param inv The new invite session.
* @param e The event which has caused the dialog to for k. * @param e The event which has caused the dialog to for k.
* The type of this event can be either * The type of this event can be either
* PJSIP_EVENT_RX_MSG or PJSIP_EVENT_RX_200_MSG. * PJSIP_EVENT_RX_MSG or PJSIP_EVENT_RX_200_MSG.
*/ */
void (*on_new_session)(pjsip_inv_session *inv, pjsip_event *e); void (*on_new_session)(pjsip_inv_session *inv, pjsip_event *e);
/** /**
* This callback is called whenever any transactions within the session * This callback is called whenever any transactions within the session
* has changed their state. Application MAY implement this callback, * has changed their state. Application MAY implement this callback,
* e.g. to monitor the progress of an outgoing request. * e.g. to monitor the progress of an outgoing request, or to send
* response to unhandled incoming request (such as INFO).
* *
* This callback is optional. * This callback is optional.
* *
* @param inv The invite session. * @param inv The invite session.
* @param tsx The transaction, which state has changed. * @param tsx The transaction, which state has changed.
* @param e The event which has caused the transation st ate's * @param e The event which has caused the transation st ate's
* to change. * to change.
*/ */
void (*on_tsx_state_changed)(pjsip_inv_session *inv, void (*on_tsx_state_changed)(pjsip_inv_session *inv,
pjsip_transaction *tsx, pjsip_transaction *tsx,
pjsip_event *e); pjsip_event *e);
/** /**
* This callback is called when the invite session has received * This callback is called when the invite session has received
* new offer from peer. Application can inspect the remote offer * new offer from peer. Application can inspect the remote offer
* in "offer". * in "offer", and set the SDP answer with #pjsip_inv_set_sdp_answer().
* When the application sends a SIP message to send the answer,
* this SDP answer will be negotiated with the offer, and the result
* will be sent with the SIP message.
* *
* @param inv The invite session. * @param inv The invite session.
* @param offer Remote offer. * @param offer Remote offer.
*/ */
void (*on_rx_offer)(pjsip_inv_session *inv, void (*on_rx_offer)(pjsip_inv_session *inv,
const pjmedia_sdp_session *offer); const pjmedia_sdp_session *offer);
/** /**
* This callback is optional, and it is used to ask the application
* to create a fresh offer, when the invite session has received
* re-INVITE without offer. This offer then will be sent in the
* 200/OK response to the re-INVITE request.
*
* If application doesn't implement this callback, the invite session
* will send the currently active SDP as the offer.
*
* @param inv The invite session.
* @param p_offer Pointer to receive the SDP offer created by
* application.
*/
void (*on_create_offer)(pjsip_inv_session *inv,
pjmedia_sdp_session **p_offer);
/**
* This callback is called after SDP offer/answer session has completed . * This callback is called after SDP offer/answer session has completed .
* The status argument specifies the status of the offer/answer, * The status argument specifies the status of the offer/answer,
* as returned by pjmedia_sdp_neg_negotiate(). * as returned by pjmedia_sdp_neg_negotiate().
* *
* This callback is optional (from the point of view of the framework), * This callback is optional (from the point of view of the framework),
* but all useful applications normally need to implement this callback . * but all useful applications normally need to implement this callback .
* *
* @param inv The invite session. * @param inv The invite session.
* @param status The negotiation status. * @param status The negotiation status.
*/ */
skipping to change at line 228 skipping to change at line 248
pj_bool_t cancelling; /**< CANCEL requested */ pj_bool_t cancelling; /**< CANCEL requested */
pj_bool_t pending_cancel; /**< Wait to send CANCEL */ pj_bool_t pending_cancel; /**< Wait to send CANCEL */
pjsip_status_code cause; /**< Disconnect cause. */ pjsip_status_code cause; /**< Disconnect cause. */
pj_str_t cause_text; /**< Cause text. */ pj_str_t cause_text; /**< Cause text. */
pj_bool_t notify; /**< Internal. */ pj_bool_t notify; /**< Internal. */
pjsip_dialog *dlg; /**< Underlying dialog. */ pjsip_dialog *dlg; /**< Underlying dialog. */
pjsip_role_e role; /**< Invite role. */ pjsip_role_e role; /**< Invite role. */
unsigned options; /**< Options in use. */ unsigned options; /**< Options in use. */
pjmedia_sdp_neg *neg; /**< Negotiator. */ pjmedia_sdp_neg *neg; /**< Negotiator. */
pjsip_transaction *invite_tsx; /**< 1st invite tsx. */ pjsip_transaction *invite_tsx; /**< 1st invite tsx. */
pjsip_tx_data *last_answer; /**< Last INVITE resp.
*/
pjsip_tx_data *last_ack; /**< Last ACK request
*/
pj_int32_t last_ack_cseq; /**< CSeq of last ACK
*/
void *mod_data[PJSIP_MAX_MODULE];/**< Modules data. */ void *mod_data[PJSIP_MAX_MODULE];/**< Modules data. */
}; };
/** /**
* Initialize the invite usage module and register it to the endpoint. * Initialize the invite usage module and register it to the endpoint.
* The callback argument contains pointer to functions to be called on * The callback argument contains pointer to functions to be called on
* occurences of events in invite sessions. * occurences of events in invite sessions.
* *
* @param endpt The endpoint instance. * @param endpt The endpoint instance.
* @param cb Callback structure. * @param cb Callback structure.
skipping to change at line 522 skipping to change at line 545
* @return PJ_SUCCESS if a re-INVITE request with the specified * @return PJ_SUCCESS if a re-INVITE request with the specified
* characteristics (e.g. to contain new offer) can be * characteristics (e.g. to contain new offer) can be
* created. * created.
*/ */
PJ_DECL(pj_status_t) pjsip_inv_reinvite(pjsip_inv_session *inv, PJ_DECL(pj_status_t) pjsip_inv_reinvite(pjsip_inv_session *inv,
const pj_str_t *new_contact, const pj_str_t *new_contact,
const pjmedia_sdp_session *new_offer , const pjmedia_sdp_session *new_offer ,
pjsip_tx_data **p_tdata ); pjsip_tx_data **p_tdata );
/** /**
* Create an UPDATE request. * Create an UPDATE request to initiate new SDP offer.
* *
* @param inv The invite session. * @param inv The invite session.
* @param new_contact If application wants to update its local contact * @param new_contact If application wants to update its local contact
* and inform peer to perform target refresh with a new * and inform peer to perform target refresh with a new
* contact, it can specify the new contact in this * contact, it can specify the new contact in this
* argument; otherwise this argument must be NULL. * argument; otherwise this argument must be NULL.
* @param new_offer Application MAY initiate a new SDP offer/answer * @param offer Offer to be sent to remote. This argument is
* session in the request when there is no pending answ * mandatory.
er
* to be sent or received. It can detect this condition
* by observing the state of the SDP negotiator of the
* invite session. If new offer should be sent to remot
e,
* the offer must be specified in this argument; otherw
ise
* this argument must be NULL.
* @param p_tdata Pointer to receive the UPDATE request message to * @param p_tdata Pointer to receive the UPDATE request message to
* be created. * be created.
* *
* @return PJ_SUCCESS if a UPDATE request with the specified * @return PJ_SUCCESS if a UPDATE request with the specified
* characteristics (e.g. to contain new offer) can be * characteristics (e.g. to contain new offer) can be
* created. * created.
*/ */
PJ_DECL(pj_status_t) pjsip_inv_update ( pjsip_inv_session *inv, PJ_DECL(pj_status_t) pjsip_inv_update ( pjsip_inv_session *inv,
const pj_str_t *new_contact, const pj_str_t *new_contact,
const pjmedia_sdp_session *new_offer , const pjmedia_sdp_session *offer,
pjsip_tx_data **p_tdata ); pjsip_tx_data **p_tdata );
/** /**
* Send request or response message in tdata. * Send request or response message in tdata.
* *
* @param inv The invite session. * @param inv The invite session.
* @param tdata The message to be sent. * @param tdata The message to be sent.
* *
* @return PJ_SUCCESS if transaction can be initiated * @return PJ_SUCCESS if transaction can be initiated
* successfully to send this message. Note that the * successfully to send this message. Note that the
 End of changes. 8 change blocks. 
15 lines changed or deleted 33 lines changed or added


 sip_msg.h   sip_msg.h 
/* $Id: sip_msg.h 1127 2007-04-02 11:44:47Z bennylp $ */ /* $Id: sip_msg.h 1461 2007-09-30 16:40:57Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 84 skipping to change at line 84
struct pjsip_method struct pjsip_method
{ {
pjsip_method_e id; /**< Method ID, from \a pjsip_method_e. */ pjsip_method_e id; /**< Method ID, from \a pjsip_method_e. */
pj_str_t name; /**< Method name, which will always contain the pj_str_t name; /**< Method name, which will always contain the
method string. */ method string. */
}; };
/* /*
* For convenience, standard method structures are defined in the library. * For convenience, standard method structures are defined in the library.
*/ */
extern const pjsip_method pjsip_invite_method; /**< INVITE structure. /** INVITE method constant. @see pjsip_get_invite_method() */
*/ PJ_DECL_DATA(const pjsip_method) pjsip_invite_method;
extern const pjsip_method pjsip_cancel_method; /**< CANCEL structure.
*/ /** CANCEL method constant. @see pjsip_get_cancel_method() */
extern const pjsip_method pjsip_ack_method; /**< ACK structure. PJ_DECL_DATA(const pjsip_method) pjsip_cancel_method;
*/
extern const pjsip_method pjsip_bye_method; /**< BYE structure. /** ACK method constant. @see pjsip_get_ack_method() */
*/ PJ_DECL_DATA(const pjsip_method) pjsip_ack_method;
extern const pjsip_method pjsip_register_method; /**< REGISTER structure
.*/ /** BYE method constant. @see pjsip_get_bye_method() */
extern const pjsip_method pjsip_options_method; /**< OPTIONS str PJ_DECL_DATA(const pjsip_method) pjsip_bye_method;
ucture. */
/** REGISTER method constant. @see pjsip_get_register_method() */
PJ_DECL_DATA(const pjsip_method) pjsip_register_method;
/** OPTIONS method constant. @see pjsip_get_options_method() */
PJ_DECL_DATA(const pjsip_method) pjsip_options_method;
/*
* Accessor functions for standard SIP methods.
*/
/** Get INVITE method constant. */
PJ_DECL(const pjsip_method*) pjsip_get_invite_method(void);
/** Get CANCEL method constant. */
PJ_DECL(const pjsip_method*) pjsip_get_cancel_method(void);
/** Get ACK method constant. */
PJ_DECL(const pjsip_method*) pjsip_get_ack_method(void);
/** Get BYE method constant. */
PJ_DECL(const pjsip_method*) pjsip_get_bye_method(void);
/** Get REGISTER method constant.*/
PJ_DECL(const pjsip_method*) pjsip_get_register_method(void);
/** Get OPTIONS method constant. */
PJ_DECL(const pjsip_method*) pjsip_get_options_method(void);
/*
* Accessor functions
*/
/** /**
* Initialize the method structure from a string. * Initialize the method structure from a string.
* This function will check whether the method is a known method then set * This function will check whether the method is a known method then set
* both the id and name accordingly. * both the id and name accordingly.
* *
* @param m The method to initialize. * @param m The method to initialize.
* @param pool Pool where memory allocation will be allocated from, if requ ired. * @param pool Pool where memory allocation will be allocated from, if requ ired.
* @param str The method string. * @param str The method string.
*/ */
skipping to change at line 1159 skipping to change at line 1190
PJ_DECL(pjsip_clen_hdr*) pjsip_clen_hdr_init( pj_pool_t *pool, PJ_DECL(pjsip_clen_hdr*) pjsip_clen_hdr_init( pj_pool_t *pool,
void *mem ); void *mem );
/* ************************************************************************ **/ /* ************************************************************************ **/
/** /**
* CSeq header. * CSeq header.
*/ */
typedef struct pjsip_cseq_hdr typedef struct pjsip_cseq_hdr
{ {
PJSIP_DECL_HDR_MEMBER(struct pjsip_cseq_hdr); PJSIP_DECL_HDR_MEMBER(struct pjsip_cseq_hdr);
int cseq; /**< CSeq number. */ pj_int32_t cseq; /**< CSeq number. */
pjsip_method method; /**< CSeq method. */ pjsip_method method; /**< CSeq method. */
} pjsip_cseq_hdr; } pjsip_cseq_hdr;
/** Create new CSeq header. /** Create new CSeq header.
* *
* @param pool The pool. * @param pool The pool.
* @return A new CSeq header instance. * @return A new CSeq header instance.
*/ */
PJ_DECL(pjsip_cseq_hdr*) pjsip_cseq_hdr_create( pj_pool_t *pool ); PJ_DECL(pjsip_cseq_hdr*) pjsip_cseq_hdr_create( pj_pool_t *pool );
 End of changes. 3 change blocks. 
14 lines changed or deleted 39 lines changed or added


 sip_parser.h   sip_parser.h 
/* $Id: sip_parser.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: sip_parser.h 1417 2007-08-16 10:11:44Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 312 skipping to change at line 312
* successfully parsed headers. * successfully parsed headers.
*/ */
PJ_DECL(pj_status_t) pjsip_parse_headers( pj_pool_t *pool, PJ_DECL(pj_status_t) pjsip_parse_headers( pj_pool_t *pool,
char *input, pj_size_t size, char *input, pj_size_t size,
pj_list *hlist ); pj_list *hlist );
/** /**
* @} * @}
*/ */
/* /**
* Various specification used in parsing, exported here as extern for other * Parser constants. @see pjsip_parser_const()
* parsers.
*/ */
extern pj_cis_t typedef struct pjsip_parser_const_t
pjsip_HOST_SPEC, /**< For scanning host part. */ {
pjsip_DIGIT_SPEC, /**< Decimal digits */ const pj_str_t pjsip_USER_STR; /**< "user" string constant. */
pjsip_ALPHA_SPEC, /**< Alpha (A-Z, a-z) */ const pj_str_t pjsip_METHOD_STR; /**< "method" string constant */
pjsip_ALNUM_SPEC, /**< Decimal + Alpha. */ const pj_str_t pjsip_TRANSPORT_STR; /**< "transport" string cons
pjsip_TOKEN_SPEC, /**< Token. */ t. */
pjsip_TOKEN_SPEC_ESC, /**< Token without '%' character */ const pj_str_t pjsip_MADDR_STR; /**< "maddr" string const. */
pjsip_HEX_SPEC, /**< Hexadecimal digits. */ const pj_str_t pjsip_LR_STR; /**< "lr" string const. */
pjsip_PARAM_CHAR_SPEC, /**< For scanning pname (or pvalue when it' const pj_str_t pjsip_SIP_STR; /**< "sip" string constant. */
s const pj_str_t pjsip_SIPS_STR; /**< "sips" string constant. */
not quoted.) in URI */ const pj_str_t pjsip_TEL_STR; /**< "tel" string constant. */
pjsip_PARAM_CHAR_SPEC_ESC, /**< Variant without the escape ('%') char * const pj_str_t pjsip_BRANCH_STR; /**< "branch" string constant. */
/ const pj_str_t pjsip_TTL_STR; /**< "ttl" string constant. */
pjsip_HDR_CHAR_SPEC, /**< Chars in hname/havalue in URL. */ const pj_str_t pjsip_RECEIVED_STR; /**< "received" string const. */
pjsip_HDR_CHAR_SPEC_ESC, /**< Variant without the escape ('%') char * const pj_str_t pjsip_Q_STR; /**< "q" string constant.
/ */
pjsip_PROBE_USER_HOST_SPEC, /**< Hostname characters. */ const pj_str_t pjsip_EXPIRES_STR; /**< "expires" string constant. */
pjsip_PASSWD_SPEC, /**< Password. */ const pj_str_t pjsip_TAG_STR; /**< "tag" string constant. */
pjsip_PASSWD_SPEC_ESC, /**< Variant without the escape ('%') char * const pj_str_t pjsip_RPORT_STR; /**< "rport" string const. */
/
pjsip_USER_SPEC, /**< User */ pj_cis_t pjsip_HOST_SPEC; /**< For scanning host part. */
pjsip_USER_SPEC_ESC, /**< Variant without the escape ('%') char * pj_cis_t pjsip_DIGIT_SPEC; /**< Decimal digits */
/ pj_cis_t pjsip_ALPHA_SPEC; /**< Alpha (A-Z, a-z) */
pjsip_NOT_NEWLINE, /**< For eating up header, basicly any chars pj_cis_t pjsip_ALNUM_SPEC; /**< Decimal + Alpha. */
except newlines or zero. */ pj_cis_t pjsip_TOKEN_SPEC; /**< Token. */
pjsip_NOT_COMMA_OR_NEWLINE, /**< Array elements. */ pj_cis_t pjsip_TOKEN_SPEC_ESC; /**< Token without '%' character */
pjsip_DISPLAY_SPEC; /**< Used when searching for display pj_cis_t pjsip_HEX_SPEC; /**< Hexadecimal digits. */
name. */ pj_cis_t pjsip_PARAM_CHAR_SPEC; /**< For scanning pname (or pvalue
when it's not quoted.) in URI
*/
pj_cis_t pjsip_PARAM_CHAR_SPEC_ESC; /**< Variant without the esc
ape ('%')
char */
pj_cis_t pjsip_HDR_CHAR_SPEC; /**< Chars in hname/havalue in URL.
*/
pj_cis_t pjsip_HDR_CHAR_SPEC_ESC; /**< Variant without the escape ('%'
)
char */
pj_cis_t pjsip_PROBE_USER_HOST_SPEC;/**< Hostname characters. */
pj_cis_t pjsip_PASSWD_SPEC; /**< Password.
*/
pj_cis_t pjsip_PASSWD_SPEC_ESC; /**< Variant without the escape ('%'
)
char */
pj_cis_t pjsip_USER_SPEC; /**< User */
pj_cis_t pjsip_USER_SPEC_ESC; /**< Variant without the escape ('%'
)
char */
pj_cis_t pjsip_USER_SPEC_LENIENT; /**< User, with additional '#' char
*/
pj_cis_t pjsip_USER_SPEC_LENIENT_ESC;/**< pjsip_USER_SPEC_ESC with '#'
*/
pj_cis_t pjsip_NOT_NEWLINE; /**< For eating up header, b
asically
any chars except newlines or
zero. */
pj_cis_t pjsip_NOT_COMMA_OR_NEWLINE;/**< Array elements. */
pj_cis_t pjsip_DISPLAY_SPEC; /**< Used when searching for display
name. */
/* } pjsip_parser_const_t;
* Various string constants.
/**
* Get parser constants.
*/ */
extern const pj_str_t pjsip_USER_STR, /**< "user" string constant. PJ_DECL(const pjsip_parser_const_t*) pjsip_parser_const(void);
*/
pjsip_METHOD_STR, /**< "method" string constant
*/
pjsip_TRANSPORT_STR, /**< "transport" string const.
*/
pjsip_MADDR_STR, /**< "maddr" string const.
*/
pjsip_LR_STR, /**< "lr" string const.
*/
pjsip_SIP_STR, /**< "sip" string constant.
*/
pjsip_SIPS_STR, /**< "sips" string constant.
*/
pjsip_TEL_STR, /**< "tel" string constant.
*/
pjsip_BRANCH_STR, /**< "branch" string constant.
*/
pjsip_TTL_STR, /**< "ttl" string constant.
*/
pjsip_RECEIVED_STR, /**< "received" string const.
*/
pjsip_Q_STR, /**< "q" string constant.
*/
pjsip_EXPIRES_STR, /**< "expires" string constant.
*/
pjsip_TAG_STR, /**< "tag" string constant.
*/
pjsip_RPORT_STR; /**< "rport" string const.
*/
/* /*
* Parser utilities. * Parser utilities.
*/ */
enum enum
{ {
PJSIP_PARSE_REMOVE_QUOTE = 1 PJSIP_PARSE_REMOVE_QUOTE = 1
}; };
/* Parse parameter in header (matching the character as token) */ /* Parse parameter in header (matching the character as token) */
void pjsip_parse_param_imp( pj_scanner *scanner, pj_pool_t *pool, PJ_DECL(void) pjsip_parse_param_imp(pj_scanner *scanner, pj_pool_t *pool,
pj_str_t *pname, pj_str_t *pvalue, pj_str_t *pname, pj_str_t *pvalue,
unsigned opt); unsigned opt);
/* Parse parameter in URL (matching the character as paramchar) */ /* Parse parameter in URL (matching the character as paramchar) */
void pjsip_parse_uri_param_imp( pj_scanner *scanner, pj_pool_t *pool, PJ_DECL(void) pjsip_parse_uri_param_imp(pj_scanner *scanner, pj_pool_t *poo
pj_str_t *pname, pj_str_t *pvalue, l,
unsigned opt); pj_str_t *pname, pj_str_t *pvalue,
void pjsip_concat_param_imp( pj_str_t *param, pj_pool_t *pool, unsigned opt);
const pj_str_t *pname, const pj_str_t *pvalue, PJ_DECL(void) pjsip_concat_param_imp(pj_str_t *param, pj_pool_t *pool,
int sepchar); const pj_str_t *pname,
void pjsip_parse_end_hdr_imp ( pj_scanner *scanner ); const pj_str_t *pvalue,
int sepchar);
PJ_DECL(void) pjsip_parse_end_hdr_imp ( pj_scanner *scanner );
PJ_END_DECL PJ_END_DECL
#endif /* __PJSIP_SIP_PARSER_H__ */ #endif /* __PJSIP_SIP_PARSER_H__ */
 End of changes. 7 change blocks. 
74 lines changed or deleted 79 lines changed or added


 sip_regc.h   sip_regc.h 
/* $Id: sip_regc.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: sip_regc.h 1561 2007-11-08 09:24:30Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 184 skipping to change at line 184
* @param count Number of credentials in the array. * @param count Number of credentials in the array.
* @param cred Array of credentials. * @param cred Array of credentials.
* *
* @return PJ_SUCCESS on success. * @return PJ_SUCCESS on success.
*/ */
PJ_DECL(pj_status_t) pjsip_regc_set_credentials( pjsip_regc *regc, PJ_DECL(pj_status_t) pjsip_regc_set_credentials( pjsip_regc *regc,
int count, int count,
const pjsip_cred_info cred[ ] ); const pjsip_cred_info cred[ ] );
/** /**
* Set authentication preference.
*
* @param regc The registration structure.
* @param pref Authentication preference.
*
* @return PJ_SUCCESS on success.
*/
PJ_DECL(pj_status_t) pjsip_regc_set_prefs( pjsip_regc *regc,
const pjsip_auth_clt_pref *pref);
/**
* Set route set to be used for outgoing requests. * Set route set to be used for outgoing requests.
* *
* @param regc The client registration structure. * @param regc The client registration structure.
* @param route_set List containing Route headers. * @param route_set List containing Route headers.
* *
* @return PJ_SUCCESS on success. * @return PJ_SUCCESS on success.
*/ */
PJ_DECL(pj_status_t) pjsip_regc_set_route_set(pjsip_regc *regc, PJ_DECL(pj_status_t) pjsip_regc_set_route_set(pjsip_regc *regc,
const pjsip_route_hdr*route_se t); const pjsip_route_hdr*route_se t);
 End of changes. 2 change blocks. 
1 lines changed or deleted 12 lines changed or added


 sip_transaction.h   sip_transaction.h 
/* $Id: sip_transaction.h 1319 2007-05-30 04:26:40Z bennylp $ */ /* $Id: sip_transaction.h 1463 2007-09-30 16:50:27Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 95 skipping to change at line 95
pjsip_module *tsx_user; /**< Transaction user. */ pjsip_module *tsx_user; /**< Transaction user. */
pjsip_endpoint *endpt; /**< Endpoint instance. */ pjsip_endpoint *endpt; /**< Endpoint instance. */
pj_mutex_t *mutex; /**< Mutex for this tsx. */ pj_mutex_t *mutex; /**< Mutex for this tsx. */
/* /*
* Transaction identification. * Transaction identification.
*/ */
char obj_name[PJ_MAX_OBJ_NAME]; /**< Log info. */ char obj_name[PJ_MAX_OBJ_NAME]; /**< Log info. */
pjsip_role_e role; /**< Role (UAS or UAC) */ pjsip_role_e role; /**< Role (UAS or UAC) */
pjsip_method method; /**< The method. */ pjsip_method method; /**< The method. */
int cseq; /**< The CSeq */ pj_int32_t cseq; /**< The CSeq */
pj_str_t transaction_key;/**< Hash table key. */ pj_str_t transaction_key;/**< Hash table key. */
pj_uint32_t hashed_key; /**< Key's hashed va lue. */ pj_uint32_t hashed_key; /**< Key's hashed va lue. */
pj_str_t branch; /**< The branch Id. */ pj_str_t branch; /**< The branch Id. */
pjsip_tpselector tp_sel; /**< Transport selector. */ pjsip_tpselector tp_sel; /**< Transport selector. */
/* /*
* State and status. * State and status.
*/ */
int status_code; /**< Last status cod e seen. */ int status_code; /**< Last status cod e seen. */
pj_str_t status_text; /**< Last reason phrase. */ pj_str_t status_text; /**< Last reason phrase. */
skipping to change at line 267 skipping to change at line 267
* @param tdata The outgoing message. If NULL is specified, then the * @param tdata The outgoing message. If NULL is specified, then the
* last message transmitted (or the message specified * last message transmitted (or the message specified
* in UAC initialization) will be sent. * in UAC initialization) will be sent.
* *
* @return PJ_SUCCESS if successfull. * @return PJ_SUCCESS if successfull.
*/ */
PJ_DECL(pj_status_t) pjsip_tsx_send_msg( pjsip_transaction *tsx, PJ_DECL(pj_status_t) pjsip_tsx_send_msg( pjsip_transaction *tsx,
pjsip_tx_data *tdata); pjsip_tx_data *tdata);
/** /**
* Manually retransmit the last message transmitted by this transaction,
* without updating the transaction state. This function is useful when
* TU wants to maintain the retransmision by itself (for example,
* retransmitting reliable provisional response).
*
* @param tsx The transaction.
* @param tdata The outgoing message. If NULL is specified, then the
* last message transmitted (or the message specified
* in UAC initialization) will be sent.
*
*
* @return PJ_SUCCESS if successful.
*/
PJ_DECL(pj_status_t) pjsip_tsx_retransmit_no_state(pjsip_transaction *tsx,
pjsip_tx_data *tdata);
/**
* Create transaction key, which is used to match incoming requests * Create transaction key, which is used to match incoming requests
* or response (retransmissions) against transactions. * or response (retransmissions) against transactions.
* *
* @param pool The pool * @param pool The pool
* @param key Output key. * @param key Output key.
* @param role The role of the transaction. * @param role The role of the transaction.
* @param method The method to be put as a key. * @param method The method to be put as a key.
* @param rdata The received data to calculate. * @param rdata The received data to calculate.
* *
* @return PJ_SUCCESS or the appropriate error code. * @return PJ_SUCCESS or the appropriate error code.
 End of changes. 3 change blocks. 
2 lines changed or deleted 19 lines changed or added


 sip_transport.h   sip_transport.h 
/* $Id: sip_transport.h 1310 2007-05-28 12:58:57Z bennylp $ */ /* $Id: sip_transport.h 1388 2007-06-23 07:26:54Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 883 skipping to change at line 883
pjsip_tpfactory *tpf); pjsip_tpfactory *tpf);
/************************************************************************** *** /************************************************************************** ***
* *
* TRANSPORT MANAGER * TRANSPORT MANAGER
* *
************************************************************************** ***/ ************************************************************************** ***/
typedef void (*pjsip_rx_callback)(pjsip_endpoint*, pj_status_t, pjsip_rx_da ta *); typedef void (*pjsip_rx_callback)(pjsip_endpoint*, pj_status_t, pjsip_rx_da ta *);
typedef pj_status_t (*pjsip_tx_callback)(pjsip_endpoint*, pjsip_tx_data*); typedef pj_status_t (*pjsip_tx_callback)(pjsip_endpoint*, pjsip_tx_data*);
/** /**
* Create a new transport manager. * Create a transport manager. Normally application doesn't need to call
* this function directly, since a transport manager will be created and
* destroyed automatically by the SIP endpoint.
* *
* @param pool Pool. * @param pool Pool.
* @param endpt Endpoint instance. * @param endpt Endpoint instance.
* @param rx_cb Callback to receive incoming message. * @param rx_cb Callback to receive incoming message.
* @param tx_cb Callback to be called before transport manager i s sending * @param tx_cb Callback to be called before transport manager i s sending
* outgoing message. * outgoing message.
* @param p_mgr Pointer to receive the new transport manager. * @param p_mgr Pointer to receive the new transport manager.
* *
* @return PJ_SUCCESS or the appropriate error code on error. * @return PJ_SUCCESS or the appropriate error code on error.
*/ */
skipping to change at line 936 skipping to change at line 938
* Return number of transports currently registered to the transport * Return number of transports currently registered to the transport
* manager. * manager.
* *
* @param mgr The transport manager. * @param mgr The transport manager.
* *
* @return Number of transports. * @return Number of transports.
*/ */
PJ_DECL(unsigned) pjsip_tpmgr_get_transport_count(pjsip_tpmgr *mgr); PJ_DECL(unsigned) pjsip_tpmgr_get_transport_count(pjsip_tpmgr *mgr);
/** /**
* Destroy transport manager. * Destroy a transport manager. Normally application doesn't need to call
* this function directly, since a transport manager will be created and
* destroyed automatically by the SIP endpoint.
*
* @param mgr The transport manager.
*
* @return PJ_SUCCESS on success.
*/ */
PJ_DECL(pj_status_t) pjsip_tpmgr_destroy(pjsip_tpmgr *mgr); PJ_DECL(pj_status_t) pjsip_tpmgr_destroy(pjsip_tpmgr *mgr);
/** /**
* Dump transport info. * Dump transport info and status to log.
*
* @param mgr The transport manager.
*/ */
PJ_DECL(void) pjsip_tpmgr_dump_transports(pjsip_tpmgr *mgr); PJ_DECL(void) pjsip_tpmgr_dump_transports(pjsip_tpmgr *mgr);
/************************************************************************** *** /************************************************************************** ***
* *
* PUBLIC API * PUBLIC API
* *
************************************************************************** ***/ ************************************************************************** ***/
/** /**
skipping to change at line 976 skipping to change at line 986
* *
* @return PJ_SUCCESS on success, or the appropriate error code. * @return PJ_SUCCESS on success, or the appropriate error code.
*/ */
PJ_DECL(pj_status_t) pjsip_tpmgr_acquire_transport(pjsip_tpmgr *mgr, PJ_DECL(pj_status_t) pjsip_tpmgr_acquire_transport(pjsip_tpmgr *mgr,
pjsip_transport_type_e ty pe, pjsip_transport_type_e ty pe,
const pj_sockaddr_t *remo te, const pj_sockaddr_t *remo te,
int addr_len, int addr_len,
const pjsip_tpselector *s el, const pjsip_tpselector *s el,
pjsip_transport **tp); pjsip_transport **tp);
/**
* Type of callback to receive notification when message or raw data
* has been sent.
*
* @param token The token that was given when calling the fu
nction
* to send message or raw data.
* @param tdata The transmit buffer used to send the message
.
* @param bytes_sent Number of bytes sent. On success, the value will be
* positive number indicating the number of bytes sent.
* On failure, the value will be a negative number of
* the error code (i.e. bytes_sent = -status).
*/
typedef void (*pjsip_tp_send_callback)(void *token, pjsip_tx_data *tdata, typedef void (*pjsip_tp_send_callback)(void *token, pjsip_tx_data *tdata,
p pj_ssize_t bytes_sent);
j_ssize_t bytes_sent);
/** /**
* Send a SIP message using the specified transport. * This is a low-level function to send a SIP message using the specified
* transport to the specified destination.
*
* @param tr The SIP transport to be used.
* @param tdata Transmit data buffer containing SIP message.
* @param addr Destination address.
* @param addr_len Length of destination address.
* @param token Arbitrary token to be returned back to callback.
* @param cb Optional callback to be called to notify caller about
* the completion status of the pending send operation.
*
* @return If the message has been sent successfully, this function
* will return PJ_SUCCESS and the callback will not be
* called. If message cannot be sent immediately, this
* function will return PJ_EPENDING, and application will
* be notified later about the completion via the callback.
* Any statuses other than PJ_SUCCESS or PJ_EPENDING
* indicates immediate failure, and in this case the
* callback will not be called.
*/ */
PJ_DECL(pj_status_t) pjsip_transport_send( pjsip_transport *tr, PJ_DECL(pj_status_t) pjsip_transport_send( pjsip_transport *tr,
pjsip_tx_data *tdata, pjsip_tx_data *tdata,
const pj_sockaddr_t *addr, const pj_sockaddr_t *addr,
int addr_len, int addr_len,
void *token, void *token,
pjsip_tp_send_callback cb); pjsip_tp_send_callback cb);
/** /**
* This is a low-level function to send raw data to a destination.
*
* See also #pjsip_endpt_send_raw() and #pjsip_endpt_send_raw_to_uri().
*
* @param mgr Transport manager.
* @param tp_type Transport type.
* @param sel Optional pointer to transport selector instance if
* application wants to use a specific transport instance
* rather then letting transport manager finds the suitable
* transport.
* @param tdata Optional transmit data buffer to be used. If thi
s value
* is NULL, this function will create one internally. If
* tdata is specified, this function will decrement the
* reference counter upon completion.
* @param raw_data The data to be sent.
* @param data_len The length of the data.
* @param addr Destination address.
* @param addr_len Length of destination address.
* @param token Arbitrary token to be returned back to callback.
* @param cb Optional callback to be called to notify caller about
* the completion status of the pending send operation.
*
* @return If the message has been sent successfully, this function
* will return PJ_SUCCESS and the callback will not be
* called. If message cannot be sent immediately, this
* function will return PJ_EPENDING, and application will
* be notified later about the completion via the callback.
* Any statuses other than PJ_SUCCESS or PJ_EPENDING
* indicates immediate failure, and in this case the
* callback will not be called.
*/
PJ_DECL(pj_status_t) pjsip_tpmgr_send_raw(pjsip_tpmgr *mgr,
pjsip_transport_type_e tp_type,
const pjsip_tpselector *sel,
pjsip_tx_data *tdata,
const void *raw_data,
pj_size_t data_len,
const pj_sockaddr_t *addr,
int addr_len,
void *token,
pjsip_tp_send_callback cb);
/**
* @} * @}
*/ */
PJ_END_DECL PJ_END_DECL
#endif /* __PJSIP_SIP_TRANSPORT_H__ */ #endif /* __PJSIP_SIP_TRANSPORT_H__ */
 End of changes. 8 change blocks. 
7 lines changed or deleted 93 lines changed or added


 sip_transport_udp.h   sip_transport_udp.h 
/* $Id: sip_transport_udp.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: sip_transport_udp.h 1382 2007-06-22 11:32:49Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 41 skipping to change at line 41
/** /**
* @defgroup PJSIP_TRANSPORT_UDP UDP Transport * @defgroup PJSIP_TRANSPORT_UDP UDP Transport
* @ingroup PJSIP_TRANSPORT * @ingroup PJSIP_TRANSPORT
* @brief API to create and register UDP transport. * @brief API to create and register UDP transport.
* @{ * @{
* The functions below are used to create UDP transport and register * The functions below are used to create UDP transport and register
* the transport to the framework. * the transport to the framework.
*/ */
/** /**
* Flag that can be specified when calling #pjsip_udp_transport_pause() or
* #pjsip_udp_transport_restart().
*/
enum
{
/**
* This flag tells the transport to keep the existing/internal socket
* handle.
*/
PJSIP_UDP_TRANSPORT_KEEP_SOCKET = 1,
/**
* This flag tells the transport to destroy the existing/internal socke
t
* handle. Naturally this flag and PJSIP_UDP_TRANSPORT_KEEP_SOCKET are
* mutually exclusive.
*/
PJSIP_UDP_TRANSPORT_DESTROY_SOCKET = 2
};
/**
* Start UDP transport. * Start UDP transport.
* *
* @param endpt The SIP endpoint. * @param endpt The SIP endpoint.
* @param local Optional local address to bind. If this argu ment * @param local Optional local address to bind. If this argu ment
* is NULL, the UDP transport will be bound to arbitrar y * is NULL, the UDP transport will be bound to arbitrar y
* UDP port. * UDP port.
* @param a_name Published address (only the host and port portion is * @param a_name Published address (only the host and port portion is
* used). If this argument is NULL, then the bound addr ess * used). If this argument is NULL, then the bound addr ess
* will be used as the published address. * will be used as the published address.
* @param async_cnt Number of simultaneous async operations. * @param async_cnt Number of simultaneous async operations.
skipping to change at line 83 skipping to change at line 103
* @return PJ_SUCCESS when the transport has been successfully * @return PJ_SUCCESS when the transport has been successfully
* started and registered to transport manager, or * started and registered to transport manager, or
* the appropriate error code. * the appropriate error code.
*/ */
PJ_DECL(pj_status_t) pjsip_udp_transport_attach(pjsip_endpoint *endpt, PJ_DECL(pj_status_t) pjsip_udp_transport_attach(pjsip_endpoint *endpt,
pj_sock_t sock, pj_sock_t sock,
const pjsip_host_port *a_nam e, const pjsip_host_port *a_nam e,
unsigned async_cnt, unsigned async_cnt,
pjsip_transport **p_transpor t); pjsip_transport **p_transpor t);
/**
* Retrieve the internal socket handle used by the UDP transport. Note
* that this socket normally is registered to ioqueue, so if application
* wants to make use of this socket, it should temporarily pause the
* transport.
*
* @param transport The UDP transport.
*
* @return The socket handle, or PJ_INVALID_SOCKET if no socket
* is currently being used (for example, when transport
* is being paused).
*/
PJ_DECL(pj_sock_t) pjsip_udp_transport_get_socket(pjsip_transport *transpor
t);
/**
* Temporarily pause or shutdown the transport. When transport is being
* paused, it cannot be used by the SIP stack to send or receive SIP
* messages.
*
* Two types of operations are supported by this function:
* - to temporarily make this transport unavailable for SIP uses, but
* otherwise keep the socket handle intact. Application then can
* retrieve the socket handle with #pjsip_udp_transport_get_socket()
* and use it to send/receive application data (for example, STUN
* messages). In this case, application should specify
* PJSIP_UDP_TRANSPORT_KEEP_SOCKET when calling this function, and
* also to specify this flag when calling #pjsip_udp_transport_restart()
* later.
* - to temporarily shutdown the transport, including closing down
* the internal socket handle. This is useful for example to
* temporarily suspend the application for an indefinite period. In
* this case, application should specify PJSIP_UDP_TRANSPORT_DESTROY_SOC
KET
* flag when calling this function, and specify a new socket when
* calling #pjsip_udp_transport_restart().
*
* @param transport The UDP transport.
* @param option Pause option.
*
* @return PJ_SUCCESS if transport is paused successfully,
* or the appropriate error code.
*/
PJ_DECL(pj_status_t) pjsip_udp_transport_pause(pjsip_transport *transport,
unsigned option);
/**
* Restart the transport. Several operations are supported by this function
:
* - if transport was made temporarily unavailable to SIP stack with
* pjsip_udp_transport_pause() and PJSIP_UDP_TRANSPORT_KEEP_SOCKET,
* application can make the transport available to the SIP stack
* again, by specifying PJSIP_UDP_TRANSPORT_KEEP_SOCKET flag here.
* - if application wants to replace the internal socket with a new
* socket, it must specify PJSIP_UDP_TRANSPORT_DESTROY_SOCKET when
* calling this function, so that the internal socket will be destroyed
* if it hasn't been closed. In this case, application has two choices
* on how to create the new socket: 1) to let the transport create
* the new socket, in this case the \a sock option should be set
* to \a PJ_INVALID_SOCKET and optionally the \a local parameter can be
* filled with the desired address and port where the new socket
* should be bound to, or 2) to specify its own socket to be used
* by this transport, by specifying a valid socket in \a sock argument
* and set the \a local argument to NULL. In both cases, application
* may specify the published address of the socket in \a a_name
* argument.
*
* @param transport The UDP transport.
* @param option Restart option.
* @param sock Optional socket to be used by the transport.
* @param local The address where the socket should be bound
to.
* If this argument is NULL, socket will be bound
* to any available port.
* @param a_name Optionally specify the published address for
* this transport. If the socket is not replaced
* (PJSIP_UDP_TRANSPORT_KEEP_SOCKET flag is
* specified), then if this argument is NULL, the
* previous value will be used. If the socket is
* replaced and this argument is NULL, the bound
* address will be used as the published address
* of the transport.
*
* @return PJ_SUCCESS if transport can be restarted, or
* the appropriate error code.
*/
PJ_DECL(pj_status_t) pjsip_udp_transport_restart(pjsip_transport *transport
,
unsigned option,
pj_sock_t sock,
const pj_sockaddr_in *local
,
const pjsip_host_port *a_na
me);
PJ_END_DECL PJ_END_DECL
/** /**
* @} * @}
*/ */
#endif /* __PJSIP_TRANSPORT_UDP_H__ */ #endif /* __PJSIP_TRANSPORT_UDP_H__ */
 End of changes. 3 change blocks. 
1 lines changed or deleted 117 lines changed or added


 sip_ua_layer.h   sip_ua_layer.h 
/* $Id: sip_ua_layer.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: sip_ua_layer.h 1417 2007-08-16 10:11:44Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 115 skipping to change at line 115
* *
* @return PJ_SUCCESS on success. * @return PJ_SUCCESS on success.
*/ */
PJ_DECL(pj_status_t) pjsip_ua_destroy(void); PJ_DECL(pj_status_t) pjsip_ua_destroy(void);
/** /**
* Dump user agent contents (e.g. all dialogs). * Dump user agent contents (e.g. all dialogs).
* *
* @param detail If non-zero, list of dialogs will be printed. * @param detail If non-zero, list of dialogs will be printed.
*/ */
PJ_DEF(void) pjsip_ua_dump(pj_bool_t detail); PJ_DECL(void) pjsip_ua_dump(pj_bool_t detail);
/** /**
* Get the endpoint instance of a user agent module. * Get the endpoint instance of a user agent module.
* *
* @param ua The user agent instance. * @param ua The user agent instance.
* *
* @return The endpoint instance where the user agent is * @return The endpoint instance where the user agent is
* registered. * registered.
*/ */
PJ_DECL(pjsip_endpoint*) pjsip_ua_get_endpt(pjsip_user_agent *ua); PJ_DECL(pjsip_endpoint*) pjsip_ua_get_endpt(pjsip_user_agent *ua);
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 sip_util.h   sip_util.h 
/* $Id: sip_util.h 1269 2007-05-12 15:03:23Z bennylp $ */ /* $Id: sip_util.h 1388 2007-06-23 07:26:54Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 23 skipping to change at line 23
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US A
*/ */
#ifndef __PJSIP_SIP_MISC_H__ #ifndef __PJSIP_SIP_MISC_H__
#define __PJSIP_SIP_MISC_H__ #define __PJSIP_SIP_MISC_H__
#include <pjsip/sip_msg.h> #include <pjsip/sip_msg.h>
#include <pjsip/sip_transport.h>
#include <pjsip/sip_resolve.h> #include <pjsip/sip_resolve.h>
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /**
* @defgroup PJSIP_ENDPT_STATELESS Message Creation and Stateless Operation s * @defgroup PJSIP_ENDPT_STATELESS Message Creation and Stateless Operation s
* @ingroup PJSIP_CORE_CORE * @ingroup PJSIP_CORE_CORE
* @brief Utilities to create various messages and base function to send me ssages. * @brief Utilities to create various messages and base function to send me ssages.
* @{ * @{
*/ */
skipping to change at line 257 skipping to change at line 258
pjsip_transport *cur_transport; pjsip_transport *cur_transport;
/** The application callback which was specified when the function /** The application callback which was specified when the function
* #pjsip_endpt_send_request_stateless() was called. * #pjsip_endpt_send_request_stateless() was called.
*/ */
void (*app_cb)(struct pjsip_send_state*, void (*app_cb)(struct pjsip_send_state*,
pj_ssize_t sent, pj_ssize_t sent,
pj_bool_t *cont); pj_bool_t *cont);
} pjsip_send_state; } pjsip_send_state;
typedef void (*pjsip_endpt_callback)(pjsip_send_state*, pj_ssize_t sent, typedef void (*pjsip_send_callback)(pjsip_send_state*, pj_ssize_t sent,
pj_ pj_bool_t *cont);
bool_t *cont);
/** /**
* Send outgoing request statelessly The function will take care of which * Send outgoing request statelessly The function will take care of which
* destination and transport to use based on the information in the message , * destination and transport to use based on the information in the message ,
* taking care of URI in the request line and Route header. * taking care of URI in the request line and Route header.
* *
* This function is different than #pjsip_transport_send() in that this * This function is different than #pjsip_transport_send() in that this
* function adds/modify the Via header as necessary. * function adds/modify the Via header as necessary.
* *
* @param endpt The endpoint instance. * @param endpt The endpoint instance.
* @param tdata The transmit data to be sent. * @param tdata The transmit data to be sent.
skipping to change at line 280 skipping to change at line 282
* @param cb Optional callback to notify transmission status (also * @param cb Optional callback to notify transmission status (also
* gives chance for application to discontinue retrying * gives chance for application to discontinue retrying
* sending to alternate address). * sending to alternate address).
* *
* @return PJ_SUCCESS, or the appropriate error code. * @return PJ_SUCCESS, or the appropriate error code.
*/ */
PJ_DECL(pj_status_t) PJ_DECL(pj_status_t)
pjsip_endpt_send_request_stateless( pjsip_endpoint *endpt, pjsip_endpt_send_request_stateless( pjsip_endpoint *endpt,
pjsip_tx_data *tdata, pjsip_tx_data *tdata,
void *token, void *token,
pjsip_endpt_callback cb); pjsip_send_callback cb);
/**
* This is a low-level function to send raw data to a destination.
*
* See also #pjsip_endpt_send_raw_to_uri().
*
* @param endpt The SIP endpoint instance.
* @param tp_type Transport type.
* @param sel Optional pointer to transport selector instance if
* application wants to use a specific transport instance
* rather then letting transport manager finds the suitable
* transport..
* @param raw_data The data to be sent.
* @param data_len The length of the data.
* @param addr Destination address.
* @param addr_len Length of destination address.
* @param token Arbitrary token to be returned back to callback.
* @param cb Optional callback to be called to notify caller about
* the completion status of the pending send operation.
*
* @return If the message has been sent successfully, this function
* will return PJ_SUCCESS and the callback will not be
* called. If message cannot be sent immediately, this
* function will return PJ_EPENDING, and application will
* be notified later about the completion via the callback.
* Any statuses other than PJ_SUCCESS or PJ_EPENDING
* indicates immediate failure, and in this case the
* callback will not be called.
*/
PJ_DECL(pj_status_t) pjsip_endpt_send_raw(pjsip_endpoint *endpt,
pjsip_transport_type_e tp_type,
const pjsip_tpselector *sel,
const void *raw_data,
pj_size_t data_len,
const pj_sockaddr_t *addr,
int addr_len,
void *token,
pjsip_tp_send_callback cb);
/**
* Send raw data to the specified destination URI. The actual destination
* address will be calculated from the URI, using normal SIP URI to host
* resolution.
*
* See also #pjsip_endpt_send_raw().
*
* @param endpt The SIP endpoint instance.
* @param dst_uri Destination address URI.
* @param sel Optional pointer to transport selector instance if
* application wants to use a specific transport instance
* rather then letting transport manager finds the suitable
* transport..
* @param raw_data The data to be sent.
* @param data_len The length of the data.
* @param token Arbitrary token to be returned back to callback.
* @param cb Optional callback to be called to notify caller about
* the completion status of the pending send operation.
*
* @return If the message has been sent successfully, this function
* will return PJ_SUCCESS and the callback will not be
* called. If message cannot be sent immediately, this
* function will return PJ_EPENDING, and application will
* be notified later about the completion via the callback.
* Any statuses other than PJ_SUCCESS or PJ_EPENDING
* indicates immediate failure, and in this case the
* callback will not be called.
*/
PJ_DECL(pj_status_t) pjsip_endpt_send_raw_to_uri(pjsip_endpoint *endpt,
const pj_str_t *dst_uri,
const pjsip_tpselector *sel
,
const void *raw_data,
pj_size_t data_len,
void *token,
pjsip_tp_send_callback cb);
/** /**
* This structure describes destination information to send response. * This structure describes destination information to send response.
* It is initialized by calling #pjsip_get_response_addr(). * It is initialized by calling #pjsip_get_response_addr().
* *
* If the response message should be sent using transport from which * If the response message should be sent using transport from which
* the request was received, then transport, addr, and addr_len fields * the request was received, then transport, addr, and addr_len fields
* are initialized. * are initialized.
* *
* The dst_host field is also initialized. It should be used when server * The dst_host field is also initialized. It should be used when server
skipping to change at line 356 skipping to change at line 432
* *
* @return PJ_SUCCESS if response has been successfully created and * @return PJ_SUCCESS if response has been successfully created and
* sent to transport layer, or a non-zero error code. * sent to transport layer, or a non-zero error code.
* However, even when it returns PJ_SUCCESS, there is no * However, even when it returns PJ_SUCCESS, there is no
* guarantee that the response has been successfully sent. * guarantee that the response has been successfully sent.
*/ */
PJ_DECL(pj_status_t) pjsip_endpt_send_response( pjsip_endpoint *endpt, PJ_DECL(pj_status_t) pjsip_endpt_send_response( pjsip_endpoint *endpt,
pjsip_response_addr *res_add r, pjsip_response_addr *res_add r,
pjsip_tx_data *tdata, pjsip_tx_data *tdata,
void *token, void *token,
pjsip_endpt_callback cb); pjsip_send_callback cb);
/** /**
* This is a convenient function which wraps #pjsip_get_response_addr() and * This is a convenient function which wraps #pjsip_get_response_addr() and
* #pjsip_endpt_send_response() in a single function. * #pjsip_endpt_send_response() in a single function.
* *
* @param endpt The endpoint instance. * @param endpt The endpoint instance.
* @param rdata The original request to be responded. * @param rdata The original request to be responded.
* @param tdata The response message to be sent. * @param tdata The response message to be sent.
* @param token Token to be passed back when the callback is cal led. * @param token Token to be passed back when the callback is cal led.
* @param cb Optional callback to notify the transmission status * @param cb Optional callback to notify the transmission status
skipping to change at line 379 skipping to change at line 455
* *
* @return PJ_SUCCESS if response has been successfully created and * @return PJ_SUCCESS if response has been successfully created and
* sent to transport layer, or a non-zero error code. * sent to transport layer, or a non-zero error code.
* However, even when it returns PJ_SUCCESS, there is no * However, even when it returns PJ_SUCCESS, there is no
* guarantee that the response has been successfully sent. * guarantee that the response has been successfully sent.
*/ */
PJ_DECL(pj_status_t) pjsip_endpt_send_response2(pjsip_endpoint *endpt, PJ_DECL(pj_status_t) pjsip_endpt_send_response2(pjsip_endpoint *endpt,
pjsip_rx_data *rdata, pjsip_rx_data *rdata,
pjsip_tx_data *tdata, pjsip_tx_data *tdata,
void *token, void *token,
pjsip_endpt_callback cb); pjsip_send_callback cb);
/** /**
* This composite function sends response message statelessly to an incomin g * This composite function sends response message statelessly to an incomin g
* request message. Internally it calls #pjsip_endpt_create_response() and * request message. Internally it calls #pjsip_endpt_create_response() and
* #pjsip_endpt_send_response(). * #pjsip_endpt_send_response().
* *
* @param endpt The endpoint instance. * @param endpt The endpoint instance.
* @param rdata The incoming request message. * @param rdata The incoming request message.
* @param st_code Status code of the response. * @param st_code Status code of the response.
* @param st_text Optional status text of the response. * @param st_text Optional status text of the response.
 End of changes. 6 change blocks. 
7 lines changed or deleted 83 lines changed or added


 sip_xfer.h   sip_xfer.h 
/* $Id: sip_xfer.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: sip_xfer.h 1417 2007-08-16 10:11:44Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 60 skipping to change at line 60
* to use REFER functionality. * to use REFER functionality.
* *
* Reference: * Reference:
* - <A HREF="http://www.ietf.org/rfc/rfc3515.txt">RFC 3515: The Session * - <A HREF="http://www.ietf.org/rfc/rfc3515.txt">RFC 3515: The Session
* Initiation Protocol (SIP) Refer Method</A> * Initiation Protocol (SIP) Refer Method</A>
* - @ref PJSIP_EVENT_NOT * - @ref PJSIP_EVENT_NOT
*/ */
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /** Declaration for REFER method constant. */
* Declaration for REFER method constant. PJ_DECL_DATA(const pjsip_method) pjsip_refer_method;
*/
extern const pjsip_method pjsip_refer_method; /** Get REFER method constant */
PJ_DECL(const pjsip_method*) pjsip_get_refer_method();
/** /**
* Initialize the REFER subsystem. * Initialize the REFER subsystem.
* This currently does very little (only register REFER as supported method ). * This currently does very little (only register REFER as supported method ).
*/ */
PJ_DECL(pj_status_t) pjsip_xfer_init_module(pjsip_endpoint *endpt); PJ_DECL(pj_status_t) pjsip_xfer_init_module(pjsip_endpoint *endpt);
/** /**
* Create transferer (sender of REFER request). * Create transferer (sender of REFER request).
* *
 End of changes. 2 change blocks. 
5 lines changed or deleted 6 lines changed or added


 sock.h   sock.h 
/* $Id: sock.h 1104 2007-03-25 18:44:51Z bennylp $ */ /* $Id: sock.h 1410 2007-07-28 02:44:55Z bennylp $ */
/* /*
* Copyright (C)2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C)2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 60 skipping to change at line 60
* - \ref page_pjlib_sock_test * - \ref page_pjlib_sock_test
* - \ref page_pjlib_select_test * - \ref page_pjlib_select_test
* - \ref page_pjlib_sock_perf_test * - \ref page_pjlib_sock_perf_test
*/ */
/** /**
* Supported address families. * Supported address families.
* APPLICATION MUST USE THESE VALUES INSTEAD OF NORMAL AF_*, BECAUSE * APPLICATION MUST USE THESE VALUES INSTEAD OF NORMAL AF_*, BECAUSE
* THE LIBRARY WILL DO TRANSLATION TO THE NATIVE VALUE. * THE LIBRARY WILL DO TRANSLATION TO THE NATIVE VALUE.
*/ */
extern const pj_uint16_t PJ_AF_UNIX; /**< Unix domain socket. */
#define PJ_AF_LOCAL PJ_AF_UNIX; /**< POSIX name for AF_UNIX */ /** Unix domain socket. @see pj_AF_UNIX() */
extern const pj_uint16_t PJ_AF_INET; /**< Internet IP protocol. */ extern const pj_uint16_t PJ_AF_UNIX;
extern const pj_uint16_t PJ_AF_INET6; /**< IP version 6. */
extern const pj_uint16_t PJ_AF_PACKET; /**< Packet family. */ /** POSIX name for AF_UNIX */
extern const pj_uint16_t PJ_AF_IRDA; /**< IRDA sockets. */ #define PJ_AF_LOCAL PJ_AF_UNIX;
/** Internet IP protocol. @see pj_AF_INET() */
extern const pj_uint16_t PJ_AF_INET;
/** IP version 6. @see pj_AF_INET6() */
extern const pj_uint16_t PJ_AF_INET6;
/** Packet family. @see pj_AF_PACKET() */
extern const pj_uint16_t PJ_AF_PACKET;
/** IRDA sockets. @see pj_AF_IRDA() */
extern const pj_uint16_t PJ_AF_IRDA;
/*
* Accessor functions for various address family constants. These
* functions are provided because Symbian doesn't allow exporting
* global variables from a DLL.
*/
/** Get #PJ_AF_UNIX value. */
PJ_DECL(pj_uint16_t) pj_AF_UNIX(void);
/** Get #PJ_AF_INET value. */
PJ_DECL(pj_uint16_t) pj_AF_INET(void);
/** Get #PJ_AF_INET6 value. */
PJ_DECL(pj_uint16_t) pj_AF_INET6(void);
/** Get #PJ_AF_PACKET value. */
PJ_DECL(pj_uint16_t) pj_AF_PACKET(void);
/** Get #PJ_AF_IRDA value. */
PJ_DECL(pj_uint16_t) pj_AF_IRDA(void);
/** /**
* Supported types of sockets. * Supported types of sockets.
* APPLICATION MUST USE THESE VALUES INSTEAD OF NORMAL SOCK_*, BECAUSE * APPLICATION MUST USE THESE VALUES INSTEAD OF NORMAL SOCK_*, BECAUSE
* THE LIBRARY WILL TRANSLATE THE VALUE TO THE NATIVE VALUE. * THE LIBRARY WILL TRANSLATE THE VALUE TO THE NATIVE VALUE.
*/ */
extern const pj_uint16_t PJ_SOCK_STREAM; /**< Sequenced, reliable, connecti /** Sequenced, reliable, connection-based byte streams.
on- * @see pj_SOCK_STREAM() */
based byte streams. extern const pj_uint16_t PJ_SOCK_STREAM;
*/
extern const pj_uint16_t PJ_SOCK_DGRAM; /**< Connectionless, unreliable /** Connectionless, unreliable datagrams of fixed maximum lengths.
datagrams of fixed maximum * @see pj_SOCK_DGRAM() */
lengths. extern const pj_uint16_t PJ_SOCK_DGRAM;
*/
extern const pj_uint16_t PJ_SOCK_RAW; /**< Raw protocol interface. /** Raw protocol interface. @see pj_SOCK_RAW() */
*/ extern const pj_uint16_t PJ_SOCK_RAW;
extern const pj_uint16_t PJ_SOCK_RDM; /**< Reliably-delivered messages.
*/ /** Reliably-delivered messages. @see pj_SOCK_RDM() */
extern const pj_uint16_t PJ_SOCK_RDM;
/*
* Accessor functions for various constants. These functions are provided
* because Symbian doesn't allow exporting global variables from a DLL.
*/
/** Get #PJ_SOCK_STREAM constant */
PJ_DECL(int) pj_SOCK_STREAM(void);
/** Get #PJ_SOCK_DGRAM constant */
PJ_DECL(int) pj_SOCK_DGRAM(void);
/** Get #PJ_SOCK_RAW constant */
PJ_DECL(int) pj_SOCK_RAW(void);
/** Get #PJ_SOCK_RDM constant */
PJ_DECL(int) pj_SOCK_RDM(void);
/** /**
* Socket level specified in #pj_sock_setsockopt() or #pj_sock_getsockopt() . * Socket level specified in #pj_sock_setsockopt() or #pj_sock_getsockopt() .
* APPLICATION MUST USE THESE VALUES INSTEAD OF NORMAL SOL_*, BECAUSE * APPLICATION MUST USE THESE VALUES INSTEAD OF NORMAL SOL_*, BECAUSE
* THE LIBRARY WILL TRANSLATE THE VALUE TO THE NATIVE VALUE. * THE LIBRARY WILL TRANSLATE THE VALUE TO THE NATIVE VALUE.
*/ */
extern const pj_uint16_t PJ_SOL_SOCKET; /**< Socket level. */ /** Socket level. @see pj_SOL_SOCKET() */
extern const pj_uint16_t PJ_SOL_IP; /**< IP level. */ extern const pj_uint16_t PJ_SOL_SOCKET;
extern const pj_uint16_t PJ_SOL_TCP; /**< TCP level. */ /** IP level. @see pj_SOL_IP() */
extern const pj_uint16_t PJ_SOL_UDP; /**< UDP level. */ extern const pj_uint16_t PJ_SOL_IP;
extern const pj_uint16_t PJ_SOL_IPV6; /**< IP version 6 */ /** TCP level. @see pj_SOL_TCP() */
extern const pj_uint16_t PJ_SOL_TCP;
/** UDP level. @see pj_SOL_UDP() */
extern const pj_uint16_t PJ_SOL_UDP;
/** IP version 6. @see pj_SOL_IPV6() */
extern const pj_uint16_t PJ_SOL_IPV6;
/*
* Accessor functions for various constants. These functions are provided
* because Symbian doesn't allow exporting global variables from a DLL.
*/
/** Get #PJ_SOL_SOCKET constant */
PJ_DECL(pj_uint16_t) pj_SOL_SOCKET(void);
/** Get #PJ_SOL_IP constant */
PJ_DECL(pj_uint16_t) pj_SOL_IP(void);
/** Get #PJ_SOL_TCP constant */
PJ_DECL(pj_uint16_t) pj_SOL_TCP(void);
/** Get #PJ_SOL_UDP constant */
PJ_DECL(pj_uint16_t) pj_SOL_UDP(void);
/** Get #PJ_SOL_IPV6 constant */
PJ_DECL(pj_uint16_t) pj_SOL_IPV6(void);
/* IP_TOS /* IP_TOS
* *
* Note: * Note:
* TOS CURRENTLY DOES NOT WORK IN Windows 2000 and above! * TOS CURRENTLY DOES NOT WORK IN Windows 2000 and above!
* See http://support.microsoft.com/kb/248611 * See http://support.microsoft.com/kb/248611
*/ */
extern const pj_uint16_t PJ_IP_TOS; /**< IP_TOS optname in setsockopt() /** IP_TOS optname in setsockopt(). @see pj_IP_TOS() */
*/ extern const pj_uint16_t PJ_IP_TOS;
/** Get #PJ_IP_TOS constant */
PJ_DECL(int) pj_IP_TOS(void);
/* /*
* IP TOS related constats. * IP TOS related constats.
* *
* Note: * Note:
* TOS CURRENTLY DOES NOT WORK IN Windows 2000 and above! * TOS CURRENTLY DOES NOT WORK IN Windows 2000 and above!
* See http://support.microsoft.com/kb/248611 * See http://support.microsoft.com/kb/248611
*/ */
extern const pj_uint16_t PJ_IPTOS_LOWDELAY; /**< Minimize delays /** Minimize delays. @see pj_IPTOS_LOWDELAY() */
*/ extern const pj_uint16_t PJ_IPTOS_LOWDELAY;
extern const pj_uint16_t PJ_IPTOS_THROUGHPUT; /**< Optimize throughput
*/ /** Optimize throughput. @see pj_IPTOS_THROUGHPUT() */
extern const pj_uint16_t PJ_IPTOS_RELIABILITY; /**< Optimize for reliabilit extern const pj_uint16_t PJ_IPTOS_THROUGHPUT;
y*/
extern const pj_uint16_t PJ_IPTOS_MINCOST; /**< "filler data" where slo /** Optimize for reliability. @see pj_IPTOS_RELIABILITY() */
w extern const pj_uint16_t PJ_IPTOS_RELIABILITY;
transmission does't matter
*/ /** "filler data" where slow transmission does't matter.
* @see pj_IPTOS_MINCOST() */
extern const pj_uint16_t PJ_IPTOS_MINCOST;
/** Get #PJ_IPTOS_LOWDELAY constant */
PJ_DECL(int) pj_IPTOS_LOWDELAY(void);
/** Get #PJ_IPTOS_THROUGHPUT constant */
PJ_DECL(int) pj_IPTOS_THROUGHPUT(void);
/** Get #PJ_IPTOS_RELIABILITY constant */
PJ_DECL(int) pj_IPTOS_RELIABILITY(void);
/** Get #PJ_IPTOS_MINCOST constant */
PJ_DECL(int) pj_IPTOS_MINCOST(void);
/** /**
* Values to be specified as \c optname when calling #pj_sock_setsockopt() * Values to be specified as \c optname when calling #pj_sock_setsockopt()
* or #pj_sock_getsockopt(). * or #pj_sock_getsockopt().
*/ */
extern const pj_uint16_t PJ_SO_TYPE; /**< Socket type. */
extern const pj_uint16_t PJ_SO_RCVBUF; /**< Buffer size for receive. */ /** Socket type. @see pj_SO_TYPE() */
extern const pj_uint16_t PJ_SO_SNDBUF; /**< Buffer size for send. */ extern const pj_uint16_t PJ_SO_TYPE;
/** Buffer size for receive. @see pj_SO_RCVBUF() */
extern const pj_uint16_t PJ_SO_RCVBUF;
/** Buffer size for send. @see pj_SO_SNDBUF() */
extern const pj_uint16_t PJ_SO_SNDBUF;
/** Get #PJ_SO_TYPE constant */
PJ_DECL(pj_uint16_t) pj_SO_TYPE(void);
/** Get #PJ_SO_RCVBUF constant */
PJ_DECL(pj_uint16_t) pj_SO_RCVBUF(void);
/** Get #PJ_SO_SNDBUF constant */
PJ_DECL(pj_uint16_t) pj_SO_SNDBUF(void);
/* /*
* Flags to be specified in #pj_sock_recv, #pj_sock_send, etc. * Flags to be specified in #pj_sock_recv, #pj_sock_send, etc.
*/ */
extern const int PJ_MSG_OOB; /**< Out-of-band messages. */
extern const int PJ_MSG_PEEK; /**< Peek, don't remove from buffer. */ /** Out-of-band messages. @see pj_MSG_OOB() */
extern const int PJ_MSG_DONTROUTE; /**< Don't route. */ extern const int PJ_MSG_OOB;
/** Peek, don't remove from buffer. @see pj_MSG_PEEK() */
extern const int PJ_MSG_PEEK;
/** Don't route. @see pj_MSG_DONTROUTE() */
extern const int PJ_MSG_DONTROUTE;
/** Get #PJ_MSG_OOB constant */
PJ_DECL(int) pj_MSG_OOB(void);
/** Get #PJ_MSG_PEEK constant */
PJ_DECL(int) pj_MSG_PEEK(void);
/** Get #PJ_MSG_DONTROUTE constant */
PJ_DECL(int) pj_MSG_DONTROUTE(void);
/** /**
* Flag to be specified in #pj_sock_shutdown. * Flag to be specified in #pj_sock_shutdown().
*/ */
typedef enum pj_socket_sd_type typedef enum pj_socket_sd_type
{ {
PJ_SD_RECEIVE = 0, /**< No more receive. */ PJ_SD_RECEIVE = 0, /**< No more receive. */
PJ_SHUT_RD = 0, /**< Alias for SD_RECEIVE. */ PJ_SHUT_RD = 0, /**< Alias for SD_RECEIVE. */
PJ_SD_SEND = 1, /**< No more sending. */ PJ_SD_SEND = 1, /**< No more sending. */
PJ_SHUT_WR = 1, /**< Alias for SD_SEND. */ PJ_SHUT_WR = 1, /**< Alias for SD_SEND. */
PJ_SD_BOTH = 2, /**< No more send and receive. */ PJ_SD_BOTH = 2, /**< No more send and receive. */
PJ_SHUT_RDWR = 2 /**< Alias for SD_BOTH. */ PJ_SHUT_RDWR = 2 /**< Alias for SD_BOTH. */
} pj_socket_sd_type; } pj_socket_sd_type;
skipping to change at line 661 skipping to change at line 784
const void *optval, const void *optval,
int optlen); int optlen);
/** /**
* Receives data stream or message coming to the specified socket. * Receives data stream or message coming to the specified socket.
* *
* @param sockfd The socket descriptor. * @param sockfd The socket descriptor.
* @param buf The buffer to receive the data or message. * @param buf The buffer to receive the data or message.
* @param len On input, the length of the buffer. On return, * @param len On input, the length of the buffer. On return,
* contains the length of data received. * contains the length of data received.
* @param flags Combination of #pj_sock_msg_flag. * @param flags Flags (such as pj_MSG_PEEK()).
* *
* @return PJ_SUCCESS or the error code. * @return PJ_SUCCESS or the error code.
*/ */
PJ_DECL(pj_status_t) pj_sock_recv(pj_sock_t sockfd, PJ_DECL(pj_status_t) pj_sock_recv(pj_sock_t sockfd,
void *buf, void *buf,
pj_ssize_t *len, pj_ssize_t *len,
unsigned flags); unsigned flags);
/** /**
* Receives data stream or message coming to the specified socket. * Receives data stream or message coming to the specified socket.
* *
* @param sockfd The socket descriptor. * @param sockfd The socket descriptor.
* @param buf The buffer to receive the data or message. * @param buf The buffer to receive the data or message.
* @param len On input, the length of the buffer. On return, * @param len On input, the length of the buffer. On return,
* contains the length of data received. * contains the length of data received.
* @param flags Bitmask combination of #pj_sock_msg_flag. * @param flags Flags (such as pj_MSG_PEEK()).
* @param from If not NULL, it will be filled with the source * @param from If not NULL, it will be filled with the source
* address of the connection. * address of the connection.
* @param fromlen Initially contains the length of from address, * @param fromlen Initially contains the length of from address,
* and upon return will be filled with the actual * and upon return will be filled with the actual
* length of the address. * length of the address.
* *
* @return PJ_SUCCESS or the error code. * @return PJ_SUCCESS or the error code.
*/ */
PJ_DECL(pj_status_t) pj_sock_recvfrom( pj_sock_t sockfd, PJ_DECL(pj_status_t) pj_sock_recvfrom( pj_sock_t sockfd,
void *buf, void *buf,
skipping to change at line 701 skipping to change at line 824
int *fromlen); int *fromlen);
/** /**
* Transmit data to the socket. * Transmit data to the socket.
* *
* @param sockfd Socket descriptor. * @param sockfd Socket descriptor.
* @param buf Buffer containing data to be sent. * @param buf Buffer containing data to be sent.
* @param len On input, the length of the data in the buffer. * @param len On input, the length of the data in the buffer.
* Upon return, it will be filled with the length * Upon return, it will be filled with the length
* of data sent. * of data sent.
* @param flags Bitmask combination of #pj_sock_msg_flag. * @param flags Flags (such as pj_MSG_DONTROUTE()).
* *
* @return PJ_SUCCESS or the status code. * @return PJ_SUCCESS or the status code.
*/ */
PJ_DECL(pj_status_t) pj_sock_send(pj_sock_t sockfd, PJ_DECL(pj_status_t) pj_sock_send(pj_sock_t sockfd,
const void *buf, const void *buf,
pj_ssize_t *len, pj_ssize_t *len,
unsigned flags); unsigned flags);
/** /**
* Transmit data to the socket to the specified address. * Transmit data to the socket to the specified address.
* *
* @param sockfd Socket descriptor. * @param sockfd Socket descriptor.
* @param buf Buffer containing data to be sent. * @param buf Buffer containing data to be sent.
* @param len On input, the length of the data in the buffer. * @param len On input, the length of the data in the buffer.
* Upon return, it will be filled with the length * Upon return, it will be filled with the length
* of data sent. * of data sent.
* @param flags Bitmask combination of #pj_sock_msg_flag. * @param flags Flags (such as pj_MSG_DONTROUTE()).
* @param to The address to send. * @param to The address to send.
* @param tolen The length of the address in bytes. * @param tolen The length of the address in bytes.
* *
* @return PJ_SUCCESS or the status code. * @return PJ_SUCCESS or the status code.
*/ */
PJ_DECL(pj_status_t) pj_sock_sendto(pj_sock_t sockfd, PJ_DECL(pj_status_t) pj_sock_sendto(pj_sock_t sockfd,
const void *buf, const void *buf,
pj_ssize_t *len, pj_ssize_t *len,
unsigned flags, unsigned flags,
const pj_sockaddr_t *to, const pj_sockaddr_t *to,
 End of changes. 13 change blocks. 
47 lines changed or deleted 159 lines changed or added


 sock_select.h   sock_select.h 
/* $Id: sock_select.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: sock_select.h 1405 2007-07-20 08:08:30Z bennylp $ */
/* /*
* Copyright (C)2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C)2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 68 skipping to change at line 68
} pj_fd_set_t; } pj_fd_set_t;
/** /**
* Initialize the descriptor set pointed to by fdsetp to the null set. * Initialize the descriptor set pointed to by fdsetp to the null set.
* *
* @param fdsetp The descriptor set. * @param fdsetp The descriptor set.
*/ */
PJ_DECL(void) PJ_FD_ZERO(pj_fd_set_t *fdsetp); PJ_DECL(void) PJ_FD_ZERO(pj_fd_set_t *fdsetp);
/** /**
* This is an internal function, application shouldn't use this.
*
* Get the number of descriptors in the set. This is defined in sock_select
.c
* This function will only return the number of sockets set from PJ_FD_SET
* operation. When the set is modified by other means (such as by select())
,
* the count will not be reflected here.
*
* @param fdsetp The descriptor set.
*
* @return Number of descriptors in the set.
*/
PJ_DECL(pj_size_t) PJ_FD_COUNT(const pj_fd_set_t *fdsetp);
/**
* Add the file descriptor fd to the set pointed to by fdsetp. * Add the file descriptor fd to the set pointed to by fdsetp.
* If the file descriptor fd is already in this set, there shall be no effe ct * If the file descriptor fd is already in this set, there shall be no effe ct
* on the set, nor will an error be returned. * on the set, nor will an error be returned.
* *
* @param fd The socket descriptor. * @param fd The socket descriptor.
* @param fdsetp The descriptor set. * @param fdsetp The descriptor set.
*/ */
PJ_DECL(void) PJ_FD_SET(pj_sock_t fd, pj_fd_set_t *fdsetp); PJ_DECL(void) PJ_FD_SET(pj_sock_t fd, pj_fd_set_t *fdsetp);
/** /**
 End of changes. 2 change blocks. 
1 lines changed or deleted 17 lines changed or added


 srv_resolver.h   srv_resolver.h 
/* $Id: srv_resolver.h 1102 2007-03-24 17:37:25Z bennylp $ */ /* $Id: srv_resolver.h 1357 2007-06-11 16:51:18Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 78 skipping to change at line 78
* argument of the callback. * argument of the callback.
* *
* \section PJ_DNS_SRV_RESOLVER_REFERENCE Reference * \section PJ_DNS_SRV_RESOLVER_REFERENCE Reference
* *
* Reference: * Reference:
* - <A HREF="http://www.ietf.org/rfc/rfc2782.txt">RFC 2782</A>: * - <A HREF="http://www.ietf.org/rfc/rfc2782.txt">RFC 2782</A>:
* A DNS RR for specifying the location of services (DNS SRV) * A DNS RR for specifying the location of services (DNS SRV)
*/ */
/** /**
* Maximum server address entries per one SRV record * This structure represents DNS SRV records as the result of DNS SRV
*/ * resolution using #pj_dns_srv_resolve().
#ifndef PJ_DNS_SRV_MAX_ADDR
# define PJ_DNS_SRV_MAX_ADDR 8
#endif
/**
* The server addresses returned by the resolver.
*/ */
typedef struct pj_dns_srv_record typedef struct pj_dns_srv_record
{ {
/** Number of address records. */ /** Number of address records. */
unsigned count; unsigned count;
/** Address records. */ /** Address records. */
struct struct
{ v {
/** Server priority (the lower the higher the priority). */ /** Server priority (the lower the higher the priority). */
unsigned priority; unsigned priority;
/** Server weight (the higher the more load it can handle). */ /** Server weight (the higher the more load it can handle). */
unsigned weight; unsigned weight;
/** The server's address. */ /** Port number. */
pj_sockaddr addr; pj_uint16_t port;
/** Address length. */ /** The host address. */
int addr_len; pj_dns_a_record server;
} entry[PJ_DNS_SRV_MAX_ADDR]; } entry[PJ_DNS_SRV_MAX_ADDR];
} pj_dns_srv_record; } pj_dns_srv_record;
/** /**
* Type of callback function to receive notification from the resolver * Type of callback function to receive notification from the resolver
* when the resolution process completes. * when the resolution process completes.
*/ */
typedef void pj_dns_srv_resolver_cb(void *user_data, typedef void pj_dns_srv_resolver_cb(void *user_data,
skipping to change at line 138 skipping to change at line 132
* when the DNS SRV resolution fails and the name is * when the DNS SRV resolution fails and the name is
* resolved with DNS A resolution. * resolved with DNS A resolution.
* @param pool Memory pool used to allocate memory for the query. * @param pool Memory pool used to allocate memory for the query.
* @param resolver The resolver instance. * @param resolver The resolver instance.
* @param fallback_a Specify if the resolver should fallback with DNS A * @param fallback_a Specify if the resolver should fallback with DNS A
* resolution when the SRV resolution fails. * resolution when the SRV resolution fails.
* @param token Arbitrary data to be associated with this qu ery when * @param token Arbitrary data to be associated with this qu ery when
* the calback is called. * the calback is called.
* @param cb Pointer to callback function to receive the * @param cb Pointer to callback function to receive the
* notification when the resolution process completes. * notification when the resolution process completes.
* @param p_query Optional pointer to receive the query object, if one
* was started. If this pointer is specified, a NULL ma
y
* be returned if response cache is available immediate
ly.
* *
* @return PJ_SUCCESS on success, or the appropriate error code . * @return PJ_SUCCESS on success, or the appropriate error code .
*/ */
PJ_DECL(pj_status_t) pj_dns_srv_resolve(const pj_str_t *domain_name, PJ_DECL(pj_status_t) pj_dns_srv_resolve(const pj_str_t *domain_name,
const pj_str_t *res_name, const pj_str_t *res_name,
unsigned def_port, unsigned def_port,
pj_pool_t *pool, pj_pool_t *pool,
pj_dns_resolver *resolver, pj_dns_resolver *resolver,
pj_bool_t fallback_a, pj_bool_t fallback_a,
void *token, void *token,
pj_dns_srv_resolver_cb *cb); pj_dns_srv_resolver_cb *cb,
pj_dns_async_query **p_query);
/** /**
* @} * @}
*/ */
PJ_END_DECL PJ_END_DECL
#endif /* __PJLIB_UTIL_SRV_RESOLVER_H__ */ #endif /* __PJLIB_UTIL_SRV_RESOLVER_H__ */
 End of changes. 7 change blocks. 
15 lines changed or deleted 15 lines changed or added


 string.h   string.h 
/* $Id: string.h 1210 2007-04-22 12:48:30Z bennylp $ */ /* $Id: string.h 1397 2007-06-28 00:50:10Z bennylp $ */
/* /*
* Copyright (C)2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C)2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 342 skipping to change at line 342
* *
* @return * @return
* - < 0 if str1 is less than str2 * - < 0 if str1 is less than str2
* - 0 if str1 is identical to str2 * - 0 if str1 is identical to str2
* - > 0 if str1 is greater than str2 * - > 0 if str1 is greater than str2
*/ */
PJ_IDECL(int) pj_strncmp2( const pj_str_t *str1, const char *str2, PJ_IDECL(int) pj_strncmp2( const pj_str_t *str1, const char *str2,
pj_size_t len); pj_size_t len);
/** /**
* Perform lowercase comparison to the strings. * Perform case-insensitive comparison to the strings.
* *
* @param str1 The string to compare. * @param str1 The string to compare.
* @param str2 The string to compare. * @param str2 The string to compare.
* *
* @return * @return
* - < 0 if str1 is less than str2 * - < 0 if str1 is less than str2
* - 0 if str1 is equal to str2 * - 0 if str1 is equal to str2
* - > 0 if str1 is greater than str2 * - > 0 if str1 is greater than str2
*/ */
PJ_IDECL(int) pj_stricmp(const pj_str_t *str1, const pj_str_t *str2); PJ_IDECL(int) pj_stricmp(const pj_str_t *str1, const pj_str_t *str2);
skipping to change at line 399 skipping to change at line 399
* - 0 if str1 is equal to str2 * - 0 if str1 is equal to str2
* - (-1) if not equal. * - (-1) if not equal.
*/ */
#if defined(PJ_HAS_STRICMP_ALNUM) && PJ_HAS_STRICMP_ALNUM!=0 #if defined(PJ_HAS_STRICMP_ALNUM) && PJ_HAS_STRICMP_ALNUM!=0
PJ_IDECL(int) pj_stricmp_alnum(const pj_str_t *str1, const pj_str_t *str2); PJ_IDECL(int) pj_stricmp_alnum(const pj_str_t *str1, const pj_str_t *str2);
#else #else
#define pj_stricmp_alnum pj_stricmp #define pj_stricmp_alnum pj_stricmp
#endif #endif
/** /**
* Perform lowercase comparison to the strings. * Perform case-insensitive comparison to the strings.
* *
* @param str1 The string to compare. * @param str1 The string to compare.
* @param str2 The string to compare. * @param str2 The string to compare.
* *
* @return * @return
* - < 0 if str1 is less than str2 * - < 0 if str1 is less than str2
* - 0 if str1 is identical to str2 * - 0 if str1 is identical to str2
* - > 0 if str1 is greater than str2 * - > 0 if str1 is greater than str2
*/ */
PJ_IDECL(int) pj_stricmp2( const pj_str_t *str1, const char *str2); PJ_IDECL(int) pj_stricmp2( const pj_str_t *str1, const char *str2);
/** /**
* Perform lowercase comparison to the strings. * Perform case-insensitive comparison to the strings.
* *
* @param str1 The string to compare. * @param str1 The string to compare.
* @param str2 The string to compare. * @param str2 The string to compare.
* @param len The maximum number of characters to compare. * @param len The maximum number of characters to compare.
* *
* @return * @return
* - < 0 if str1 is less than str2 * - < 0 if str1 is less than str2
* - 0 if str1 is identical to str2 * - 0 if str1 is identical to str2
* - > 0 if str1 is greater than str2 * - > 0 if str1 is greater than str2
*/ */
PJ_IDECL(int) pj_strnicmp( const pj_str_t *str1, const pj_str_t *str2, PJ_IDECL(int) pj_strnicmp( const pj_str_t *str1, const pj_str_t *str2,
pj_size_t len); pj_size_t len);
/** /**
* Perform lowercase comparison to the strings. * Perform case-insensitive comparison to the strings.
* *
* @param str1 The string to compare. * @param str1 The string to compare.
* @param str2 The string to compare. * @param str2 The string to compare.
* @param len The maximum number of characters to compare. * @param len The maximum number of characters to compare.
* *
* @return * @return
* - < 0 if str1 is less than str2 * - < 0 if str1 is less than str2
* - 0 if str1 is identical to str2 * - 0 if str1 is identical to str2
* - > 0 if str1 is greater than str2 * - > 0 if str1 is greater than str2
*/ */
 End of changes. 5 change blocks. 
5 lines changed or deleted 5 lines changed or added


 string_i.h   string_i.h 
/* $Id: string_i.h 974 2007-02-19 01:13:53Z bennylp $ */ /* $Id: string_i.h 1527 2007-10-26 09:02:28Z bennylp $ */
/* /*
* Copyright (C)2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C)2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 137 skipping to change at line 137
max = src->slen; max = src->slen;
pj_memcpy(dst->ptr, src->ptr, max); pj_memcpy(dst->ptr, src->ptr, max);
dst->ptr[max] = '\0'; dst->ptr[max] = '\0';
dst->slen = max; dst->slen = max;
return dst; return dst;
} }
PJ_IDEF(int) pj_strcmp( const pj_str_t *str1, const pj_str_t *str2) PJ_IDEF(int) pj_strcmp( const pj_str_t *str1, const pj_str_t *str2)
{ {
pj_ssize_t diff; if (str1->slen == 0) {
return str2->slen==0 ? 0 : -1;
diff = str1->slen - str2->slen; } else if (str2->slen == 0) {
if (diff) { return 1;
return diff > 0 ? 1 : -1;
} else if (str1->ptr && str1->slen) {
return memcmp(str1->ptr, str2->ptr, str1->slen);
} else { } else {
return 0; int min = (str1->slen < str2->slen)? str1->slen : str2->slen;
int res = pj_memcmp(str1->ptr, str2->ptr, min);
if (res == 0) {
return (str1->slen < str2->slen) ? -1 :
(str1->slen == str2->slen ? 0 : 1);
} else {
return res;
}
} }
} }
PJ_IDEF(int) pj_strncmp( const pj_str_t *str1, const pj_str_t *str2, PJ_IDEF(int) pj_strncmp( const pj_str_t *str1, const pj_str_t *str2,
pj_size_t len) pj_size_t len)
{ {
if (str1->ptr && str2->ptr) pj_str_t copy1, copy2;
return memcmp(str1->ptr, str2->ptr, len);
else if (str2->ptr) if (len < (unsigned)str1->slen) {
return str2->slen==0 ? 0 : -1; copy1.ptr = str1->ptr;
else if (str1->ptr) copy1.slen = len;
return str1->slen==0 ? 0 : 1; str1 = &copy1;
else }
return 0;
if (len < (unsigned)str2->slen) {
copy2.ptr = str2->ptr;
copy2.slen = len;
str2 = &copy2;
}
return pj_strcmp(str1, str2);
} }
PJ_IDEF(int) pj_strncmp2( const pj_str_t *str1, const char *str2, PJ_IDEF(int) pj_strncmp2( const pj_str_t *str1, const char *str2,
pj_size_t len) pj_size_t len)
{ {
if (len == 0) pj_str_t copy2;
return 0;
else if (str1->ptr && str2) if (str2) {
return memcmp(str1->ptr, str2, len); copy2.ptr = (char*)str2;
else if (str1->ptr) copy2.slen = pj_ansi_strlen(str2);
return str1->slen==0 ? 0 : 1; } else {
else if (str2) copy2.slen = 0;
return *str2=='\0' ? 0 : -1; }
else
return 0; return pj_strncmp(str1, &copy2, len);
} }
PJ_IDEF(int) pj_strcmp2( const pj_str_t *str1, const char *str2 ) PJ_IDEF(int) pj_strcmp2( const pj_str_t *str1, const char *str2 )
{ {
if (str1->slen == 0) { pj_str_t copy2;
return (!str2 || *str2=='\0') ? 0 : -1;
} else if (str2) {
return pj_strncmp2( str1, str2, str1->slen); copy2.ptr = (char*)str2;
copy2.slen = pj_ansi_strlen(str2);
} else {
copy2.ptr = NULL;
copy2.slen = 0;
}
return pj_strcmp(str1, &copy2);
} }
PJ_IDEF(int) pj_stricmp( const pj_str_t *str1, const pj_str_t *str2) PJ_IDEF(int) pj_stricmp( const pj_str_t *str1, const pj_str_t *str2)
{ {
register int len = str1->slen; if (str1->slen == 0) {
if (len != str2->slen) { return str2->slen==0 ? 0 : -1;
return (int)(len - str2->slen); } else if (str2->slen == 0) {
} else if (len == 0) { return 1;
return 0;
} else { } else {
return pj_ansi_strnicmp(str1->ptr, str2->ptr, len); int min = (str1->slen < str2->slen)? str1->slen : str2->slen;
int res = pj_ansi_strnicmp(str1->ptr, str2->ptr, min);
if (res == 0) {
return (str1->slen < str2->slen) ? -1 :
(str1->slen == str2->slen ? 0 : 1);
} else {
return res;
}
} }
} }
#if defined(PJ_HAS_STRICMP_ALNUM) && PJ_HAS_STRICMP_ALNUM!=0 #if defined(PJ_HAS_STRICMP_ALNUM) && PJ_HAS_STRICMP_ALNUM!=0
PJ_IDEF(int) strnicmp_alnum( const char *str1, const char *str2, PJ_IDEF(int) strnicmp_alnum( const char *str1, const char *str2,
int len) int len)
{ {
if (len==0) if (len==0)
return 0; return 0;
else { else {
skipping to change at line 270 skipping to change at line 294
return ((*p1 & 0x5F000000)==(*p2 & 0x5F000000)) ? 0 : -1; return ((*p1 & 0x5F000000)==(*p2 & 0x5F000000)) ? 0 : -1;
#endif #endif
else else
return 0; return 0;
} }
} }
#endif /* PJ_HAS_STRICMP_ALNUM */ #endif /* PJ_HAS_STRICMP_ALNUM */
PJ_IDEF(int) pj_stricmp2( const pj_str_t *str1, const char *str2) PJ_IDEF(int) pj_stricmp2( const pj_str_t *str1, const char *str2)
{ {
if (str1->ptr && str2) pj_str_t copy2;
return pj_ansi_strnicmp(str1->ptr, str2, str1->slen);
else if (str2) if (str2) {
return (*str2=='\0') ? 0 : -1; copy2.ptr = (char*)str2;
else if (str1->ptr) copy2.slen = pj_ansi_strlen(str2);
return (str1->slen==0) ? 0 : 1; } else {
else copy2.ptr = NULL;
return 0; copy2.slen = 0;
}
return pj_stricmp(str1, &copy2);
} }
PJ_IDEF(int) pj_strnicmp( const pj_str_t *str1, const pj_str_t *str2, PJ_IDEF(int) pj_strnicmp( const pj_str_t *str1, const pj_str_t *str2,
pj_size_t len) pj_size_t len)
{ {
if (str1->ptr && str2->ptr) pj_str_t copy1, copy2;
return pj_ansi_strnicmp(str1->ptr, str2->ptr, len);
else if (str2->ptr) if (len < (unsigned)str1->slen) {
return str2->slen==0 ? 0 : -1; copy1.ptr = str1->ptr;
else if (str1->ptr) copy1.slen = len;
return str1->slen==0 ? 0 : 1; str1 = &copy1;
else }
return 0;
if (len < (unsigned)str2->slen) {
copy2.ptr = str2->ptr;
copy2.slen = len;
str2 = &copy2;
}
return pj_stricmp(str1, str2);
} }
PJ_IDEF(int) pj_strnicmp2( const pj_str_t *str1, const char *str2, PJ_IDEF(int) pj_strnicmp2( const pj_str_t *str1, const char *str2,
pj_size_t len) pj_size_t len)
{ {
if (len == 0) pj_str_t copy2;
return 0;
else if (str1->ptr && str2) if (str2) {
return pj_ansi_strnicmp(str1->ptr, str2, len); copy2.ptr = (char*)str2;
else if (str1->ptr) copy2.slen = pj_ansi_strlen(str2);
return str1->slen==0 ? 0 : 1; } else {
else if (str2) copy2.slen = 0;
return *str2=='\0' ? 0 : -1; }
else
return 0;
return pj_strnicmp(str1, &copy2, len);
} }
PJ_IDEF(void) pj_strcat(pj_str_t *dst, const pj_str_t *src) PJ_IDEF(void) pj_strcat(pj_str_t *dst, const pj_str_t *src)
{ {
if (src->slen) { if (src->slen) {
pj_memcpy(dst->ptr + dst->slen, src->ptr, src->slen); pj_memcpy(dst->ptr + dst->slen, src->ptr, src->slen);
dst->slen += src->slen; dst->slen += src->slen;
} }
} }
PJ_IDEF(void) pj_strcat2(pj_str_t *dst, const char *str) PJ_IDEF(void) pj_strcat2(pj_str_t *dst, const char *str)
{ {
unsigned len = pj_ansi_strlen(str); unsigned len = str? pj_ansi_strlen(str) : 0;
if (len) { if (len) {
pj_memcpy(dst->ptr + dst->slen, str, len); pj_memcpy(dst->ptr + dst->slen, str, len);
dst->slen += len; dst->slen += len;
} }
} }
PJ_IDEF(pj_str_t*) pj_strtrim( pj_str_t *str ) PJ_IDEF(pj_str_t*) pj_strtrim( pj_str_t *str )
{ {
pj_strltrim(str); pj_strltrim(str);
pj_strrtrim(str); pj_strrtrim(str);
 End of changes. 13 change blocks. 
64 lines changed or deleted 97 lines changed or added


 stun_auth.h   stun_auth.h 
/* $Id: stun_auth.h 1290 2007-05-23 07:05:59Z bennylp $ */ /* $Id: stun_auth.h 1374 2007-06-19 09:04:58Z bennylp $ */
/* /*
* Copyright (C) 2003-2005 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 stun_config.h   stun_config.h 
/* $Id: stun_config.h 1275 2007-05-15 10:42:56Z bennylp $ */ /* $Id: stun_config.h 1374 2007-06-19 09:04:58Z bennylp $ */
/* /*
* Copyright (C) 2003-2005 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 stun_msg.h   stun_msg.h 
/* $Id: stun_msg.h 1275 2007-05-15 10:42:56Z bennylp $ */ /* $Id: stun_msg.h 1443 2007-09-20 11:30:30Z bennylp $ */
/* /*
* Copyright (C) 2003-2005 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 271 skipping to change at line 271
* This enumeration describes STUN attribute types. * This enumeration describes STUN attribute types.
*/ */
typedef enum pj_stun_attr_type typedef enum pj_stun_attr_type
{ {
PJ_STUN_ATTR_MAPPED_ADDR = 0x0001,/**< MAPPED-ADDRESS. */ PJ_STUN_ATTR_MAPPED_ADDR = 0x0001,/**< MAPPED-ADDRESS. */
PJ_STUN_ATTR_RESPONSE_ADDR = 0x0002,/**< RESPONSE-ADDRESS (deprcatd )*/ PJ_STUN_ATTR_RESPONSE_ADDR = 0x0002,/**< RESPONSE-ADDRESS (deprcatd )*/
PJ_STUN_ATTR_CHANGE_REQUEST = 0x0003,/**< CHANGE-REQUEST (de precated)*/ PJ_STUN_ATTR_CHANGE_REQUEST = 0x0003,/**< CHANGE-REQUEST (de precated)*/
PJ_STUN_ATTR_SOURCE_ADDR = 0x0004,/**< SOURCE-ADDRESS (deprecated )*/ PJ_STUN_ATTR_SOURCE_ADDR = 0x0004,/**< SOURCE-ADDRESS (deprecated )*/
PJ_STUN_ATTR_CHANGED_ADDR = 0x0005,/**< CHANGED-ADDRESS (deprecatd )*/ PJ_STUN_ATTR_CHANGED_ADDR = 0x0005,/**< CHANGED-ADDRESS (deprecatd )*/
PJ_STUN_ATTR_USERNAME = 0x0006,/**< USERNAME attribute. */ PJ_STUN_ATTR_USERNAME = 0x0006,/**< USERNAME attribute. */
PJ_STUN_ATTR_PASSWORD = 0x0007,/**< PASSWORD attribute. */ PJ_STUN_ATTR_PASSWORD = 0x0007,/**< was PASSWORD attribute. */
PJ_STUN_ATTR_MESSAGE_INTEGRITY = 0x0008,/**< MESSAGE-INTEGRITY. */ PJ_STUN_ATTR_MESSAGE_INTEGRITY = 0x0008,/**< MESSAGE-INTEGRITY. */
PJ_STUN_ATTR_ERROR_CODE = 0x0009,/**< ERROR-CODE. */ PJ_STUN_ATTR_ERROR_CODE = 0x0009,/**< ERROR-CODE. */
PJ_STUN_ATTR_UNKNOWN_ATTRIBUTES = 0x000A,/**< UNKNOWN-ATTRIBUTES. */ PJ_STUN_ATTR_UNKNOWN_ATTRIBUTES = 0x000A,/**< UNKNOWN-ATTRIBUTES. */
PJ_STUN_ATTR_REFLECTED_FROM = 0x000B,/**< REFLECTED-FROM (de precatd)*/ PJ_STUN_ATTR_REFLECTED_FROM = 0x000B,/**< REFLECTED-FROM (de precatd)*/
PJ_STUN_ATTR_LIFETIME = 0x000D,/**< LIFETIME attribute. */ PJ_STUN_ATTR_LIFETIME = 0x000D,/**< LIFETIME attribute. */
PJ_STUN_ATTR_MAGIC_COOKIE = 0x000F,/**< MAGIC-COOKIE attr (deprec) */ PJ_STUN_ATTR_MAGIC_COOKIE = 0x000F,/**< MAGIC-COOKIE attr (deprec) */
PJ_STUN_ATTR_BANDWIDTH = 0x0010,/**< BANDWIDTH attribute */ PJ_STUN_ATTR_BANDWIDTH = 0x0010,/**< BANDWIDTH attribute */
PJ_STUN_ATTR_REMOTE_ADDR = 0x0012,/**< REMOTE-ADDRESS attribute */ PJ_STUN_ATTR_REMOTE_ADDR = 0x0012,/**< REMOTE-ADDRESS attribute */
PJ_STUN_ATTR_DATA = 0x0013,/**< DATA attribute. */ PJ_STUN_ATTR_DATA = 0x0013,/**< DATA attribute. */
PJ_STUN_ATTR_REALM = 0x0014,/**< REALM attribute. */ PJ_STUN_ATTR_REALM = 0x0014,/**< REALM attribute. */
skipping to change at line 319 skipping to change at line 319
/** /**
* STUN error codes, which goes into STUN ERROR-CODE attribute. * STUN error codes, which goes into STUN ERROR-CODE attribute.
*/ */
typedef enum pj_stun_status typedef enum pj_stun_status
{ {
PJ_STUN_SC_TRY_ALTERNATE = 300, /**< Try Alternate */ PJ_STUN_SC_TRY_ALTERNATE = 300, /**< Try Alternate */
PJ_STUN_SC_BAD_REQUEST = 400, /**< Bad Request */ PJ_STUN_SC_BAD_REQUEST = 400, /**< Bad Request */
PJ_STUN_SC_UNAUTHORIZED = 401, /**< Unauthorized */ PJ_STUN_SC_UNAUTHORIZED = 401, /**< Unauthorized */
PJ_STUN_SC_UNKNOWN_ATTRIBUTE = 420, /**< Unknown Attribute */ PJ_STUN_SC_UNKNOWN_ATTRIBUTE = 420, /**< Unknown Attribute */
PJ_STUN_SC_STALE_CREDENTIALS = 430, /**< Stale Credentials #if 0
*/ /* These were obsolete in recent rfc3489bis */
PJ_STUN_SC_INTEGRITY_CHECK_FAILURE = 431, /**< Integrity Chk Fail //PJ_STUN_SC_STALE_CREDENTIALS = 430, /**< Stale Credentials
*/ */
PJ_STUN_SC_MISSING_USERNAME = 432, /**< Missing Usernam //PJ_STUN_SC_INTEGRITY_CHECK_FAILURE= 431, /**< Integrity Chk Fail
e */ */
PJ_STUN_SC_USE_TLS = 433, /**< Use TLS //PJ_STUN_SC_MISSING_USERNAME = 432, /**< Missing Username
*/ */
PJ_STUN_SC_MISSING_REALM = 434, /**< Missing Realm //PJ_STUN_SC_USE_TLS = 433, /**< Use TLS
*/ */
PJ_STUN_SC_MISSING_NONCE = 435, /**< Missing Nonce //PJ_STUN_SC_MISSING_REALM = 434, /**< Missing Realm
*/ */
PJ_STUN_SC_UNKNOWN_USERNAME = 436, /**< Unknown Usernam //PJ_STUN_SC_MISSING_NONCE = 435, /**< Missing Nonce
e */ */
//PJ_STUN_SC_UNKNOWN_USERNAME = 436, /**< Unknown Username
*/
#endif
PJ_STUN_SC_NO_BINDING = 437, /**< No Binding. */ PJ_STUN_SC_NO_BINDING = 437, /**< No Binding. */
PJ_STUN_SC_STALE_NONCE = 438, /**< Stale Nonce */ PJ_STUN_SC_STALE_NONCE = 438, /**< Stale Nonce */
PJ_STUN_SC_TRANSITIONING = 439, /**< Transitioning. */ PJ_STUN_SC_TRANSITIONING = 439, /**< Transitioning. */
PJ_STUN_SC_UNSUPP_TRANSPORT_PROTO = 442, /**< Unsupported Transport or PJ_STUN_SC_UNSUPP_TRANSPORT_PROTO = 442, /**< Unsupported Transport or
Protocol */ Protocol */
PJ_STUN_SC_INVALID_IP_ADDR = 443, /**< Invalid IP Address */ PJ_STUN_SC_INVALID_IP_ADDR = 443, /**< Invalid IP Address */
PJ_STUN_SC_INVALID_PORT = 444, /**< Invalid Port */ PJ_STUN_SC_INVALID_PORT = 444, /**< Invalid Port */
PJ_STUN_SC_OPER_TCP_ONLY = 445, /**< Operation for TCP Only */ PJ_STUN_SC_OPER_TCP_ONLY = 445, /**< Operation for TCP Only */
PJ_STUN_SC_CONNECTION_FAILURE = 446, /**< Connection Failure */ PJ_STUN_SC_CONNECTION_FAILURE = 446, /**< Connection Failure */
PJ_STUN_SC_CONNECTION_TIMEOUT = 447, /**< Connection Timeout */ PJ_STUN_SC_CONNECTION_TIMEOUT = 447, /**< Connection Timeout */
skipping to change at line 1042 skipping to change at line 1045
/** /**
* Get STUN standard reason phrase for the specified error code. * Get STUN standard reason phrase for the specified error code.
* *
* @param err_code The STUN error code. * @param err_code The STUN error code.
* *
* @return The STUN error reason phrase. * @return The STUN error reason phrase.
*/ */
PJ_DECL(pj_str_t) pj_stun_get_err_reason(int err_code); PJ_DECL(pj_str_t) pj_stun_get_err_reason(int err_code);
/** /**
* Internal: set the padding character for string attribute.
* The default padding character is PJ_STUN_STRING_ATTR_PAD_CHR.
*
* @return The previous padding character.
*/
PJ_DECL(int) pj_stun_set_padding_char(int chr);
/**
* Create a generic STUN message. * Create a generic STUN message.
* *
* @param pool Pool to create the STUN message. * @param pool Pool to create the STUN message.
* @param msg_type The 14bit message type. * @param msg_type The 14bit message type.
* @param magic Magic value to be put to the mesage; for req uests, * @param magic Magic value to be put to the mesage; for req uests,
* the value should be PJ_STUN_MAGIC. * the value should be PJ_STUN_MAGIC.
* @param tsx_id Optional transaction ID, or NULL to let the * @param tsx_id Optional transaction ID, or NULL to let the
* function generates a random transaction ID. * function generates a random transaction ID.
* @param p_msg Pointer to receive the message. * @param p_msg Pointer to receive the message.
* *
skipping to change at line 1358 skipping to change at line 1369
/** /**
* Create a STUN generic 64bit value attribute. * Create a STUN generic 64bit value attribute.
* *
* @param pool Pool to allocate memory from. * @param pool Pool to allocate memory from.
* @param attr_type Attribute type, from #pj_stun_attr_type. * @param attr_type Attribute type, from #pj_stun_attr_type.
* @param value Optional value to be assigned. * @param value Optional value to be assigned.
* @param p_attr Pointer to receive the attribute. * @param p_attr Pointer to receive the attribute.
* *
* @return PJ_SUCCESS on success or the appropriate error code. * @return PJ_SUCCESS on success or the appropriate error code.
*/ */
PJ_DEF(pj_status_t) pj_stun_uint64_attr_create(pj_pool_t *pool, PJ_DECL(pj_status_t) pj_stun_uint64_attr_create(pj_pool_t *pool,
int attr_type, int attr_type,
const pj_timestamp *value, const pj_timestamp *value,
pj_stun_uint64_attr **p_attr ); pj_stun_uint64_attr **p_attr );
/** /**
* Create and add STUN generic 64bit value attribute to the message. * Create and add STUN generic 64bit value attribute to the message.
* *
* @param pool The pool to allocate memory from. * @param pool The pool to allocate memory from.
* @param msg The STUN message * @param msg The STUN message
* @param attr_type Attribute type, from #pj_stun_attr_type. * @param attr_type Attribute type, from #pj_stun_attr_type.
 End of changes. 6 change blocks. 
18 lines changed or deleted 29 lines changed or added


 stun_session.h   stun_session.h 
/* $Id: stun_session.h 1275 2007-05-15 10:42:56Z bennylp $ */ /* $Id: stun_session.h 1498 2007-10-13 00:06:59Z bennylp $ */
/* /*
* Copyright (C) 2003-2005 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 256 skipping to change at line 256
const pj_stun_auth_cred *cred); const pj_stun_auth_cred *cred);
/** /**
* Create a STUN request message. After the message has been successfully * Create a STUN request message. After the message has been successfully
* created, application can send the message by calling * created, application can send the message by calling
* pj_stun_session_send_msg(). * pj_stun_session_send_msg().
* *
* @param sess The STUN session instance. * @param sess The STUN session instance.
* @param msg_type The STUN request message type, from pj_stun_method_e or * @param msg_type The STUN request message type, from pj_stun_method_e or
* from pj_stun_msg_type. * from pj_stun_msg_type.
* @param magic STUN magic, use PJ_STUN_MAGIC.
* @param tsx_id Optional transaction ID. * @param tsx_id Optional transaction ID.
* @param p_tdata Pointer to receive STUN transmit data instance containi ng * @param p_tdata Pointer to receive STUN transmit data instance containi ng
* the request. * the request.
* *
* @return PJ_SUCCESS on success, or the appropriate error code. * @return PJ_SUCCESS on success, or the appropriate error code.
*/ */
PJ_DECL(pj_status_t) pj_stun_session_create_req(pj_stun_session *sess, PJ_DECL(pj_status_t) pj_stun_session_create_req(pj_stun_session *sess,
int msg_type, int msg_type,
pj_uint32_t magic,
const pj_uint8_t tsx_id[12], const pj_uint8_t tsx_id[12],
pj_stun_tx_data **p_tdata); pj_stun_tx_data **p_tdata);
/** /**
* Create a STUN Indication message. After the message has been successful ly * Create a STUN Indication message. After the message has been successful ly
* created, application can send the message by calling * created, application can send the message by calling
* pj_stun_session_send_msg(). * pj_stun_session_send_msg().
* *
* @param sess The STUN session instance. * @param sess The STUN session instance.
* @param msg_type The STUN request message type, from pj_stun_method_e or * @param msg_type The STUN request message type, from pj_stun_method_e or
 End of changes. 4 change blocks. 
2 lines changed or deleted 4 lines changed or added


 stun_simple.h   stun_simple.h 
/* $Id: stun_simple.h 992 2007-02-21 00:40:05Z bennylp $ */ /* $Id: stun_simple.h 1374 2007-06-19 09:04:58Z bennylp $ */
/* /*
* Copyright (C) 2003-2005 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 stun_transaction.h   stun_transaction.h 
/* $Id: stun_transaction.h 1152 2007-04-05 11:32:47Z bennylp $ */ /* $Id: stun_transaction.h 1374 2007-06-19 09:04:58Z bennylp $ */
/* /*
* Copyright (C) 2003-2005 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 timer.h   timer.h 
/* $Id: timer.h 1246 2007-05-03 13:31:21Z bennylp $ */ /* $Id: timer.h 1405 2007-07-20 08:08:30Z bennylp $ */
/* /*
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 252 skipping to change at line 252
* *
* @return PJ_SUCCESS, or PJ_ENOTFOUND if no entry is scheduled. * @return PJ_SUCCESS, or PJ_ENOTFOUND if no entry is scheduled.
*/ */
PJ_DECL(pj_status_t) pj_timer_heap_earliest_time( pj_timer_heap_t *ht, PJ_DECL(pj_status_t) pj_timer_heap_earliest_time( pj_timer_heap_t *ht,
pj_time_val *timeval); pj_time_val *timeval);
/** /**
* Poll the timer heap, check for expired timers and call the callback for * Poll the timer heap, check for expired timers and call the callback for
* each of the expired timers. * each of the expired timers.
* *
* Note: polling the timer heap is not necessary in Symbian. Please see
* @ref PJ_SYMBIAN_OS for more info.
*
* @param ht The timer heap. * @param ht The timer heap.
* @param next_delay If this parameter is not NULL, it will be filled up wi th * @param next_delay If this parameter is not NULL, it will be filled up wi th
* the time delay until the next timer elapsed, or -1 in * the time delay until the next timer elapsed, or -1 in
* the sec part if no entry exist. * the sec part if no entry exist.
* *
* @return The number of timers expired. * @return The number of timers expired.
*/ */
PJ_DECL(unsigned) pj_timer_heap_poll( pj_timer_heap_t *ht, PJ_DECL(unsigned) pj_timer_heap_poll( pj_timer_heap_t *ht,
pj_time_val *next_delay); pj_time_val *next_delay);
 End of changes. 2 change blocks. 
1 lines changed or deleted 4 lines changed or added


 transport_ice.h   transport_ice.h 
/* $Id: transport_ice.h 1112 2007-03-28 16:24:00Z bennylp $ */ /* $Id: transport_ice.h 1436 2007-09-15 08:55:00Z bennylp $ */
/* /*
* Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 40 skipping to change at line 40
/** /**
* @defgroup PJMEDIA_TRANSPORT_ICE ICE Capable media transport * @defgroup PJMEDIA_TRANSPORT_ICE ICE Capable media transport
* @ingroup PJMEDIA_TRANSPORT * @ingroup PJMEDIA_TRANSPORT
* @brief Implementation of media transport with ICE. * @brief Implementation of media transport with ICE.
* @{ * @{
*/ */
PJ_BEGIN_DECL PJ_BEGIN_DECL
/** /**
* Structure containing callbacks to receive ICE notifications.
*/
typedef struct pjmedia_ice_cb
{
/**
* This callback will be called when ICE negotiation completes.
*
* @param tp PJMEDIA ICE transport.
* @param status ICE negotiation result, PJ_SUCCESS on success.
*/
void (*on_ice_complete)(pjmedia_transport *tp,
pj_status_t status);
} pjmedia_ice_cb;
/**
* Create the media transport. * Create the media transport.
* *
* @param endpt The media endpoint. * @param endpt The media endpoint.
* @param name Optional name to identify this ICE media transport * @param name Optional name to identify this ICE media transport
* for logging purposes. * for logging purposes.
* @param comp_cnt Number of components to be created. * @param comp_cnt Number of components to be created.
* @param stun_cfg Pointer to STUN configuration settings. * @param stun_cfg Pointer to STUN configuration settings.
* @param cb Optional callbacks.
* @param p_tp Pointer to receive the media transport instance. * @param p_tp Pointer to receive the media transport instance.
* *
* @return PJ_SUCCESS on success, or the appropriate error code . * @return PJ_SUCCESS on success, or the appropriate error code .
*/ */
PJ_DECL(pj_status_t) pjmedia_ice_create(pjmedia_endpt *endpt, PJ_DECL(pj_status_t) pjmedia_ice_create(pjmedia_endpt *endpt,
const char *name, const char *name,
unsigned comp_cnt, unsigned comp_cnt,
pj_stun_config *stun_cfg, pj_stun_config *stun_cfg,
const pjmedia_ice_cb *cb,
pjmedia_transport **p_tp); pjmedia_transport **p_tp);
/** /**
* Destroy the media transport. * Destroy the media transport.
* *
* @param tp The media transport. * @param tp The media transport.
* *
* @return PJ_SUCCESS. * @return PJ_SUCCESS.
*/ */
PJ_DECL(pj_status_t) pjmedia_ice_destroy(pjmedia_transport *tp); PJ_DECL(pj_status_t) pjmedia_ice_destroy(pjmedia_transport *tp);
skipping to change at line 195 skipping to change at line 213
* Stop the ICE session (typically when the call is terminated). Applicatio n * Stop the ICE session (typically when the call is terminated). Applicatio n
* may restart the ICE session again by calling #pjmedia_ice_init_ice(), * may restart the ICE session again by calling #pjmedia_ice_init_ice(),
* for example to use this media transport for the next call. * for example to use this media transport for the next call.
* *
* @param tp The media transport. * @param tp The media transport.
* *
* @return PJ_SUCCESS, or the appropriate error code. * @return PJ_SUCCESS, or the appropriate error code.
*/ */
PJ_DECL(pj_status_t) pjmedia_ice_stop_ice(pjmedia_transport *tp); PJ_DECL(pj_status_t) pjmedia_ice_stop_ice(pjmedia_transport *tp);
/**
* Simulate packet lost in the specified direction (for testing purposes).
* When enabled, the transport will randomly drop packets to the specified
* direction.
*
* @param tp The ICE media transport.
* @param dir Media direction to which packets will be randomly droppe
d.
* @param pct_lost Percent lost (0-100). Set to zero to disable packet
* lost simulation.
*
* @return PJ_SUCCESS on success.
*/
PJ_DECL(pj_status_t) pjmedia_ice_simulate_lost(pjmedia_transport *tp,
pjmedia_dir dir,
unsigned pct_lost);
PJ_END_DECL PJ_END_DECL
/** /**
* @} * @}
*/ */
#endif /* __pjmedia_ice_H__ */ #endif /* __pjmedia_ice_H__ */
 End of changes. 5 change blocks. 
1 lines changed or deleted 36 lines changed or added


 types.h   types.h 
/* $Id: types.h 1269 2007-05-12 15:03:23Z bennylp $ */ /* $Id: types.h 1405 2007-07-20 08:08:30Z bennylp $ */
/* /*
* Copyright (C)2003-2007 Benny Prijono <benny@prijono.org> * Copyright (C)2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 299 skipping to change at line 299
* *
* @return PJ_SUCCESS on success. * @return PJ_SUCCESS on success.
*/ */
PJ_DECL(pj_status_t) pj_init(void); PJ_DECL(pj_status_t) pj_init(void);
/** /**
* Shutdown PJLIB. * Shutdown PJLIB.
*/ */
PJ_DECL(void) pj_shutdown(void); PJ_DECL(void) pj_shutdown(void);
/**
* Type of callback to register to pj_atexit().
*/
typedef void (*pj_exit_callback)(void); typedef void (*pj_exit_callback)(void);
/** /**
* Register cleanup function to be called by PJLIB when pj_shutdown() is * Register cleanup function to be called by PJLIB when pj_shutdown() is
* called. * called.
* *
* @param func The function to be registered. * @param func The function to be registered.
* *
* @return PJ_SUCCESS on success. * @return PJ_SUCCESS on success.
*/ */
PJ_DECL(pj_status_t) pj_atexit(pj_exit_callback func); PJ_DECL(pj_status_t) pj_atexit(pj_exit_callback func);
 End of changes. 3 change blocks. 
1 lines changed or deleted 5 lines changed or added


 xml.h   xml.h 
/* $Id: xml.h 754 2006-10-08 13:56:07Z bennylp $ */ /* $Id: xml.h 1374 2007-06-19 09:04:58Z bennylp $ */
/* /*
* Copyright (C) 2003-2005 Benny Prijono <benny@prijono.org> * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/