From 8bb8512eb7e6e0883964c1f58750d80dd90c6e2d Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Sun, 8 Nov 2009 03:35:41 +0000 Subject: Misc (#951): some fixes for pjsystest application: - added the missing build target on the Makefile build system - added alternative search path for the WAV files git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2991 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip-apps/build/Makefile | 17 ++++++++++++++++- pjsip-apps/src/pjsystest/systest.c | 39 +++++++++++++++++++++++++++++--------- pjsip-apps/src/pjsystest/systest.h | 2 ++ 3 files changed, 48 insertions(+), 10 deletions(-) diff --git a/pjsip-apps/build/Makefile b/pjsip-apps/build/Makefile index 56e540fb..5c1684fa 100644 --- a/pjsip-apps/build/Makefile +++ b/pjsip-apps/build/Makefile @@ -39,12 +39,23 @@ export PJSUA_LDFLAGS += $(APP_LDFLAGS) $(APP_LDLIBS) $(LDFLAGS) export PJSUA_EXE:=../bin/pjsua-$(TARGET_NAME)$(HOST_EXE) +############################################################################### +# Defines for building pjsystest +# +export PJSYSTEST_SRCDIR = ../src/pjsystest +export PJSYSTEST_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \ + systest.o main_console.o +export PJSYSTEST_CFLAGS += $(_CFLAGS) +export PJSYSTEST_LDFLAGS += $(APP_LDFLAGS) $(APP_LDLIBS) $(LDFLAGS) +export PJSYSTEST_EXE:=../bin/pjsystest-$(TARGET_NAME)$(HOST_EXE) + + export CC_OUT CC AR RANLIB HOST_MV HOST_RM HOST_RMDIR HOST_MKDIR OBJEXT LD LDOUT ############################################################################### # Main entry # # -TARGETS := pjsua samples +TARGETS := pjsua pjsystest samples .PHONY: $(TARGETS) @@ -60,6 +71,9 @@ distclean: realclean pjsua: $(MAKE) -f $(RULES_MAK) APP=PJSUA app=pjsua $(PJSUA_EXE) +pjsystest: + $(MAKE) -f $(RULES_MAK) APP=PJSYSTEST app=pjsystest $(PJSYSTEST_EXE) + samples: $(MAKE) -f Samples.mak @@ -72,6 +86,7 @@ clean depend realclean: $(MAKE) -f Samples.mak $@ @if test "$@" = "depend"; then \ echo '$(PJSUA_EXE): $(APP_LIB_FILES)' >> .pjsua-$(TARGET_NAME).depend; \ + echo '$(PJSYSTEST_EXE): $(APP_LIB_FILES)' >> .pjsystest-$(TARGET_NAME).depend; \ fi diff --git a/pjsip-apps/src/pjsystest/systest.c b/pjsip-apps/src/pjsystest/systest.c index 81c8d638..678b2c0c 100644 --- a/pjsip-apps/src/pjsystest/systest.c +++ b/pjsip-apps/src/pjsystest/systest.c @@ -114,7 +114,7 @@ static void systest_perror(const char *title, pj_status_t status) errmsg[0] = '\0'; strcpy(themsg, title); - strncat(themsg, errmsg, sizeof(themsg)); + strncat(themsg, errmsg, sizeof(themsg)-1); themsg[sizeof(themsg)-1] = '\0'; gui_msgbox("Error", themsg, WITH_OK); @@ -245,16 +245,32 @@ on_return: return; } +/* Util: create file player, each time trying different paths until we get + * the file. + */ +static pj_status_t create_player(unsigned path_cnt, const char *paths[], + pjsua_player_id *p_id) +{ + pj_str_t name; + pj_status_t status = PJ_ENOTFOUND; + unsigned i; + + for (i=0; i