1
0
Fork 0

Misc bug fixes in mmsbox module

This commit is contained in:
bagyenda 2005-09-12 09:51:31 +00:00
parent 48ed54d110
commit 5d9bd9b3a5
6 changed files with 521 additions and 65 deletions

View File

@ -1,5 +1,5 @@
group = core group = core
log-file = /tmp/log/ours.log log-file = /tmp/log/mbuni.log
access-log = /tmp/log/access.log access-log = /tmp/log/access.log
log-level = 0 log-level = 0
@ -45,7 +45,7 @@ faked-sender = 100
group = mmsc group = mmsc
id = testone id = testone
mmsc-url = http://mmsc mmsc-url = http://localhost:8080/vasp/servlet/messagerouter
incoming-username = user incoming-username = user
incoming-password = pass incoming-password = pass
incoming-port = 10002 incoming-port = 10002
@ -53,9 +53,9 @@ type = soap
group = mms-service group = mms-service
name = me name = me
post-url = http://localhost/~bagyenda/test2.hei file = /tmp/start.smil
catch-all = true catch-all = true
http-post-parameters = fx=true&images.=%i&text.=%t # http-post-parameters = fx=true&images.=%i&text.=%t
accept-x-mbuni-headers = true accept-x-mbuni-headers = true
keyword = test keyword = test

451
mbuni/mmsbox/Makefile.in Normal file
View File

