Index: /pjproject/trunk/pjsip-apps/build/Footprint.mak
===================================================================
--- /pjproject/trunk/pjsip-apps/build/Footprint.mak	(revision 585)
+++ /pjproject/trunk/pjsip-apps/build/Footprint.mak	(revision 585)
@@ -0,0 +1,51 @@
+#
+# This file is used by get-footprint.py script to build samples/footprint.c
+# to get the footprint report for PJSIP/PJMEDIA.
+#
+include ../../build/common.mak
+
+PJLIB_LIB:=../../pjlib/lib/libpj-$(TARGET_NAME)$(LIBEXT)
+PJLIB_UTIL_LIB:=../../pjlib-util/lib/libpjlib-util-$(TARGET_NAME)$(LIBEXT)
+PJMEDIA_LIB:=../../pjmedia/lib/libpjmedia-$(TARGET_NAME)$(LIBEXT)
+PJMEDIA_CODEC_LIB:=../../pjmedia/lib/libpjmedia-codec-$(TARGET_NAME)$(LIBEXT)
+PJSIP_LIB:=../../pjsip/lib/libpjsip-$(TARGET_NAME)$(LIBEXT)
+PJSIP_UA_LIB:=../../pjsip/lib/libpjsip-ua-$(TARGET_NAME)$(LIBEXT)
+PJSIP_SIMPLE_LIB:=../../pjsip/lib/libpjsip-simple-$(TARGET_NAME)$(LIBEXT)
+PJSUA_LIB_LIB=../../pjsip/lib/libpjsua-$(TARGET_NAME)$(LIBEXT)
+
+
+###############################################################################
+# Gather all flags.
+#
+export _CFLAGS 	:= $(CC_CFLAGS) $(OS_CFLAGS) $(HOST_CFLAGS) $(M_CFLAGS) \
+		   $(CFLAGS) $(CC_INC)../../pjsip/include \
+		   $(CC_INC)../../pjlib/include \
+		   $(CC_INC)../../pjlib-util/include \
+		   $(CC_INC)../../pjmedia/include
+export _CXXFLAGS:= $(_CFLAGS) $(CC_CXXFLAGS) $(OS_CXXFLAGS) $(M_CXXFLAGS) \
+		   $(HOST_CXXFLAGS) $(CXXFLAGS)
+
+export LIBS :=	$(subst /,$(HOST_PSEP),$(PJSUA_LIB_LIB)) \
+		$(subst /,$(HOST_PSEP),$(PJSIP_UA_LIB)) \
+		$(subst /,$(HOST_PSEP),$(PJSIP_SIMPLE_LIB)) \
+		$(subst /,$(HOST_PSEP),$(PJSIP_LIB)) \
+		$(subst /,$(HOST_PSEP),$(PJMEDIA_CODEC_LIB)) \
+		$(subst /,$(HOST_PSEP),$(PJMEDIA_LIB)) \
+		$(subst /,$(HOST_PSEP),$(PJLIB_UTIL_LIB)) \
+		$(subst /,$(HOST_PSEP),$(PJLIB_LIB))
+
+
+export _LDFLAGS := $(LIBS) \
+		   $(CC_LDFLAGS) $(OS_LDFLAGS) $(M_LDFLAGS) $(HOST_LDFLAGS) \
+		   $(LDFLAGS) -lm
+
+
+
+EXE := footprint.exe
+
+all: 
+	$(CC_NAME) -o $(EXE) ../src/samples/footprint.c $(FCFLAGS) $(_CFLAGS) $(_LDFLAGS)
+
+clean:
+	rm -f $(EXE)
+
Index: /pjproject/trunk/pjsip-apps/build/get-footprint.py
===================================================================
--- /pjproject/trunk/pjsip-apps/build/get-footprint.py	(revision 585)
+++ /pjproject/trunk/pjsip-apps/build/get-footprint.py	(revision 585)
@@ -0,0 +1,292 @@
+# $Id$
+# 
+# This file is used to generate PJSIP/PJMEDIA footprint report.
+# To use this file, just run it in pjsip-apps/build directory, to
+# produce footprint.txt and footprint.htm report files.
+#
+import os
+import sys
+import string
+import time
+
+compile_flags1 = [
+    # Base
+    ['BASE', 			'Minimum PJLIB only'],
+
+    # Subtotal
+    ['',			'Subtotal'],
+
+    # PJLIB-UTIL
+    ['HAS_PJLIB_STUN',		'STUN client'],
+    ['HAS_PJLIB_GETOPT',	'getopt() functionality'],
+    
+    # Subtotal
+    ['',			'TOTAL']
+]
+
+compile_flags = [
+    # Base
+    ['BASE', 			'PJLIB (pool, data structures, hash tables, ioqueue, timer heap)'],
+    ['', 			'Subtotal: Minimum PJLIB application size (linked with OS libraries)'],
+
+    # PJLIB-UTIL
+    ['HAS_PJLIB_STUN',		'PJLIB-UTIL STUN client'],
+    ['HAS_PJLIB_GETOPT',	'PJLIB-UTIL getopt() functionality'],
+    ['HAS_PJLIB_XML',		'PJLIB-UTIL XML parsing and API'],
+
+    # PJSIP
+    ['HAS_PJSIP_CORE',		'PJSIP Core (endpoint, transport manager, parser, message elements, etc.)'],
+    ['HAS_PJSIP_UDP_TRANSPORT',	'PJSIP UDP transport'],
+    ['',			'Subtotal: A very minimum SIP application (parsing, UDP transport+STUN, no transaction)'],
+    
+    ['HAS_PJSIP_TCP_TRANSPORT',	'PJSIP TCP transport'],
+    ['HAS_PJSIP_INFO',		'PJSIP INFO support (RFC 2976) (no special treatment, thus the zero size)'],
+    ['HAS_PJSIP_TRANSACTION',	'PJSIP transaction and stateful API'],
+    ['HAS_PJSIP_UA_LAYER',	'PJSIP User agent layer and base dialog and usage management (draft-ietf-sipping-dialogusage-01)'],
+    ['HAS_PJMEDIA_SDP',		'PJMEDIA SDP API (RFC 2327), needed by SDP negotiator'],
+    ['HAS_PJMEDIA_SDP_NEGOTIATOR','PJMEDIA SDP negotiator (RFC 3264), needed by INVITE session'],
+    ['HAS_PJSIP_INV_SESSION',	'PJSIP INVITE session API'],
+    ['HAS_PJSIP_REGC',		'PJSIP client registration API'],
+    ['',			'Subtotal: Minimal SIP application with registration (including digest authentication)'],
+    
+    ['HAS_PJSIP_EVENT_FRAMEWORK','PJSIP Event/SUBSCRIBE framework, RFC 3265 (needed by call transfer, and presence)'],
+    ['HAS_PJSIP_CALL_TRANSFER',	'PJSIP Call Transfer/REFER support (RFC 3515)'],
+    ['',			'Subtotal: Minimal SIP application with call transfer'],
+
+
+    ['HAS_PJSIP_PRESENCE',	'PJSIP Presence subscription, including PIDF/X-PIDF support (RFC 3856, RFC 3863, etc) (needs XML)'],
+    ['HAS_PJSIP_MESSAGE',	'PJSIP Instant Messaging/MESSAGE support (RFC 3428) (no special treatment, thus the zero size)'],
+    ['HAS_PJSIP_IS_COMPOSING',	'PJSIP Message Composition indication (RFC 3994)'],
+
+    # Subtotal
+    ['',			'Subtotal: Complete PJSIP package (call, registration, presence, IM) +STUN +GETOPT (+PJLIB), no media'],
+    
+    # PJMEDIA
+    ['HAS_PJMEDIA_SND_DEV',	'PJMEDIA sound device backend (platform specific)'],
+    ['HAS_PJMEDIA_SILENCE_DET',	'PJMEDIA Adaptive silence detector'],
+    ['HAS_PJMEDIA',		'PJMEDIA endpoint'],
+    ['HAS_PJMEDIA_PLC',		'PJMEDIA Packet Lost Concealment implementation (needed by G.711, GSM, and sound device port)'],
+    ['HAS_PJMEDIA_SND_PORT',	'PJMEDIA sound device media port'],
+    ['HAS_PJMEDIA_RESAMPLE',	'PJMEDIA high quality resampling implementation (can be fine tuned with PJMEDIA_HAS_LARGE_FILTER and PJMEDIA_HAS_SMALL_FILTER)'],
+    ['HAS_PJMEDIA_G711_CODEC',	'PJMEDIA G.711 codec (PCMA/PCMU, including PLC) (may have already been linked by other module)'],
+    ['HAS_PJMEDIA_CONFERENCE',	'PJMEDIA conference bridge (needs resampling and silence detector)'],
+    ['HAS_PJMEDIA_MASTER_PORT',	'PJMEDIA master port'],
+    ['HAS_PJMEDIA_RTP',		'PJMEDIA stand-alone RTP'],
+    ['HAS_PJMEDIA_RTCP',	'PJMEDIA stand-alone RTCP and media quality calculation'],
+    ['HAS_PJMEDIA_JBUF',	'PJMEDIA stand-alone adaptive jitter buffer'],
+    ['HAS_PJMEDIA_STREAM',	'PJMEDIA stream for remote media communication (needs RTP, RTCP, and jitter buffer)'],
+    ['HAS_PJMEDIA_UDP_TRANSPORT','PJMEDIA UDP media transport'],
+    ['HAS_PJMEDIA_FILE_PLAYER',	'PJMEDIA WAV file player'],
+    ['HAS_PJMEDIA_FILE_CAPTURE',	'PJMEDIA WAV file writer'],
+    ['HAS_PJMEDIA_MEM_PLAYER',	'PJMEDIA fixed buffer player'],
+    ['HAS_PJMEDIA_MEM_CAPTURE',	'PJMEDIA fixed buffer writer'],
+
+    # Subtotal
+    ['',			'Subtotal: Complete SIP and all PJMEDIA features (G.711 codec only)'],
+    
+    # Codecs
+    ['HAS_PJMEDIA_GSM_CODEC',	'PJMEDIA GSM codec (including PLC)'],
+    ['HAS_PJMEDIA_SPEEX_CODEC',	'PJMEDIA Speex codec (narrowband, wideband, ultra-wideband)'],
+
+    # Total
+    ['',			'TOTAL: complete libraries (+all codecs)'],
+]
+
+# Executable size report, tuple of:
+#   <all flags>, <flags added>, <text size>, <data>, <bss>, <description>
+exe_size = []
+
+#
+# Write the report to text file
+#
+def print_text_report(filename):
+    output = open(filename, 'w')
+
+    output.write('PJSIP and PJMEDIA footprint report\n')
+    output.write('Auto-generated by pjsip-apps/build/get-footprint.py\n')
+    output.write('\n')
+
+    # Write Revision info.
+    f = os.popen('svn info | grep Revision')
+    output.write(f.readline())
+
+    output.write('Date: ')
+    output.write(time.asctime())
+    output.write('\n')
+    output.write('\n')
+
+    # Write individual module size
+    output.write('Footprint (in bytes):\n')
+    output.write('   .text   .data    .bss    Module Description\n')
+    output.write('==========================================================\n')
+	
+    for i in range(1, len(exe_size)):
+	e = exe_size[i]
+	prev = exe_size[i-1]
+	
+	if e[1]<>'':
+	    output.write(' ')
+	    output.write(  string.rjust(`string.atoi(e[2]) - string.atoi(prev[2])`, 8) )
+	    output.write(  string.rjust(`string.atoi(e[3]) - string.atoi(prev[3])`, 8) )
+	    output.write(  string.rjust(`string.atoi(e[4]) - string.atoi(prev[4])`, 8) )
+	    output.write('   ' + e[5] + '\n')
+	else:
+	    output.write(' ------------------------\n')	
+	    output.write(' ')
+	    output.write( string.rjust(e[2], 8) )
+	    output.write( string.rjust(e[3], 8) )
+	    output.write( string.rjust(e[4], 8) )
+	    output.write('   ' + e[5] + '\n')
+	    output.write('\n')	
+
+	
+    # Done    
+    output.close()
+
+
+#
+# Write the report to HTML file
+#
+def print_html_report(filename):
+    output = open(filename, 'w')
+
+    # Get Revision info.
+    f = os.popen('svn info | grep Revision')
+    revision = f.readline()
+
+    output.write('<HTML><HEAD>\n');
+    output.write(' <TITLE>PJSIP and PJMEDIA footprint report (' + revision + ')</TITLE>\n')
+    output.write(' <LINK href="/style/style.css" type="text/css" rel="stylesheet">\n')
+    output.write('</HEAD>\n');
+    output.write('<BODY bgcolor="white">\n');
+    output.write('<!-- #include virtual="/header.html" -->')
+
+    output.write(' <H1>PJSIP and PJMEDIA footprint report (' + revision + ')</H1>\n')
+    output.write('Auto-generated by pjsip-apps/build/get-footprint.py\n')
+    output.write('<p>Date: ' + time.asctime() + '<BR>\n')
+    output.write(revision + '</p>\n\n')
+    output.write('<HR>\n')
+    output.write('\n')
+
+    # Info
+    output.write('<H2>Build Configuration</H2>\n')
+
+    # build.mak
+    output.write('\n<H3>build.mak</H3>\n')
+    output.write('<tt>\n')
+    f = open('../../build.mak', 'r')
+    s = f.readlines()
+    for l in s:
+	output.write(l + '<BR>\n')
+    output.write('</tt>\n')
+
+    # user.mak
+    output.write('\n<H3>user.mak</H3>\n')
+    output.write('<tt>\n')
+    f = open('../../user.mak', 'r')
+    s = f.readlines()
+    for l in s:
+	output.write(l + '<BR>\n')
+    output.write('</tt>\n')
+
+    # config_site.h
+    output.write('\n<H3>&lt;pj/config.site.h&gt;</H3>\n')
+    output.write('<tt>\n')
+    f = os.popen('cpp -dM ../../pjlib/include/pj/config_site.h | grep PJ')
+    s = f.readlines()
+    for l in s:
+	output.write(l + '<BR>\n')
+    output.write('</tt>\n')
+
+
+
+    # Write individual module size
+    output.write('<H2>Footprint Report</H2>\n')
+    output.write('<p>The table below shows the footprint of individual feature, in bytes.</p>')
+    output.write('<TABLE border="1" cellpadding="2" cellspacing="0">\n' + 
+		  '<TR bgcolor="#e8e8ff">\n' + 
+		  '  <TD align="center"><strong>.text</strong></TD>\n' +
+		  '  <TD align="center"><strong>.data</strong></TD>\n' +
+		  '  <TD align="center"><strong>.bss</strong></TD>\n' +
+		  '  <TD align="center"><strong>Features/Module Description</strong></TD>\n' +
+		  '</TR>\n')
+	
+	
+    for i in range(1, len(exe_size)):
+	e = exe_size[i]
+	prev = exe_size[i-1]
+	
+	output.write('<TR>\n')
+	if e[1]<>'':
+	    output.write( '  <TD align="right">' + `string.atoi(e[2]) - string.atoi(prev[2])` + '</TD>\n')
+	    output.write( '  <TD align="right">' + `string.atoi(e[3]) - string.atoi(prev[3])` + '</TD>\n')
+	    output.write( '  <TD align="right">' + `string.atoi(e[4]) - string.atoi(prev[4])` + '</TD>\n' )
+	    output.write( '  <TD>' + e[5] + '</TD>\n')
+	else:
+	    output.write('<TR bgcolor="#e8e8ff">\n')
+	    output.write( '  <TD align="right">&nbsp;</TD>\n')
+	    output.write( '  <TD align="right">&nbsp;</TD>\n')
+	    output.write( '  <TD align="right">&nbsp;</TD>\n')
+	    output.write( '  <TD><strong>' + e[5] + ': .text=' + e[2]+ ', .data=' + e[3] + ', .bss=' + e[4] + '</strong></TD>\n')
+
+	output.write('</TR>\n')
+
+    output.write('</TABLE>\n')
+    output.write('<!-- #include virtual="/footer.html" -->')
+    output.write('</BODY>\n')
+    output.write('</HTML>\n')
+	
+    # Done    
+    output.close()
+
+
+
+
+#
+# Get the size of individual feature
+#
+def get_size(all_flags, flags, desc):
+	file = 'footprint.exe'
+	# Remove file
+	rc = os.system("make -f Footprint.mak FCFLAGS='" + all_flags + "' clean")
+	# Make the executable
+	cmd = "make -f Footprint.mak FCFLAGS='" + all_flags + "' all"
+	#print cmd
+	rc = os.system(cmd)
+	if rc <> 0:
+		sys.exit(1)
+
+	# Run 'size' against the executable
+	f = os.popen('size ' + file)
+	# Skip header of the 'size' output
+	f.readline()
+	# Get the sizes
+	size = f.readline()
+	f.close()
+	# Split into tokens
+	tokens = size.split()
+	# Build the size tuple and add to exe_size
+	elem = all_flags, flags, tokens[0], tokens[1], tokens[2], desc
+	exe_size.append(elem)
+	# Remove file
+	rc = os.system("make -f Footprint.mak FCFLAGS='" + all_flags + "' clean")
+	
+# Main
+elem = '', '',  '0', '0', '0', ''
+exe_size.append(elem)
+
+all_flags = ''
+for elem in compile_flags:
+    if elem[0] <> '':
+	flags = '-D' + elem[0]
+	all_flags += flags + ' '
+	get_size(all_flags, elem[0], elem[1])
+    else:
+	e = exe_size[len(exe_size)-1]
+	n = all_flags, '', e[2], e[3], e[4], elem[1]
+	exe_size.append(n)
+	
+
+print_text_report('footprint.txt')	
+print_html_report('footprint.htm')
+
Index: /pjproject/trunk/pjsip-apps/build/sample_debug.dsp
===================================================================
--- /pjproject/trunk/pjsip-apps/build/sample_debug.dsp	(revision 584)
+++ /pjproject/trunk/pjsip-apps/build/sample_debug.dsp	(revision 585)
@@ -43,5 +43,5 @@
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /Zi /O2 /I "../../pjsip/include" /I "../../pjlib/include" /I "../../pjlib-util/include" /I "../../pjmedia/include" /D PJ_WIN32=1 /D PJ_M_I386=1 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
+# ADD CPP /nologo /MD /W3 /Zi /O2 /I "../../pjsip/include" /I "../../pjlib/include" /I "../../pjlib-util/include" /I "../../pjmedia/include" /D PJ_WIN32=1 /D PJ_M_I386=1 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FR /FD /c
 # SUBTRACT CPP /YX
 # ADD BASE RSC /l 0x409 /d "NDEBUG"