@ -0,0 +1,451 @@
# Makefile.in generated by automake 1.9.3 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
SOURCES = $(mmsbox_SOURCES)
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
bin_PROGRAMS = mmsbox$(EXEEXT)
subdir = mmsbox
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
am__installdirs = "$(DESTDIR)$(bindir)"
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(bin_PROGRAMS)
am_mmsbox_OBJECTS = mmsbox.$(OBJEXT) mmsbox_cfg.$(OBJEXT) \
dlr.$(OBJEXT) bearerbox.$(OBJEXT)
mmsbox_OBJECTS = $(am_mmsbox_OBJECTS)
mmsbox_LDADD = $(LDADD)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(mmsbox_SOURCES)
DIST_SOURCES = $(mmsbox_SOURCES)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
EXE_EXT = @EXE_EXT@
F77 = @F77@
FFLAGS = @FFLAGS@
GW_CONFIG = @GW_CONFIG@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
OPENSSL = @OPENSSL@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
mmsbox_SOURCES = mmsbox.c mmsbox_cfg.c dlr.c bearerbox.c
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu mmsbox/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu mmsbox/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
@list='$(bin_PROGRAMS)'; for p in $$list; do \
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
if test -f $$p \
|| test -f $$p1 \
; then \
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
else :; fi; \
done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; for p in $$list; do \
f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
rm -f "$(DESTDIR)$(bindir)/$$f"; \
done
clean-binPROGRAMS:
@list='$(bin_PROGRAMS)'; for p in $$list; do \
f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
echo " rm -f $$p $$f"; \
rm -f $$p $$f ; \
done
mmsbox$(EXEEXT): $(mmsbox_OBJECTS) $(mmsbox_DEPENDENCIES)
@rm -f mmsbox$(EXEEXT)
$(LINK) $(mmsbox_LDFLAGS) $(mmsbox_OBJECTS) $(mmsbox_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bearerbox.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dlr.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsbox.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsbox_cfg.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS)
installdirs:
for dir in "$(DESTDIR)$(bindir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-libtool distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am:
install-exec-am: install-binPROGRAMS
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-binPROGRAMS uninstall-info-am
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
clean-generic clean-libtool ctags distclean distclean-compile \
distclean-generic distclean-libtool distclean-tags distdir dvi \
dvi-am html html-am info info-am install install-am \
install-binPROGRAMS install-data install-data-am install-exec \
install-exec-am install-info install-info-am install-man \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
pdf pdf-am ps ps-am tags uninstall uninstall-am \
uninstall-binPROGRAMS uninstall-info-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -582,9 +582,12 @@ static Octstr *mm7soap_send(MmscGrp *mmc, Octstr *from, Octstr *to,
} else } else
ret = mm7_soap_header_value(mresp, octstr_imm("MessageID")); ret = mm7_soap_header_value(mresp, octstr_imm("MessageID"));
info(0, "Sent to MMC[%s], code=[%d=>%s]", octstr_get_cstr(mmc->id), info(0, "Sent to MMC[%s], code=[%d=>%s], msgid [%s]", octstr_get_cstr(mmc->id),
tstatus, mms_soap_status_to_cstr(tstatus)); tstatus, mms_soap_status_to_cstr(tstatus), ret ? octstr_get_cstr(ret) : "(none)");
done1:
if (ret)
mms_log2("Sent", from, to, -1, ret, NULL, mmc->id, "MMSBox", NULL, NULL);
done1:
if (mreq) if (mreq)
mm7_soap_destroy(mreq); mm7_soap_destroy(mreq);
@ -656,6 +659,9 @@ static Octstr *mm7eaif_send(MmscGrp *mmc, Octstr *from, Octstr *to,
ret = http_header_value(ph, octstr_imm("X-Nokia-MMSC-Message-Id")); ret = http_header_value(ph, octstr_imm("X-Nokia-MMSC-Message-Id"));
} }
if (ret)
mms_log2("Sent", from, to, -1, ret, NULL, mmc->id, "MMSBox", NULL, NULL);
if (rh) if (rh)
http_destroy_headers(rh); http_destroy_headers(rh);
if (body) if (body)
@ -737,8 +743,10 @@ static MmscGrp *get_handler_mmc(Octstr *id, Octstr *to)
for (i = 0, n = list_len(mmscs); i < n; i++) for (i = 0, n = list_len(mmscs); i < n; i++)
if ((mmc = list_get(mmscs, i)) != NULL && if ((mmc = list_get(mmscs, i)) != NULL &&
does_prefix_match(mmc->allowed_prefix, phonenum) && (mmc->allowed_prefix == NULL ||
!does_prefix_match(mmc->denied_prefix, phonenum)) does_prefix_match(mmc->allowed_prefix, phonenum)) &&
(mmc->denied_prefix == NULL ||
!does_prefix_match(mmc->denied_prefix, phonenum)))
return mmc; return mmc;
if (phonenum) if (phonenum)
@ -797,7 +805,7 @@ static int sendMsg(MmsEnvelope *e)
done: done:
if (res == MMS_SEND_OK) if (res == MMS_SEND_OK)
to->process = 0; to->process = 0;
else if (mmc) else if (res == MMS_SEND_ERROR_FATAL && mmc)
send_report(to->rcpt, "delivery-report", send_report(to->rcpt, "delivery-report",
(e->expiryt != 0 && e->expiryt < tnow) ? (e->expiryt != 0 && e->expiryt < tnow) ?
octstr_imm("Expired") : octstr_imm("Rejected"), octstr_imm("Expired") : octstr_imm("Rejected"),

View File

@ -100,7 +100,11 @@ Octstr *mms_dlr_url_get(Octstr *msgid, char *rtype, Octstr *mmc_id)
Octstr *s = octstr_read_pipe(f); Octstr *s = octstr_read_pipe(f);
fclose(f); fclose(f);
return s; if (s && octstr_len(s) == 0) {
octstr_destroy(s);
return NULL;
} else
return s;
} else if (fd >= 0) } else if (fd >= 0)
close(fd); close(fd);
return NULL; return NULL;

View File

@ -230,8 +230,9 @@ done:
if (pm->value) /* add value part as needed. */ if (pm->value) /* add value part as needed. */
octstr_append(p->body, pm->value); octstr_append(p->body, pm->value);
#if 0
base64_mimeparts(p); base64_mimeparts(p);
#endif
list_append(plist->multiparts, p); list_append(plist->multiparts, p);
octstr_destroy(cd); octstr_destroy(cd);
@ -487,23 +488,20 @@ int main(int argc, char *argv[])
signal(SIGHUP, quit_now); signal(SIGHUP, quit_now);
signal(SIGTERM, quit_now); signal(SIGTERM, quit_now);
signal(SIGPIPE,SIG_IGN); /* Ignore pipe errors. They kill us sometimes for nothing*/ signal(SIGPIPE,SIG_IGN); /* Ignore pipe errors. They kill us sometimes for nothing*/
/* Start sendmms port */
/* Start sendmms port */
if (sendmms_port.port > 0) if (sendmms_port.port > 0)
sthread = gwthread_create((gwthread_func_t *)sendmms_func, NULL); sthread = gwthread_create((gwthread_func_t *)sendmms_func, NULL);
#if 0 #if 1
/* Start out-going queue thread. */ /* Start out-going queue thread. */
qthread = gwthread_create((gwthread_func_t *)mmsbox_outgoing_queue_runner, &rstop); qthread = gwthread_create((gwthread_func_t *)mmsbox_outgoing_queue_runner, &rstop);
#endif
#if 1 #endif
mms_queue_run(octstr_get_cstr(incoming_qdir), mms_queue_run(octstr_get_cstr(incoming_qdir),
mmsbox_service_dispatch, mmsbox_service_dispatch,
queue_interval, maxthreads, &rstop); queue_interval, maxthreads, &rstop);
#endif
/* Wait for the sender thread, then quit. */ /* Wait for the sender thread, then quit. */
gwthread_join(qthread); /* Wait for it to die... */ gwthread_join(qthread); /* Wait for it to die... */
@ -820,14 +818,14 @@ static int make_and_queue_msg(Octstr *data, Octstr *ctype, List *reply_headers,
Octstr *dlr_url = NULL, *rr_url = NULL, *mmc = NULL; Octstr *dlr_url = NULL, *rr_url = NULL, *mmc = NULL;
MmsMsg *m = NULL; MmsMsg *m = NULL;
MIMEEntity *me = mime_entity_create(); MIMEEntity *me = mime_entity_create();
time_t expiryt = 0; time_t expiryt = 0;
Octstr *x; Octstr *x;
List *xto = list_create();; List *xto = list_create();;
int i, n, res = -1; int i, n, res = -1;
gw_assert(svc_name); gw_assert(svc_name);
/* Get the from address. */ /* Get the from address. */
if (faked_sender) if (faked_sender)
from = octstr_duplicate(faked_sender); from = octstr_duplicate(faked_sender);
@ -841,7 +839,10 @@ static int make_and_queue_msg(Octstr *data, Octstr *ctype, List *reply_headers,
from = octstr_duplicate(r->rcpt); from = octstr_duplicate(r->rcpt);
else else
from = octstr_imm("anon@anon"); from = octstr_imm("anon@anon");
} }
if (from)
_mms_fixup_address(from);
/* start with the easy one... */ /* start with the easy one... */
if (octstr_case_compare(ctype, octstr_imm("application/vnd.wap.mms-message")) == 0) if (octstr_case_compare(ctype, octstr_imm("application/vnd.wap.mms-message")) == 0)
@ -910,6 +911,9 @@ static int make_and_queue_msg(Octstr *data, Octstr *ctype, List *reply_headers,
Octstr *h = NULL, *v = NULL; Octstr *h = NULL, *v = NULL;
http_header_get(l, i, &h, &v); http_header_get(l, i, &h, &v);
/* Fix the address. */
_mms_fixup_address(v);
list_append(xto, v); list_append(xto, v);
octstr_destroy(h); octstr_destroy(h);
} }
@ -999,6 +1003,9 @@ static SendMmsUser *auth_user(Octstr *user, Octstr *pass)
{ {
int i, n; int i, n;
SendMmsUser *u = NULL; SendMmsUser *u = NULL;
if (!user || !pass)
return NULL;
for (i = 0, n = list_len(sendmms_users); i < n; i++) for (i = 0, n = list_len(sendmms_users); i < n; i++)
if ((u = list_get(sendmms_users, i)) != NULL && if ((u = list_get(sendmms_users, i)) != NULL &&
octstr_compare(u->user, user) == 0 && octstr_compare(u->user, user) == 0 &&
@ -1035,20 +1042,15 @@ static void sendmms_func(void *unused)
Octstr *charset = http_cgi_variable(cgivars, "charset"); Octstr *charset = http_cgi_variable(cgivars, "charset");
ctype = octstr_format("text/plain"); ctype = octstr_format("text/plain");
if (charset) { if (charset)
octstr_format_append(ctype, "; charset=%S", charset); octstr_format_append(ctype, "; charset=%S", charset);
octstr_destroy(charset);
}
} else if ((data = http_cgi_variable(cgivars, "smil")) != NULL) /* smil. */ } else if ((data = http_cgi_variable(cgivars, "smil")) != NULL) /* smil. */
ctype = octstr_imm("application/smil"); ctype = octstr_imm("application/smil");
else else
rb = octstr_imm("Missing content"); rb = octstr_imm("Missing content");
if ((from = http_cgi_variable(cgivars, "from")) == NULL && !u->faked_sender) dlr_url = http_cgi_variable(cgivars, "dlr-url");
rb = octstr_imm("Missing Sender address"); rr_url = http_cgi_variable(cgivars, "rr-url");
dlr_url = http_cgi_variable(cgivars, "dlr_url");
rr_url = http_cgi_variable(cgivars, "rr_url");
mmc = http_cgi_variable(cgivars, "mmsc"); mmc = http_cgi_variable(cgivars, "mmsc");
subject = http_cgi_variable(cgivars, "subject"); subject = http_cgi_variable(cgivars, "subject");
@ -1061,61 +1063,53 @@ static void sendmms_func(void *unused)
if (ctype) if (ctype)
http_header_add(rh, "Content-Type", octstr_get_cstr(ctype)); http_header_add(rh, "Content-Type", octstr_get_cstr(ctype));
if (from) { if ((from = http_cgi_variable(cgivars, "from")) != NULL) {
from = octstr_duplicate(from);
_mms_fixup_address(from);
http_header_add(rh, "X-Mbuni-From", octstr_get_cstr(from)); http_header_add(rh, "X-Mbuni-From", octstr_get_cstr(from));
octstr_destroy(from); octstr_destroy(from);
} } else if (!u->faked_sender)
rb = octstr_imm("Missing Sender address");
if (lto) { if (lto) {
for (i = 0, n = list_len(lto); i < n; i++) { for (i = 0, n = list_len(lto); i < n; i++) {
Octstr *x = list_get(lto, i); Octstr *x = list_get(lto, i);
_mms_fixup_address(x);
http_header_add(rh, "X-Mbuni-To", octstr_get_cstr(x)); http_header_add(rh, "X-Mbuni-To", octstr_get_cstr(x));
} }
list_destroy(lto, (list_item_destructor_t *)octstr_destroy); list_destroy(lto, (list_item_destructor_t *)octstr_destroy);
} }
if (dlr_url) { if (dlr_url)
http_header_add(rh, "X-Mbuni-DLR-Url", octstr_get_cstr(dlr_url)); http_header_add(rh, "X-Mbuni-DLR-Url", octstr_get_cstr(dlr_url));
octstr_destroy(dlr_url);
}
if (rr_url) { if (rr_url)
http_header_add(rh, "X-Mbuni-RR-Url", octstr_get_cstr(rr_url)); http_header_add(rh, "X-Mbuni-RR-Url", octstr_get_cstr(rr_url));
octstr_destroy(rr_url);
}
if (mmc) { if (mmc)
http_header_add(rh, "X-Mbuni-MMSC", octstr_get_cstr(mmc)); http_header_add(rh, "X-Mbuni-MMSC", octstr_get_cstr(mmc));
octstr_destroy(mmc);
}
if (subject) { if (subject)
http_header_add(rh, "X-Mbuni-Subject", octstr_get_cstr(subject)); http_header_add(rh, "X-Mbuni-Subject", octstr_get_cstr(subject));
octstr_destroy(subject);
}
/* Requests to make_and_queue below can block, but for now we don't care. */ /* Requests to make_and_queue below can block, but for now we don't care. */
if (ctype && data) { if (ctype && data && !rb) { /* only send if no error. */
res = make_and_queue_msg(data, ctype, rh, base_url, URL_TYPE, NULL, res = make_and_queue_msg(data, ctype, rh, base_url, URL_TYPE, NULL,
octstr_imm("sendmms-user"), u->faked_sender, octstr_imm("sendmms-user"), u->faked_sender,
1, &err); 1, &err);
http_destroy_headers(rh); http_destroy_headers(rh);
if (res < 0) if (res < 0)
rb = octstr_imm("Error in message conversion"); rb = octstr_imm("Error in message conversion");
} else if (!rb) } else if (!rb)
rb = octstr_imm("Failed to send message"); rb = octstr_imm("Failed to send message");
http_send_reply(client, HTTP_BAD_REQUEST, hh, rb); http_send_reply(client, HTTP_BAD_REQUEST, hh,
rb ? rb : octstr_imm("Sent"));
info(0, "MMSBox.mmssend: u=%s, %s", info(0, "MMSBox.mmssend: u=%s, %s",
u ? octstr_get_cstr(u->user) : "none", u ? octstr_get_cstr(u->user) : "none",
(res == 0) ? "Sent" : "Not Sent"); (res == 0) ? "Sent" : "Not Sent");
octstr_destroy(base_url); octstr_destroy(base_url);
if (data)
octstr_destroy(data);
if (ctype) if (ctype)
octstr_destroy(ctype); octstr_destroy(ctype);
} else { } else {
@ -1132,16 +1126,15 @@ static void sendmms_func(void *unused)
octstr_destroy(err); octstr_destroy(err);
} }
/* Free the ip and other stuff here. */ /* Free the ip and other stuff here. */
if (username)
octstr_destroy(username);
if (password)
octstr_destroy(password);
octstr_destroy(ip); octstr_destroy(ip);
if (body) octstr_destroy(body); if (body) octstr_destroy(body);
octstr_destroy(url); if (url)
http_destroy_cgiargs(cgivars); octstr_destroy(url);
http_destroy_headers(h); if (cgivars)
http_destroy_cgiargs(cgivars);
if (h)
http_destroy_headers(h);
} }
} }

View File

@ -144,8 +144,8 @@ int mms_load_mmsbox_settings(Cfg *cfg, gwthread_func_t *mmsc_handler_func)
m->id = _mms_cfg_getx(x, octstr_imm("id")); m->id = _mms_cfg_getx(x, octstr_imm("id"));
m->mmsc_url = _mms_cfg_getx(x, octstr_imm("mmsc-url")); m->mmsc_url = _mms_cfg_getx(x, octstr_imm("mmsc-url"));
m->allowed_prefix = _mms_cfg_getx(x, octstr_imm("allowed-prefix")); m->allowed_prefix = cfg_get(x, octstr_imm("allowed-prefix"));
m->denied_prefix = _mms_cfg_getx(x, octstr_imm("denied-prefix")); m->denied_prefix = cfg_get(x, octstr_imm("denied-prefix"));
m->incoming.allow_ip = cfg_get(x, octstr_imm("allow-ip")); m->incoming.allow_ip = cfg_get(x, octstr_imm("allow-ip"));
m->incoming.deny_ip = cfg_get(x, octstr_imm("deny-ip")); m->incoming.deny_ip = cfg_get(x, octstr_imm("deny-ip"));