@@ -77,5 +77,5 @@
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 ole32.lib user32.lib dsound.lib dxguid.lib netapi32.lib mswsock.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"../bin/samples/sampledebug_vc6d.exe" /pdbtype:sept
+# ADD LINK32 ole32.lib user32.lib dsound.lib dxguid.lib netapi32.lib mswsock.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /map /debug /machine:I386 /out:"../bin/samples/sampledebug_vc6d.exe" /pdbtype:sept
 
 !ENDIF 
Index: /pjproject/trunk/pjsip-apps/build/samples.dsp
===================================================================
--- /pjproject/trunk/pjsip-apps/build/samples.dsp	(revision 584)
+++ /pjproject/trunk/pjsip-apps/build/samples.dsp	(revision 585)
@@ -95,4 +95,8 @@
 # Begin Source File
 
+SOURCE=..\src\samples\footprint.c
+# End Source File
+# Begin Source File
+
 SOURCE=..\src\samples\level.c
 # End Source File
Index: /pjproject/trunk/pjsip-apps/src/samples/debug.c
===================================================================
--- /pjproject/trunk/pjsip-apps/src/samples/debug.c	(revision 584)
+++ /pjproject/trunk/pjsip-apps/src/samples/debug.c	(revision 585)
@@ -28,4 +28,4 @@
  *  #include "playfile.c"
  */
-#include "pjsip-perf.c"
+#include "footprint.c"
 
Index: /pjproject/trunk/pjsip-apps/src/samples/footprint.c
===================================================================
--- /pjproject/trunk/pjsip-apps/src/samples/footprint.c	(revision 585)
+++ /pjproject/trunk/pjsip-apps/src/samples/footprint.c	(revision 585)
@@ -0,0 +1,443 @@
+/* $Id$ */
+/* 
+ * Copyright (C) 2003-2006 Benny Prijono <benny@prijono.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
+ */
+
+/**
+ * The purpose of this file is to show the typical footprint of
+ * the application when various PJSIP/PJMEDIA components are used.
+ *
+ * This file will not be build as samples, but instead it is build
+ * by get-footprint.py Python script in pjsip-apps/build directory.
+ */
+
+#include <pjsip_ua.h>
+#include <pjsip_simple.h>
+#include <pjsip.h>
+#include <pjmedia.h>
+#include <pjmedia-codec.h>
+#include <pjlib-util.h>
+#include <pjlib.h>
+
+
+/* All flags: */
+#if 0
+#define HAS_PJLIB_STUN
+#define HAS_PJLIB_GETOPT
+#define HAS_PJLIB_XML
+
+#define HAS_PJSIP_CORE
+#define HAS_PJSIP_UDP_TRANSPORT
+#define HAS_PJSIP_TCP_TRANSPORT
+#define HAS_PJSIP_TRANSACTION
+#define HAS_PJSIP_UA_LAYER
+#define HAS_PJMEDIA_SDP
+#define HAS_PJMEDIA_SDP_NEGOTIATOR
+#define HAS_PJSIP_INV_SESSION
+#define HAS_PJSIP_REGC
+#define HAS_PJSIP_EVENT_FRAMEWORK
+#define HAS_PJSIP_CALL_TRANSFER
+#define HAS_PJSIP_PRESENCE
+#define HAS_PJSIP_IS_COMPOSING
+
+#define HAS_PJMEDIA
+#define HAS_PJMEDIA_SND_DEV
+#define HAS_PJMEDIA_SND_PORT
+#define HAS_PJMEDIA_RESAMPLE
+#define HAS_PJMEDIA_SILENCE_DET
+#define HAS_PJMEDIA_PLC
+#define HAS_PJMEDIA_CONFERENCE
+#define HAS_PJMEDIA_MASTER_PORT
+#define HAS_PJMEDIA_RTP
+#define HAS_PJMEDIA_RTCP
+#define HAS_PJMEDIA_JBUF
+#define HAS_PJMEDIA_STREAM
+#define HAS_PJMEDIA_UDP_TRANSPORT
+#define HAS_PJMEDIA_FILE_PLAYER
+#define HAS_PJMEDIA_FILE_CAPTURE
+#define HAS_PJMEDIA_MEM_PLAYER
+#define HAS_PJMEDIA_MEM_CAPTURE
+
+#define HAS_PJMEDIA_G711_CODEC
+#define HAS_PJMEDIA_GSM_CODEC
+#define HAS_PJMEDIA_SPEEX_CODEC
+#endif
+
+
+int dummy_function()
+{
+    pj_caching_pool cp;
+
+    pj_init();
+    pj_caching_pool_init(&cp, NULL, 0);
+    pj_array_erase(NULL, 0, 0, 0);
+    pj_create_unique_string(NULL, NULL);
+    pj_hash_create(NULL, 0);
+    pj_hash_get(NULL, NULL, 0, NULL);
+    pj_hash_set(NULL, NULL, NULL, 0, 0, NULL);
+    pj_ioqueue_create(NULL, 0, NULL);
+    pj_ioqueue_register_sock(NULL, NULL, 0, NULL, NULL, NULL);
+    pj_pool_alloc(NULL, 0);
+    pj_timer_heap_create(NULL, 0, NULL);
+
+#ifdef HAS_PJLIB_STUN
+    pj_stun_get_mapped_addr(&cp.factory, 0, NULL, NULL, 80, NULL, 80, NULL);
+#endif
+
+#ifdef HAS_PJLIB_GETOPT
+    pj_getopt_long(0, NULL, NULL, NULL, NULL);
+#endif
+    
+#ifdef HAS_PJLIB_XML
+    pj_xml_parse(NULL, NULL, 100);
+    pj_xml_print(NULL, NULL, 10, PJ_FALSE);
+    pj_xml_clone(NULL, NULL);
+    pj_xml_node_new(NULL, NULL);
+    pj_xml_attr_new(NULL, NULL, NULL);
+    pj_xml_add_node(NULL, NULL);
+    pj_xml_add_attr(NULL, NULL);
+    pj_xml_find_node(NULL, NULL);
+    pj_xml_find_next_node(NULL, NULL, NULL);
+    pj_xml_find_attr(NULL, NULL, NULL);
+    pj_xml_find(NULL, NULL, NULL, NULL);
+#endif
+
+#ifdef HAS_PJSIP_CORE
+    pjsip_endpt_create(NULL, NULL, NULL);
+
+    pjsip_endpt_create_request(NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+			       -1, NULL, NULL);
+    pjsip_endpt_create_request_from_hdr(NULL, NULL, NULL, NULL, NULL, NULL,
+					NULL, -1, NULL, NULL);
+    pjsip_endpt_create_response(NULL, NULL, -1, NULL, NULL);
+    pjsip_endpt_create_ack(NULL, NULL, NULL, NULL);
+    pjsip_endpt_create_cancel(NULL, NULL, NULL);
+    pjsip_get_request_addr(NULL, NULL);
+    pjsip_endpt_send_request_stateless(NULL, NULL, NULL, NULL);
+    pjsip_get_response_addr(NULL, NULL, NULL);
+    pjsip_endpt_send_response(NULL, NULL, NULL, NULL, NULL);
+    pjsip_endpt_respond_stateless(NULL, NULL, -1, NULL, NULL, NULL);
+#endif
+
+#ifdef HAS_PJSIP_UDP_TRANSPORT
+    pjsip_udp_transport_start(NULL, NULL, NULL, 1, NULL);
+#endif
+
+#ifdef HAS_PJSIP_TCP_TRANSPORT
+    pjsip_tcp_transport_start(NULL, NULL, 1, NULL);
+#endif
+
+#ifdef HAS_PJSIP_TRANSACTION
+    pjsip_tsx_layer_init_module(NULL);
+
+    pjsip_tsx_layer_destroy();
+    pjsip_tsx_create_uac(NULL, NULL, NULL);
+    pjsip_tsx_create_uas(NULL, NULL, NULL);
+    pjsip_tsx_recv_msg(NULL, NULL);
+    pjsip_tsx_send_msg(NULL, NULL);
+    pjsip_tsx_terminate(NULL, 200);
+
+    pjsip_endpt_send_request(NULL, NULL, -1, NULL, NULL);
+    pjsip_endpt_respond(NULL, NULL, NULL, -1, NULL, NULL, NULL, NULL);
+#endif
+
+#ifdef HAS_PJMEDIA_SDP
+    pjmedia_sdp_parse(NULL, NULL, 1024, NULL);
+    pjmedia_sdp_print(NULL, NULL, 1024);
+    pjmedia_sdp_validate(NULL);
+    pjmedia_sdp_session_clone(NULL, NULL);
+    pjmedia_sdp_session_cmp(NULL, NULL, 0);
+    pjmedia_sdp_attr_to_rtpmap(NULL, NULL, NULL);
+    pjmedia_sdp_attr_get_fmtp(NULL, NULL);
+    pjmedia_sdp_attr_get_rtcp(NULL, NULL);
+    pjmedia_sdp_conn_clone(NULL, NULL);
+    pjmedia_sdp_media_clone(NULL, NULL);
+    pjmedia_sdp_media_find_attr(NULL, NULL, NULL);
+#endif
+
+#ifdef HAS_PJMEDIA_SDP_NEGOTIATOR
+    pjmedia_sdp_neg_create_w_local_offer(NULL, NULL, NULL);
+    pjmedia_sdp_neg_create_w_remote_offer(NULL, NULL, NULL, NULL);
+    pjmedia_sdp_neg_get_state(NULL);
+    pjmedia_sdp_neg_negotiate(NULL, NULL, PJ_FALSE);
+#endif
+
+#ifdef HAS_PJSIP_UA_LAYER
+    pjsip_ua_init_module(NULL, NULL);
+    pjsip_ua_destroy();
+    pjsip_dlg_create_uac(NULL, NULL, NULL, NULL, NULL, NULL);
+    pjsip_dlg_create_uas(NULL, NULL, NULL, NULL);
+    pjsip_dlg_terminate(NULL);
+    pjsip_dlg_set_route_set(NULL, NULL);
+    pjsip_dlg_create_request(NULL, NULL, -1, NULL);
+    pjsip_dlg_send_request(NULL, NULL, -1, NULL);
+    pjsip_dlg_create_response(NULL, NULL, -1, NULL, NULL);
+    pjsip_dlg_modify_response(NULL, NULL, -1, NULL);
+    pjsip_dlg_send_response(NULL, NULL, NULL);
+    pjsip_dlg_respond(NULL, NULL, -1, NULL, NULL, NULL);
+#endif
+
+#ifdef HAS_PJSIP_INV_SESSION
+    pjsip_inv_usage_init(NULL, NULL);
+    pjsip_inv_create_uac(NULL, NULL, 0, NULL);
+    pjsip_inv_verify_request(NULL, NULL, NULL, NULL, NULL, NULL);
+    pjsip_inv_create_uas(NULL, NULL, NULL, 0, NULL);
+    pjsip_inv_terminate(NULL, 200, PJ_FALSE);
+    pjsip_inv_invite(NULL, NULL);
+    pjsip_inv_initial_answer(NULL, NULL, 200, NULL, NULL, NULL);
+    pjsip_inv_answer(NULL, 200, NULL, NULL, NULL);
+    pjsip_inv_end_session(NULL, 200, NULL, NULL);
+    pjsip_inv_reinvite(NULL, NULL, NULL, NULL);
+    pjsip_inv_update(NULL, NULL, NULL, NULL);
+    pjsip_inv_send_msg(NULL, NULL);
+    pjsip_dlg_get_inv_session(NULL);
+    //pjsip_tsx_get_inv_session(NULL);
+    pjsip_inv_state_name(PJSIP_INV_STATE_NULL);
+#endif
+
+#ifdef HAS_PJSIP_REGC
+    //pjsip_regc_get_module();
+    pjsip_regc_create(NULL, NULL, NULL, NULL);
+    pjsip_regc_destroy(NULL);
+    pjsip_regc_get_info(NULL, NULL);
+    pjsip_regc_get_pool(NULL);
+    pjsip_regc_init(NULL, NULL, NULL, NULL, 0, NULL, 600);
+    pjsip_regc_set_credentials(NULL, 1, NULL);
+    pjsip_regc_set_route_set(NULL, NULL);
+    pjsip_regc_register(NULL, PJ_TRUE, NULL);
+    pjsip_regc_unregister(NULL, NULL);
+    pjsip_regc_update_contact(NULL, 10, NULL);
+    pjsip_regc_update_expires(NULL, 600);
+    pjsip_regc_send(NULL, NULL);
+#endif
+
+#ifdef HAS_PJSIP_EVENT_FRAMEWORK
+    pjsip_evsub_init_module(NULL);
+    pjsip_evsub_instance();
+    pjsip_evsub_register_pkg(NULL, NULL, 30, 10, NULL);
+    pjsip_evsub_create_uac(NULL, NULL, NULL, 10, NULL);
+    pjsip_evsub_create_uas(NULL, NULL, NULL, 10, NULL);
+    pjsip_evsub_terminate(NULL, PJ_FALSE);
+    pjsip_evsub_get_state(NULL);
+    pjsip_evsub_get_state_name(NULL);
+    pjsip_evsub_initiate(NULL, NULL, -1, NULL);
+    pjsip_evsub_accept(NULL, NULL, 200, NULL);
+    pjsip_evsub_notify(NULL, PJSIP_EVSUB_STATE_ACTIVE, NULL, NULL, NULL);
+    pjsip_evsub_current_notify(NULL, NULL);
+    pjsip_evsub_send_request(NULL, NULL);
+    pjsip_tsx_get_evsub(NULL);
+    pjsip_evsub_set_mod_data(NULL, 1, NULL);
+    pjsip_evsub_get_mod_data(NULL, 1);
+#endif
+
+#ifdef HAS_PJSIP_CALL_TRANSFER
+    pjsip_xfer_init_module(NULL);
+    pjsip_xfer_create_uac(NULL, NULL, NULL);
+    pjsip_xfer_create_uas(NULL, NULL, NULL, NULL);
+    pjsip_xfer_initiate(NULL, NULL, NULL);
+    pjsip_xfer_accept(NULL, NULL, 200, NULL);
+    pjsip_xfer_notify(NULL, PJSIP_EVSUB_STATE_ACTIVE, 200, NULL, NULL);
+    pjsip_xfer_current_notify(NULL, NULL);
+    pjsip_xfer_send_request(NULL, NULL);
+#endif
+
+#ifdef HAS_PJSIP_PRESENCE
+    pjsip_pres_init_module(NULL, NULL);
+    pjsip_pres_instance();
+    pjsip_pres_create_uac(NULL, NULL, NULL);
+    pjsip_pres_create_uas(NULL, NULL, NULL, NULL);
+    pjsip_pres_terminate(NULL, PJ_FALSE);
+    pjsip_pres_initiate(NULL, 100, NULL);
+    pjsip_pres_accept(NULL, NULL, 200, NULL);
+    pjsip_pres_notify(NULL, PJSIP_EVSUB_STATE_ACTIVE, NULL, NULL, NULL);
+    pjsip_pres_current_notify(NULL, NULL);
+    pjsip_pres_send_request(NULL, NULL);
+    pjsip_pres_get_status(NULL, NULL);
+    pjsip_pres_set_status(NULL, NULL);
+#endif
+
+#ifdef HAS_PJSIP_IS_COMPOSING
+    pjsip_iscomposing_create_xml(NULL, PJ_TRUE, NULL, NULL, 0);
+    pjsip_iscomposing_create_body(NULL, PJ_TRUE, NULL, NULL, 0);
+    pjsip_iscomposing_parse(NULL, NULL, 0, NULL, NULL, NULL, NULL);
+#endif
+
+#ifdef HAS_PJMEDIA
+    pjmedia_endpt_create(NULL, NULL, 1, NULL);
+    pjmedia_endpt_destroy(NULL);
+    pjmedia_endpt_create_sdp(NULL, NULL, 1, NULL, NULL);
+#endif
+
+#ifdef HAS_PJMEDIA_SND_DEV
+    pjmedia_snd_init(NULL);
+    pjmedia_snd_get_dev_count();
+    pjmedia_snd_get_dev_info(0);
+    pjmedia_snd_open(-1, -1, 8000, 1, 80, 16, NULL, NULL, NULL, NULL);
+    pjmedia_snd_open_rec(-1, 8000, 1, 160, 16, NULL, NULL, NULL);
+    pjmedia_snd_open_player(-1, 8000, 1, 160, 16, NULL, NULL, NULL);
+    pjmedia_snd_stream_start(NULL);
+    pjmedia_snd_stream_stop(NULL);
+    pjmedia_snd_stream_close(NULL);
+    pjmedia_snd_deinit();
+#endif
+
+#ifdef HAS_PJMEDIA_SND_PORT
+    pjmedia_snd_port_create(NULL, -1, -1, 8000, 1, 180, 16, 0, NULL);
+    pjmedia_snd_port_create_rec(NULL, -1, 8000, 1, 160, 16, 0, NULL);
+    pjmedia_snd_port_create_player(NULL, -1, 8000, 1, 160, 16, 0, NULL);
+    pjmedia_snd_port_destroy(NULL);
+    pjmedia_snd_port_get_snd_stream(NULL);
+    pjmedia_snd_port_connect(NULL, NULL);
+    pjmedia_snd_port_get_port(NULL);
+    pjmedia_snd_port_disconnect(NULL);
+#endif
+
+#ifdef HAS_PJMEDIA_RESAMPLE
+    pjmedia_resample_create(NULL, PJ_TRUE, PJ_TRUE, 0, 0, 0, NULL);
+    pjmedia_resample_run(NULL, NULL, NULL);
+#endif
+
+#ifdef HAS_PJMEDIA_SILENCE_DET
+    pjmedia_silence_det_create(NULL, 8000, 80, NULL);
+    pjmedia_silence_det_detect(NULL, NULL, 0, NULL);
+    pjmedia_silence_det_apply(NULL, 0);
+#endif
+
+#ifdef HAS_PJMEDIA_PLC
+    pjmedia_plc_create(NULL, 8000, 80, 0, NULL);
+    pjmedia_plc_save(NULL, NULL);
+    pjmedia_plc_generate(NULL, NULL);
+#endif
+
+#ifdef HAS_PJMEDIA_CONFERENCE
+    pjmedia_conf_create(NULL, 10, 8000, 1, 160, 16, 0, NULL);
+    pjmedia_conf_destroy(NULL);
+    pjmedia_conf_get_master_port(NULL);
+    pjmedia_conf_add_port(NULL, NULL, NULL, NULL, NULL);
+    pjmedia_conf_configure_port(NULL, 1, 0, 0);
+    pjmedia_conf_connect_port(NULL, 0, 0, 0);
+    pjmedia_conf_disconnect_port(NULL, 0, 0);
+    pjmedia_conf_remove_port(NULL, 0);
+    pjmedia_conf_enum_ports(NULL, NULL, NULL);
+    pjmedia_conf_get_port_info(NULL, 0, NULL);
+    pjmedia_conf_get_ports_info(NULL, NULL, NULL);
+    pjmedia_conf_get_signal_level(NULL, 0, NULL, NULL);
+    pjmedia_conf_adjust_rx_level(NULL, 0, 0);
+    pjmedia_conf_adjust_tx_level(NULL, 0, 0);
+#endif
+
+#ifdef HAS_PJMEDIA_MASTER_PORT
+    pjmedia_master_port_create(NULL, NULL, NULL, 0, NULL);
+    pjmedia_master_port_start(NULL);
+    pjmedia_master_port_stop(NULL);
+    pjmedia_master_port_set_uport(NULL, NULL);
+    pjmedia_master_port_get_uport(NULL);
+    pjmedia_master_port_set_dport(NULL, NULL);
+    pjmedia_master_port_get_dport(NULL);
+    pjmedia_master_port_destroy(NULL, PJ_FALSE);
+#endif
+
+#ifdef HAS_PJMEDIA_RTP
+    pjmedia_rtp_session_init(NULL, 0, 0);
+    pjmedia_rtp_encode_rtp(NULL, 0, 0, 0, 0, NULL, NULL);
+    pjmedia_rtp_decode_rtp(NULL, NULL, 0, NULL, NULL, NULL);
+    pjmedia_rtp_session_update(NULL, NULL, NULL);
+#endif
+
+#ifdef HAS_PJMEDIA_RTCP
+    pjmedia_rtcp_init(NULL, NULL, 0, 0, 0);
+    pjmedia_rtcp_get_ntp_time(NULL, NULL);
+    pjmedia_rtcp_fini(NULL);
+    pjmedia_rtcp_rx_rtp(NULL, 0, 0, 0);
+    pjmedia_rtcp_tx_rtp(NULL, 0);
+    pjmedia_rtcp_rx_rtcp(NULL, NULL, 0);
+    pjmedia_rtcp_build_rtcp(NULL, NULL, NULL);
+#endif
+
+#ifdef HAS_PJMEDIA_JBUF
+    pjmedia_jbuf_create(NULL, NULL, 0, 0, 0, NULL);
+    pjmedia_jbuf_set_fixed(NULL, 0);
+    pjmedia_jbuf_set_adaptive(NULL, 0, 0, 0);
+    pjmedia_jbuf_destroy(NULL);
+    pjmedia_jbuf_put_frame(NULL, NULL, 0, 0);
+    pjmedia_jbuf_get_frame(NULL, NULL, NULL);
+#endif
+
+#ifdef HAS_PJMEDIA_STREAM
+    pjmedia_stream_create(NULL, NULL, NULL, NULL, NULL, NULL);
+    pjmedia_stream_destroy(NULL);
+    pjmedia_stream_get_port(NULL, NULL);
+    pjmedia_stream_get_transport(NULL);
+    pjmedia_stream_start(NULL);
+    pjmedia_stream_get_stat(NULL, NULL);
+    pjmedia_stream_pause(NULL, PJMEDIA_DIR_ENCODING);
+    pjmedia_stream_resume(NULL, PJMEDIA_DIR_ENCODING);
+    pjmedia_stream_dial_dtmf(NULL, NULL);
+    pjmedia_stream_check_dtmf(NULL);
+    pjmedia_stream_get_dtmf(NULL, NULL, NULL);
+#endif
+
+#ifdef HAS_PJMEDIA_UDP_TRANSPORT
+    pjmedia_transport_udp_create(NULL, NULL, 0, 0, NULL);
+    pjmedia_transport_udp_close(NULL);
+#endif
+
+#ifdef HAS_PJMEDIA_FILE_PLAYER
+    pjmedia_wav_player_port_create(NULL, NULL, 0, 0, 0, NULL);
+    pjmedia_wav_player_port_set_pos(NULL, 0);
+    pjmedia_wav_player_port_get_pos(NULL);
+    pjmedia_wav_player_set_eof_cb(NULL, NULL, NULL);
+#endif
+
+#ifdef HAS_PJMEDIA_FILE_CAPTURE
+    pjmedia_wav_writer_port_create(NULL, NULL, 8000, 1, 80, 16, 0, 0, NULL);
+    pjmedia_wav_writer_port_get_pos(NULL);
+    pjmedia_wav_writer_port_set_cb(NULL, 0, NULL, NULL);
+#endif
+
+#ifdef HAS_PJMEDIA_MEM_PLAYER
+    pjmedia_mem_player_create(NULL, NULL, 1000, 8000, 1, 80, 16, 0, NULL);
+#endif
+
+#ifdef HAS_PJMEDIA_MEM_CAPTURE
+    pjmedia_mem_capture_create(NULL, NULL, 1000, 8000, 1, 80, 16, 0, NULL);
+#endif
+
+#ifdef HAS_PJMEDIA_G711_CODEC
+    pjmedia_codec_g711_init(NULL);
+    pjmedia_codec_g711_deinit();
+#endif
+
+#ifdef HAS_PJMEDIA_GSM_CODEC
+    pjmedia_codec_gsm_init(NULL);
+    pjmedia_codec_gsm_deinit();
+#endif
+
+#ifdef HAS_PJMEDIA_SPEEX_CODEC
+    pjmedia_codec_speex_init(NULL, 0, 0, 0);
+    pjmedia_codec_speex_deinit();
+#endif
+
+    return 0;
+}
+
+
+int main()
+{
+    return dummy_function();
+}
+
