Compare commits
516 Commits
Author | SHA1 | Date |
---|---|---|
bagyenda | 73955b34cf | |
bagyenda | cb989364b8 | |
bagyenda | be8dc0ee28 | |
bagyenda | 5208b4311f | |
bagyenda | 628fc0c744 | |
bagyenda | 58ebfcc0fd | |
bagyenda | 1eb8f06cb6 | |
bagyenda | 3cd18abe87 | |
bagyenda | 61ff6817fa | |
bagyenda | 5cd58210fe | |
bagyenda | 0d2974bd27 | |
bagyenda | f67330f9e0 | |
bagyenda | e7b5faee07 | |
bagyenda | 11c50d6217 | |
bagyenda | 044e3ebbe6 | |
bagyenda | 265c827fe1 | |
bagyenda | dc3ad6068d | |
bagyenda | d155bd57d4 | |
bagyenda | 8efe4605bc | |
bagyenda | 1e14a17e39 | |
bagyenda | 6a34ce5ca2 | |
bagyenda | 9a7952d200 | |
bagyenda | fae80063f8 | |
bagyenda | fd2ff89411 | |
bagyenda | 919aef48d5 | |
bagyenda | 442846f4c0 | |
bagyenda | 7c1654c5dd | |
bagyenda | fedce613cf | |
bagyenda | 67d8049f1b | |
bagyenda | eba4e9e09d | |
bagyenda | cdabed7443 | |
bagyenda | 18dd46568f | |
bagyenda | e64d8d322d | |
bagyenda | 17a2cbfc90 | |
bagyenda | 2891e9bb27 | |
matlads | f65646e1b8 | |
matlads | 6a459a63f6 | |
bagyenda | 7c777cd10f | |
bagyenda | e104515d9b | |
bagyenda | 6cb349ec90 | |
bagyenda | ea9506fde2 | |
bagyenda | 821f4f32bf | |
matlads | bcfb4ea87b | |
bagyenda | 83d5d370b3 | |
bagyenda | 60be3311ca | |
bagyenda | fd2ed9038f | |
bagyenda | 20ae441d94 | |
bagyenda | bf5c6e2c6c | |
bagyenda | 92563ae701 | |
bagyenda | f23dfb66b9 | |
bagyenda | 6e23d68a16 | |
bagyenda | 8c51f383d7 | |
bagyenda | 3223e679cb | |
bagyenda | 9693113f21 | |
bagyenda | e6de3e5b31 | |
bagyenda | 79cd5a1c7b | |
bagyenda | ab8828922d | |
bagyenda | 4f185a7032 | |
bagyenda | 760b8d734e | |
bagyenda | 09e891bcc9 | |
bagyenda | 48bc07ef14 | |
bagyenda | 41fba4873d | |
bagyenda | 8ba2b9b126 | |
bagyenda | 7206e8b20d | |
bagyenda | 00bdd513fe | |
bagyenda | 18cd80e632 | |
bagyenda | adc01f651f | |
bagyenda | 8e72d4ca3b | |
bagyenda | 83a824759b | |
bagyenda | a7be9632e7 | |
bagyenda | e499aa8131 | |
bagyenda | 0ee33f2da1 | |
bagyenda | 3d663b90a9 | |
bagyenda | 6b35184a7e | |
bagyenda | 1db281efec | |
bagyenda | 5fcfe061af | |
bagyenda | e35d2ffa26 | |
bagyenda | 790e15eb20 | |
bagyenda | 53b7e978e4 | |
bagyenda | b2ba6dfdb5 | |
bagyenda | 828a78bcf3 | |
bagyenda | 1e761682a5 | |
bagyenda | a15d86fa74 | |
bagyenda | 5000597c67 | |
bagyenda | abb7b6d2d1 | |
bagyenda | a721364402 | |
bagyenda | cda686d77a | |
bagyenda | d27f4c0f8a | |
bagyenda | 462972c4a3 | |
bagyenda | 9a0785830c | |
bagyenda | c2887c0857 | |
bagyenda | b00dcbe383 | |
bagyenda | af393b2afe | |
bagyenda | c96438a274 | |
bagyenda | d98f7906b6 | |
bagyenda | c2c0ce7fe3 | |
bagyenda | 25d8d878c7 | |
bagyenda | 2aed655a12 | |
bagyenda | e402334756 | |
bagyenda | 7d69e70dc3 | |
bagyenda | d62e733178 | |
bagyenda | 037183a65a | |
bagyenda | 76cb3e6f5b | |
bagyenda | 591c61f094 | |
bagyenda | 967898a995 | |
bagyenda | 2544b6d718 | |
bagyenda | 0e5dad042b | |
bagyenda | 28231a7d7e | |
bagyenda | ec32ce868e | |
bagyenda | b8ea7dac27 | |
bagyenda | cb2e860093 | |
bagyenda | 5247c97695 | |
bagyenda | 1a1b8ba5e5 | |
bagyenda | e60ed679b4 | |
bagyenda | 8b05add577 | |
bagyenda | be5d0a6bc9 | |
bagyenda | e090e6795e | |
bagyenda | d93be7fce5 | |
bagyenda | f10b0e4e41 | |
bagyenda | b064ee14f0 | |
bagyenda | b579472a52 | |
bagyenda | 3db2d7db6c | |
bagyenda | 8aa1a1a0be | |
bagyenda | bc1a24200e | |
bagyenda | 6c5759f1e9 | |
bagyenda | fcebda1812 | |
bagyenda | e370a86566 | |
bagyenda | 39f5cccee4 | |
bagyenda | 00198c858a | |
bagyenda | c26a3d3e24 | |
bagyenda | 5cd0188e94 | |
bagyenda | bb16c3299a | |
bagyenda | 9490de2bc8 | |
bagyenda | 09bb2abe14 | |
bagyenda | 4a2ad20874 | |
bagyenda | 445723dc0f | |
bagyenda | a1fa945c5f | |
bagyenda | c0e677a7a5 | |
bagyenda | 3e3b9b2b2b | |
bagyenda | 0dfdfdc305 | |
bagyenda | b480d170a5 | |
bagyenda | 069455ec3d | |
bagyenda | 04037fbb64 | |
bagyenda | 335682874b | |
bagyenda | b82e3f2723 | |
bagyenda | 671a62699d | |
bagyenda | 5afec26e5d | |
bagyenda | f55d24567f | |
bagyenda | 30973cf9e5 | |
bagyenda | 02a5ede686 | |
bagyenda | 6263d512b8 | |
bagyenda | 1a3aa4c9aa | |
bagyenda | 30d9e2c0d4 | |
bagyenda | 526ec741fb | |
bagyenda | 2236d0e9e5 | |
bagyenda | b7bd482849 | |
bagyenda | c6591fc15b | |
bagyenda | bf9218da78 | |
bagyenda | fb68ed198e | |
bagyenda | 9b99b14955 | |
bagyenda | 2ff5dabb9e | |
bagyenda | b477dd843c | |
bagyenda | 3b1371f55f | |
bagyenda | f7bc48d88d | |
bagyenda | 85babd8de0 | |
bagyenda | 3f4df1cdc7 | |
bagyenda | 80682bbcb3 | |
bagyenda | 49ae1c2a69 | |
bagyenda | 13e9649091 | |
bagyenda | d63cc82ea8 | |
bagyenda | f654396ea5 | |
bagyenda | 7c7de0e22d | |
bagyenda | 06e4a94eb0 | |
bagyenda | 590444539c | |
bagyenda | b99cbd96fa | |
bagyenda | fe4c53f2be | |
bagyenda | 0cb6626339 | |
bagyenda | f7fa35d3ea | |
bagyenda | 4cdb712d76 | |
bagyenda | 5b5fa1fd7b | |
bagyenda | 6445ca1403 | |
bagyenda | ce84ac2e7b | |
bagyenda | 505e998657 | |
bagyenda | 47172dbb5f | |
bagyenda | 173be8807a | |
bagyenda | 769690693d | |
bagyenda | 55f9ee3766 | |
bagyenda | 82d5a85805 | |
bagyenda | 371438118b | |
bagyenda | 23df285f45 | |
bagyenda | dc10393106 | |
bagyenda | 4658ce6b10 | |
bagyenda | 6eb3e6629c | |
bagyenda | 6b472bf22b | |
bagyenda | 4eb54ddffa | |
bagyenda | 483c6d658d | |
bagyenda | 7264d4f88d | |
bagyenda | 9bf11ffd57 | |
bagyenda | d9be1198a5 | |
bagyenda | fbbec2877b | |
bagyenda | e1c18c07a4 | |
bagyenda | b31790def4 | |
bagyenda | 0fb93b3c90 | |
bagyenda | f69e38cd85 | |
bagyenda | 72ea4e45f0 | |
bagyenda | 232351d5ce | |
bagyenda | cf2f4e7d8e | |
bagyenda | e78739a3a1 | |
bagyenda | ee5c86878d | |
bagyenda | 2179aa0b3c | |
bagyenda | be411e731b | |
bagyenda | 59e844d16c | |
bagyenda | 3ebb5316c1 | |
bagyenda | cd52c8f1ee | |
bagyenda | 9748e88621 | |
bagyenda | fcad678f3c | |
bagyenda | 5d01704548 | |
bagyenda | a49d02b4e8 | |
bagyenda | 15888c94ca | |
bagyenda | b36fe80262 | |
bagyenda | 421c6f6856 | |
bagyenda | d06fa69106 | |
bagyenda | 6cad727c78 | |
bagyenda | d0714028b5 | |
bagyenda | cade2f51a9 | |
bagyenda | 2bee4e49db | |
bagyenda | c58cfafec5 | |
bagyenda | a69feb2eb9 | |
bagyenda | d05d46cc9f | |
bagyenda | 18dcdf7052 | |
bagyenda | 650c1c8318 | |
bagyenda | fc552034da | |
bagyenda | 7137d5bd5d | |
bagyenda | 0cb610d5bd | |
bagyenda | 15f61ba8d5 | |
bagyenda | a87514cc02 | |
bagyenda | 281b7c220b | |
bagyenda | c845a51c10 | |
bagyenda | e76995ab27 | |
bagyenda | 970badf660 | |
bagyenda | 195b7888b9 | |
bagyenda | 30ed2d83f6 | |
bagyenda | d2c8efd1aa | |
bagyenda | 5a5e6603ef | |
bagyenda | fcdd5c442b | |
bagyenda | 3059138928 | |
bagyenda | e1f24fdeee | |
bagyenda | 4308cb1446 | |
bagyenda | 9640be11c8 | |
bagyenda | e48246fa63 | |
bagyenda | 45c6276727 | |
bagyenda | 61d76e1a14 | |
bagyenda | 4208985069 | |
bagyenda | 4ebf96552e | |
bagyenda | 3789d199a7 | |
bagyenda | 89a6e5007d | |
bagyenda | aea228ecc2 | |
bagyenda | b3f9f30919 | |
bagyenda | 21f1188c4e | |
bagyenda | 382c48bb69 | |
bagyenda | 4c5a8389c0 | |
bagyenda | 8438ca779d | |
bagyenda | 9cbf72f5f1 | |
bagyenda | 8124439d44 | |
bagyenda | d7d97c695d | |
bagyenda | 96811a10b7 | |
bagyenda | 67cdf0f387 | |
bagyenda | d973e24c53 | |
bagyenda | 99318916ea | |
bagyenda | f7da8933d8 | |
bagyenda | b3da1b4ead | |
bagyenda | 27d9e7f6ec | |
bagyenda | 8ef3978cab | |
bagyenda | 7c31b97523 | |
bagyenda | 26b0508487 | |
bagyenda | 3d59903562 | |
bagyenda | cc3a502516 | |
bagyenda | e6a0b2d72c | |
bagyenda | 5e84205190 | |
bagyenda | eef103ae02 | |
bagyenda | 7cb159ae13 | |
bagyenda | 3a83c61050 | |
bagyenda | 83312fbf45 | |
bagyenda | f0a3e8a350 | |
bagyenda | 7eec5761a1 | |
bagyenda | 098ffba5cf | |
bagyenda | 824581609c | |
bagyenda | eef6e9b967 | |
bagyenda | 824b57f35f | |
bagyenda | 71c19b6b30 | |
bagyenda | 26adfda0db | |
bagyenda | 81adc79a47 | |
bagyenda | 64722b0299 | |
bagyenda | a2c99daca6 | |
bagyenda | 7430986871 | |
bagyenda | 5271c532c8 | |
bagyenda | e84a8c67ab | |
bagyenda | 561dafdca7 | |
bagyenda | b5aa2c8e63 | |
bagyenda | e3aabcccfe | |
bagyenda | c3a4ddcf67 | |
bagyenda | e59b517fb8 | |
bagyenda | 65c185e3eb | |
bagyenda | c49a4bbe57 | |
bagyenda | 27547cb49b | |
bagyenda | b1df15b16d | |
bagyenda | 3c990ad7cf | |
bagyenda | a22898306a | |
bagyenda | 89c9b8eddb | |
bagyenda | d6292f03d9 | |
bagyenda | a8c3ddccf7 | |
bagyenda | eb1a689a8a | |
bagyenda | 5af2e53f30 | |
bagyenda | 825102fc0a | |
bagyenda | 7a0d166d21 | |
bagyenda | 2255fe303b | |
bagyenda | 222cf4487a | |
bagyenda | fd2d1fbc79 | |
bagyenda | 869a6d3eed | |
bagyenda | bc7049dbd6 | |
bagyenda | a21f21d5d6 | |
bagyenda | de6ded80a9 | |
bagyenda | 14e44ea421 | |
bagyenda | 1b9c2dc2ad | |
bagyenda | c057093761 | |
bagyenda | 7ad9569dce | |
bagyenda | 6ca83011c9 | |
bagyenda | 1075745c33 | |
bagyenda | 99ad888a54 | |
bagyenda | 5eec86d69e | |
bagyenda | 65a82a7175 | |
bagyenda | 00c7e34515 | |
bagyenda | 8ece099c13 | |
bagyenda | f34daaa335 | |
bagyenda | 6e363677a0 | |
bagyenda | c6b75666ab | |
bagyenda | 0b22c99c69 | |
bagyenda | 8e6ecf8a5c | |
bagyenda | ea98a5da35 | |
bagyenda | 89fbf157c8 | |
bagyenda | 63b90a7845 | |
bagyenda | f2d45f4164 | |
bagyenda | c3feca09ff | |
bagyenda | 26cf73882b | |
bagyenda | caa71ca8ca | |
bagyenda | c73765c7a9 | |
bagyenda | 64c2ffe8ed | |
bagyenda | 356905c4b6 | |
bagyenda | 491a6173a8 | |
bagyenda | 3e010fccd4 | |
bagyenda | e652be1d62 | |
bagyenda | 96708be15c | |
bagyenda | c42ddb8aa5 | |
bagyenda | bbeb0c91e3 | |
bagyenda | 88de7ef670 | |
bagyenda | 79b19bac64 | |
bagyenda | 7fd8045dd4 | |
bagyenda | 4d625f2375 | |
bagyenda | e656ec81a7 | |
bagyenda | 1e21db8592 | |
bagyenda | b2f178153c | |
bagyenda | d48ac96cd7 | |
bagyenda | f8c0ef9a7b | |
bagyenda | 9e59d79de5 | |
bagyenda | 1bd576132d | |
bagyenda | cfa26d3c75 | |
bagyenda | feeb8ab13c | |
bagyenda | 0ccc7938d0 | |
bagyenda | fcebfd2ea1 | |
bagyenda | 3e6f552a5f | |
bagyenda | 11574bb88e | |
bagyenda | 0f38817669 | |
bagyenda | 50fd9b03aa | |
bagyenda | bc4ef69c40 | |
bagyenda | 142c9f8342 | |
bagyenda | ea8bce278a | |
bagyenda | ca05acedc9 | |
bagyenda | e92035851f | |
bagyenda | aa1708af9a | |
bagyenda | ddcd63dfa2 | |
bagyenda | ef53251db3 | |
bagyenda | dfc9f52994 | |
menulis | 53c8b46e57 | |
bagyenda | 83d1c98991 | |
bagyenda | dde519afc2 | |
bagyenda | 2a25a4cd3e | |
bagyenda | fa8e2b7f02 | |
bagyenda | 6972fad0fe | |
bagyenda | e1a4f3d031 | |
bagyenda | 7644c1d064 | |
bagyenda | cc00c947ec | |
bagyenda | f5834f50bb | |
bagyenda | 47904ecd65 | |
bagyenda | e13422bab4 | |
bagyenda | cba8424eef | |
bagyenda | 35e33941c7 | |
bagyenda | 3d88101a5f | |
bagyenda | 7efbee12b7 | |
bagyenda | 05d1910723 | |
bagyenda | d89834bda1 | |
bagyenda | 2188c0c6c8 | |
bagyenda | 0581db65b4 | |
bagyenda | 5c1107594d | |
bagyenda | 0b9802fce3 | |
bagyenda | a27ae1b7b2 | |
bagyenda | fa4bac1491 | |
bagyenda | bbd268ecce | |
bagyenda | 88a99db39d | |
bagyenda | 183b162be8 | |
bagyenda | 26b1c37a1d | |
bagyenda | 788ba4c2fe | |
bagyenda | 0350bbcb65 | |
bagyenda | 6098cf5029 | |
bagyenda | 9b672030a1 | |
bagyenda | 068ebd9a9c | |
bagyenda | 4a6237fda7 | |
bagyenda | 9c7597812b | |
bagyenda | c8ed17f864 | |
bagyenda | 22fd2f9bd3 | |
bagyenda | 2aa2319a6f | |
bagyenda | 07119b61f9 | |
bagyenda | b4386c0bc3 | |
bagyenda | f101c756a2 | |
bagyenda | 44a68b5e79 | |
bagyenda | fdd73ba3b6 | |
bagyenda | 88d7ff9a84 | |
bagyenda | 593cf0436b | |
bagyenda | c5c0cab256 | |
bagyenda | 189e6e8b73 | |
bagyenda | dd86106119 | |
bagyenda | 21546794d8 | |
bagyenda | 5d9bd9b3a5 | |
bagyenda | 48ed54d110 | |
bagyenda | 4ceeeb8128 | |
bagyenda | fc0524057e | |
bagyenda | 7dd3546ab3 | |
bagyenda | ebe98efd32 | |
bagyenda | eafec96bd9 | |
bagyenda | 5409f34c79 | |
bagyenda | be06cd60ce | |
bagyenda | 472b5fb4b1 | |
bagyenda | c93a5ca1bb | |
bagyenda | f6c90d2c9a | |
bagyenda | 17d3517eec | |
bagyenda | f3fff0f45e | |
bagyenda | 6f7e3ea12d | |
bagyenda | df3efbd19c | |
bagyenda | 683948a174 | |
bagyenda | 025c3f507b | |
matlads | d61af3945f | |
matlads | 7af14eec04 | |
bagyenda | 19873786c1 | |
bagyenda | 422c72137c | |
bagyenda | de883c68b2 | |
bagyenda | 89f4fa061f | |
bagyenda | d921d00ae8 | |
bagyenda | a52b301e16 | |
bagyenda | 7cd09e14cb | |
bagyenda | e3b7753a27 | |
bagyenda | df8bbcb660 | |
bagyenda | 38e36613c9 | |
bagyenda | b45bd9059e | |
bagyenda | 6c1cc4d59f | |
bagyenda | e10f3caf93 | |
bagyenda | 0534bbcd63 | |
bagyenda | 4991ad3e24 | |
bagyenda | fd898205b3 | |
bagyenda | 720f81d04f | |
bagyenda | bcb1f8fe1c | |
bagyenda | fdda50a286 | |
shawarma | 1ccd3e7b32 | |
bagyenda | ee793a55f4 | |
bagyenda | 86ff85feea | |
bagyenda | 528d797953 | |
bagyenda | 0eddc08f46 | |
shawarma | f992bfd86b | |
bagyenda | 0885a7965b | |
bagyenda | d5d9b76af2 | |
bagyenda | 59ad03b55a | |
bagyenda | 2b2999a31e | |
bagyenda | 224866fbff | |
bagyenda | 857b08c16b | |
bagyenda | 734ef4946d | |
bagyenda | bbf523d144 | |
bagyenda | 7497919605 | |
bagyenda | 7967dcc45f | |
bagyenda | 38a4b2197c | |
bagyenda | 17fc190e29 | |
bagyenda | 3a5ac7c59e | |
bagyenda | 1b08584a1a | |
bagyenda | 819a40ca9c | |
bagyenda | 08a7638b0b | |
bagyenda | ccaab590bc | |
bagyenda | da666bfcd3 | |
bagyenda | b3a218b42f | |
bagyenda | 6c5d99c0e2 | |
bagyenda | 08234f3191 | |
bagyenda | b75f523f6d | |
bagyenda | 71b17df47f | |
bagyenda | 397fa48525 | |
shawarma | 941c83734a | |
bagyenda | ea76865a4f | |
bagyenda | 8c3d30a831 | |
bagyenda | 1be50b7561 | |
bagyenda | e30df1e560 | |
bagyenda | f9a34a1aea | |
shawarma | eacef28de6 | |
bagyenda | d59559f0fc | |
bagyenda | 148892ef80 | |
bagyenda | 05a5863013 | |
shawarma | 9112b7f312 | |
shawarma | a695ea217f | |
shawarma | d51dc0d1fb | |
bagyenda | c4e38261f1 | |
bagyenda | 7fbbfdfcbb | |
shawarma | cda8811921 |
|
@ -0,0 +1 @@
|
|||
anonymous
|
|
@ -0,0 +1,25 @@
|
|||
.*.sw[po]
|
||||
*~
|
||||
*.diff
|
||||
*.patch
|
||||
*.lo
|
||||
*.o
|
||||
.gdb_history
|
||||
mpeg2dec-*.tar.gz
|
||||
Makefile
|
||||
Makefile.in
|
||||
configure
|
||||
.deps
|
||||
.libs
|
||||
aclocal.m4
|
||||
config.log
|
||||
config.cache
|
||||
libtool
|
||||
config.status
|
||||
gmon.out
|
||||
autom4te.cache
|
||||
mbuni-config.h
|
||||
mbuni-config.h.in
|
||||
.cproject
|
||||
.project
|
||||
stamp-h1
|
340
mbuni/COPYING
340
mbuni/COPYING
|
@ -0,0 +1,340 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
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
|
||||
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
1002
mbuni/ChangeLog
1002
mbuni/ChangeLog
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,341 @@
|
|||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) 19yy <name of author>
|
||||
|
||||
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) 19yy name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
235
mbuni/INSTALL
235
mbuni/INSTALL
|
@ -1 +1,234 @@
|
|||
See www.mbuni.org/docs.shtml
|
||||
Installation Instructions
|
||||
*************************
|
||||
|
||||
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
|
||||
2006 Free Software Foundation, Inc.
|
||||
|
||||
This file is free documentation; the Free Software Foundation gives
|
||||
unlimited permission to copy, distribute and modify it.
|
||||
|
||||
Basic Installation
|
||||
==================
|
||||
|
||||
Briefly, the shell commands `./configure; make; make install' should
|
||||
configure, build, and install this package. The following
|
||||
more-detailed instructions are generic; see the `README' file for
|
||||
instructions specific to this package.
|
||||
|
||||
The `configure' shell script attempts to guess correct values for
|
||||
various system-dependent variables used during compilation. It uses
|
||||
those values to create a `Makefile' in each directory of the package.
|
||||
It may also create one or more `.h' files containing system-dependent
|
||||
definitions. Finally, it creates a shell script `config.status' that
|
||||
you can run in the future to recreate the current configuration, and a
|
||||
file `config.log' containing compiler output (useful mainly for
|
||||
debugging `configure').
|
||||
|
||||
It can also use an optional file (typically called `config.cache'
|
||||
and enabled with `--cache-file=config.cache' or simply `-C') that saves
|
||||
the results of its tests to speed up reconfiguring. Caching is
|
||||
disabled by default to prevent problems with accidental use of stale
|
||||
cache files.
|
||||
|
||||
If you need to do unusual things to compile the package, please try
|
||||
to figure out how `configure' could check whether to do them, and mail
|
||||
diffs or instructions to the address given in the `README' so they can
|
||||
be considered for the next release. If you are using the cache, and at
|
||||
some point `config.cache' contains results you don't want to keep, you
|
||||
may remove or edit it.
|
||||
|
||||
The file `configure.ac' (or `configure.in') is used to create
|
||||
`configure' by a program called `autoconf'. You need `configure.ac' if
|
||||
you want to change it or regenerate `configure' using a newer version
|
||||
of `autoconf'.
|
||||
|
||||
The simplest way to compile this package is:
|
||||
|
||||
1. `cd' to the directory containing the package's source code and type
|
||||
`./configure' to configure the package for your system.
|
||||
|
||||
Running `configure' might take a while. While running, it prints
|
||||
some messages telling which features it is checking for.
|
||||
|
||||
2. Type `make' to compile the package.
|
||||
|
||||
3. Optionally, type `make check' to run any self-tests that come with
|
||||
the package.
|
||||
|
||||
4. Type `make install' to install the programs and any data files and
|
||||
documentation.
|
||||
|
||||
5. You can remove the program binaries and object files from the
|
||||
source code directory by typing `make clean'. To also remove the
|
||||
files that `configure' created (so you can compile the package for
|
||||
a different kind of computer), type `make distclean'. There is
|
||||
also a `make maintainer-clean' target, but that is intended mainly
|
||||
for the package's developers. If you use it, you may have to get
|
||||
all sorts of other programs in order to regenerate files that came
|
||||
with the distribution.
|
||||
|
||||
Compilers and Options
|
||||
=====================
|
||||
|
||||
Some systems require unusual options for compilation or linking that the
|
||||
`configure' script does not know about. Run `./configure --help' for
|
||||
details on some of the pertinent environment variables.
|
||||
|
||||
You can give `configure' initial values for configuration parameters
|
||||
by setting variables in the command line or in the environment. Here
|
||||
is an example:
|
||||
|
||||
./configure CC=c99 CFLAGS=-g LIBS=-lposix
|
||||
|
||||
*Note Defining Variables::, for more details.
|
||||
|
||||
Compiling For Multiple Architectures
|
||||
====================================
|
||||
|
||||
You can compile the package for more than one kind of computer at the
|
||||
same time, by placing the object files for each architecture in their
|
||||
own directory. To do this, you can use GNU `make'. `cd' to the
|
||||
directory where you want the object files and executables to go and run
|
||||
the `configure' script. `configure' automatically checks for the
|
||||
source code in the directory that `configure' is in and in `..'.
|
||||
|
||||
With a non-GNU `make', it is safer to compile the package for one
|
||||
architecture at a time in the source code directory. After you have
|
||||
installed the package for one architecture, use `make distclean' before
|
||||
reconfiguring for another architecture.
|
||||
|
||||
Installation Names
|
||||
==================
|
||||
|
||||
By default, `make install' installs the package's commands under
|
||||
`/usr/local/bin', include files under `/usr/local/include', etc. You
|
||||
can specify an installation prefix other than `/usr/local' by giving
|
||||
`configure' the option `--prefix=PREFIX'.
|
||||
|
||||
You can specify separate installation prefixes for
|
||||
architecture-specific files and architecture-independent files. If you
|
||||
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
|
||||
PREFIX as the prefix for installing programs and libraries.
|
||||
Documentation and other data files still use the regular prefix.
|
||||
|
||||
In addition, if you use an unusual directory layout you can give
|
||||
options like `--bindir=DIR' to specify different values for particular
|
||||
kinds of files. Run `configure --help' for a list of the directories
|
||||
you can set and what kinds of files go in them.
|
||||
|
||||
If the package supports it, you can cause programs to be installed
|
||||
with an extra prefix or suffix on their names by giving `configure' the
|
||||
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
||||
|
||||
Optional Features
|
||||
=================
|
||||
|
||||
Some packages pay attention to `--enable-FEATURE' options to
|
||||
`configure', where FEATURE indicates an optional part of the package.
|
||||
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
||||
is something like `gnu-as' or `x' (for the X Window System). The
|
||||
`README' should mention any `--enable-' and `--with-' options that the
|
||||
package recognizes.
|
||||
|
||||
For packages that use the X Window System, `configure' can usually
|
||||
find the X include and library files automatically, but if it doesn't,
|
||||
you can use the `configure' options `--x-includes=DIR' and
|
||||
`--x-libraries=DIR' to specify their locations.
|
||||
|
||||
Specifying the System Type
|
||||
==========================
|
||||
|
||||
There may be some features `configure' cannot figure out automatically,
|
||||
but needs to determine by the type of machine the package will run on.
|
||||
Usually, assuming the package is built to be run on the _same_
|
||||
architectures, `configure' can figure that out, but if it prints a
|
||||
message saying it cannot guess the machine type, give it the
|
||||
`--build=TYPE' option. TYPE can either be a short name for the system
|
||||
type, such as `sun4', or a canonical name which has the form:
|
||||
|
||||
CPU-COMPANY-SYSTEM
|
||||
|
||||
where SYSTEM can have one of these forms:
|
||||
|
||||
OS KERNEL-OS
|
||||
|
||||
See the file `config.sub' for the possible values of each field. If
|
||||
`config.sub' isn't included in this package, then this package doesn't
|
||||
need to know the machine type.
|
||||
|
||||
If you are _building_ compiler tools for cross-compiling, you should
|
||||
use the option `--target=TYPE' to select the type of system they will
|
||||
produce code for.
|
||||
|
||||
If you want to _use_ a cross compiler, that generates code for a
|
||||
platform different from the build platform, you should specify the
|
||||
"host" platform (i.e., that on which the generated programs will
|
||||
eventually be run) with `--host=TYPE'.
|
||||
|
||||
Sharing Defaults
|
||||
================
|
||||
|
||||
If you want to set default values for `configure' scripts to share, you
|
||||
can create a site shell script called `config.site' that gives default
|
||||
values for variables like `CC', `cache_file', and `prefix'.
|
||||
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
||||
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||
`CONFIG_SITE' environment variable to the location of the site script.
|
||||
A warning: not all `configure' scripts look for a site script.
|
||||
|
||||
Defining Variables
|
||||
==================
|
||||
|
||||
Variables not defined in a site shell script can be set in the
|
||||
environment passed to `configure'. However, some packages may run
|
||||
configure again during the build, and the customized values of these
|
||||
variables may be lost. In order to avoid this problem, you should set
|
||||
them in the `configure' command line, using `VAR=value'. For example:
|
||||
|
||||
./configure CC=/usr/local2/bin/gcc
|
||||
|
||||
causes the specified `gcc' to be used as the C compiler (unless it is
|
||||
overridden in the site shell script).
|
||||
|
||||
Unfortunately, this technique does not work for `CONFIG_SHELL' due to
|
||||
an Autoconf bug. Until the bug is fixed you can use this workaround:
|
||||
|
||||
CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
|
||||
|
||||
`configure' Invocation
|
||||
======================
|
||||
|
||||
`configure' recognizes the following options to control how it operates.
|
||||
|
||||
`--help'
|
||||
`-h'
|
||||
Print a summary of the options to `configure', and exit.
|
||||
|
||||
`--version'
|
||||
`-V'
|
||||
Print the version of Autoconf used to generate the `configure'
|
||||
script, and exit.
|
||||
|
||||
`--cache-file=FILE'
|
||||
Enable the cache: use and save the results of the tests in FILE,
|
||||
traditionally `config.cache'. FILE defaults to `/dev/null' to
|
||||
disable caching.
|
||||
|
||||
`--config-cache'
|
||||
`-C'
|
||||
Alias for `--cache-file=config.cache'.
|
||||
|
||||
`--quiet'
|
||||
`--silent'
|
||||
`-q'
|
||||
Do not print messages saying which checks are being made. To
|
||||
suppress all normal output, redirect it to `/dev/null' (any error
|
||||
messages will still be shown).
|
||||
|
||||
`--srcdir=DIR'
|
||||
Look for the package's source code in directory DIR. Usually
|
||||
`configure' can determine that directory automatically.
|
||||
|
||||
`configure' also accepts some other, not widely useful, options. Run
|
||||
`configure --help' for more details.
|
||||
|
||||
|
|
|
@ -0,0 +1,56 @@
|
|||
/* ====================================================================
|
||||
* The Kannel Software License, Version 1.0
|
||||
*
|
||||
* Copyright (c) 2001-2004 Kannel Group
|
||||
* Copyright (c) 1998-2001 WapIT Ltd.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. The end-user documentation included with the redistribution,
|
||||
* if any, must include the following acknowledgment:
|
||||
* "This product includes software developed by the
|
||||
* Kannel Group (http://www.kannel.org/)."
|
||||
* Alternately, this acknowledgment may appear in the software itself,
|
||||
* if and wherever such third-party acknowledgments normally appear.
|
||||
*
|
||||
* 4. The names "Kannel" and "Kannel Group" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please
|
||||
* contact org@kannel.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "Kannel",
|
||||
* nor may "Kannel" appear in their name, without prior written
|
||||
* permission of the Kannel Group.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE KANNEL GROUP OR ITS CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
||||
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
* This software consists of voluntary contributions made by many
|
||||
* individuals on behalf of the Kannel Group. For more information on
|
||||
* the Kannel Group, please see <http://www.kannel.org/>.
|
||||
*
|
||||
* Portions of this software are based upon software originally written at
|
||||
* WapIT Ltd., Helsinki, Finland for the Kannel project.
|
||||
*/
|
||||
|
|
@ -1,44 +1,32 @@
|
|||
Mbuni License v1.0
|
||||
|
||||
Mbuni License v2.0
|
||||
|
||||
|
||||
Copyright (c) 2003-2005, Digital Solutions Ltd.
|
||||
All rights reserved.
|
||||
|
||||
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.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
In addition, as a special exception, Digital Solutions gives
|
||||
permission to link the code of this program with the Kannel
|
||||
(http://www.kannel.org) libraries (or with modified versions of Kannel
|
||||
that use the same license as Kannel) and any other libraries Kannel requires
|
||||
, and distribute linked combinations including the two. You must obey
|
||||
the GNU General Public License in all respects for all of the code
|
||||
used other than Kannel. If you modify this file, you may extend this
|
||||
exception to your version of the file, but you are not obligated to do
|
||||
so. If you do not wish to do so, delete this exception statement from
|
||||
your version.
|
||||
|
||||
Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
Neither the name of Digital Solutions Ltd nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
The names "Mbuni" and "Mbuni Project" must not be used to endorse or
|
||||
promote products derived from this software without prior written
|
||||
permission. For written permission, please contact info@mbuni.org.
|
||||
|
||||
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
|
||||
Portions of this software are based on software originally developed
|
||||
by the Kannel Project
|
||||
|
|
|
@ -1 +1,3 @@
|
|||
SUBDIRS = mmlib mmsc
|
||||
SUBDIRS = autotools doc mmlib mmsc mmsbox extras
|
||||
|
||||
EXTRA_DIST = VERSION GnuLICENSE KannelLICENSE bootstrap Notes
|
||||
|
|
|
@ -1,563 +0,0 @@
|
|||
# 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@
|
||||
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 = :
|
||||
subdir = .
|
||||
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
|
||||
$(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
|
||||
TODO config.guess config.sub depcomp install-sh ltmain.sh \
|
||||
missing
|
||||
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)
|
||||
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
||||
configure.lineno configure.status.lineno
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
|
||||
html-recursive info-recursive install-data-recursive \
|
||||
install-exec-recursive install-info-recursive \
|
||||
install-recursive installcheck-recursive installdirs-recursive \
|
||||
pdf-recursive ps-recursive uninstall-info-recursive \
|
||||
uninstall-recursive
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DIST_SUBDIRS = $(SUBDIRS)
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
top_distdir = $(distdir)
|
||||
am__remove_distdir = \
|
||||
{ test ! -d $(distdir) \
|
||||
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
|
||||
&& rm -fr $(distdir); }; }
|
||||
DIST_ARCHIVES = $(distdir).tar.gz
|
||||
GZIP_ENV = --best
|
||||
distuninstallcheck_listfiles = find . -type f -print
|
||||
distcleancheck_listfiles = find . -type f -print
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
AMTAR = @AMTAR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
EXE_EXT = @EXE_EXT@
|
||||
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@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJEXT = @OBJEXT@
|
||||
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_CC = @ac_ct_CC@
|
||||
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__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build_alias = @build_alias@
|
||||
datadir = @datadir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host_alias = @host_alias@
|
||||
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@
|
||||
SUBDIRS = mmlib mmsc
|
||||
all: config.h
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-recursive
|
||||
|
||||
.SUFFIXES:
|
||||
am--refresh:
|
||||
@:
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \
|
||||
cd $(srcdir) && $(AUTOMAKE) --gnu \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
echo ' $(SHELL) ./config.status'; \
|
||||
$(SHELL) ./config.status;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
$(SHELL) ./config.status --recheck
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(srcdir) && $(AUTOCONF)
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
||||
|
||||
config.h: stamp-h1
|
||||
@if test ! -f $@; then \
|
||||
rm -f stamp-h1; \
|
||||
$(MAKE) stamp-h1; \
|
||||
else :; fi
|
||||
|
||||
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
|
||||
@rm -f stamp-h1
|
||||
cd $(top_builddir) && $(SHELL) ./config.status config.h
|
||||
$(srcdir)/config.h.in: $(am__configure_deps)
|
||||
cd $(top_srcdir) && $(AUTOHEADER)
|
||||
rm -f stamp-h1
|
||||
touch $@
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f config.h stamp-h1
|
||||
uninstall-info-am:
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
# To change the values of `make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in `config.status', edit `config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||
# (2) otherwise, pass the desired values on the `make' command line.
|
||||
$(RECURSIVE_TARGETS):
|
||||
@set fnord $$MAKEFLAGS; amf=$$2; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
||||
done; \
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
mostlyclean-recursive clean-recursive distclean-recursive \
|
||||
maintainer-clean-recursive:
|
||||
@set fnord $$MAKEFLAGS; amf=$$2; \
|
||||
dot_seen=no; \
|
||||
case "$@" in \
|
||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||
*) list='$(SUBDIRS)' ;; \
|
||||
esac; \
|
||||
rev=''; for subdir in $$list; do \
|
||||
if test "$$subdir" = "."; then :; else \
|
||||
rev="$$subdir $$rev"; \
|
||||
fi; \
|
||||
done; \
|
||||
rev="$$rev ."; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
for subdir in $$rev; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
||||
done && test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
done
|
||||
ctags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
|
||||
done
|
||||
|
||||
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: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
||||
include_option=--etags-include; \
|
||||
empty_fix=.; \
|
||||
else \
|
||||
include_option=--include; \
|
||||
empty_fix=; \
|
||||
fi; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test ! -f $$subdir/TAGS || \
|
||||
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
list='$(SOURCES) $(HEADERS) config.h.in $(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: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) config.h.in $(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)
|
||||
$(am__remove_distdir)
|
||||
mkdir $(distdir)
|
||||
@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
|
||||
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -d "$(distdir)/$$subdir" \
|
||||
|| $(mkdir_p) "$(distdir)/$$subdir" \
|
||||
|| exit 1; \
|
||||
distdir=`$(am__cd) $(distdir) && pwd`; \
|
||||
top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
|
||||
(cd $$subdir && \
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$$top_distdir" \
|
||||
distdir="$$distdir/$$subdir" \
|
||||
distdir) \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
|
||||
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
|
||||
|| chmod -R a+r $(distdir)
|
||||
dist-gzip: distdir
|
||||
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-bzip2: distdir
|
||||
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-tarZ: distdir
|
||||
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-shar: distdir
|
||||
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-zip: distdir
|
||||
-rm -f $(distdir).zip
|
||||
zip -rq $(distdir).zip $(distdir)
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist dist-all: distdir
|
||||
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
# This target untars the dist file and tries a VPATH configuration. Then
|
||||
# it guarantees that the distribution is self-contained by making another
|
||||
# tarfile.
|
||||
distcheck: dist
|
||||
case '$(DIST_ARCHIVES)' in \
|
||||
*.tar.gz*) \
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
|
||||
*.tar.bz2*) \
|
||||
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
|
||||
*.tar.Z*) \
|
||||
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
|
||||
*.shar.gz*) \
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
|
||||
*.zip*) \
|
||||
unzip $(distdir).zip ;;\
|
||||
esac
|
||||
chmod -R a-w $(distdir); chmod a+w $(distdir)
|
||||
mkdir $(distdir)/_build
|
||||
mkdir $(distdir)/_inst
|
||||
chmod a-w $(distdir)
|
||||
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
|
||||
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
|
||||
&& cd $(distdir)/_build \
|
||||
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
|
||||
$(DISTCHECK_CONFIGURE_FLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) check \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
|
||||
distuninstallcheck \
|
||||
&& chmod -R a-w "$$dc_install_base" \
|
||||
&& ({ \
|
||||
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
|
||||
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
|
||||
} || { rm -rf "$$dc_destdir"; exit 1; }) \
|
||||
&& rm -rf "$$dc_destdir" \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dist \
|
||||
&& rm -rf $(DIST_ARCHIVES) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
|
||||
$(am__remove_distdir)
|
||||
@(echo "$(distdir) archives ready for distribution: "; \
|
||||
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
|
||||
sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
|
||||
distuninstallcheck:
|
||||
@cd $(distuninstallcheck_dir) \
|
||||
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|
||||
|| { echo "ERROR: files left after uninstall:" ; \
|
||||
if test -n "$(DESTDIR)"; then \
|
||||
echo " (check DESTDIR support)"; \
|
||||
fi ; \
|
||||
$(distuninstallcheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
distcleancheck: distclean
|
||||
@if test '$(srcdir)' = . ; then \
|
||||
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
|
||||
exit 1 ; \
|
||||
fi
|
||||
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|
||||
|| { echo "ERROR: files left in build directory after distclean:" ; \
|
||||
$(distcleancheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
check-am: all-am
|
||||
check: check-recursive
|
||||
all-am: Makefile config.h
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
install: install-recursive
|
||||
install-exec: install-exec-recursive
|
||||
install-data: install-data-recursive
|
||||
uninstall: uninstall-recursive
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-recursive
|
||||
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-recursive
|
||||
|
||||
clean-am: clean-generic mostlyclean-am
|
||||
|
||||
distclean: distclean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
|
||||
|
||||
dvi: dvi-recursive
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-recursive
|
||||
|
||||
info: info-recursive
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-info: install-info-recursive
|
||||
|
||||
install-man:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -rf $(top_srcdir)/autom4te.cache
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-recursive
|
||||
|
||||
mostlyclean-am: mostlyclean-generic
|
||||
|
||||
pdf: pdf-recursive
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-recursive
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-info-am
|
||||
|
||||
uninstall-info: uninstall-info-recursive
|
||||
|
||||
.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
|
||||
check-am clean clean-generic clean-recursive ctags \
|
||||
ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-shar \
|
||||
dist-tarZ dist-zip distcheck distclean distclean-generic \
|
||||
distclean-hdr distclean-recursive distclean-tags \
|
||||
distcleancheck distdir distuninstallcheck dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-exec install-exec-am install-info \
|
||||
install-info-am install-man install-strip installcheck \
|
||||
installcheck-am installdirs installdirs-am maintainer-clean \
|
||||
maintainer-clean-generic maintainer-clean-recursive \
|
||||
mostlyclean mostlyclean-generic mostlyclean-recursive pdf \
|
||||
pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
|
||||
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:
|
|
@ -0,0 +1 @@
|
|||
No News!
|
|
@ -0,0 +1,8 @@
|
|||
Mbuni - Open Source MMS Gateway
|
||||
|
||||
Please see
|
||||
LICENSE - for license terms
|
||||
www.mbuni.org/docs.shtml - for documentation
|
||||
|
||||
Portions of this software are based on software originally developed
|
||||
by the Kannel Project
|
|
@ -0,0 +1,5 @@
|
|||
cvs
|
||||
$Date$
|
||||
|
||||
This file contains the version number of Mbuni, which must be on the first line. Second line is the date
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,19 @@
|
|||
.*.sw[po]
|
||||
*~
|
||||
*.diff
|
||||
*.patch
|
||||
*.lo
|
||||
*.o
|
||||
Makefile
|
||||
Makefile.in
|
||||
.deps
|
||||
.libs
|
||||
config.guess
|
||||
config.sub
|
||||
depcomp
|
||||
install-sh
|
||||
ltconfig
|
||||
ltmain.sh
|
||||
missing
|
||||
mkinstalldirs
|
||||
compile
|
|
@ -0,0 +1,67 @@
|
|||
#! /bin/sh
|
||||
set -x
|
||||
set -e
|
||||
|
||||
# Check for automake
|
||||
amvers="no"
|
||||
if automake-1.11 --version >/dev/null 2>&1; then
|
||||
amvers="-1.11"
|
||||
elif automake-1.10 --version >/dev/null 2>&1; then
|
||||
amvers="-1.10"
|
||||
elif automake-1.9 --version >/dev/null 2>&1; then
|
||||
amvers="-1.9"
|
||||
elif automake-1.8 --version >/dev/null 2>&1; then
|
||||
amvers="-1.8"
|
||||
elif automake-1.7 --version >/dev/null 2>&1; then
|
||||
amvers="-1.7"
|
||||
elif automake-1.6 --version >/dev/null 2>&1; then
|
||||
amvers="-1.6"
|
||||
elif automake-1.5 --version >/dev/null 2>&1; then
|
||||
amvers="-1.5"
|
||||
elif automake --version > /dev/null 2>&1; then
|
||||
amvers="`automake --version | sed -e '1s/[^0-9]*//' -e q`"
|
||||
if expr "$amvers" "<" "1.5" > /dev/null 2>&1; then
|
||||
amvers="no"
|
||||
else
|
||||
amvers=""
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$amvers" = "no"; then
|
||||
set +x
|
||||
echo "$0: you need automake version 1.5 or later"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check for libtool
|
||||
libtoolize="no"
|
||||
if glibtoolize --version >/dev/null 2>&1; then
|
||||
libtoolize="glibtoolize"
|
||||
elif libtoolize --version >/dev/null 2>&1; then
|
||||
libtoolize="libtoolize"
|
||||
fi
|
||||
|
||||
if test "$libtoolize" = "no"; then
|
||||
set +x
|
||||
echo "$0: you need libtool"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Remove old cruft
|
||||
set +x; for x in aclocal.m4 configure config.guess config.log config.sub config.cache config.h.in config.h compile libtool.m4 ltoptions.m4 ltsugar.m4 ltversion.m4 ltmain.sh libtool ltconfig missing mkinstalldirs depcomp install-sh; do rm -f $x autotools/$x; done; rm -Rf autom4te.cache; set -x
|
||||
if test ! -d autotools; then mkdir autotools; fi
|
||||
|
||||
# Bootstrap package
|
||||
${libtoolize} --copy --force
|
||||
if test -f "ltmain.sh"; then
|
||||
echo "$0: working around a minor libtool issue"
|
||||
mv ltmain.sh autotools/
|
||||
fi
|
||||
|
||||
aclocal${amvers} -I autotools
|
||||
autoconf
|
||||
autoheader
|
||||
#add --include-deps if you want to bootstrap with any other compiler than gcc
|
||||
#automake${amvers} --add-missing --copy --include-deps
|
||||
automake${amvers} --add-missing --copy
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -1,143 +0,0 @@
|
|||
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Define to 1 if the `closedir' function returns void instead of `int'. */
|
||||
#undef CLOSEDIR_VOID
|
||||
|
||||
/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
|
||||
*/
|
||||
#undef HAVE_DIRENT_H
|
||||
|
||||
/* Define to 1 if you have the <float.h> header file. */
|
||||
#undef HAVE_FLOAT_H
|
||||
|
||||
/* Define to 1 if you have the `floor' function. */
|
||||
#undef HAVE_FLOOR
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define to 1 if you have the `dl' library (-ldl). */
|
||||
#undef HAVE_LIBDL
|
||||
|
||||
/* Define to 1 if you have the `gwlib' library (-lgwlib). */
|
||||
#undef HAVE_LIBGWLIB
|
||||
|
||||
/* Define to 1 if you have the `pthread' library (-lpthread). */
|
||||
#undef HAVE_LIBPTHREAD
|
||||
|
||||
/* Define to 1 if you have the `wap' library (-lwap). */
|
||||
#undef HAVE_LIBWAP
|
||||
|
||||
/* Define to 1 if you have the `xml2' library (-lxml2). */
|
||||
#undef HAVE_LIBXML2
|
||||
|
||||
/* Define to 1 if you have the `localtime_r' function. */
|
||||
#undef HAVE_LOCALTIME_R
|
||||
|
||||
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
|
||||
to 0 otherwise. */
|
||||
#undef HAVE_MALLOC
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define to 1 if you have the `memset' function. */
|
||||
#undef HAVE_MEMSET
|
||||
|
||||
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
|
||||
#undef HAVE_NDIR_H
|
||||
|
||||
/* Define to 1 if you have the `sqrt' function. */
|
||||
#undef HAVE_SQRT
|
||||
|
||||
/* Define to 1 if `stat' has the bug that it succeeds when given the
|
||||
zero-length file name argument. */
|
||||
#undef HAVE_STAT_EMPTY_STRING_BUG
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define to 1 if you have the `strerror' function. */
|
||||
#undef HAVE_STRERROR
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define to 1 if you have the `strrchr' function. */
|
||||
#undef HAVE_STRRCHR
|
||||
|
||||
/* Define to 1 if you have the `strtol' function. */
|
||||
#undef HAVE_STRTOL
|
||||
|
||||
/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
|
||||
*/
|
||||
#undef HAVE_SYS_DIR_H
|
||||
|
||||
/* Define to 1 if you have the <sys/file.h> header file. */
|
||||
#undef HAVE_SYS_FILE_H
|
||||
|
||||
/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
|
||||
*/
|
||||
#undef HAVE_SYS_NDIR_H
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||
#undef HAVE_SYS_WAIT_H
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
|
||||
slash. */
|
||||
#undef LSTAT_FOLLOWS_SLASHED_SYMLINK
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#undef PACKAGE_NAME
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#undef PACKAGE_STRING
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/* Define as the return type of signal handlers (`int' or `void'). */
|
||||
#undef RETSIGTYPE
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
|
||||
#undef TM_IN_SYS_TIME
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
#undef const
|
||||
|
||||
/* Define to rpl_malloc if the replacement function should be used. */
|
||||
#undef malloc
|
||||
|
||||
/* Define to empty if the keyword `volatile' does not work. Warning: valid
|
||||
code using `volatile' can become incorrect without. Disable with care. */
|
||||
#undef volatile
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,47 +1,64 @@
|
|||
# -*- Autoconf -*-
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
dnl Mbuni - Open Source MMS Gateway
|
||||
dnl
|
||||
dnl Copyright (C) 2003 - 2011, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
dnl
|
||||
dnl Paul Bagyenda <bagyenda@dsmagic.com>
|
||||
dnl
|
||||
dnl This program is free software, distributed under the terms of
|
||||
dnl the GNU General Public License, with a few exceptions granted (see LICENSE)
|
||||
dnl
|
||||
AC_PREREQ(2.61)
|
||||
|
||||
AC_INIT([mbuni],[cvs],[devel@mbuni.org])
|
||||
|
||||
dnl Set version
|
||||
|
||||
AC_MSG_CHECKING([Retrieving Mbuni version])
|
||||
M_VERSION=`head -n 1 VERSION`
|
||||
if test "x$M_VERSION" = "xcvs"; then
|
||||
CVS_DATE=`head -1 ChangeLog | cut -f 1 -d ' ' | sed 's/-//g'`
|
||||
M_VERSION="$M_VERSION-$CVS_DATE"
|
||||
fi
|
||||
|
||||
AC_MSG_RESULT([$M_VERSION])
|
||||
|
||||
AC_PREREQ(2.59)
|
||||
AC_INIT(mbuni, 0.96, devel@mbuni.org)
|
||||
AM_INIT_AUTOMAKE
|
||||
AC_CONFIG_SRCDIR([mmlib/mms_util.c])
|
||||
AC_CONFIG_HEADER([config.h])
|
||||
AC_CONFIG_AUX_DIR(autotools)
|
||||
AM_INIT_AUTOMAKE([mbuni],[$M_VERSION])
|
||||
AC_CONFIG_HEADERS([mbuni-config.h])
|
||||
AM_MAINTAINER_MODE
|
||||
AC_CANONICAL_HOST
|
||||
|
||||
# Checks for programs.
|
||||
dnl Checks for programs.
|
||||
AC_PROG_CC
|
||||
AC_PROG_LIBTOOL
|
||||
AC_PROG_RANLIB
|
||||
|
||||
# Checks for libraries.
|
||||
# FIXME: Replace `main' with a function in `-lcrypto':
|
||||
# AC_CHECK_LIB([crypto], [main])
|
||||
# FIXME: Replace `main' with a function in `-ldl':
|
||||
AC_CHECK_LIB([dl], [dlsym])
|
||||
# FIXME: Replace `main' with a function in `-liconv':
|
||||
AC_CHECK_LIB([iconv], [libiconv], [LIBS="$LIBS -liconv"])
|
||||
# FIXME: Replace `main' with a function in `-lm':
|
||||
# AC_CHECK_LIB([m], [main])
|
||||
# FIXME: Replace `main' with a function in `-lpthread':
|
||||
AC_CHECK_LIB([pthread], [pthread_create])
|
||||
# FIXME: Replace `main' with a function in `-lssl':
|
||||
# AC_CHECK_LIB([ssl], [main])
|
||||
# FIXME: Replace `main' with a function in `-lxml2':
|
||||
AC_CHECK_LIB([xml2], [xmlStrcasecmp], [],
|
||||
AC_MSG_ERROR([LibXML2 is required]))
|
||||
# FIXME: Replace `main' with a function in `-lz':
|
||||
# AC_CHECK_LIB([z], [main])
|
||||
dnl add mmlib to the include path
|
||||
INCLUDES='-I$(top_srcdir)/mmlib -I$(top_builddir)/mmsc -I$(top_srcdir)/mmsc -I$(top_builddir)/mmsbox -I$(top_srcdir)/mmlib -I$(top_builddir)/mmsbox'
|
||||
AC_SUBST([INCLUDES])
|
||||
|
||||
# Checks for header files.
|
||||
|
||||
dnl Checks for libraries.
|
||||
AC_CHECK_LIB([dl], [dlsym])
|
||||
dnl AC_CHECK_LIB([iconv], [libiconv], [LIBS="$LIBS -liconv"])
|
||||
AC_CHECK_LIB([pthread], [pthread_create])
|
||||
dnl AC_CHECK_LIB([xml2], [xmlStrcasecmp], [],
|
||||
dnl AC_MSG_ERROR([LibXML2 is required]))
|
||||
AC_CHECK_FUNCS([backtrace])
|
||||
|
||||
dnl Checks for header files.
|
||||
AC_HEADER_DIRENT
|
||||
AC_HEADER_STDC
|
||||
AC_HEADER_SYS_WAIT
|
||||
AC_CHECK_HEADERS([float.h memory.h stdlib.h string.h sys/file.h unistd.h])
|
||||
|
||||
# Checks for typedefs, structures, and compiler characteristics.
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_CONST
|
||||
AC_STRUCT_TM
|
||||
AC_C_VOLATILE
|
||||
|
||||
# Checks for library functions.
|
||||
dnl Checks for library functions.
|
||||
AC_FUNC_CLOSEDIR_VOID
|
||||
AC_FUNC_ERROR_AT_LINE
|
||||
AC_FUNC_MALLOC
|
||||
|
@ -50,32 +67,36 @@ AC_TYPE_SIGNAL
|
|||
AC_FUNC_STAT
|
||||
AC_CHECK_FUNCS([floor localtime_r memset sqrt strerror strrchr strtol])
|
||||
|
||||
# Change a few things (a la kannel config)
|
||||
dnl Change a few things (a la kannel config)
|
||||
EXE_EXT=""
|
||||
LIB_EXT="a"
|
||||
case "$host" in
|
||||
*-sun-solaris*)
|
||||
CFLAGS="$CFLAGS -DSunOS=1"
|
||||
*-sun-solaris* | *SunOS* | *-pc-solaris*)
|
||||
CFLAGS="$CFLAGS -DSunOS=1 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT"
|
||||
;;
|
||||
*-cygwin*)
|
||||
EXE_EXT=".exe"
|
||||
;;
|
||||
*apple-darwin*)
|
||||
CFLAGS="$CFLAGS -DDARWIN=1"
|
||||
LIBTOOL="libtool -static -o"
|
||||
CFLAGS="$CFLAGS -DDARWIN=1 -O4 -Wall -D_REENTRANT=1"
|
||||
LIB_EXT="dylib"
|
||||
allow_undefined_flag='-flat_namespace -undefined suppress'
|
||||
;;
|
||||
*-linux-*)
|
||||
CFLAGS="$CFLAGS -D_XOPEN_SOURCE=600 -D_BSD_SOURCE"
|
||||
*-linux*)
|
||||
CFLAGS="$CFLAGS -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -O4 -Wall -D_REENTRANT=1"
|
||||
LDFLAGS="$LDFLAGS -rdynamic"
|
||||
;;
|
||||
*-*-openbsd* | *-*-freebsd*)
|
||||
*-*-openbsd*)
|
||||
CFLAGS="$CFLAGS -pthread"
|
||||
AC_CHECK_LIB(c_r, pthread_exit, [LIBS="$LIBS -lc_r -lkse"; pthread="yes"])
|
||||
AC_CHECK_LIB(c_r, pthread_exit, [LIBS="$LIBS -lc_r -lpthread"; pthread="yes"])
|
||||
;;
|
||||
*-*-freebsd*)
|
||||
LDFLAGS="$LDFLAGS -export-dynamic"
|
||||
CFLAGS="$CFLAGS -DFREEBSD=1 -pthread"
|
||||
AC_CHECK_LIB(c_r, pthread_exit, [LIBS="$LIBS -lc_r -lpthread"; pthread="yes"])
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_SUBST(EXE_EXT)
|
||||
# AC_SUBST(LIBTOOL)
|
||||
|
||||
AC_ARG_WITH(cflags,
|
||||
[ --with-cflags=FLAGS use FLAGS for CFLAGS],
|
||||
CFLAGS="$CFLAGS $withval")
|
||||
|
@ -84,7 +105,120 @@ AC_ARG_WITH(libs,
|
|||
[ --with-libs=FLAGS use FLAGS for extra libraries],
|
||||
LIBS="$LIBS $withval")
|
||||
|
||||
# Need to check for kannel and also that kannel has been patched.
|
||||
dnl Check for large file handling
|
||||
AC_SYS_LARGEFILE(CFLAGS)
|
||||
if test "${ac_cv_sys_file_offset_bits}" != no ; then
|
||||
CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=${ac_cv_sys_file_offset_bits}"
|
||||
fi
|
||||
if test "${ac_cv_sys_large_files}" != "no" ; then
|
||||
CFLAGS="$CFLAGS -D_LARGE_FILES=${ac_cv_sys_large_files}"
|
||||
fi
|
||||
|
||||
dnl implement SSL stuff.
|
||||
|
||||
dnl Implement the --with-ssl option.
|
||||
|
||||
|
||||
AC_ARG_WITH(ssl,
|
||||
[ --with-ssl[=DIR] where to look for OpenSSL libs and header files
|
||||
DIR points to the installation [/usr/local/ssl]],
|
||||
[ if test -d "$withval"; then
|
||||
ssllib="$withval/lib";
|
||||
sslinc="$withval/include"
|
||||
else
|
||||
AC_MSG_ERROR(Unable to find OpenSSL libs and/or directories at $withval)
|
||||
fi
|
||||
])
|
||||
|
||||
dnl Implement --enable-ssl option.
|
||||
|
||||
AC_MSG_CHECKING([whether to compile with SSL support])
|
||||
AC_ARG_ENABLE(ssl,
|
||||
[ --enable-ssl enable SSL client and server support [enabled]], [
|
||||
if test "$enableval" = no ; then
|
||||
AC_MSG_RESULT(disabled)
|
||||
ssl=no
|
||||
else
|
||||
ssl=yes
|
||||
fi
|
||||
],[
|
||||
ssl=yes
|
||||
])
|
||||
|
||||
if test "$ssl" = "yes" ; then
|
||||
dnl test only if --with-ssl has not been used
|
||||
if test "x$ssllib" = "x" && test "x$sslinc" = "x"; then
|
||||
for loc in /usr/lib /usr/local/ssl/lib /usr/local/openssl/lib; do
|
||||
if test -f "$loc/libssl.$LIB_EXT"; then
|
||||
ssllib="$loc"
|
||||
fi
|
||||
done
|
||||
for loc in /usr/include/ssl /usr/include/openssl /usr/local/ssl/include \
|
||||
/usr/local/openssl/include; do
|
||||
if test -d "$loc"; then
|
||||
sslinc="$loc"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
AC_MSG_RESULT(trying $ssllib $sslinc)
|
||||
fi
|
||||
|
||||
dnl Implement the SSL library checking routine.
|
||||
dnl This will define HAVE_LIBSSL in config.h
|
||||
|
||||
if test "x$ssllib" != "x" && test "x$sslinc" != "x"; then
|
||||
CFLAGS="$CFLAGS -I$sslinc"
|
||||
LIBS="$LIBS -L$ssllib"
|
||||
|
||||
AC_PATH_PROG(OPENSSL, openssl, no)
|
||||
if test "$OPENSSL" = "yes"; then
|
||||
AC_MSG_CHECKING([openssl version])
|
||||
openssl_version=`$OPENSSL version | awk '{print $2}'`
|
||||
AC_MSG_RESULT([$openssl_version])
|
||||
fi
|
||||
AC_CHECK_LIB(crypto, CRYPTO_lock,
|
||||
[ LIBS="$LIBS -lcrypto"
|
||||
AC_CHECK_LIB(ssl, SSL_library_init,
|
||||
[ AC_CHECK_LIB(ssl, SSL_connect)
|
||||
AC_CHECK_HEADERS(openssl/x509.h openssl/rsa.h openssl/crypto.h \
|
||||
openssl/pem.h openssl/ssl.h openssl/err.h)
|
||||
AC_MSG_CHECKING(whether the OpenSSL library is multithread-enabled)
|
||||
AC_TRY_RUN([
|
||||
#define OPENSSL_THREAD_DEFINES
|
||||
#include <openssl/opensslconf.h>
|
||||
int main(void) {
|
||||
#if defined(THREADS)
|
||||
exit(0);
|
||||
#elif defined(OPENSSL_THREADS)
|
||||
exit(0);
|
||||
#else
|
||||
exit(1);
|
||||
#endif
|
||||
}
|
||||
], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_LIBSSL)
|
||||
LIBS="$LIBS -lssl"
|
||||
AC_MSG_CHECKING([whether to compile with SSL support])
|
||||
AC_MSG_RESULT(yes)
|
||||
], [
|
||||
AC_ARG_ENABLE(ssl-thread-test,
|
||||
[ --disable-ssl-thread-test disable the multithread test for the OpenSSL library
|
||||
this will force to continue even if the test fails],
|
||||
[ if test "$enableval" = no ; then
|
||||
AC_MSG_RESULT([no, continue forced])
|
||||
fi
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_ERROR(Either get a multithread-enabled SSL or configure with --disable-ssl)
|
||||
])
|
||||
], echo "Cross-compiling; make sure your SSL library is multithread-enabled"
|
||||
)
|
||||
])
|
||||
])
|
||||
fi
|
||||
|
||||
dnl Need to check for kannel and also that kannel has been patched.
|
||||
|
||||
dnl Implement the --with-kannel-dir option
|
||||
AC_ARG_WITH(kannel-dir,
|
||||
|
@ -98,7 +232,7 @@ if test -d "$withval" ; then
|
|||
fi
|
||||
])
|
||||
|
||||
AC_PATH_PROG(GW_CONFIG, gw-config, no, [$PATH:$gwloc/bin:$gwloc])
|
||||
AC_PATH_PROG(GW_CONFIG, gw-config, no, [$gwloc/bin:$gwloc:$PATH])
|
||||
dnl check for Kannel gw-config
|
||||
if test "$GW_CONFIG" = "no"; then
|
||||
found=""
|
||||
|
@ -108,7 +242,7 @@ found=""
|
|||
AC_MSG_RESULT($loc)
|
||||
AC_CHECK_FILE("$loc/include/kannel/gw-config.h",
|
||||
[CFLAGS="$CFLAGS -I$loc/include/kannel";
|
||||
LIBS="$LIBS -L$loc/lib/kannel -lwap -lgwlib";
|
||||
LDFLAGS="$LDFLAGS -L$loc/lib/kannel -lwap -lgwlib";
|
||||
found=1
|
||||
])
|
||||
fi
|
||||
|
@ -124,8 +258,9 @@ else
|
|||
AC_MSG_RESULT([$gw_version])
|
||||
AC_MSG_CHECKING([Kannel libs])
|
||||
if ! $GW_CONFIG --libs &>/dev/null ; then
|
||||
LIBS="$LIBS `$GW_CONFIG --libs`"
|
||||
gw_libdir=`$GW_CONFIG --libs`
|
||||
LDFLAGS="$LDFLAGS $gw_libdir"
|
||||
LIBS="$LIBS $gw_libdir"
|
||||
AC_MSG_RESULT([$gw_libdir])
|
||||
fi
|
||||
AC_MSG_CHECKING([Kannel includes])
|
||||
|
@ -139,12 +274,109 @@ fi
|
|||
AC_CHECK_LIB([gwlib], [cfg_create], [], AC_MSG_ERROR([Kannel gwlib is required!]))
|
||||
AC_CHECK_LIB([wap], [wsp_headers_pack], [], AC_MSG_ERROR([Kannel WAP lib is required!]))
|
||||
|
||||
CFLAGS="-I$srcdir/../mmlib $CFLAGS"
|
||||
LIBS="-L$srcdir/../mmlib -lmms $LIBS"
|
||||
dnl Implement the --with-pgsql-dir option.
|
||||
pgsqlloc="/usr/local/pgsql"
|
||||
AC_ARG_WITH(pgsql-dir,
|
||||
[ --with-pgsql-dir=DIR where to look for PostgreSQL libs and header files
|
||||
DIR points to the installation [/usr/local/pgsql] ],
|
||||
[
|
||||
pgsqlloc=""
|
||||
if test -d "$withval" ; then
|
||||
pgsqlloc="$withval"
|
||||
fi
|
||||
])
|
||||
|
||||
# May be we need to check for media conversion tools (imagemagick, etc)?
|
||||
AC_PATH_PROG(PGSQL_CONFIG, pg_config, no, [$pgsqlloc/bin:$pgsqlloc:/usr/lib/postgresql/bin:${PATH}])
|
||||
dnl check for PgSQL >= 7.2 style pg_config information
|
||||
if test "$PGSQL_CONFIG" = "no"; then
|
||||
found=""
|
||||
for loc in $pgsqlloc /usr /usr/local ; do
|
||||
if test "x$found" = "x" ; then
|
||||
AC_MSG_CHECKING([for PostgresSQL include files in])
|
||||
AC_MSG_RESULT($loc)
|
||||
AC_CHECK_FILE("$loc/include/postgresql/libpq-fe.h",
|
||||
[CFLAGS="$CFLAGS -I$loc/include/postgresql"; LIBS="-L$loc/lib/postgresql -lpq $LIBS"]; found=1,
|
||||
[AC_CHECK_FILE("$loc/include/pgsql/libpq-fe.h",
|
||||
[CFLAGS="$CFLAGS -I$loc/include/pgsql"; LIBS=" -L$loc/lib/pgsql $LIBS -lpq"]; found=1,
|
||||
[AC_CHECK_FILE("$loc/pgsql/include/libpq-fe.h",
|
||||
[CFLAGS="-I$loc/pgsql/include $CFLAGS"; LIBS="-L$loc/pgsql/lib $LIBS -lpq"]; found=1,
|
||||
)]
|
||||
)]
|
||||
)
|
||||
fi
|
||||
done
|
||||
|
||||
else
|
||||
dnl pg_config found
|
||||
AC_MSG_CHECKING([PostgreSQL version])
|
||||
pgsql_version=`$PGSQL_CONFIG --version`
|
||||
AC_MSG_RESULT([$pgsql_version])
|
||||
AC_MSG_CHECKING([PostgreSQL libs])
|
||||
if $PGSQL_CONFIG --libdir &>/dev/null ; then
|
||||
LIBS="-L`$PGSQL_CONFIG --libdir` $LIBS -lpq "
|
||||
pg_libdir="`$PGSQL_CONFIG --libdir`"
|
||||
AC_MSG_RESULT([$pg_libdir])
|
||||
fi
|
||||
AC_MSG_CHECKING([PostgreSQL includes])
|
||||
if $PGSQL_CONFIG --includedir &>/dev/null ; then
|
||||
CFLAGS="-I`$PGSQL_CONFIG --includedir` $CFLAGS"
|
||||
pg_incdir=`$PGSQL_CONFIG --includedir`
|
||||
AC_MSG_RESULT([$pg_incdir])
|
||||
fi
|
||||
fi
|
||||
# set HAVE_LIBpq if we have libpq
|
||||
AC_CHECK_LIB([pq], [PQexec], [has_pgsql=true])
|
||||
|
||||
AM_CONDITIONAL([BUILD_PGSQLQ], [test x$has_pgsql = xtrue])
|
||||
|
||||
# Look for curl lib
|
||||
AC_PATH_PROG(CURL_CONFIG, curl-config, no, [${PATH}])
|
||||
if test "$CURL_CONFIG" != "no"; then
|
||||
dnl curl-config found
|
||||
AC_MSG_CHECKING([curl lib version])
|
||||
curl_version=`$CURL_CONFIG --version`
|
||||
AC_MSG_RESULT([$curl_version])
|
||||
AC_MSG_CHECKING([curl libs])
|
||||
if $CURL_CONFIG --libs &>/dev/null ; then
|
||||
curl_libs=`$CURL_CONFIG --libs`
|
||||
AC_MSG_RESULT([$curl_libs])
|
||||
LIBS="$LIBS $curl_libs"
|
||||
fi
|
||||
AC_MSG_CHECKING([curl includes])
|
||||
if $CURL_CONFIG --cflags &>/dev/null ; then
|
||||
curl_cflags=`$CURL_CONFIG --cflags`
|
||||
CFLAGS="$curl_cflags $CFLAGS"
|
||||
AC_MSG_RESULT([$curl_cflags])
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_CHECK_LIB([curl], [curl_global_init], [
|
||||
CFLAGS="-DHAVE_LIBCURL=1 $CFLAGS";
|
||||
has_libcurl=true
|
||||
])
|
||||
|
||||
AM_CONDITIONAL([BUILD_MMSBOXMM1], [test x$has_libcurl = xtrue])
|
||||
|
||||
dnl Add mbuni version to Cflags
|
||||
# CFLAGS="$CFLAGS -DMBUNI_VERSION=\"$M_VERSION\""
|
||||
AC_DEFINE_UNQUOTED(MBUNI_VERSION, "$M_VERSION", "Mbuni Version")
|
||||
|
||||
dnl May be we need to check for media conversion tools (imagemagick, etc)?
|
||||
|
||||
|
||||
AC_CONFIG_FILES([Makefile mmlib/Makefile mmsc/Makefile])
|
||||
AC_CONFIG_FILES([Makefile autotools/Makefile doc/Makefile doc/examples/Makefile doc/images/Makefile mmlib/Makefile mmsc/Makefile mmsbox/Makefile extras/Makefile extras/pgsql-queue/Makefile extras/mmsbox-mm1/Makefile])
|
||||
|
||||
AC_OUTPUT
|
||||
|
||||
cat<<X
|
||||
License:
|
||||
Mbuni (version $M_VERSION) - Open Source MMS Gateway - http://www.mbuni.org/
|
||||
|
||||
Copyright (C) 2003 - 2011, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
|
||||
This program is free software, distributed under the terms of
|
||||
the GNU General Public License, with a few exceptions granted (see LICENSE)
|
||||
|
||||
If you do not agree with the terms of the license, you must abort the
|
||||
installation process now.
|
||||
X
|
||||
|
|
|
@ -0,0 +1,53 @@
|
|||
#!/bin/sh
|
||||
|
||||
MBUNI=/usr/local/mbuni
|
||||
BINDIR=$MBUNI/bin
|
||||
PIDFILES=$MBUNI/run
|
||||
CONF=$MBUNI/etc/mmsc.conf
|
||||
|
||||
MP=mmsproxy
|
||||
MR=mmsrelay
|
||||
|
||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MBUNI/lib/mbuni
|
||||
|
||||
export LD_LIBRARY_PATH
|
||||
|
||||
test -x $BINDIR/$MP && test -x $BINDIR/$MR || exit 0
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Starting MMSC: mmsproxy"
|
||||
$BINDIR/$MP --daemonize --parachute --pid-file $PIDFILES/$MP.pid -- $CONF
|
||||
sleep 1
|
||||
echo -n " mmsrelay"
|
||||
$BINDIR/$MR --daemonize --parachute --pid-file $PIDFILES/$MR.pid -- $CONF
|
||||
echo "."
|
||||
;;
|
||||
|
||||
stop)
|
||||
echo -n "Stopping MMSC: mmsrelay"
|
||||
kill `cat $PIDFILES/$MR.pid`
|
||||
sleep 1
|
||||
echo -n " mmsproxy"
|
||||
kill `cat $PIDFILES/$MP.pid`
|
||||
echo "."
|
||||
;;
|
||||
|
||||
reload)
|
||||
# We don't have support for this yet.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
restart|force-reload)
|
||||
$0 stop
|
||||
sleep 1
|
||||
$0 start
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|reload|restart|force-reload}"
|
||||
exit 1
|
||||
|
||||
esac
|
||||
|
||||
exit 0
|
520
mbuni/depcomp
520
mbuni/depcomp
|
@ -1,520 +0,0 @@
|
|||
#! /bin/sh
|
||||
# depcomp - compile a program generating dependencies as side-effects
|
||||
|
||||
scriptversion=2003-11-08.23
|
||||
|
||||
# Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc.
|
||||
|
||||
# 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, 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.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
|
||||
|
||||
Run PROGRAMS ARGS to compile a file, generating dependencies
|
||||
as side-effects.
|
||||
|
||||
Environment variables:
|
||||
depmode Dependency tracking mode.
|
||||
source Source file read by `PROGRAMS ARGS'.
|
||||
object Object file output by `PROGRAMS ARGS'.
|
||||
depfile Dependency file to output.
|
||||
tmpdepfile Temporary file to use when outputing dependencies.
|
||||
libtool Whether libtool is used (yes/no).
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
EOF
|
||||
exit 0
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "depcomp $scriptversion"
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
|
||||
echo "depcomp: Variables source, object and depmode must be set" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
# `libtool' can also be set to `yes' or `no'.
|
||||
|
||||
if test -z "$depfile"; then
|
||||
base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'`
|
||||
dir=`echo "$object" | sed 's,/.*$,/,'`
|
||||
if test "$dir" = "$object"; then
|
||||
dir=
|
||||
fi
|
||||
# FIXME: should be _deps on DOS.
|
||||
depfile="$dir.deps/$base"
|
||||
fi
|
||||
|
||||
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
|
||||
|
||||
rm -f "$tmpdepfile"
|
||||
|
||||
# Some modes work just like other modes, but use different flags. We
|
||||
# parameterize here, but still list the modes in the big case below,
|
||||
# to make depend.m4 easier to write. Note that we *cannot* use a case
|
||||
# here, because this file can only contain one case statement.
|
||||
if test "$depmode" = hp; then
|
||||
# HP compiler uses -M and no extra arg.
|
||||
gccflag=-M
|
||||
depmode=gcc
|
||||
fi
|
||||
|
||||
if test "$depmode" = dashXmstdout; then
|
||||
# This is just like dashmstdout with a different argument.
|
||||
dashmflag=-xM
|
||||
depmode=dashmstdout
|
||||
fi
|
||||
|
||||
case "$depmode" in
|
||||
gcc3)
|
||||
## gcc 3 implements dependency tracking that does exactly what
|
||||
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
|
||||
## it if -MD -MP comes after the -MF stuff. Hmm.
|
||||
"$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
mv "$tmpdepfile" "$depfile"
|
||||
;;
|
||||
|
||||
gcc)
|
||||
## There are various ways to get dependency output from gcc. Here's
|
||||
## why we pick this rather obscure method:
|
||||
## - Don't want to use -MD because we'd like the dependencies to end
|
||||
## up in a subdir. Having to rename by hand is ugly.
|
||||
## (We might end up doing this anyway to support other compilers.)
|
||||
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
|
||||
## -MM, not -M (despite what the docs say).
|
||||
## - Using -M directly means running the compiler twice (even worse
|
||||
## than renaming).
|
||||
if test -z "$gccflag"; then
|
||||
gccflag=-MD,
|
||||
fi
|
||||
"$@" -Wp,"$gccflag$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
|
||||
## The second -e expression handles DOS-style file names with drive letters.
|
||||
sed -e 's/^[^:]*: / /' \
|
||||
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
|
||||
## This next piece of magic avoids the `deleted header file' problem.
|
||||
## The problem is that when a header file which appears in a .P file
|
||||
## is deleted, the dependency causes make to die (because there is
|
||||
## typically no way to rebuild the header). We avoid this by adding
|
||||
## dummy dependencies for each header file. Too bad gcc doesn't do
|
||||
## this for us directly.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" |
|
||||
## Some versions of gcc put a space before the `:'. On the theory
|
||||
## that the space means something, we add a space to the output as
|
||||
## well.
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
hp)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
sgi)
|
||||
if test "$libtool" = yes; then
|
||||
"$@" "-Wp,-MDupdate,$tmpdepfile"
|
||||
else
|
||||
"$@" -MDupdate "$tmpdepfile"
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
|
||||
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
|
||||
echo "$object : \\" > "$depfile"
|
||||
|
||||
# Clip off the initial element (the dependent). Don't try to be
|
||||
# clever and replace this with sed code, as IRIX sed won't handle
|
||||
# lines with more than a fixed number of characters (4096 in
|
||||
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
|
||||
# the IRIX cc adds comments like `#:fec' to the end of the
|
||||
# dependency line.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
|
||||
tr '
|
||||
' ' ' >> $depfile
|
||||
echo >> $depfile
|
||||
|
||||
# The second pass generates a dummy entry for each header file.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
|
||||
>> $depfile
|
||||
else
|
||||
# The sourcefile does not contain any dependencies, so just
|
||||
# store a dummy comment line, to avoid errors with the Makefile
|
||||
# "include basename.Plo" scheme.
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
aix)
|
||||
# The C for AIX Compiler uses -M and outputs the dependencies
|
||||
# in a .u file. In older versions, this file always lives in the
|
||||
# current directory. Also, the AIX compiler puts `$object:' at the
|
||||
# start of each line; $object doesn't have directory information.
|
||||
# Version 6 uses the directory in both cases.
|
||||
stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
|
||||
tmpdepfile="$stripped.u"
|
||||
if test "$libtool" = yes; then
|
||||
"$@" -Wc,-M
|
||||
else
|
||||
"$@" -M
|
||||
fi
|
||||
stat=$?
|
||||
|
||||
if test -f "$tmpdepfile"; then :
|
||||
else
|
||||
stripped=`echo "$stripped" | sed 's,^.*/,,'`
|
||||
tmpdepfile="$stripped.u"
|
||||
fi
|
||||
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
if test -f "$tmpdepfile"; then
|
||||
outname="$stripped.o"
|
||||
# Each line is of the form `foo.o: dependent.h'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
# The sourcefile does not contain any dependencies, so just
|
||||
# store a dummy comment line, to avoid errors with the Makefile
|
||||
# "include basename.Plo" scheme.
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
icc)
|
||||
# Intel's C compiler understands `-MD -MF file'. However on
|
||||
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
|
||||
# ICC 7.0 will fill foo.d with something like
|
||||
# foo.o: sub/foo.c
|
||||
# foo.o: sub/foo.h
|
||||
# which is wrong. We want:
|
||||
# sub/foo.o: sub/foo.c
|
||||
# sub/foo.o: sub/foo.h
|
||||
# sub/foo.c:
|
||||
# sub/foo.h:
|
||||
# ICC 7.1 will output
|
||||
# foo.o: sub/foo.c sub/foo.h
|
||||
# and will wrap long lines using \ :
|
||||
# foo.o: sub/foo.c ... \
|
||||
# sub/foo.h ... \
|
||||
# ...
|
||||
|
||||
"$@" -MD -MF "$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
# Each line is of the form `foo.o: dependent.h',
|
||||
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
|
||||
sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
tru64)
|
||||
# The Tru64 compiler uses -MD to generate dependencies as a side
|
||||
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
|
||||
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
|
||||
# dependencies in `foo.d' instead, so we check for that too.
|
||||
# Subdirectories are respected.
|
||||
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
|
||||
test "x$dir" = "x$object" && dir=
|
||||
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
|
||||
|
||||
if test "$libtool" = yes; then
|
||||
tmpdepfile1="$dir.libs/$base.lo.d"
|
||||
tmpdepfile2="$dir.libs/$base.d"
|
||||
"$@" -Wc,-MD
|
||||
else
|
||||
tmpdepfile1="$dir$base.o.d"
|
||||
tmpdepfile2="$dir$base.d"
|
||||
"$@" -MD
|
||||
fi
|
||||
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
if test -f "$tmpdepfile1"; then
|
||||
tmpdepfile="$tmpdepfile1"
|
||||
else
|
||||
tmpdepfile="$tmpdepfile2"
|
||||
fi
|
||||
if test -f "$tmpdepfile"; then
|
||||
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
|
||||
# That's a tab and a space in the [].
|
||||
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
#nosideeffect)
|
||||
# This comment above is used by automake to tell side-effect
|
||||
# dependency tracking mechanisms from slower ones.
|
||||
|
||||
dashmstdout)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout, regardless of -o.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove `-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
test -z "$dashmflag" && dashmflag=-M
|
||||
# Require at least two characters before searching for `:'
|
||||
# in the target name. This is to cope with DOS-style filenames:
|
||||
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
|
||||
"$@" $dashmflag |
|
||||
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
dashXmstdout)
|
||||
# This case only exists to satisfy depend.m4. It is never actually
|
||||
# run, as this mode is specially recognized in the preamble.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
makedepend)
|
||||
"$@" || exit $?
|
||||
# Remove any Libtool call
|
||||
if test "$libtool" = yes; then
|
||||
while test $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
# X makedepend
|
||||
shift
|
||||
cleared=no
|
||||
for arg in "$@"; do
|
||||
case $cleared in
|
||||
no)
|
||||
set ""; shift
|
||||
cleared=yes ;;
|
||||
esac
|
||||
case "$arg" in
|
||||
-D*|-I*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
# Strip any option that makedepend may not understand. Remove
|
||||
# the object too, otherwise makedepend will parse it as a source file.
|
||||
-*|$object)
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
esac
|
||||
done
|
||||
obj_suffix="`echo $object | sed 's/^.*\././'`"
|
||||
touch "$tmpdepfile"
|
||||
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
sed '1,2d' "$tmpdepfile" | tr ' ' '
|
||||
' | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile" "$tmpdepfile".bak
|
||||
;;
|
||||
|
||||
cpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove `-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
"$@" -E |
|
||||
sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
|
||||
sed '$ s: \\$::' > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
cat < "$tmpdepfile" >> "$depfile"
|
||||
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
msvisualcpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout, regardless of -o,
|
||||
# because we must use -o when running libtool.
|
||||
"$@" || exit $?
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case "$arg" in
|
||||
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
|
||||
set fnord "$@"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
"$@" -E |
|
||||
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
|
||||
echo " " >> "$depfile"
|
||||
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
none)
|
||||
exec "$@"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Unknown depmode $depmode" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
|
@ -0,0 +1,10 @@
|
|||
.*.sw[po]
|
||||
*~
|
||||
*.diff
|
||||
*.patch
|
||||
*.lo
|
||||
*.o
|
||||
Makefile
|
||||
Makefile.in
|
||||
.deps
|
||||
.libs
|
|
@ -0,0 +1,2 @@
|
|||
SUBDIRS = examples images
|
||||
EXTRA_DIST = userguide.shtml
|
|
@ -0,0 +1,10 @@
|
|||
.*.sw[po]
|
||||
*~
|
||||
*.diff
|
||||
*.patch
|
||||
*.lo
|
||||
*.o
|
||||
Makefile
|
||||
Makefile.in
|
||||
.deps
|
||||
.libs
|
|
@ -0,0 +1 @@
|
|||
EXTRA_DIST = mmsc.conf mmsbox.conf
|
|
@ -0,0 +1,59 @@
|
|||
group = core
|
||||
log-file = /var/log/mmsbox.log
|
||||
access-log = /var/log/mmsbox-access.log
|
||||
log-level = 0
|
||||
|
||||
group = mbuni
|
||||
storage-directory = /var/spool/mbuni
|
||||
max-send-threads = 5
|
||||
maximum-send-attempts = 50
|
||||
default-message-expiry = 360000
|
||||
queue-run-interval = 5
|
||||
send-attempt-back-off = 300
|
||||
sendmms-port = 10001
|
||||
|
||||
group = mmsc
|
||||
id = local
|
||||
mmsc-url = http://mbuni:test@localhost:1982/soap
|
||||
incoming-username = user
|
||||
incoming-password = pass
|
||||
incoming-port = 12345
|
||||
type = soap
|
||||
|
||||
# Sample conf for MMSBox using a modem (MM1)
|
||||
group = mmsc
|
||||
id = modem
|
||||
type = mm1
|
||||
mm1-sms-on-command = lynx -dump 'http://localhost:13000/start-smsc?password=bar&smsc=nokia-modem'
|
||||
mm1-sms-off-command = lynx -dump 'http://localhost:13000/stop-smsc?password=bar&smsc=nokia-modem'
|
||||
mm1-msisdn = "100"
|
||||
mm1-http-proxy = 10.11.12.13:8080
|
||||
incoming-port = 13014
|
||||
mmsc-url = http://net.mmsc/servlets/mms
|
||||
mm1-gprs-on-command = /usr/local/sbin/start-net-gprs
|
||||
mm1-gprs-pid-command = "cat /var/run/ppp-net.pid|head -1"
|
||||
|
||||
group = mms-service
|
||||
name = me
|
||||
post-url = http://localhost/~bagyenda/test-mbuni.php
|
||||
catch-all = true
|
||||
http-post-parameters = fx=true&images[]=%i&text[]=%t&skip=1
|
||||
accept-x-mbuni-headers = true
|
||||
pass-thro-headers = X-NOKIA-MMSC-Charging,X-NOKIA-MMSC-Charged-Party
|
||||
keyword = test
|
||||
omit-empty = no
|
||||
suppress-reply = true
|
||||
service-code = regular
|
||||
|
||||
group = mms-service
|
||||
name = fullmessage
|
||||
get-url = http://localhost/images/apache_pb.gif
|
||||
# http-post-parameters = fx=true&image=%i&text=%t
|
||||
accept-x-mbuni-headers = true
|
||||
keyword = thixs
|
||||
|
||||
group = send-mms-user
|
||||
username = tester
|
||||
password = foobar
|
||||
faked-sender = 100
|
||||
|
|
@ -1,45 +1,56 @@
|
|||
group = core
|
||||
log-file = log/ours.log
|
||||
log-file = /tmp/log/mbuni-mmsc.log
|
||||
access-log = /tmp/log/mmsc-access.log
|
||||
log-level = 0
|
||||
|
||||
group = mmsbox
|
||||
group = mbuni
|
||||
name = "My MMSC"
|
||||
hostname = ds.co.ug
|
||||
host-alias = mmsc
|
||||
local-mmsc-domains = ds.co.ug,dsmagic.com,lilo,lilo.ds.co.ug
|
||||
local-prefixes = 034;+25634;25634
|
||||
send-queue-directory = spool/global
|
||||
mm1-queue-directory = spool/mm1
|
||||
mm4-queue-directory = spool/mm4
|
||||
local-prefixes = 037;+25637;25637
|
||||
storage-directory = /tmp/spool
|
||||
max-send-threads = 5
|
||||
send-mail-prog = /usr/sbin/sendmail -f '%f' '%t'
|
||||
unified-prefix = "+25634,034,34"
|
||||
unified-prefix = "+25637,037,37"
|
||||
maximum-send-attempts = 50
|
||||
mm1-maximum-notify-attempts = 1
|
||||
default-message-expiry = 360000
|
||||
queue-run-interval = 0.1
|
||||
max-message-expiry = 720000
|
||||
mmsc-services = Relay,MM1
|
||||
queue-run-interval = 5
|
||||
mm1-queue-run-interval = 300
|
||||
send-attempt-back-off = 300
|
||||
sendsms-url = http://localhost:13013/cgi-bin/sendsms
|
||||
sendsms-username = tester
|
||||
sendsms-password = foobar
|
||||
#sendsms-global-sender = 198
|
||||
mms-port = 1981
|
||||
mm7-port = 1982
|
||||
#allow-ip = 192.168.129.11
|
||||
email2mms-relay-prefixes = "034;035;25634"
|
||||
ua-profile-cache-directory = misc/profiles
|
||||
billing-module-parameters = "log/cdr.log"
|
||||
email2mms-relay-hosts = "mbuni.org;dsmagic.com;ds.co.ug"
|
||||
billing-module-parameters = "/tmp/log/cdr.log"
|
||||
# billing-library = billdemo.so
|
||||
prov-server-notify-script = ~/src/mmprov/provnotify.sh
|
||||
prov-server-sub-status-script = ~/src/mmprov/rcptstatus.sh
|
||||
#prov-server-notify-script = ~/src/mmprov/provnotify.sh
|
||||
#prov-server-sub-status-script = ~/src/mmprov/rcptstatus.sh
|
||||
content-adaptation = true
|
||||
notify-unprovisioned = yes
|
||||
mms-notify-text = "You have received a multimedia message from %S, go to XXX to view it"
|
||||
mm-box-host = test.ds.co.ug
|
||||
mms-notify-unprovisioned-text = "This is a test"
|
||||
mms-to-email-txt = "This is a multimedia message (HTML suppressed)"
|
||||
mms-to-email-html = "This is a multimedia message powered by <emph>Digital Solutions</emph>"
|
||||
mms-to-email-default-subject = "This is a multimedia message"
|
||||
mms-message-too-large-txt = "You have received a multimedia message from %S that is too large for your phone. Go to xxx to view it"
|
||||
strip-prefixes = "1;2"
|
||||
|
||||
group = mms-vasp
|
||||
vasp-id = newscorp
|
||||
type = soap
|
||||
short-code = 111
|
||||
vasp-username = mbuni
|
||||
vasp-password = test
|
||||
vasp-url = http://user:pass@localhost:12345/
|
||||
|
||||
group = mmsproxy
|
||||
name = "A test mms proxy"
|
||||
host = test.com
|
||||
allowed-prefix = "035"
|
||||
denied-prefix = "034"
|
||||
host = ds.co.ug
|
||||
allowed-prefix = "+25635"
|
||||
denied-prefix = "037"
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
.*.sw[po]
|
||||
*~
|
||||
*.diff
|
||||
*.patch
|
||||
*.lo
|
||||
*.o
|
||||
Makefile
|
||||
Makefile.in
|
||||
.deps
|
||||
.libs
|
|
@ -0,0 +1 @@
|
|||
EXTRA_DIST = empty.gif logo.jpg mmsgw.png
|
Binary file not shown.
After Width: | Height: | Size: 43 B |
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
Binary file not shown.
After Width: | Height: | Size: 31 KiB |
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,7 @@
|
|||
if BUILD_PGSQLQ
|
||||
X = pgsql-queue
|
||||
endif
|
||||
if BUILD_MMSBOXMM1
|
||||
Y = mmsbox-mm1
|
||||
endif
|
||||
SUBDIRS = $(X) $(Y)
|
|
@ -0,0 +1,3 @@
|
|||
lib_LTLIBRARIES = libmmsbox_mm1.la
|
||||
libmmsbox_mm1_la_SOURCES = mmsbox_mm1.c
|
||||
libmmsbox_mm1_la_LDFLAGS = -module
|
|
@ -0,0 +1,761 @@
|
|||
/*
|
||||
* Mbuni - Open Source MMS Gateway
|
||||
*
|
||||
* Mbuni MmsBox MM1 Component - Send & Receive MMS using a GPRS/EDGE/3G modem
|
||||
*
|
||||
* Copyright (C) 2007-2009, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
*
|
||||
* Paul Bagyenda <bagyenda@dsmagic.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License, with a few exceptions granted (see LICENSE)
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <signal.h>
|
||||
#include <sys/wait.h>
|
||||
|
||||
#include "mmsbox_mmsc.h"
|
||||
#include "mmsbox_cfg.h"
|
||||
#include "mmsbox.h"
|
||||
#include "mms_util.h"
|
||||
|
||||
typedef struct {
|
||||
Octstr *mmsc_url; /* mmsc-url. */
|
||||
Octstr *msisdn; /* my msisdn. */
|
||||
Octstr *proxy; /* form is host:port. */
|
||||
Octstr *gprs_on; /* Command to start GPRS link. Must not exit. */
|
||||
Octstr *gprs_off; /* Command to stop GPRS link. */
|
||||
Octstr *gprs_pid; /* command to call to get PID of GPRS for stopping GPRS link (i.e. pppd). */
|
||||
Octstr *smsc_on; /* command to start smsc connection */
|
||||
Octstr *smsc_off; /* commadn to stop smsc connection */
|
||||
int port; /* port for incoming messages. */
|
||||
Octstr *interface; /* specific interface to listen on. */
|
||||
|
||||
Octstr *unified_prefix; /* copies from above, do not edit! */
|
||||
List *strip_prefixes;
|
||||
|
||||
/* internal data. */
|
||||
MmscGrp *info;
|
||||
MmsQueueHandlerFuncs *qfs;
|
||||
List *requests; /* list of requests. */
|
||||
long h_tid, d_tid; /* thread IDs. */
|
||||
|
||||
int sender_alive;
|
||||
|
||||
} MM1Settings;
|
||||
|
||||
typedef struct {
|
||||
enum {MM1_GET, MM1_PUSH} type;
|
||||
int waiter_exists; /* set to true if after handling, should signal and NOT destroy struct.*/
|
||||
pthread_cond_t cond;
|
||||
pthread_mutex_t mutex;
|
||||
union {
|
||||
MmsMsg *m; /* for push. */
|
||||
Octstr *url; /* for get */
|
||||
} u;
|
||||
void *result; /* set to the result for a PUSH */
|
||||
Octstr *error;
|
||||
} MM1Request;
|
||||
|
||||
static void stop_gprs(Octstr *cmd);
|
||||
static void handle_notify(MM1Settings *mm1);
|
||||
static void handle_mm1(MM1Settings *mm1);
|
||||
static int open_mm1(MmscGrp *mmc, MmsQueueHandlerFuncs *qfs,
|
||||
Octstr *unified_prefix, List *strip_prefixes,
|
||||
void **data)
|
||||
{
|
||||
Octstr *x, *y;
|
||||
List *l;
|
||||
Octstr *mmsc_url = NULL;
|
||||
Octstr *proxy = NULL;
|
||||
Octstr *gprs_on = NULL;
|
||||
Octstr *gprs_off = NULL;
|
||||
Octstr *gprs_pid = NULL;
|
||||
Octstr *smsc_on = NULL;
|
||||
Octstr *smsc_off = NULL;
|
||||
int port = 80;
|
||||
Octstr *interface = NULL;
|
||||
Octstr *msisdn = NULL;
|
||||
|
||||
MM1Settings *mm1;
|
||||
|
||||
/* parse the settings. */
|
||||
|
||||
x = octstr_duplicate(mmc->settings);
|
||||
l = octstr_split(x, octstr_imm(";"));
|
||||
octstr_destroy(x);
|
||||
if (l)
|
||||
while ((y = gwlist_extract_first(l)) != NULL) {
|
||||
int i = octstr_search_char(y, '=', 0);
|
||||
Octstr *item = (i>=0) ? octstr_copy(y, 0, i) : NULL;
|
||||
Octstr *value = (i>=0) ? octstr_copy(y, i+1, octstr_len(y)) : NULL;
|
||||
|
||||
if (item == NULL)
|
||||
octstr_destroy(value);
|
||||
else if (octstr_str_case_compare(item, "mmsc-url") == 0)
|
||||
mmsc_url = value;
|
||||
else if (octstr_str_case_compare(item, "proxy") == 0)
|
||||
proxy = value;
|
||||
else if (octstr_str_case_compare(item, "gprs-on") == 0)
|
||||
gprs_on = value;
|
||||
else if (octstr_str_case_compare(item, "gprs-off") == 0)
|
||||
gprs_off = value;
|
||||
else if (octstr_str_case_compare(item, "gprs-pid") == 0)
|
||||
gprs_pid = value;
|
||||
else if (octstr_str_case_compare(item, "port") == 0) {
|
||||
port = value ? atoi(octstr_get_cstr(value)) : 80;
|
||||
if (http_open_port(port, 0) != 0)
|
||||
mms_warning(0, "mmsbox-mm1", NULL, "failed to open incoming notifications port %d: %s",
|
||||
port, strerror(errno));
|
||||
}else if (octstr_str_case_compare(item, "http-interface") == 0)
|
||||
interface = value;
|
||||
else if (octstr_str_case_compare(item, "smsc-on") == 0)
|
||||
smsc_on = value;
|
||||
else if (octstr_str_case_compare(item, "smsc-off") == 0)
|
||||
smsc_off = value;
|
||||
else if (octstr_str_case_compare(item, "msisdn") == 0)
|
||||
msisdn = value;
|
||||
else {
|
||||
mms_error(0, "mmsbox-mm1", NULL, "unknown/unsupported option: %s", octstr_get_cstr(item));
|
||||
octstr_destroy(value);
|
||||
}
|
||||
octstr_destroy(item);
|
||||
octstr_destroy(y);
|
||||
}
|
||||
else {
|
||||
mms_error(0, "mmsbox-mm1", NULL, "failed to parse settings string: %s", octstr_get_cstr(mmc->settings));
|
||||
return -1;
|
||||
}
|
||||
|
||||
gwlist_destroy(l, NULL);
|
||||
|
||||
mm1 = gw_malloc(sizeof *mm1);
|
||||
mm1->mmsc_url = mmsc_url;
|
||||
mm1->proxy = proxy;
|
||||
mm1->gprs_on = gprs_on;
|
||||
mm1->gprs_off = gprs_off;
|
||||
mm1->gprs_pid = gprs_pid;
|
||||
mm1->smsc_on = smsc_on;
|
||||
mm1->smsc_off = smsc_off;
|
||||
mm1->port = port;
|
||||
mm1->interface = interface;
|
||||
mm1->msisdn = msisdn;
|
||||
|
||||
mm1->unified_prefix = unified_prefix;
|
||||
mm1->strip_prefixes = strip_prefixes;
|
||||
|
||||
mm1->qfs = qfs;
|
||||
mm1->info = mmc;
|
||||
mm1->requests = gwlist_create();
|
||||
mm1->sender_alive = 0;
|
||||
gwlist_add_producer(mm1->requests); /* so that when first listener starts, knows there is a consumer. */
|
||||
mm1->h_tid = gwthread_create((gwthread_func_t *)handle_notify, mm1);
|
||||
mm1->d_tid = gwthread_create((gwthread_func_t *)handle_mm1, mm1);
|
||||
|
||||
*data = mm1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static void handle_notify(MM1Settings *mm1)
|
||||
{
|
||||
HTTPClient *client = NULL;
|
||||
Octstr *ip = NULL, *url = NULL;
|
||||
Octstr *body = NULL;
|
||||
List *cgivars = NULL, *h = NULL;
|
||||
|
||||
while ((client = http_accept_request(mm1->port, &ip, &url, &h, &body, &cgivars)) != NULL) {
|
||||
List *cgivar_ctypes = NULL;
|
||||
Octstr *text, *rb = NULL, *s = NULL, *loc = NULL;
|
||||
MmsMsg *m = NULL;
|
||||
int hdrlen, status = HTTP_ACCEPTED, mtype;
|
||||
List *mh = NULL, *to = gwlist_create(), *rh = http_create_empty_headers();
|
||||
time_t expiryt = -1, deliveryt = -1;
|
||||
Octstr *from = NULL, *subject = NULL, *otransid = NULL, *mmc_id = NULL;
|
||||
Octstr *qdir;
|
||||
|
||||
|
||||
|
||||
parse_cgivars(h, body, &cgivars, &cgivar_ctypes);
|
||||
text = http_cgi_variable(cgivars, "text");
|
||||
|
||||
if (!text) {
|
||||
rb = octstr_imm("mmsbox-mm1: missing 'text' CGI parameter!");
|
||||
status = HTTP_NOT_FOUND;
|
||||
goto loop;
|
||||
}
|
||||
/* now parse the MMS, determine what kind it is,
|
||||
queue the fetch request or deal with it directly.
|
||||
*/
|
||||
hdrlen = octstr_get_char(text, 2);
|
||||
if ((s = octstr_copy(text, 3 + hdrlen, octstr_len(text))) != NULL)
|
||||
m = mms_frombinary(s, mm1->msisdn);
|
||||
else
|
||||
m = NULL;
|
||||
|
||||
if (m == NULL) {
|
||||
rb = octstr_imm("mmsbox-mm1: mal-formed mms packet on interface!");
|
||||
status = HTTP_FORBIDDEN;
|
||||
goto loop;
|
||||
} else
|
||||
mms_msgdump(m, 1);
|
||||
|
||||
/* rest of this copied largely from EAIF code. */
|
||||
mh = mms_message_headers(m);
|
||||
mtype = mms_messagetype(m);
|
||||
mms_collect_envdata_from_msgheaders(mh, &to, &subject,
|
||||
&otransid, &expiryt, &deliveryt,
|
||||
DEFAULT_EXPIRE, -1,
|
||||
octstr_get_cstr(mm1->unified_prefix),
|
||||
mm1->strip_prefixes);
|
||||
from = http_header_value(mh, octstr_imm("From"));
|
||||
|
||||
qdir = get_mmsbox_queue_dir(from, to, mm1->info, &mmc_id); /* get routing info. */
|
||||
switch (mtype) {
|
||||
Octstr *qf;
|
||||
Octstr *dlr_url, *status_value, *msgid;
|
||||
List *rqh;
|
||||
case MMS_MSGTYPE_DELIVERY_IND: /* notification of a delivery. */
|
||||
case MMS_MSGTYPE_READ_ORIG_IND: /* message read. */
|
||||
msgid = http_header_value(mh, octstr_imm("Message-ID"));
|
||||
status_value = http_header_value(mh,
|
||||
(mtype == MMS_MSGTYPE_DELIVERY_IND) ?
|
||||
octstr_imm("X-Mms-Status") :
|
||||
octstr_imm("X-Mms-Read-Status"));
|
||||
|
||||
rqh = http_create_empty_headers();
|
||||
|
||||
dlr_url = mmsbox_get_report_info(m, mm1->info, mmc_id,
|
||||
(mtype == MMS_MSGTYPE_DELIVERY_IND) ?
|
||||
"delivery-report" : "read-report",
|
||||
status_value, rqh, NULL, 0, msgid);
|
||||
|
||||
qf = mm1->qfs->mms_queue_add(from, to, NULL,
|
||||
mm1->info->id, mmc_id,
|
||||
0, time(NULL) + default_msgexpiry, m, NULL,
|
||||
NULL, NULL,
|
||||
dlr_url, NULL,
|
||||
rqh,
|
||||
0,
|
||||
octstr_get_cstr(qdir),
|
||||
"MM7/MM1-IN",
|
||||
octstr_imm(MM_NAME));
|
||||
if (qf)
|
||||
/* Log to access log */
|
||||
mms_log((mtype == MMS_MSGTYPE_DELIVERY_IND) ? "Received DLR" : "Received RR",
|
||||
from, to, -1, msgid, status_value, mm1->info->id,
|
||||
"MMSBox", octstr_imm("MM1"), NULL);
|
||||
else
|
||||
status = HTTP_INTERNAL_SERVER_ERROR;
|
||||
octstr_destroy(qf);
|
||||
octstr_destroy(msgid);
|
||||
octstr_destroy(dlr_url);
|
||||
octstr_destroy(status_value);
|
||||
http_destroy_headers(rqh);
|
||||
break;
|
||||
|
||||
case MMS_MSGTYPE_NOTIFICATION_IND: /* notification of an incoming message. */
|
||||
if ((loc = http_header_value(mh, octstr_imm("X-Mms-Content-Location"))) != NULL) {
|
||||
MM1Request *r = gw_malloc(sizeof *r);
|
||||
|
||||
memset(r, 0, sizeof *r);
|
||||
r->type = MM1_GET;
|
||||
r->u.url = loc;
|
||||
r->waiter_exists = 0;
|
||||
loc = NULL;
|
||||
|
||||
gwlist_produce(mm1->requests, r);
|
||||
} else
|
||||
rb = octstr_format("mmsbox-mm1: notification with content-location??");
|
||||
break;
|
||||
default:
|
||||
rb = octstr_format("mmsbox-mm1: unexpected message type: %s",
|
||||
mms_message_type_to_cstr(mtype));
|
||||
status = HTTP_NOT_FOUND;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
loop:
|
||||
/* send reply. */
|
||||
http_header_add(rh, "Content-Type", "text/plain");
|
||||
http_send_reply(client, status, rh, rb ? rb : octstr_imm(""));
|
||||
|
||||
octstr_destroy(s);
|
||||
octstr_destroy(ip);
|
||||
octstr_destroy(url);
|
||||
octstr_destroy(loc);
|
||||
octstr_destroy(mmc_id);
|
||||
octstr_destroy(from);
|
||||
octstr_destroy(subject);
|
||||
octstr_destroy(otransid);
|
||||
octstr_destroy(body);
|
||||
octstr_destroy(rb);
|
||||
|
||||
gwlist_destroy(to, (void *)octstr_destroy);
|
||||
http_destroy_headers(h);
|
||||
http_destroy_headers(rh);
|
||||
http_destroy_headers(mh);
|
||||
http_destroy_cgiargs(cgivars);
|
||||
http_destroy_cgiargs(cgivar_ctypes);
|
||||
mms_destroy(m);
|
||||
}
|
||||
|
||||
mms_info(0, "mmsbox-mm1", NULL, "handle_notify exits");
|
||||
gwlist_remove_producer(mm1->requests); /* cause consumers to shut down. */
|
||||
}
|
||||
|
||||
|
||||
static Octstr *send_msg(void *data, Octstr *from, Octstr *to,
|
||||
Octstr *transid,
|
||||
Octstr *linkedid, char *vasid, Octstr *service_code,
|
||||
MmsMsg *m, List *hdrs, Octstr **err, int *retry)
|
||||
{
|
||||
MM1Request *r = gw_malloc(sizeof *r);
|
||||
MM1Settings *s = data;
|
||||
Octstr *id;
|
||||
|
||||
gw_assert(data);
|
||||
gw_assert(m);
|
||||
|
||||
if (!s->sender_alive) {
|
||||
*err = octstr_imm("internal error, mm1 notify not started!");
|
||||
*retry = 1;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Remove the from address first of all, replace the to address as well */
|
||||
mms_replace_header_value(m, "From", "#insert");
|
||||
mms_replace_header_value(m, "To", octstr_get_cstr(to));
|
||||
mms_remove_headers(m, "Message-ID");
|
||||
|
||||
r->u.m = m;
|
||||
pthread_cond_init(&r->cond, NULL);
|
||||
pthread_mutex_init(&r->mutex, NULL);
|
||||
r->waiter_exists = 1;
|
||||
r->type = MM1_PUSH;
|
||||
r->result = NULL;
|
||||
r->error = NULL;
|
||||
|
||||
pthread_mutex_lock(&r->mutex); /* at pickup, must grab mutex before signalling. otherwise race condition.*/
|
||||
|
||||
gwlist_produce(s->requests, r);
|
||||
|
||||
pthread_cond_wait(&r->cond, &r->mutex);
|
||||
|
||||
*err = r->error;
|
||||
|
||||
id = r->result;
|
||||
mms_info(0, "mmsbox-mm1", NULL, "sent message, type=%s, result=%s",
|
||||
mms_message_type_to_cstr(mms_messagetype(m)), r->error ? octstr_get_cstr(r->error) : "(none)");
|
||||
/* destroy the structure. */
|
||||
if(r->error && (octstr_compare(r->error, octstr_imm("Error-service-denied")) == 0 ||
|
||||
octstr_compare(r->error, octstr_imm("Error-permanent-failure")) == 0))
|
||||
*retry = 0;
|
||||
else
|
||||
*retry = 1;
|
||||
|
||||
pthread_cond_destroy(&r->cond);
|
||||
pthread_mutex_destroy(&r->mutex);
|
||||
gw_free(r);
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
static long start_gprs(Octstr *cmd, Octstr *pid_cmd);
|
||||
static Octstr *fetch_content(Octstr *url, Octstr *proxy, Octstr *body, int *hstatus);
|
||||
static void handle_mm1(MM1Settings *mm1)
|
||||
{
|
||||
/* stop smsc, start GPRS, transact, stop GPRS, start SMSC. And so on. */
|
||||
MM1Request *r;
|
||||
|
||||
mms_info(0, "mmsbox-mm1", NULL, "handle_mm1 started");
|
||||
mm1->sender_alive++;
|
||||
while ((r = gwlist_consume(mm1->requests)) != NULL) {
|
||||
long n, pid = -1;
|
||||
if (mm1->smsc_off) {
|
||||
n = system(octstr_get_cstr(mm1->smsc_off));
|
||||
gwthread_sleep(5); /* allow it to die. */
|
||||
}
|
||||
if (mm1->gprs_on)
|
||||
pid = start_gprs(mm1->gprs_on, mm1->gprs_pid);
|
||||
|
||||
if (pid < 0) {
|
||||
mms_warning(0, "mmsbox-mm1", NULL,
|
||||
"Failed to start GPRS connection. waiting...");
|
||||
gwthread_sleep(2);
|
||||
goto kill_gprs;
|
||||
} else
|
||||
mms_info(0, "mmsbox-mm1", NULL, "start_gprs returned PID: %ld", pid);
|
||||
|
||||
do {
|
||||
Octstr *body;
|
||||
Octstr *url;
|
||||
int hstatus = 0;
|
||||
Octstr *ms;
|
||||
MmsMsg *m;
|
||||
int msize;
|
||||
|
||||
if (r->waiter_exists)
|
||||
pthread_mutex_lock(&r->mutex); /* grab lock to avoid race condition */
|
||||
|
||||
body = (r->type == MM1_PUSH) ? mms_tobinary(r->u.m) : NULL;
|
||||
url = (r->type == MM1_PUSH) ? mm1->mmsc_url : r->u.url;
|
||||
ms = fetch_content(url, mm1->proxy, body, &hstatus);
|
||||
msize = ms ? octstr_len(ms) : 0;
|
||||
m = (hstatus == 0 && ms) ? mms_frombinary(ms, mm1->msisdn) : NULL;
|
||||
|
||||
if (r->type == MM1_GET) {
|
||||
if (m == NULL)
|
||||
mms_error(0, "mmsbox-mm1", NULL, "failed to fetch mms from URL: %s!",
|
||||
octstr_get_cstr(url));
|
||||
else {
|
||||
List *mh = mms_message_headers(m), *to = gwlist_create();
|
||||
Octstr *subject = NULL, *otransid = NULL, *msgid = NULL, *value;
|
||||
Octstr *hfrom = mh ? http_header_value(mh, octstr_imm("From")) : octstr_imm("anon@anon");
|
||||
Octstr *qf = NULL, *qdir = NULL, *mmc_id = NULL;
|
||||
time_t expiryt = -1, deliveryt = -1;
|
||||
int dlr;
|
||||
|
||||
/* we assume it is a true message (send_req|retrieve_conf) */
|
||||
mms_collect_envdata_from_msgheaders(mh, &to, &subject,
|
||||
&otransid, &expiryt, &deliveryt,
|
||||
DEFAULT_EXPIRE, -1,
|
||||
octstr_get_cstr(mm1->unified_prefix),
|
||||
mm1->strip_prefixes);
|
||||
|
||||
msgid = http_header_value(mh, octstr_imm("Message-ID"));
|
||||
value = http_header_value(mh, octstr_imm("X-Mms-Delivery-Report"));
|
||||
if (value &&
|
||||
octstr_case_compare(value, octstr_imm("Yes")) == 0)
|
||||
dlr = 1;
|
||||
else
|
||||
dlr = 0;
|
||||
octstr_destroy(value);
|
||||
|
||||
if (deliveryt < 0)
|
||||
deliveryt = time(NULL);
|
||||
|
||||
if (expiryt < 0)
|
||||
expiryt = time(NULL) + DEFAULT_EXPIRE;
|
||||
|
||||
if (hfrom == NULL)
|
||||
hfrom = http_header_value(mh, octstr_imm("From"));
|
||||
|
||||
mms_remove_headers(m, "Bcc");
|
||||
mms_remove_headers(m, "X-Mms-Delivery-Time");
|
||||
mms_remove_headers(m, "X-Mms-Expiry");
|
||||
mms_remove_headers(m, "X-Mms-Sender-Visibility");
|
||||
|
||||
qdir = get_mmsbox_queue_dir(hfrom, to, mm1->info, &mmc_id); /* get routing info. */
|
||||
/* Save it, put message id in header, return. */
|
||||
qf = qfs->mms_queue_add(hfrom, to, subject,
|
||||
mm1->info->id, mmc_id,
|
||||
deliveryt, expiryt, m, NULL,
|
||||
NULL, NULL,
|
||||
NULL, NULL,
|
||||
NULL,
|
||||
dlr,
|
||||
octstr_get_cstr(qdir),
|
||||
"MM7/MM1-IN",
|
||||
octstr_imm(MM_NAME));
|
||||
|
||||
if (qf)
|
||||
/* Log to access log */
|
||||
mms_log("Received", hfrom, to, msize,
|
||||
msgid, NULL, mm1->info->id, "MMSBox",octstr_imm("MM1"), NULL);
|
||||
else
|
||||
mms_error(0, "mmsbox-mm1", NULL, "failed to create queue entry for URL %s",
|
||||
octstr_get_cstr(url));
|
||||
|
||||
if (otransid) { /* tell mmsc that we fetched fine. */
|
||||
int _status;
|
||||
MmsMsg *mresp = mms_notifyresp_ind(octstr_get_cstr(otransid),
|
||||
mms_message_enc(m), "Retrieved", 1);
|
||||
Octstr *sm = mms_tobinary(mresp);
|
||||
Octstr *_x = fetch_content(mm1->mmsc_url, mm1->proxy,
|
||||
sm, &_status);
|
||||
|
||||
octstr_destroy(_x);
|
||||
octstr_destroy(sm);
|
||||
mms_destroy(mresp);
|
||||
}
|
||||
gwlist_destroy(to, (gwlist_item_destructor_t *)octstr_destroy);
|
||||
octstr_destroy(hfrom);
|
||||
octstr_destroy(subject);
|
||||
octstr_destroy(otransid);
|
||||
octstr_destroy(msgid);
|
||||
octstr_destroy(qf);
|
||||
octstr_destroy(mmc_id);
|
||||
|
||||
http_destroy_headers(mh);
|
||||
}
|
||||
|
||||
} else if (r->type == MM1_PUSH) {
|
||||
/* we expect a send-conf. */
|
||||
if (ms) {
|
||||
octstr_dump(ms, 0);
|
||||
|
||||
mms_msgdump(m, 1);
|
||||
} else
|
||||
mms_warning(0, "mmsbox-mm1", NULL,"No send-conf returned by operator");
|
||||
|
||||
if (m == NULL ||
|
||||
(r->result = mms_get_header_value(m, octstr_imm("Message-ID"))) == NULL ||
|
||||
octstr_compare(mms_get_header_value(m, octstr_imm("X-Mms-Response-Status")),
|
||||
octstr_imm("Ok")) != 0
|
||||
) {
|
||||
Octstr *err = m ? mms_get_header_value(m, octstr_imm("X-Mms-Response-Text")) : NULL;
|
||||
Octstr *status = m ? mms_get_header_value(m, octstr_imm("X-Mms-Response-Status")) : NULL;
|
||||
if(status && (octstr_compare(status, octstr_imm("Error-service-denied")) == 0 ||
|
||||
octstr_compare(status, octstr_imm("Error-permanent-failure")) == 0)) {
|
||||
r->error = octstr_duplicate(status);
|
||||
}
|
||||
r->result = NULL; /* indicate failure to bearerbox */
|
||||
mms_error(0, "mmsbox-mm1", NULL, "Sending failed: %s, %s!",
|
||||
err ? octstr_get_cstr(err) : "(none)",
|
||||
status ? octstr_get_cstr(status) : "(none)");
|
||||
octstr_destroy(err);
|
||||
octstr_destroy(status);
|
||||
}
|
||||
} else
|
||||
mms_error(0, "mmsbox-mm1", NULL, "unknown type: %d", r->type);
|
||||
|
||||
if (r->waiter_exists) {
|
||||
pthread_mutex_unlock(&r->mutex);
|
||||
pthread_cond_signal(&r->cond);
|
||||
} else /* no waiter, so we free it ourselves. */
|
||||
gw_free(r);
|
||||
|
||||
octstr_destroy(body);
|
||||
octstr_destroy(ms);
|
||||
mms_destroy(m);
|
||||
r = NULL;
|
||||
pid_t wp;
|
||||
int st;
|
||||
wp = waitpid(pid, &st, WNOHANG);
|
||||
if(wp == pid && WIFEXITED(st)) {
|
||||
mms_info(0, "mmsbox-mm1", NULL, "GPRS pid (%d) appears to be dead - quitting loop", pid);
|
||||
goto after_gprs_dead;
|
||||
}
|
||||
gwthread_sleep(2); /* according to Piotr Isajew, this makes life better */
|
||||
} while (gwlist_len(mm1->requests) > 0 &&
|
||||
(r = gwlist_consume(mm1->requests)) != NULL);
|
||||
|
||||
kill_gprs:
|
||||
if(r != NULL) {
|
||||
if(r->waiter_exists) {
|
||||
pthread_mutex_unlock(&r->mutex);
|
||||
pthread_cond_signal(&r->cond);
|
||||
} else{
|
||||
gw_free(r);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (mm1->gprs_off) {
|
||||
stop_gprs(mm1->gprs_off);
|
||||
} else if (pid > 0) { /* stop GPRS, restart SMSC connection. */
|
||||
int xkill, status;
|
||||
pid_t wpid;
|
||||
do {
|
||||
xkill = kill(pid, SIGTERM);
|
||||
mms_info(0, "mmsbox-mm1", NULL, "GPRS turned off returned: %d", xkill);
|
||||
if (xkill < 0 && errno == ESRCH)
|
||||
break;
|
||||
wpid = waitpid(pid, &status, 0);
|
||||
if (wpid == pid && WIFEXITED(status))
|
||||
break;
|
||||
else if (wpid < 0 && errno == ECHILD)
|
||||
break;
|
||||
} while (1);
|
||||
gwthread_sleep(2);
|
||||
}
|
||||
after_gprs_dead:
|
||||
if (mm1->smsc_on) {
|
||||
system(octstr_get_cstr(mm1->smsc_on));
|
||||
gwthread_sleep(5);
|
||||
mms_info(0, "mmsbox-mm1", NULL, "SMSC turned on");
|
||||
}
|
||||
|
||||
}
|
||||
mm1->sender_alive--;
|
||||
mms_info(0, "mmsbox-mm1", NULL, "handle_mm1 exits");
|
||||
}
|
||||
|
||||
static int close_mm1(void *data)
|
||||
{
|
||||
MM1Settings *s = data;
|
||||
|
||||
/* close the port, and all will die. */
|
||||
http_close_port(s->port);
|
||||
gwthread_sleep(2);
|
||||
gwthread_join(s->h_tid);
|
||||
gwthread_sleep(2);
|
||||
gwthread_join(s->d_tid);
|
||||
|
||||
octstr_destroy(s->mmsc_url);
|
||||
octstr_destroy(s->msisdn);
|
||||
octstr_destroy(s->proxy);
|
||||
octstr_destroy(s->gprs_on);
|
||||
octstr_destroy(s->gprs_off);
|
||||
octstr_destroy(s->gprs_pid);
|
||||
octstr_destroy(s->smsc_on);
|
||||
octstr_destroy(s->smsc_off);
|
||||
octstr_destroy(s->interface);
|
||||
|
||||
gwlist_destroy(s->requests, NULL);
|
||||
|
||||
gw_free(s);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
MmsBoxMmscFuncs mmsc_funcs = {
|
||||
open_mm1,
|
||||
close_mm1,
|
||||
send_msg
|
||||
};
|
||||
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
|
||||
static int write_octstr_data(void *buffer, size_t size, size_t nmemb, void *userp)
|
||||
{
|
||||
Octstr *out = userp;
|
||||
|
||||
octstr_append_data(out, buffer, size*nmemb);
|
||||
mms_info(0, "mmsbox-mm1", NULL, "write_data called with nmemn=%ld, size=%ld",
|
||||
nmemb, size);
|
||||
return size*nmemb;
|
||||
}
|
||||
|
||||
static Octstr *fetch_content(Octstr *url, Octstr *proxy, Octstr *body, int *hstatus)
|
||||
{
|
||||
CURL *cl;
|
||||
struct curl_slist *h = NULL;
|
||||
char errbuf[512];
|
||||
static int curl_inited = 0;
|
||||
Octstr *s = octstr_create("");
|
||||
|
||||
if (curl_inited == 0) {
|
||||
curl_global_init(CURL_GLOBAL_ALL);
|
||||
curl_inited = 1;
|
||||
}
|
||||
|
||||
cl = curl_easy_init();
|
||||
curl_easy_setopt(cl, CURLOPT_URL, octstr_get_cstr(url));
|
||||
if (proxy && octstr_len(proxy) > 0)
|
||||
curl_easy_setopt(cl, CURLOPT_PROXY, octstr_get_cstr(proxy));
|
||||
curl_easy_setopt(cl, CURLOPT_WRITEFUNCTION, write_octstr_data);
|
||||
curl_easy_setopt(cl, CURLOPT_WRITEDATA, s);
|
||||
curl_easy_setopt(cl, CURLOPT_NOSIGNAL, 1L);
|
||||
curl_easy_setopt(cl, CURLOPT_TIMEOUT, 120L);
|
||||
curl_easy_setopt(cl, CURLOPT_FORBID_REUSE, 1L);
|
||||
curl_easy_setopt(cl, CURLOPT_CONNECTTIMEOUT, 40L);
|
||||
|
||||
h = curl_slist_append(h, "Accept: */*");
|
||||
if (body) { /* POST. */
|
||||
h = curl_slist_append(h, "Content-Type: application/vnd.wap.mms-message");
|
||||
h = curl_slist_append(h, "User-Agent: Mozilla/5.0 (SymbianOS/9.4;U;"
|
||||
"Series60/5.0 Nokia5800d-1/52.50.2008.24;"
|
||||
"Profile/MIDP-2.1Configuration/CLDC-1.1 ) "
|
||||
"AppleWebKit/413 (KHTML, like Gecko) "
|
||||
"Safari/413");
|
||||
curl_easy_setopt(cl, CURLOPT_POSTFIELDS, octstr_get_cstr(body));
|
||||
curl_easy_setopt(cl, CURLOPT_POSTFIELDSIZE, octstr_len(body));
|
||||
}
|
||||
|
||||
|
||||
curl_easy_setopt(cl, CURLOPT_HTTPHEADER, h);
|
||||
curl_easy_setopt(cl, CURLOPT_ERRORBUFFER, errbuf);
|
||||
|
||||
*hstatus = curl_easy_perform(cl); /* post away! */
|
||||
if (*hstatus != 0)
|
||||
mms_error(0, "mmsbox-mm1", NULL, "failed to fetch/post content to host %s [proxy: %s] [http_status=%d] : %.256s",
|
||||
octstr_get_cstr(url), octstr_len(proxy) > 0 ? octstr_get_cstr(proxy) : "n/a",
|
||||
*hstatus, errbuf);
|
||||
|
||||
curl_slist_free_all(h); /* free the header list */
|
||||
curl_easy_setopt(cl, CURLOPT_NOSIGNAL, 0L);
|
||||
curl_easy_cleanup(cl);
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
static void stop_gprs(Octstr *cmd)
|
||||
{
|
||||
pid_t pid = fork();
|
||||
if (pid == 0) {
|
||||
/* in child */
|
||||
List *l = octstr_split_words(cmd);
|
||||
int i, n = gwlist_len(l);
|
||||
char **args = gw_malloc((n+1) * sizeof *args);
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
Octstr *x = gwlist_get(l, i);
|
||||
args[i] = octstr_get_cstr(x);
|
||||
printf("arg %d: %s\n", i, args[i]);
|
||||
}
|
||||
args[i] = NULL;
|
||||
printf("Not reached: %d!", execvp(args[0], args));
|
||||
}
|
||||
}
|
||||
|
||||
#define MAX_GPRS_WAIT 80
|
||||
#define GPRS_POLL 5
|
||||
static long start_gprs(Octstr *cmd, Octstr *pid_cmd)
|
||||
{
|
||||
pid_t pid = fork();
|
||||
|
||||
if (pid > 0) { /* parent. */
|
||||
int ct = 0;
|
||||
do {
|
||||
FILE *f;
|
||||
long xpid = -1, cpid;
|
||||
int status;
|
||||
gwthread_sleep(GPRS_POLL); /* wait a little. */
|
||||
if ((f = popen(octstr_get_cstr(pid_cmd), "r")) != NULL) {
|
||||
fscanf(f, "%ld", &xpid);
|
||||
pclose(f);
|
||||
if (xpid >= 0)
|
||||
return xpid;
|
||||
}
|
||||
cpid = waitpid(pid, &status, WNOHANG); /* also wait for the child. */
|
||||
mms_info(0, "mmsbox-mm1", NULL, "waiting for connection: %d, pid=%ld cpid=%ld, ifexited=%d, exitstatus=%d",
|
||||
ct, (long)pid, cpid, WIFEXITED(status), WEXITSTATUS(status));
|
||||
if (cpid == pid &&
|
||||
WIFEXITED(status))
|
||||
return -1;
|
||||
} while (GPRS_POLL*ct++ < MAX_GPRS_WAIT);
|
||||
/* Timed out, but still need to wait for child pid, as
|
||||
start-gprs script is still running and we don't need a
|
||||
zombie */
|
||||
pid_t rpid;
|
||||
int st;
|
||||
|
||||
rpid = waitpid(pid, &st, 0);
|
||||
mms_info(0, "mmsbox-mm1", NULL, "pid %d terminated", pid);
|
||||
return -1;
|
||||
} else if (pid == 0) { /* child. */
|
||||
List *l = octstr_split_words(cmd);
|
||||
int i, n = gwlist_len(l);
|
||||
char **args = gw_malloc((n+1) * sizeof *args);
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
Octstr *x = gwlist_get(l, i);
|
||||
args[i] = octstr_get_cstr(x);
|
||||
printf("arg %d: %s\n", i, args[i]);
|
||||
}
|
||||
args[i] = NULL;
|
||||
printf("Not reached: %d!", execvp(args[0], args));
|
||||
} else
|
||||
mms_error(0, "mmsbox-mm1", NULL, "failed to start process!");
|
||||
return -1;
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
EXTRA_DIST = tables.sql
|
||||
lib_LTLIBRARIES = libmms_pgsql_queue.la
|
||||
libmms_pgsql_queue_la_SOURCES = mms_pgsql_queue.c
|
||||
libmms_pgsql_queue_la_LDFLAGS = -module
|
|
@ -0,0 +1,16 @@
|
|||
This module provides Queue management for mbuni using PostgreSQL as the storage engine.
|
||||
To use it, you need only add two lines to the mbuni config 'mbuni' group:
|
||||
|
||||
queue-manager-module = "/path_to/libmms_pgsql_queue.so"
|
||||
queue-module-init-data = "host=dbhost user=db_user password=dbpassword dbname=dbname"
|
||||
|
||||
Make sure the database you are trying to connect to has already been created
|
||||
and the relevant tables created using the supplied file "tables.sql".
|
||||
|
||||
Some notes:
|
||||
- Mbuni will open number_of_db_connections connections to the database at startup.
|
||||
Ensure your PostgreSQL installation limits are not exceeded. DB connections will
|
||||
be shared by all parts of Mbuni, which means that in high traffic situations,
|
||||
you may experience mbuni component slow-down as all db connections might be in use.
|
||||
- Vacuum your DB often, since a lot of rows are updated/deleted during operation.
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,52 @@
|
|||
-- Table structure for PostgreSQL MMS storage engine
|
||||
-- (c) 2007 Digital Solutions
|
||||
-- Licence: See http://mbuni.org/license.shtml
|
||||
-- Author: P. A. Bagyenda <bagyenda@dsmagic.com>
|
||||
-- Requires: PostgresQL v8.2 and above
|
||||
|
||||
-- Master messages table
|
||||
CREATE TABLE mms_messages (
|
||||
id bigserial PRIMARY KEY,
|
||||
qdir varchar(256) NOT NULL,
|
||||
qfname varchar(256) NOT NULL,
|
||||
sender varchar(256) NOT NULL,
|
||||
created timestamp with time zone NOT NULL DEFAULT current_timestamp,
|
||||
last_try timestamp with time zone NOT NULL DEFAULT '-infinity',
|
||||
send_time timestamp with time zone NOT NULL DEFAULT '-infinity',
|
||||
expire_date timestamp with time zone NOT NULL,
|
||||
num_attempts int NOT NULL DEFAULT 0,
|
||||
|
||||
data bytea NOT NULL DEFAULT '',
|
||||
UNIQUE(qdir, qfname)
|
||||
);
|
||||
|
||||
CREATE index mm_idx1 on mms_messages(qdir); -- because we use it for lookups.
|
||||
CREATE index mm_idx2 on mms_messages(send_time);
|
||||
CREATE index mm_idx3 on mms_messages(qfname);
|
||||
|
||||
-- create a view for message lookup
|
||||
CREATE VIEW mms_messages_view AS SELECT
|
||||
*,
|
||||
EXTRACT(EPOCH FROM created) AS cdate,
|
||||
EXTRACT(EPOCH FROM last_try) AS lastt,
|
||||
EXTRACT(EPOCH FROM send_time) AS sendt,
|
||||
EXTRACT(EPOCH FROM expire_date) AS edate FROM mms_messages;
|
||||
|
||||
-- Table for envelope headers.
|
||||
CREATE TABLE mms_message_headers (
|
||||
id bigserial PRIMARY KEY,
|
||||
qid bigint REFERENCES mms_messages ON UPDATE CASCADE ON DELETE CASCADE,
|
||||
|
||||
item varchar(64) NOT NULL,
|
||||
value text NOT NULL
|
||||
);
|
||||
|
||||
-- When messages are deleted from the queue, they are moved to the achived_XXX tables.
|
||||
-- archive tables are exact copies of old ones, field for field.
|
||||
-- DBA should clear these tables as needed
|
||||
CREATE TABLE archived_mms_messages (LIKE mms_messages INCLUDING DEFAULTS INCLUDING CONSTRAINTS);
|
||||
CREATE TABLE archived_mms_message_headers (LIKE mms_message_headers INCLUDING DEFAULTS INCLUDING CONSTRAINTS);
|
||||
|
||||
ALTER table archived_mms_messages add unique(id);
|
||||
ALTER table archived_mms_message_headers add foreign key (qid)
|
||||
references archived_mms_messages (id);
|
316
mbuni/install-sh
316
mbuni/install-sh
|
@ -1,316 +0,0 @@
|
|||
#!/bin/sh
|
||||
# install - install a program, script, or datafile
|
||||
|
||||
scriptversion=2004-02-15.20
|
||||
|
||||
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||
# following copyright and license.
|
||||
#
|
||||
# Copyright (C) 1994 X Consortium
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to
|
||||
# deal in the Software without restriction, including without limitation the
|
||||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
# sell copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
|
||||
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
# Except as contained in this notice, the name of the X Consortium shall not
|
||||
# be used in advertising or otherwise to promote the sale, use or other deal-
|
||||
# ings in this Software without prior written authorization from the X Consor-
|
||||
# tium.
|
||||
#
|
||||
#
|
||||
# FSF changes to this file are in the public domain.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# `make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch. It can only install one file at a time, a restriction
|
||||
# shared with many OS's install programs.
|
||||
|
||||
# set DOITPROG to echo to test this script
|
||||
|
||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||
doit="${DOITPROG-}"
|
||||
|
||||
# put in absolute paths if you don't have them in your path; or use env. vars.
|
||||
|
||||
mvprog="${MVPROG-mv}"
|
||||
cpprog="${CPPROG-cp}"
|
||||
chmodprog="${CHMODPROG-chmod}"
|
||||
chownprog="${CHOWNPROG-chown}"
|
||||
chgrpprog="${CHGRPPROG-chgrp}"
|
||||
stripprog="${STRIPPROG-strip}"
|
||||
rmprog="${RMPROG-rm}"
|
||||
mkdirprog="${MKDIRPROG-mkdir}"
|
||||
|
||||
transformbasename=
|
||||
transform_arg=
|
||||
instcmd="$mvprog"
|
||||
chmodcmd="$chmodprog 0755"
|
||||
chowncmd=
|
||||
chgrpcmd=
|
||||
stripcmd=
|
||||
rmcmd="$rmprog -f"
|
||||
mvcmd="$mvprog"
|
||||
src=
|
||||
dst=
|
||||
dir_arg=
|
||||
|
||||
usage="Usage: $0 [OPTION]... SRCFILE DSTFILE
|
||||
or: $0 [OPTION]... SRCFILES... DIRECTORY
|
||||
or: $0 -d DIRECTORIES...
|
||||
|
||||
In the first form, install SRCFILE to DSTFILE, removing SRCFILE by default.
|
||||
In the second, create the directory path DIR.
|
||||
|
||||
Options:
|
||||
-b=TRANSFORMBASENAME
|
||||
-c copy source (using $cpprog) instead of moving (using $mvprog).
|
||||
-d create directories instead of installing files.
|
||||
-g GROUP $chgrp installed files to GROUP.
|
||||
-m MODE $chmod installed files to MODE.
|
||||
-o USER $chown installed files to USER.
|
||||
-s strip installed files (using $stripprog).
|
||||
-t=TRANSFORM
|
||||
--help display this help and exit.
|
||||
--version display version info and exit.
|
||||
|
||||
Environment variables override the default commands:
|
||||
CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
|
||||
"
|
||||
|
||||
while test -n "$1"; do
|
||||
case $1 in
|
||||
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-c) instcmd=$cpprog
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-d) dir_arg=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
--help) echo "$usage"; exit 0;;
|
||||
|
||||
-m) chmodcmd="$chmodprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-s) stripcmd=$stripprog
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
--version) echo "$0 $scriptversion"; exit 0;;
|
||||
|
||||
*) # When -d is used, all remaining arguments are directories to create.
|
||||
test -n "$dir_arg" && break
|
||||
# Otherwise, the last argument is the destination. Remove it from $@.
|
||||
for arg
|
||||
do
|
||||
if test -n "$dstarg"; then
|
||||
# $@ is not empty: it contains at least $arg.
|
||||
set fnord "$@" "$dstarg"
|
||||
shift # fnord
|
||||
fi
|
||||
shift # arg
|
||||
dstarg=$arg
|
||||
done
|
||||
break;;
|
||||
esac
|
||||
done
|
||||
|
||||
if test -z "$1"; then
|
||||
if test -z "$dir_arg"; then
|
||||
echo "$0: no input file specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
# It's OK to call `install-sh -d' without argument.
|
||||
# This can happen when creating conditional directories.
|
||||
exit 0
|
||||
fi
|
||||
|
||||
for src
|
||||
do
|
||||
# Protect names starting with `-'.
|
||||
case $src in
|
||||
-*) src=./$src ;;
|
||||
esac
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
dst=$src
|
||||
src=
|
||||
|
||||
if test -d "$dst"; then
|
||||
instcmd=:
|
||||
chmodcmd=
|
||||
else
|
||||
instcmd=$mkdirprog
|
||||
fi
|
||||
else
|
||||
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
if test ! -f "$src" && test ! -d "$src"; then
|
||||
echo "$0: $src does not exist." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test -z "$dstarg"; then
|
||||
echo "$0: no destination specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dst=$dstarg
|
||||
# Protect names starting with `-'.
|
||||
case $dst in
|
||||
-*) dst=./$dst ;;
|
||||
esac
|
||||
|
||||
# If destination is a directory, append the input filename; won't work
|
||||
# if double slashes aren't ignored.
|
||||
if test -d "$dst"; then
|
||||
dst=$dst/`basename "$src"`
|
||||
fi
|
||||
fi
|
||||
|
||||
# This sed command emulates the dirname command.
|
||||
dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
|
||||
|
||||
# Make sure that the destination directory exists.
|
||||
|
||||
# Skip lots of stat calls in the usual case.
|
||||
if test ! -d "$dstdir"; then
|
||||
defaultIFS='
|
||||
'
|
||||
IFS="${IFS-$defaultIFS}"
|
||||
|
||||
oIFS=$IFS
|
||||
# Some sh's can't handle IFS=/ for some reason.
|
||||
IFS='%'
|
||||
set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
|
||||
IFS=$oIFS
|
||||
|
||||
pathcomp=
|
||||
|
||||
while test $# -ne 0 ; do
|
||||
pathcomp=$pathcomp$1
|
||||
shift
|
||||
if test ! -d "$pathcomp"; then
|
||||
$mkdirprog "$pathcomp" || lasterr=$?
|
||||
# mkdir can fail with a `File exist' error in case several
|
||||
# install-sh are creating the directory concurrently. This
|
||||
# is OK.
|
||||
test ! -d "$pathcomp" && { (exit ${lasterr-1}); exit; }
|
||||
fi
|
||||
pathcomp=$pathcomp/
|
||||
done
|
||||
fi
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
$doit $instcmd "$dst" \
|
||||
&& { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
|
||||
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
|
||||
&& { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
|
||||
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
|
||||
|
||||
else
|
||||
# If we're going to rename the final executable, determine the name now.
|
||||
if test -z "$transformarg"; then
|
||||
dstfile=`basename "$dst"`
|
||||
else
|
||||
dstfile=`basename "$dst" $transformbasename \
|
||||
| sed $transformarg`$transformbasename
|
||||
fi
|
||||
|
||||
# don't allow the sed command to completely eliminate the filename.
|
||||
test -z "$dstfile" && dstfile=`basename "$dst"`
|
||||
|
||||
# Make a couple of temp file names in the proper directory.
|
||||
dsttmp=$dstdir/_inst.$$_
|
||||
rmtmp=$dstdir/_rm.$$_
|
||||
|
||||
# Trap to clean up those temp files at exit.
|
||||
trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
|
||||
trap '(exit $?); exit' 1 2 13 15
|
||||
|
||||
# Move or copy the file name to the temp name
|
||||
$doit $instcmd "$src" "$dsttmp" &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits.
|
||||
#
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $instcmd $src $dsttmp" command.
|
||||
#
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
|
||||
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
|
||||
&& { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
|
||||
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
|
||||
|
||||
# Now remove or move aside any old file at destination location. We
|
||||
# try this two ways since rm can't unlink itself on some systems and
|
||||
# the destination file might be busy for other reasons. In this case,
|
||||
# the final cleanup might fail but the new file should still install
|
||||
# successfully.
|
||||
{
|
||||
if test -f "$dstdir/$dstfile"; then
|
||||
$doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
|
||||
|| $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
|
||||
|| {
|
||||
echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
|
||||
(exit 1); exit
|
||||
}
|
||||
else
|
||||
:
|
||||
fi
|
||||
} &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
$doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
|
||||
fi || { (exit 1); exit; }
|
||||
done
|
||||
|
||||
# The final little trick to "correctly" pass the exit status to the exit trap.
|
||||
{
|
||||
(exit 0); exit
|
||||
}
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
7038
mbuni/libtool
7038
mbuni/libtool
File diff suppressed because it is too large
Load Diff
6402
mbuni/ltmain.sh
6402
mbuni/ltmain.sh
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,10 @@
|
|||
.*.sw[po]
|
||||
*~
|
||||
*.diff
|
||||
*.patch
|
||||
*.lo
|
||||
*.o
|
||||
Makefile
|
||||
Makefile.in
|
||||
.deps
|
||||
.libs
|
360
mbuni/missing
360
mbuni/missing
|
@ -1,360 +0,0 @@
|
|||
#! /bin/sh
|
||||
# Common stub for a few missing GNU programs while installing.
|
||||
|
||||
scriptversion=2003-09-02.23
|
||||
|
||||
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003
|
||||
# Free Software Foundation, Inc.
|
||||
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
|
||||
|
||||
# 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, 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.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
if test $# -eq 0; then
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
run=:
|
||||
|
||||
# In the cases where this matters, `missing' is being run in the
|
||||
# srcdir already.
|
||||
if test -f configure.ac; then
|
||||
configure_ac=configure.ac
|
||||
else
|
||||
configure_ac=configure.in
|
||||
fi
|
||||
|
||||
msg="missing on your system"
|
||||
|
||||
case "$1" in
|
||||
--run)
|
||||
# Try to run requested program, and just exit if it succeeds.
|
||||
run=
|
||||
shift
|
||||
"$@" && exit 0
|
||||
# Exit code 63 means version mismatch. This often happens
|
||||
# when the user try to use an ancient version of a tool on
|
||||
# a file that requires a minimum version. In this case we
|
||||
# we should proceed has if the program had been absent, or
|
||||
# if --run hadn't been passed.
|
||||
if test $? = 63; then
|
||||
run=:
|
||||
msg="probably too old"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# If it does not exist, or fails to run (possibly an outdated version),
|
||||
# try to emulate it.
|
||||
case "$1" in
|
||||
|
||||
-h|--h|--he|--hel|--help)
|
||||
echo "\
|
||||
$0 [OPTION]... PROGRAM [ARGUMENT]...
|
||||
|
||||
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
|
||||
error status if there is no known handling for PROGRAM.
|
||||
|
||||
Options:
|
||||
-h, --help display this help and exit
|
||||
-v, --version output version information and exit
|
||||
--run try to run the given command, and emulate it if it fails
|
||||
|
||||
Supported PROGRAM values:
|
||||
aclocal touch file \`aclocal.m4'
|
||||
autoconf touch file \`configure'
|
||||
autoheader touch file \`config.h.in'
|
||||
automake touch all \`Makefile.in' files
|
||||
bison create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||
flex create \`lex.yy.c', if possible, from existing .c
|
||||
help2man touch the output file
|
||||
lex create \`lex.yy.c', if possible, from existing .c
|
||||
makeinfo touch the output file
|
||||
tar try tar, gnutar, gtar, then tar without non-portable flags
|
||||
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||
|
||||
Send bug reports to <bug-automake@gnu.org>."
|
||||
;;
|
||||
|
||||
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
|
||||
echo "missing $scriptversion (GNU Automake)"
|
||||
;;
|
||||
|
||||
-*)
|
||||
echo 1>&2 "$0: Unknown \`$1' option"
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
aclocal*)
|
||||
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||
# We have it, but it failed.
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
|
||||
to install the \`Automake' and \`Perl' packages. Grab them from
|
||||
any GNU archive site."
|
||||
touch aclocal.m4
|
||||
;;
|
||||
|
||||
autoconf)
|
||||
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||
# We have it, but it failed.
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`${configure_ac}'. You might want to install the
|
||||
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
|
||||
archive site."
|
||||
touch configure
|
||||
;;
|
||||
|
||||
autoheader)
|
||||
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||
# We have it, but it failed.
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`acconfig.h' or \`${configure_ac}'. You might want
|
||||
to install the \`Autoconf' and \`GNU m4' packages. Grab them
|
||||
from any GNU archive site."
|
||||
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
|
||||
test -z "$files" && files="config.h"
|
||||
touch_files=
|
||||
for f in $files; do
|
||||
case "$f" in
|
||||
*:*) touch_files="$touch_files "`echo "$f" |
|
||||
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
|
||||
*) touch_files="$touch_files $f.in";;
|
||||
esac
|
||||
done
|
||||
touch $touch_files
|
||||
;;
|
||||
|
||||
automake*)
|
||||
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||
# We have it, but it failed.
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
|
||||
You might want to install the \`Automake' and \`Perl' packages.
|
||||
Grab them from any GNU archive site."
|
||||
find . -type f -name Makefile.am -print |
|
||||
sed 's/\.am$/.in/' |
|
||||
while read f; do touch "$f"; done
|
||||
;;
|
||||
|
||||
autom4te)
|
||||
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||
# We have it, but it failed.
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, but is $msg.
|
||||
You might have modified some files without having the
|
||||
proper tools for further handling them.
|
||||
You can get \`$1' as part of \`Autoconf' from any GNU
|
||||
archive site."
|
||||
|
||||
file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
|
||||
test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
|
||||
if test -f "$file"; then
|
||||
touch $file
|
||||
else
|
||||
test -z "$file" || exec >$file
|
||||
echo "#! /bin/sh"
|
||||
echo "# Created by GNU Automake missing as a replacement of"
|
||||
echo "# $ $@"
|
||||
echo "exit 0"
|
||||
chmod +x $file
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
bison|yacc)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' $msg. You should only need it if
|
||||
you modified a \`.y' file. You may need the \`Bison' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Bison' from any GNU archive site."
|
||||
rm -f y.tab.c y.tab.h
|
||||
if [ $# -ne 1 ]; then
|
||||
eval LASTARG="\${$#}"
|
||||
case "$LASTARG" in
|
||||
*.y)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
cp "$SRCFILE" y.tab.c
|
||||
fi
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
cp "$SRCFILE" y.tab.h
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if [ ! -f y.tab.h ]; then
|
||||
echo >y.tab.h
|
||||
fi
|
||||
if [ ! -f y.tab.c ]; then
|
||||
echo 'main() { return 0; }' >y.tab.c
|
||||
fi
|
||||
;;
|
||||
|
||||
lex|flex)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a \`.l' file. You may need the \`Flex' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Flex' from any GNU archive site."
|
||||
rm -f lex.yy.c
|
||||
if [ $# -ne 1 ]; then
|
||||
eval LASTARG="\${$#}"
|
||||
case "$LASTARG" in
|
||||
*.l)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
cp "$SRCFILE" lex.yy.c
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if [ ! -f lex.yy.c ]; then
|
||||
echo 'main() { return 0; }' >lex.yy.c
|
||||
fi
|
||||
;;
|
||||
|
||||
help2man)
|
||||
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||
# We have it, but it failed.
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a dependency of a manual page. You may need the
|
||||
\`Help2man' package in order for those modifications to take
|
||||
effect. You can get \`Help2man' from any GNU archive site."
|
||||
|
||||
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
|
||||
if test -z "$file"; then
|
||||
file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
|
||||
fi
|
||||
if [ -f "$file" ]; then
|
||||
touch $file
|
||||
else
|
||||
test -z "$file" || exec >$file
|
||||
echo ".ab help2man is required to generate this page"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
makeinfo)
|
||||
if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
|
||||
# We have makeinfo, but it failed.
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a \`.texi' or \`.texinfo' file, or any other file
|
||||
indirectly affecting the aspect of the manual. The spurious
|
||||
call might also be the consequence of using a buggy \`make' (AIX,
|
||||
DU, IRIX). You might want to install the \`Texinfo' package or
|
||||
the \`GNU make' package. Grab either from any GNU archive site."
|
||||
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
|
||||
if test -z "$file"; then
|
||||
file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
|
||||
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
|
||||
fi
|
||||
touch $file
|
||||
;;
|
||||
|
||||
tar)
|
||||
shift
|
||||
if test -n "$run"; then
|
||||
echo 1>&2 "ERROR: \`tar' requires --run"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# We have already tried tar in the generic part.
|
||||
# Look for gnutar/gtar before invocation to avoid ugly error
|
||||
# messages.
|
||||
if (gnutar --version > /dev/null 2>&1); then
|
||||
gnutar "$@" && exit 0
|
||||
fi
|
||||
if (gtar --version > /dev/null 2>&1); then
|
||||
gtar "$@" && exit 0
|
||||
fi
|
||||
firstarg="$1"
|
||||
if shift; then
|
||||
case "$firstarg" in
|
||||
*o*)
|
||||
firstarg=`echo "$firstarg" | sed s/o//`
|
||||
tar "$firstarg" "$@" && exit 0
|
||||
;;
|
||||
esac
|
||||
case "$firstarg" in
|
||||
*h*)
|
||||
firstarg=`echo "$firstarg" | sed s/h//`
|
||||
tar "$firstarg" "$@" && exit 0
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: I can't seem to be able to run \`tar' with the given arguments.
|
||||
You may want to install GNU tar or Free paxutils, or check the
|
||||
command line arguments."
|
||||
exit 1
|
||||
;;
|
||||
|
||||
*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, and is $msg.
|
||||
You might have modified some files without having the
|
||||
proper tools for further handling them. Check the \`README' file,
|
||||
it often tells you about the needed prerequisites for installing
|
||||
this package. You may also peek at any GNU archive site, in case
|
||||
some other package would contain this missing \`$1' program."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
|
@ -0,0 +1,18 @@
|
|||
.*.sw[po]
|
||||
*~
|
||||
*.diff
|
||||
*.patch
|
||||
*.lo
|
||||
*.o
|
||||
mpeg2dec-*.tar.gz
|
||||
Makefile
|
||||
Makefile.in
|
||||
configure
|
||||
.deps
|
||||
.libs
|
||||
aclocal.m4
|
||||
config.log
|
||||
config.cache
|
||||
libtool
|
||||
config.status
|
||||
gmon.out
|
|
@ -1,4 +1,4 @@
|
|||
noinst_LIBRARIES = libmms.a
|
||||
libmms_a_SOURCES = mms_billing.c mms_billing.h mms_msg.c mms_msg.h mms_queue.c mms_queue.h mms_strings.c mms_strings.h mms_uaprof.c mms_uaprof.h mms_util.c mms_util.h mms_resolve.c
|
||||
|
||||
lib_LTLIBRARIES = libmms.la
|
||||
libmms_la_SOURCES = charmibenum.def mms_eventlogger.c mms_mmbox.c mms_msg.c mms_queue.c mms_strings.c mms_uaprof.c mms_util.c mms_mm7soap.c mms_cfg.c
|
||||
|
||||
EXTRA_DIST=mms_strings.def mms_eventlogger.h mms_mm7soap.h mms_mmbox.h mms_msg.h mms_queue.h mms_strings.h mms_uaprof.h mms_util.h mms_cfg.h mms_cfg.def mms_cfg-impl.h
|
||||
|
|
|
@ -1,381 +0,0 @@
|
|||
# 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 = $(libmms_a_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 = :
|
||||
subdir = mmlib
|
||||
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 =
|
||||
LIBRARIES = $(noinst_LIBRARIES)
|
||||
AR = ar
|
||||
ARFLAGS = cru
|
||||
libmms_a_AR = $(AR) $(ARFLAGS)
|
||||
libmms_a_LIBADD =
|
||||
am_libmms_a_OBJECTS = mms_billing.$(OBJEXT) mms_msg.$(OBJEXT) \
|
||||
mms_queue.$(OBJEXT) mms_strings.$(OBJEXT) mms_uaprof.$(OBJEXT) \
|
||||
mms_util.$(OBJEXT) mms_resolve.$(OBJEXT)
|
||||
libmms_a_OBJECTS = $(am_libmms_a_OBJECTS)
|
||||
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)
|
||||
CCLD = $(CC)
|
||||
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
SOURCES = $(libmms_a_SOURCES)
|
||||
DIST_SOURCES = $(libmms_a_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@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
EXE_EXT = @EXE_EXT@
|
||||
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@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJEXT = @OBJEXT@
|
||||
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_CC = @ac_ct_CC@
|
||||
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__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build_alias = @build_alias@
|
||||
datadir = @datadir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host_alias = @host_alias@
|
||||
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@
|
||||
noinst_LIBRARIES = libmms.a
|
||||
libmms_a_SOURCES = mms_billing.c mms_billing.h mms_msg.c mms_msg.h mms_queue.c mms_queue.h mms_strings.c mms_strings.h mms_uaprof.c mms_uaprof.h mms_util.c mms_util.h mms_resolve.c
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .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 mmlib/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu mmlib/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
|
||||
|
||||
clean-noinstLIBRARIES:
|
||||
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
|
||||
libmms.a: $(libmms_a_OBJECTS) $(libmms_a_DEPENDENCIES)
|
||||
-rm -f libmms.a
|
||||
$(libmms_a_AR) libmms.a $(libmms_a_OBJECTS) $(libmms_a_LIBADD)
|
||||
$(RANLIB) libmms.a
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mms_billing.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mms_msg.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mms_queue.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mms_resolve.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mms_strings.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mms_uaprof.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mms_util.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) '$<'`
|
||||
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 $(LIBRARIES)
|
||||
installdirs:
|
||||
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-generic clean-noinstLIBRARIES mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
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
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-info-am
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-noinstLIBRARIES ctags distclean distclean-compile \
|
||||
distclean-generic distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am 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 pdf pdf-am ps ps-am tags uninstall \
|
||||
uninstall-am 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:
|
|
@ -0,0 +1,340 @@
|
|||
/*
|
||||
* Mbuni - Open Source MMS Gateway
|
||||
*
|
||||
* Charset MIBenum assignments - pre-processor magic.
|
||||
*
|
||||
* Copyright (C) 2003 - , Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
*
|
||||
* Paul Bagyenda <bagyenda@dsmagic.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License, with a few exceptions granted (see LICENSE)
|
||||
*/
|
||||
|
||||
#if !defined(CharMIBEnum)
|
||||
#error "Required macro CharMIBEnum is missing."
|
||||
#endif
|
||||
|
||||
CharMIBEnum(3,ASCII)
|
||||
CharMIBEnum(3,ANSI_X3.4-1968)
|
||||
CharMIBEnum(3,ANSI_X3.4-1986)
|
||||
CharMIBEnum(3,CP367)
|
||||
CharMIBEnum(3,IBM367)
|
||||
CharMIBEnum(3,ISO-IR-6)
|
||||
CharMIBEnum(3,ISO646-US)
|
||||
CharMIBEnum(3,ISO_646.IRV:1991)
|
||||
CharMIBEnum(3,US)
|
||||
CharMIBEnum(3,US-ASCII)
|
||||
CharMIBEnum(3,CSASCII)
|
||||
CharMIBEnum(4,CP819)
|
||||
CharMIBEnum(4,IBM819)
|
||||
CharMIBEnum(4,ISO-8859-1)
|
||||
CharMIBEnum(4,ISO-IR-100)
|
||||
CharMIBEnum(4,ISO8859-1)
|
||||
CharMIBEnum(4,ISO_8859-1)
|
||||
CharMIBEnum(4,ISO_8859-1:1987)
|
||||
CharMIBEnum(4,L1)
|
||||
CharMIBEnum(4,LATIN1)
|
||||
CharMIBEnum(4,CSISOLATIN1)
|
||||
CharMIBEnum(5,ISO-8859-2)
|
||||
CharMIBEnum(5,ISO-IR-101)
|
||||
CharMIBEnum(5,ISO8859-2)
|
||||
CharMIBEnum(5,ISO_8859-2)
|
||||
CharMIBEnum(5,ISO_8859-2:1987)
|
||||
CharMIBEnum(5,L2)
|
||||
CharMIBEnum(5,LATIN2)
|
||||
CharMIBEnum(5,CSISOLATIN2)
|
||||
CharMIBEnum(6,ISO-8859-3)
|
||||
CharMIBEnum(6,ISO-IR-109)
|
||||
CharMIBEnum(6,ISO8859-3)
|
||||
CharMIBEnum(6,ISO_8859-3)
|
||||
CharMIBEnum(6,ISO_8859-3:1988)
|
||||
CharMIBEnum(6,L3)
|
||||
CharMIBEnum(6,LATIN3)
|
||||
CharMIBEnum(6,CSISOLATIN3)
|
||||
CharMIBEnum(7,ISO-8859-4)
|
||||
CharMIBEnum(7,ISO-IR-110)
|
||||
CharMIBEnum(7,ISO8859-4)
|
||||
CharMIBEnum(7,ISO_8859-4)
|
||||
CharMIBEnum(7,ISO_8859-4:1988)
|
||||
CharMIBEnum(7,L4)
|
||||
CharMIBEnum(7,LATIN4)
|
||||
CharMIBEnum(7,CSISOLATIN4)
|
||||
CharMIBEnum(8,CYRILLIC)
|
||||
CharMIBEnum(8,ISO-8859-5)
|
||||
CharMIBEnum(8,ISO-IR-144)
|
||||
CharMIBEnum(8,ISO8859-5)
|
||||
CharMIBEnum(8,ISO_8859-5)
|
||||
CharMIBEnum(8,ISO_8859-5:1988)
|
||||
CharMIBEnum(8,CSISOLATINCYRILLIC)
|
||||
CharMIBEnum(9,ARABIC)
|
||||
CharMIBEnum(9,ASMO-708)
|
||||
CharMIBEnum(9,ECMA-114)
|
||||
CharMIBEnum(9,ISO-8859-6)
|
||||
CharMIBEnum(9,ISO-IR-127)
|
||||
CharMIBEnum(9,ISO8859-6)
|
||||
CharMIBEnum(9,ISO_8859-6)
|
||||
CharMIBEnum(9,ISO_8859-6:1987)
|
||||
CharMIBEnum(9,CSISOLATINARABIC)
|
||||
CharMIBEnum(10,ECMA-118)
|
||||
CharMIBEnum(10,ELOT_928)
|
||||
CharMIBEnum(10,GREEK)
|
||||
CharMIBEnum(10,GREEK8)
|
||||
CharMIBEnum(10,ISO-8859-7)
|
||||
CharMIBEnum(10,ISO-IR-126)
|
||||
CharMIBEnum(10,ISO8859-7)
|
||||
CharMIBEnum(10,ISO_8859-7)
|
||||
CharMIBEnum(10,ISO_8859-7:1987)
|
||||
CharMIBEnum(10,ISO_8859-7:2003)
|
||||
CharMIBEnum(10,CSISOLATINGREEK)
|
||||
CharMIBEnum(11,HEBREW)
|
||||
CharMIBEnum(11,ISO-8859-8)
|
||||
CharMIBEnum(11,ISO-IR-138)
|
||||
CharMIBEnum(11,ISO8859-8)
|
||||
CharMIBEnum(11,ISO_8859-8)
|
||||
CharMIBEnum(11,ISO_8859-8:1988)
|
||||
CharMIBEnum(11,CSISOLATINHEBREW)
|
||||
CharMIBEnum(12,ISO-8859-9)
|
||||
CharMIBEnum(12,ISO-IR-148)
|
||||
CharMIBEnum(12,ISO8859-9)
|
||||
CharMIBEnum(12,ISO_8859-9)
|
||||
CharMIBEnum(12,ISO_8859-9:1989)
|
||||
CharMIBEnum(12,L5)
|
||||
CharMIBEnum(12,LATIN5)
|
||||
CharMIBEnum(12,CSISOLATIN5)
|
||||
CharMIBEnum(13,ISO-8859-10)
|
||||
CharMIBEnum(13,ISO-IR-157)
|
||||
CharMIBEnum(13,ISO8859-10)
|
||||
CharMIBEnum(13,ISO_8859-10)
|
||||
CharMIBEnum(13,ISO_8859-10:1992)
|
||||
CharMIBEnum(13,L6)
|
||||
CharMIBEnum(13,LATIN6)
|
||||
CharMIBEnum(13,CSISOLATIN6)
|
||||
CharMIBEnum(15,JISX0201-1976)
|
||||
CharMIBEnum(15,JIS_X0201)
|
||||
CharMIBEnum(15,X0201)
|
||||
CharMIBEnum(15,CSHALFWIDTHKATAKANA)
|
||||
CharMIBEnum(17,MS_KANJI)
|
||||
CharMIBEnum(17,SHIFT-JIS)
|
||||
CharMIBEnum(17,SHIFT_JIS)
|
||||
CharMIBEnum(17,SJIS)
|
||||
CharMIBEnum(17,CSSHIFTJIS)
|
||||
CharMIBEnum(17,SHIFT_JIS-2004)
|
||||
CharMIBEnum(17,SHIFT_JISX0213)
|
||||
CharMIBEnum(18,EUC-JP)
|
||||
CharMIBEnum(18,EUCJP)
|
||||
CharMIBEnum(18,EXTENDED_UNIX_CODE_PACKED_FORMAT_FOR_JAPANESE)
|
||||
CharMIBEnum(18,CSEUCPKDFMTJAPANESE)
|
||||
CharMIBEnum(36,ISO-IR-149)
|
||||
CharMIBEnum(36,KOREAN)
|
||||
CharMIBEnum(36,KSC_5601)
|
||||
CharMIBEnum(36,KS_C_5601-1987)
|
||||
CharMIBEnum(36,KS_C_5601-1989)
|
||||
CharMIBEnum(36,CSKSC56011987)
|
||||
CharMIBEnum(37,ISO-2022-KR)
|
||||
CharMIBEnum(37,CSISO2022KR)
|
||||
CharMIBEnum(38,EUC-KR)
|
||||
CharMIBEnum(38,EUCKR)
|
||||
CharMIBEnum(38,CSEUCKR)
|
||||
CharMIBEnum(39,ISO-2022-JP)
|
||||
CharMIBEnum(39,CSISO2022JP)
|
||||
CharMIBEnum(39,ISO-2022-JP-1)
|
||||
CharMIBEnum(39,ISO-2022-JP-2)
|
||||
CharMIBEnum(39,CSISO2022JP2)
|
||||
CharMIBEnum(39,ISO-2022-JP-2004)
|
||||
CharMIBEnum(39,ISO-2022-JP-3)
|
||||
CharMIBEnum(40,ISO-2022-JP-2)
|
||||
CharMIBEnum(40,CSISO2022JP2)
|
||||
CharMIBEnum(40,ISO-2022-JP-2004)
|
||||
CharMIBEnum(40,ISO-2022-JP-3)
|
||||
CharMIBEnum(42,ISO-IR-14)
|
||||
CharMIBEnum(42,ISO646-JP)
|
||||
CharMIBEnum(42,JIS_C6220-1969-RO)
|
||||
CharMIBEnum(42,JP)
|
||||
CharMIBEnum(42,CSISO14JISC6220RO)
|
||||
CharMIBEnum(56,CN)
|
||||
CharMIBEnum(56,GB_1988-80)
|
||||
CharMIBEnum(56,ISO-IR-57)
|
||||
CharMIBEnum(56,ISO646-CN)
|
||||
CharMIBEnum(56,CSISO57GB1988)
|
||||
CharMIBEnum(57,CHINESE)
|
||||
CharMIBEnum(57,GB_2312-80)
|
||||
CharMIBEnum(57,ISO-IR-58)
|
||||
CharMIBEnum(57,CSISO58GB231280)
|
||||
CharMIBEnum(63,ISO-IR-87)
|
||||
CharMIBEnum(63,JIS0208)
|
||||
CharMIBEnum(63,JIS_C6226-1983)
|
||||
CharMIBEnum(63,JIS_X0208)
|
||||
CharMIBEnum(63,JIS_X0208-1983)
|
||||
CharMIBEnum(63,JIS_X0208-1990)
|
||||
CharMIBEnum(63,X0208)
|
||||
CharMIBEnum(63,CSISO87JISX0208)
|
||||
CharMIBEnum(98,ISO-IR-159)
|
||||
CharMIBEnum(98,JIS_X0212)
|
||||
CharMIBEnum(98,JIS_X0212-1990)
|
||||
CharMIBEnum(98,JIS_X0212.1990-0)
|
||||
CharMIBEnum(98,X0212)
|
||||
CharMIBEnum(98,CSISO159JISX02121990)
|
||||
CharMIBEnum(103,UNICODE-1-1-UTF-7)
|
||||
CharMIBEnum(103,UTF-7)
|
||||
CharMIBEnum(103,CSUNICODE11UTF7)
|
||||
CharMIBEnum(104,ISO-2022-CN)
|
||||
CharMIBEnum(104,CSISO2022CN)
|
||||
CharMIBEnum(104,ISO-2022-CN-EXT)
|
||||
CharMIBEnum(105,ISO-2022-CN-EXT)
|
||||
CharMIBEnum(106,UTF-8)
|
||||
CharMIBEnum(106,UTF-8-MAC)
|
||||
CharMIBEnum(106,UTF8-MAC)
|
||||
CharMIBEnum(109,ISO-8859-13)
|
||||
CharMIBEnum(109,ISO-IR-179)
|
||||
CharMIBEnum(109,ISO8859-13)
|
||||
CharMIBEnum(109,ISO_8859-13)
|
||||
CharMIBEnum(109,L7)
|
||||
CharMIBEnum(109,LATIN7)
|
||||
CharMIBEnum(110,ISO-8859-14)
|
||||
CharMIBEnum(110,ISO-CELTIC)
|
||||
CharMIBEnum(110,ISO-IR-199)
|
||||
CharMIBEnum(110,ISO8859-14)
|
||||
CharMIBEnum(110,ISO_8859-14)
|
||||
CharMIBEnum(110,ISO_8859-14:1998)
|
||||
CharMIBEnum(110,L8)
|
||||
CharMIBEnum(110,LATIN8)
|
||||
CharMIBEnum(111,ISO-8859-15)
|
||||
CharMIBEnum(111,ISO-IR-203)
|
||||
CharMIBEnum(111,ISO8859-15)
|
||||
CharMIBEnum(111,ISO_8859-15)
|
||||
CharMIBEnum(111,ISO_8859-15:1998)
|
||||
CharMIBEnum(111,LATIN-9)
|
||||
CharMIBEnum(112,ISO-8859-16)
|
||||
CharMIBEnum(112,ISO-IR-226)
|
||||
CharMIBEnum(112,ISO8859-16)
|
||||
CharMIBEnum(112,ISO_8859-16)
|
||||
CharMIBEnum(112,ISO_8859-16:2001)
|
||||
CharMIBEnum(112,L10)
|
||||
CharMIBEnum(112,LATIN10)
|
||||
CharMIBEnum(113,GBK)
|
||||
CharMIBEnum(114,GB18030)
|
||||
CharMIBEnum(1000,ISO-10646-UCS-2)
|
||||
CharMIBEnum(1000,UCS-2)
|
||||
CharMIBEnum(1000,CSUNICODE)
|
||||
CharMIBEnum(1001,ISO-10646-UCS-4)
|
||||
CharMIBEnum(1001,UCS-4)
|
||||
CharMIBEnum(1001,CSUCS4)
|
||||
CharMIBEnum(1010,UCS-2BE)
|
||||
CharMIBEnum(1010,UNICODE-1-1)
|
||||
CharMIBEnum(1010,UNICODEBIG)
|
||||
CharMIBEnum(1010,CSUNICODE11)
|
||||
CharMIBEnum(1010,UNICODE-1-1-UTF-7)
|
||||
CharMIBEnum(1010,UTF-7)
|
||||
CharMIBEnum(1010,CSUNICODE11UTF7)
|
||||
CharMIBEnum(1012,UNICODE-1-1-UTF-7)
|
||||
CharMIBEnum(1012,UTF-7)
|
||||
CharMIBEnum(1012,CSUNICODE11UTF7)
|
||||
CharMIBEnum(1013,UTF-16BE)
|
||||
CharMIBEnum(1014,UTF-16LE)
|
||||
CharMIBEnum(1015,UTF-16)
|
||||
CharMIBEnum(1015,UTF-16BE)
|
||||
CharMIBEnum(1015,UTF-16LE)
|
||||
CharMIBEnum(1017,UTF-32)
|
||||
CharMIBEnum(1017,UTF-32BE)
|
||||
CharMIBEnum(1017,UTF-32LE)
|
||||
CharMIBEnum(1018,UTF-32BE)
|
||||
CharMIBEnum(1019,UTF-32LE)
|
||||
CharMIBEnum(2004,HP-ROMAN8)
|
||||
CharMIBEnum(2004,R8)
|
||||
CharMIBEnum(2004,ROMAN8)
|
||||
CharMIBEnum(2004,CSHPROMAN8)
|
||||
CharMIBEnum(2009,850)
|
||||
CharMIBEnum(2009,CP850)
|
||||
CharMIBEnum(2009,IBM850)
|
||||
CharMIBEnum(2009,CSPC850MULTILINGUAL)
|
||||
CharMIBEnum(2013,862)
|
||||
CharMIBEnum(2013,CP862)
|
||||
CharMIBEnum(2013,IBM862)
|
||||
CharMIBEnum(2013,CSPC862LATINHEBREW)
|
||||
CharMIBEnum(2025,CHINESE)
|
||||
CharMIBEnum(2025,GB_2312-80)
|
||||
CharMIBEnum(2025,ISO-IR-58)
|
||||
CharMIBEnum(2025,CSISO58GB231280)
|
||||
CharMIBEnum(2025,CN-GB)
|
||||
CharMIBEnum(2025,EUC-CN)
|
||||
CharMIBEnum(2025,EUCCN)
|
||||
CharMIBEnum(2025,GB2312)
|
||||
CharMIBEnum(2025,CSGB2312)
|
||||
CharMIBEnum(2026,BIG-5)
|
||||
CharMIBEnum(2026,BIG-FIVE)
|
||||
CharMIBEnum(2026,BIG5)
|
||||
CharMIBEnum(2026,BIGFIVE)
|
||||
CharMIBEnum(2026,CN-BIG5)
|
||||
CharMIBEnum(2026,CSBIG5)
|
||||
CharMIBEnum(2026,BIG5-HKSCS:1999)
|
||||
CharMIBEnum(2026,BIG5-HKSCS:2001)
|
||||
CharMIBEnum(2026,BIG5-HKSCS)
|
||||
CharMIBEnum(2026,BIG5-HKSCS:2004)
|
||||
CharMIBEnum(2026,BIG5HKSCS)
|
||||
CharMIBEnum(2026,BIG5-2003)
|
||||
CharMIBEnum(2027,MAC)
|
||||
CharMIBEnum(2027,MACINTOSH)
|
||||
CharMIBEnum(2027,MACROMAN)
|
||||
CharMIBEnum(2027,CSMACINTOSH)
|
||||
CharMIBEnum(2082,VISCII)
|
||||
CharMIBEnum(2082,VISCII1.1-1)
|
||||
CharMIBEnum(2082,CSVISCII)
|
||||
CharMIBEnum(2084,KOI8-R)
|
||||
CharMIBEnum(2084,CSKOI8R)
|
||||
CharMIBEnum(2084,KOI8-RU)
|
||||
CharMIBEnum(2085,HZ)
|
||||
CharMIBEnum(2085,HZ-GB-2312)
|
||||
CharMIBEnum(2086,866)
|
||||
CharMIBEnum(2086,CP866)
|
||||
CharMIBEnum(2086,IBM866)
|
||||
CharMIBEnum(2086,CSIBM866)
|
||||
CharMIBEnum(2088,KOI8-U)
|
||||
CharMIBEnum(2101,BIG5-HKSCS:1999)
|
||||
CharMIBEnum(2101,BIG5-HKSCS:2001)
|
||||
CharMIBEnum(2101,BIG5-HKSCS)
|
||||
CharMIBEnum(2101,BIG5-HKSCS:2004)
|
||||
CharMIBEnum(2101,BIG5HKSCS)
|
||||
CharMIBEnum(2103,CP154)
|
||||
CharMIBEnum(2103,CYRILLIC-ASIAN)
|
||||
CharMIBEnum(2103,PT154)
|
||||
CharMIBEnum(2103,PTCP154)
|
||||
CharMIBEnum(2103,CSPTCP154)
|
||||
CharMIBEnum(2109,CP874)
|
||||
CharMIBEnum(2109,WINDOWS-874)
|
||||
CharMIBEnum(2250,CP1250)
|
||||
CharMIBEnum(2250,MS-EE)
|
||||
CharMIBEnum(2250,WINDOWS-1250)
|
||||
CharMIBEnum(2251,CP1251)
|
||||
CharMIBEnum(2251,MS-CYRL)
|
||||
CharMIBEnum(2251,WINDOWS-1251)
|
||||
CharMIBEnum(2252,CP1252)
|
||||
CharMIBEnum(2252,MS-ANSI)
|
||||
CharMIBEnum(2252,WINDOWS-1252)
|
||||
CharMIBEnum(2253,CP1253)
|
||||
CharMIBEnum(2253,MS-GREEK)
|
||||
CharMIBEnum(2253,WINDOWS-1253)
|
||||
CharMIBEnum(2254,CP1254)
|
||||
CharMIBEnum(2254,MS-TURK)
|
||||
CharMIBEnum(2254,WINDOWS-1254)
|
||||
CharMIBEnum(2255,CP1255)
|
||||
CharMIBEnum(2255,MS-HEBR)
|
||||
CharMIBEnum(2255,WINDOWS-1255)
|
||||
CharMIBEnum(2256,CP1256)
|
||||
CharMIBEnum(2256,MS-ARAB)
|
||||
CharMIBEnum(2256,WINDOWS-1256)
|
||||
CharMIBEnum(2257,CP1257)
|
||||
CharMIBEnum(2257,WINBALTRIM)
|
||||
CharMIBEnum(2257,WINDOWS-1257)
|
||||
CharMIBEnum(2258,CP1258)
|
||||
CharMIBEnum(2258,WINDOWS-1258)
|
||||
CharMIBEnum(2259,ISO-IR-166)
|
||||
CharMIBEnum(2259,TIS-620)
|
||||
CharMIBEnum(2259,TIS620)
|
||||
CharMIBEnum(2259,TIS620-0)
|
||||
CharMIBEnum(2259,TIS620.2529-1)
|
||||
CharMIBEnum(2259,TIS620.2533-0)
|
||||
CharMIBEnum(2259,TIS620.2533-1)
|
||||
|
||||
#undef CharMIBEnum
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "mms_billing.h"
|
||||
|
||||
/* This module provides a basic biller and CDR implementation. Totally no frills, but a basis
|
||||
* for implementing a 'real' module.
|
||||
* It does CDR but no billing (of course).
|
||||
*/
|
||||
|
||||
|
||||
static void *mms_billingmodule_init(char *settings)
|
||||
{
|
||||
return fopen(settings, "a"); /* Settings is interpreted as a file name. */
|
||||
}
|
||||
|
||||
|
||||
static int mms_billingmodule_fini(void *module_data)
|
||||
{
|
||||
return module_data ? fclose(module_data) : -1;
|
||||
}
|
||||
|
||||
static double mms_billmsg(Octstr *from, List *to, unsigned long msg_size, void *module_data)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mms_logcdr(MmsCdrStruct *cdr)
|
||||
{
|
||||
if (cdr && cdr->module_data) {
|
||||
char buf[CBUFSIZE];
|
||||
struct tm tm;
|
||||
|
||||
localtime_r(&cdr->sdate, &tm);
|
||||
gw_strftime(buf, sizeof buf, "%Y-%m-%d %H:%M:%S", &tm);
|
||||
fprintf(cdr->module_data, "%s\t%.128s\t%.256s\t%.256s\t%ld\n",
|
||||
buf, cdr->from, cdr->to, cdr->msgid, cdr->msg_size);
|
||||
fflush(cdr->module_data);
|
||||
} else
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* The function itself. */
|
||||
MmsBillingFuncStruct mms_billfuncs = {
|
||||
mms_billingmodule_init,
|
||||
mms_logcdr,
|
||||
mms_billmsg,
|
||||
mms_billingmodule_fini
|
||||
};
|
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* Mbuni - Open Source MMS Gateway
|
||||
*
|
||||
* config file functions (when conf is loaded from another source)
|
||||
*
|
||||
* Copyright (C) 2003 - 2008, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
*
|
||||
* Paul Bagyenda <bagyenda@dsmagic.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License, with a few exceptions granted (see LICENSE)
|
||||
*/
|
||||
#ifndef __MMS_CFG_IMPL__INCLUDED__
|
||||
#define __MMS_CFG_IMPL__INCLUDED__
|
||||
#include "mms_cfg.h"
|
||||
|
||||
typedef struct mCfgImpl mCfgImpl; /* Implementation-specific struct for config info. */
|
||||
|
||||
/* each implementation must export struct, symbol 'cfg_funcs'. */
|
||||
typedef struct mCfgImpFuncs {
|
||||
mCfgImpl *(*read)(Octstr *init_param);
|
||||
void (*destroy)(mCfgImpl *);
|
||||
mCfgGrp *(*cfg_get_single)(mCfgImpl *cfg, Octstr *name);
|
||||
List *(*get_multi)(mCfgImpl *cfg,Octstr *name); /* List of mCfgGrp */
|
||||
mCfgGrp *(*get_multi_by_field)(mCfgImpl *cfg, Octstr *name, Octstr *field, Octstr *value);
|
||||
Octstr *(*get)(mCfgImpl *cfg, mCfgGrp *grp, Octstr *name);
|
||||
Octstr *(*get_grp_name)(mCfgImpl *, mCfgGrp *);
|
||||
void (*destroy_grp)(mCfgImpl *cfg, mCfgGrp *);
|
||||
} mCfgImpFuncs;
|
||||
|
||||
|
||||
#endif
|
|
@ -0,0 +1,445 @@
|
|||
/*
|
||||
* Mbuni - Open Source MMS Gateway
|
||||
*
|
||||
* MMS Config file reader functions
|
||||
*
|
||||
* Copyright (C) 2003 - 2008, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
*
|
||||
* Paul Bagyenda <bagyenda@dsmagic.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License, with a few exceptions granted (see LICENSE)
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "mms_cfg.h"
|
||||
#include "mms_cfg-impl.h"
|
||||
#include "mms_util.h"
|
||||
|
||||
/* config file representation.
|
||||
* 'grps' var is indexed by group name.
|
||||
* for multi the value is a list of groups,
|
||||
* for single it is a struct
|
||||
*/
|
||||
struct mCfg {
|
||||
Octstr *file;
|
||||
Dict *grps;
|
||||
|
||||
mCfgImpl *xcfg; /* If set, then this is the real source of conf info. */
|
||||
mCfgImpFuncs *cfg_funcs; /* Config funcs or NULL */
|
||||
};
|
||||
|
||||
struct mCfgGrp { /* when using file-based, this is our implementation of a group. */
|
||||
Octstr *name;
|
||||
Dict *fields;
|
||||
};
|
||||
|
||||
static void fixup_value(Octstr *value, int lineno)
|
||||
{
|
||||
Octstr *tmp;
|
||||
int i,n;
|
||||
|
||||
octstr_strip_blanks(value);
|
||||
|
||||
if (octstr_get_char(value, 0) != '"')
|
||||
return;
|
||||
if (octstr_get_char(value, octstr_len(value) - 1) != '"')
|
||||
mms_error(0, "mms_cfg", NULL, "Missing enclosing '\"' at line %d in conf file", lineno);
|
||||
|
||||
octstr_delete(value, 0,1); /* strip quotes. */
|
||||
octstr_delete(value, octstr_len(value) - 1, 1);
|
||||
|
||||
tmp = octstr_duplicate(value);
|
||||
octstr_delete(value, 0, octstr_len(value));
|
||||
|
||||
for (i = 0, n = octstr_len(tmp); i < n; i++) {
|
||||
int ch = octstr_get_char(tmp, i);
|
||||
|
||||
if (ch != '\\') {
|
||||
octstr_append_char(value, ch);
|
||||
continue;
|
||||
}
|
||||
|
||||
i++; /* skip forward. */
|
||||
ch = octstr_get_char(tmp,i);
|
||||
switch(ch) {
|
||||
case '"':
|
||||
case '\\':
|
||||
default:
|
||||
octstr_append_char(value, ch);
|
||||
break;
|
||||
case 'n':
|
||||
octstr_append_char(value, '\n');
|
||||
break;
|
||||
case 't':
|
||||
octstr_append_char(value, '\t');
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
octstr_destroy(tmp);
|
||||
}
|
||||
|
||||
static int is_multigroup(Octstr *grpname)
|
||||
{
|
||||
#define OCTSTR(x)
|
||||
#define SINGLE_GROUP(name, fields) \
|
||||
if (octstr_str_case_compare(grpname, #name) == 0) return 0;
|
||||
#define MULTI_GROUP(name, fields) \
|
||||
if (octstr_str_case_compare(grpname, #name) == 0) return 1;
|
||||
#include "mms_cfg.def"
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int valid_in_group(Octstr *grp, Octstr *field)
|
||||
{
|
||||
/* first validate whether field is permitted in the group. */
|
||||
#define OCTSTR(parm) else if (octstr_str_case_compare(field,#parm) == 0) return 1;
|
||||
#define SINGLE_GROUP(grpname, fields) \
|
||||
else if (octstr_str_case_compare(grp, #grpname) == 0) { \
|
||||
if (0) (void)0; \
|
||||
fields \
|
||||
}
|
||||
#define MULTI_GROUP(name, fields) SINGLE_GROUP(name, fields)
|
||||
|
||||
if (0)
|
||||
(void)0;
|
||||
#include "mms_cfg.def"
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void check_and_add_field(mCfgGrp *grp, Octstr *field, Octstr *value, int lineno)
|
||||
{
|
||||
if (!valid_in_group(grp->name, field))
|
||||
mms_info(0, "mms_cfg", NULL, "field `%s' is not expected within group `%s' at line %d in conf file - skipped",
|
||||
octstr_get_cstr(field), octstr_get_cstr(grp->name), lineno);
|
||||
else if (dict_put_once(grp->fields, field, octstr_duplicate(value)) == 0)
|
||||
mms_error(0, "mms_cfg", NULL, "Duplicate field `%s' at line %d in conf file, ignored",
|
||||
octstr_get_cstr(field), lineno);
|
||||
}
|
||||
|
||||
static mCfg *make_cfg(Octstr *file)
|
||||
{
|
||||
mCfg *cfg;
|
||||
|
||||
cfg = gw_malloc(sizeof *cfg);
|
||||
cfg->file = file ? octstr_duplicate(file) : NULL;
|
||||
cfg->grps = dict_create(7, NULL);
|
||||
|
||||
cfg->xcfg = NULL;
|
||||
cfg->cfg_funcs = NULL;
|
||||
return cfg;
|
||||
}
|
||||
|
||||
mCfg *mms_cfg_read(Octstr *file)
|
||||
{
|
||||
Octstr *sf;
|
||||
List *lines;
|
||||
int i, n;
|
||||
mCfg *cfg;
|
||||
mCfgGrp *grp = NULL;
|
||||
int skip = 0;
|
||||
|
||||
gw_assert(file);
|
||||
|
||||
if ((sf = octstr_read_file(octstr_get_cstr(file))) == NULL) {
|
||||
mms_error(errno, "mms_cfg", NULL, "failed to read config from `%s'", octstr_get_cstr(file));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
cfg = make_cfg(file);
|
||||
|
||||
lines = octstr_split(sf, octstr_imm("\n"));
|
||||
for (i = 0, n = gwlist_len(lines); i < n; i++) {
|
||||
Octstr *current = gwlist_get(lines,i);
|
||||
int pos;
|
||||
|
||||
octstr_strip_blanks(current);
|
||||
|
||||
if (octstr_len(current) == 0) { /* end of group. */
|
||||
grp = NULL;
|
||||
skip = 0;
|
||||
continue;
|
||||
} else if (skip || octstr_get_char(current, 0) == '#')
|
||||
continue;
|
||||
|
||||
if ((pos = octstr_search_char(current, '=',0)) > 0) {
|
||||
/* a field name. first see if start of grp */
|
||||
Octstr *field = octstr_copy(current,0,pos);
|
||||
Octstr *value = octstr_copy(current,pos+1,octstr_len(current));
|
||||
|
||||
octstr_strip_blanks(field);
|
||||
fixup_value(value, i+1);
|
||||
#if 0
|
||||
mms_info(0, "mms_cfg", NULL, "field/value: [%s - %s]", octstr_get_cstr(field),
|
||||
octstr_get_cstr(value));
|
||||
#endif
|
||||
|
||||
if (octstr_str_case_compare(field, "group") == 0)
|
||||
if (grp == NULL) { /* grp name. */
|
||||
int ismulti = is_multigroup(value);
|
||||
|
||||
if (ismulti < 0) {
|
||||
mms_info(0, "mms_cfg", NULL, "Skipping unknown group `%s' at line %d of conf file",
|
||||
octstr_get_cstr(value), i+1);
|
||||
skip = 1;
|
||||
} else {
|
||||
grp = gw_malloc(sizeof *grp);
|
||||
grp->name = octstr_duplicate(value);
|
||||
grp->fields = dict_create(23, (void (*)(void *))octstr_destroy);
|
||||
|
||||
if (ismulti) {
|
||||
List *l = dict_get(cfg->grps, value);
|
||||
|
||||
if (l == NULL) {
|
||||
l = gwlist_create();
|
||||
dict_put(cfg->grps, value, l);
|
||||
}
|
||||
gwlist_append(l, grp);
|
||||
} else if (dict_put_once(cfg->grps, value, grp) == 0)
|
||||
panic(0, "Group `%s' [at line %d] cannot appear more "
|
||||
"than once in config!",
|
||||
octstr_get_cstr(value), i+1);
|
||||
}
|
||||
} else
|
||||
panic(0,"`group' is an illegal field name "
|
||||
"within a group at line %d in config file!",
|
||||
i+1);
|
||||
else if (grp) /* an ordinary field name. */
|
||||
check_and_add_field(grp, field, value,i+1);
|
||||
else
|
||||
panic(0, "A group must begin with a `group = group_name' "
|
||||
"clause [at line %d in config file]", i+1);
|
||||
|
||||
octstr_destroy(field);
|
||||
octstr_destroy(value);
|
||||
} else
|
||||
panic(0, "mal-formed entry in conf file at line %d!", i+1);
|
||||
}
|
||||
|
||||
gwlist_destroy(lines, (gwlist_item_destructor_t *)octstr_destroy);
|
||||
octstr_destroy(sf);
|
||||
|
||||
/* Now check if config-source is set, use that. */
|
||||
if ((grp = mms_cfg_get_single(cfg, octstr_imm("config-source"))) != NULL) {
|
||||
Octstr *init = mms_cfg_get(cfg, grp, octstr_imm("config-library-init-param"));
|
||||
cfg->cfg_funcs = _mms_load_module(cfg, grp, "config-library", "cfg_funcs", NULL);
|
||||
|
||||
if (cfg->cfg_funcs == NULL ||
|
||||
cfg->cfg_funcs->read == NULL ||
|
||||
(cfg->xcfg = cfg->cfg_funcs->read(init)) == NULL) {
|
||||
mms_error(0, "mms_cfg", NULL, "Failed to load cfg reader library from conf!");
|
||||
mms_cfg_destroy(cfg);
|
||||
cfg = NULL;
|
||||
}
|
||||
|
||||
octstr_destroy(init);
|
||||
}
|
||||
|
||||
return cfg;
|
||||
}
|
||||
|
||||
mCfg *mms_cfg_read2(mCfgImpFuncs *cfgfuncs, Octstr *init)
|
||||
{
|
||||
mCfg *cfg;
|
||||
|
||||
gw_assert(cfgfuncs);
|
||||
|
||||
cfg = make_cfg(NULL);
|
||||
|
||||
|
||||
cfg->cfg_funcs = cfgfuncs;
|
||||
|
||||
if (cfg->cfg_funcs->read == NULL ||
|
||||
(cfg->xcfg = cfg->cfg_funcs->read(init)) == NULL) {
|
||||
mms_error(0, "mms_cfg", NULL, "Failed to load cfg reader: read failed in cfg_read2!");
|
||||
mms_cfg_destroy(cfg);
|
||||
cfg = NULL;
|
||||
}
|
||||
return cfg;
|
||||
}
|
||||
|
||||
static void mGrp_destroy(mCfgGrp *grp)
|
||||
{
|
||||
octstr_destroy(grp->name);
|
||||
dict_destroy(grp->fields);
|
||||
gw_free(grp);
|
||||
}
|
||||
|
||||
void mms_cfg_destroy(mCfg *cfg)
|
||||
{
|
||||
List *l;
|
||||
int i, n;
|
||||
|
||||
gw_assert(cfg);
|
||||
|
||||
for (i = 0, l = dict_keys(cfg->grps), n = gwlist_len(l); i < n; i++) {
|
||||
Octstr *grpname = gwlist_get(l, i);
|
||||
void *val = dict_get(cfg->grps, grpname);
|
||||
if (is_multigroup(grpname)) { /* item is a list. */
|
||||
List *gl = val;
|
||||
int j, m = gwlist_len(gl);
|
||||
for (j = 0; j < m; j++)
|
||||
mGrp_destroy(gwlist_get(gl, j));
|
||||
gwlist_destroy(gl, NULL);
|
||||
} else
|
||||
mGrp_destroy(val);
|
||||
}
|
||||
gwlist_destroy(l, (gwlist_item_destructor_t *)octstr_destroy);
|
||||
dict_destroy(cfg->grps);
|
||||
octstr_destroy(cfg->file);
|
||||
|
||||
if (cfg->xcfg && cfg->cfg_funcs &&
|
||||
cfg->cfg_funcs->destroy)
|
||||
cfg->cfg_funcs->destroy(cfg->xcfg);
|
||||
|
||||
gw_free(cfg);
|
||||
}
|
||||
|
||||
mCfgGrp *mms_cfg_get_single(mCfg *cfg, Octstr *name)
|
||||
{
|
||||
gw_assert(name);
|
||||
gw_assert(is_multigroup(name) == 0);
|
||||
|
||||
if (cfg->xcfg == NULL)
|
||||
return dict_get(cfg->grps, name);
|
||||
else
|
||||
return cfg->cfg_funcs->cfg_get_single(cfg->xcfg, name);
|
||||
}
|
||||
|
||||
List *mms_cfg_get_multi(mCfg *cfg, Octstr *name)
|
||||
{
|
||||
|
||||
gw_assert(name);
|
||||
gw_assert(is_multigroup(name) == 1);
|
||||
|
||||
if (cfg->xcfg == NULL) {
|
||||
List *l = NULL, *r;
|
||||
int i;
|
||||
r = dict_get(cfg->grps, name);
|
||||
|
||||
if (r)
|
||||
for (i = 0, l = gwlist_create(); i < gwlist_len(r); i++)
|
||||
gwlist_append(l, gwlist_get(r,i));
|
||||
return l;
|
||||
} else
|
||||
return cfg->cfg_funcs->get_multi(cfg->xcfg, name);
|
||||
}
|
||||
|
||||
void mms_cfg_destroy_grp(mCfg *cfg, mCfgGrp *grp)
|
||||
{
|
||||
gw_assert(cfg);
|
||||
if (cfg->xcfg == NULL || cfg->cfg_funcs == NULL || cfg->cfg_funcs->destroy_grp == NULL)
|
||||
return;
|
||||
else
|
||||
cfg->cfg_funcs->destroy_grp(cfg->xcfg, grp);
|
||||
}
|
||||
|
||||
mCfgGrp *mms_get_multi_by_field(mCfg *cfg, Octstr *name, Octstr *field, Octstr *value)
|
||||
{
|
||||
|
||||
gw_assert(name);
|
||||
gw_assert(is_multigroup(name) == 1);
|
||||
|
||||
if (!valid_in_group(name, field))
|
||||
panic(0, "Request for invalid field/variable `%s' in group `%s', unexpected!",
|
||||
octstr_get_cstr(field), octstr_get_cstr(name));
|
||||
|
||||
if (cfg->xcfg == NULL) {
|
||||
mCfgGrp *grp;
|
||||
Octstr *val;
|
||||
List *r;
|
||||
int i;
|
||||
r = dict_get(cfg->grps, name);
|
||||
if (r)
|
||||
for (i = 0; i < gwlist_len(r); i++)
|
||||
if ((grp = gwlist_get(r, i)) != NULL &&
|
||||
(val = dict_get(grp->fields, field)) != NULL &&
|
||||
octstr_compare(val, value) == 0)
|
||||
return grp;
|
||||
return NULL;
|
||||
} else
|
||||
return cfg->cfg_funcs->get_multi_by_field(cfg->xcfg, name, field, value);
|
||||
|
||||
}
|
||||
|
||||
Octstr *mms_cfg_get(mCfg *cfg, mCfgGrp *grp, Octstr *name)
|
||||
{
|
||||
Octstr *val;
|
||||
Octstr *grp_name = cfg->xcfg ? cfg->cfg_funcs->get_grp_name(cfg->xcfg, grp) :
|
||||
octstr_duplicate(grp->name);
|
||||
|
||||
if (!valid_in_group(grp_name, name))
|
||||
panic(0, "Request for invalid field/variable `%s' in group `%s', unexpected!",
|
||||
octstr_get_cstr(name), octstr_get_cstr(grp_name));
|
||||
|
||||
octstr_destroy(grp_name);
|
||||
if (cfg->xcfg == NULL) {
|
||||
gw_assert(grp);
|
||||
val = dict_get(grp->fields, name);
|
||||
val = octstr_duplicate(val);
|
||||
} else {
|
||||
val = cfg->cfg_funcs->get(cfg->xcfg, grp, name);
|
||||
if (val)
|
||||
fixup_value(val, 0);
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
int mms_cfg_get_int(mCfg *cfg, mCfgGrp *grp, Octstr *name, long *n)
|
||||
{
|
||||
Octstr *val = mms_cfg_get(cfg, grp, name);
|
||||
int ret;
|
||||
if (!val)
|
||||
return -1;
|
||||
ret = octstr_parse_long(n, val, 0, 0);
|
||||
octstr_destroy(val);
|
||||
return (ret == -1) ? -1 : 0;
|
||||
}
|
||||
|
||||
|
||||
int mms_cfg_get_bool(mCfg *cfg, mCfgGrp *grp, Octstr *name, int *bool)
|
||||
{
|
||||
Octstr *val = mms_cfg_get(cfg, grp, name);
|
||||
int ret = 0;
|
||||
if (!val)
|
||||
return -1;
|
||||
|
||||
if (octstr_str_case_compare(val, "yes") == 0 ||
|
||||
octstr_str_case_compare(val, "true") == 0 ||
|
||||
octstr_str_case_compare(val, "1") == 0)
|
||||
*bool = 1;
|
||||
else if (octstr_str_case_compare(val, "no") == 0 ||
|
||||
octstr_str_case_compare(val, "false") == 0 ||
|
||||
octstr_str_case_compare(val, "0") == 0)
|
||||
*bool = 0;
|
||||
else {
|
||||
Octstr *grp_name = cfg->xcfg ? cfg->cfg_funcs->get_grp_name(cfg->xcfg, grp) :
|
||||
octstr_duplicate(grp->name);
|
||||
|
||||
mms_error(0, "mms_cfg", NULL, "Unable to convert value `%s' to boolean for field `%s' in group `%s'",
|
||||
octstr_get_cstr(val), octstr_get_cstr(name), octstr_get_cstr(grp_name));
|
||||
octstr_destroy(grp_name);
|
||||
ret = -1;
|
||||
}
|
||||
|
||||
octstr_destroy(val);
|
||||
return ret;
|
||||
}
|
||||
|
||||
List *mms_cfg_get_list(mCfg *cfg, mCfgGrp *grp, Octstr *name)
|
||||
{
|
||||
Octstr *val = mms_cfg_get(cfg, grp, name);
|
||||
List *l;
|
||||
|
||||
if (val == NULL)
|
||||
return NULL;
|
||||
l = octstr_split_words(val);
|
||||
octstr_destroy(val);
|
||||
return l;
|
||||
}
|
|
@ -0,0 +1,241 @@
|
|||
/*
|
||||
* Mbuni - Open Source MMS Gateway
|
||||
*
|
||||
* MMS Config structure definitions
|
||||
*
|
||||
* Copyright (C) 2003 - 20058 Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
*
|
||||
* Paul Bagyenda <bagyenda@dsmagic.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License, with a few exceptions granted (see LICENSE)
|
||||
*/
|
||||
|
||||
#ifndef OCTSTR
|
||||
#error OCTSTR not defined.
|
||||
#endif
|
||||
|
||||
#ifndef SINGLE_GROUP
|
||||
#error SINGLE_GROUP not defined.
|
||||
#endif
|
||||
|
||||
#ifndef MULTI_GROUP
|
||||
#error MULTI_GROUP not defined.
|
||||
#endif
|
||||
|
||||
/* config-source: If it exists, the rest of the conf file is
|
||||
* ignored. Instead, use the provided lib as the reader of the
|
||||
* config info. (See mms_cfg-impl.h for details)
|
||||
*/
|
||||
|
||||
SINGLE_GROUP(config-source,
|
||||
OCTSTR(config-library)
|
||||
OCTSTR(config-library-init-param)
|
||||
)
|
||||
|
||||
SINGLE_GROUP(core,
|
||||
OCTSTR(log-file)
|
||||
OCTSTR(log-level)
|
||||
OCTSTR(access-log)
|
||||
OCTSTR(http-proxy-host)
|
||||
OCTSTR(http-proxy-port)
|
||||
OCTSTR(http-proxy-exceptions)
|
||||
OCTSTR(http-proxy-username)
|
||||
OCTSTR(http-proxy-password)
|
||||
OCTSTR(ssl-client-certkey-file)
|
||||
OCTSTR(ssl-server-cert-file)
|
||||
OCTSTR(ssl-server-key-file)
|
||||
OCTSTR(ssl-trusted-ca-file)
|
||||
OCTSTR(http-interface-name)
|
||||
)
|
||||
|
||||
SINGLE_GROUP(mbuni,
|
||||
OCTSTR(name)
|
||||
OCTSTR(hostname)
|
||||
OCTSTR(host-alias)
|
||||
OCTSTR(local-prefixes)
|
||||
OCTSTR(storage-directory)
|
||||
OCTSTR(queue-manager-module)
|
||||
OCTSTR(queue-module-init-data)
|
||||
OCTSTR(max-send-threads)
|
||||
OCTSTR(send-mail-prog)
|
||||
OCTSTR(unified-prefix)
|
||||
OCTSTR(strip-prefixes)
|
||||
OCTSTR(maximum-send-attempts)
|
||||
OCTSTR(mm1-maximum-notify-attempts)
|
||||
OCTSTR(mmsbox-maximum-request-attempts)
|
||||
OCTSTR(default-message-expiry)
|
||||
OCTSTR(max-message-expiry)
|
||||
OCTSTR(queue-run-interval)
|
||||
OCTSTR(mm1-queue-run-interval)
|
||||
OCTSTR(send-attempt-back-off)
|
||||
OCTSTR(sendsms-url)
|
||||
OCTSTR(sendsms-username)
|
||||
OCTSTR(sendsms-password)
|
||||
OCTSTR(sendsms-global-sender)
|
||||
OCTSTR(mms-port)
|
||||
OCTSTR(mm7-port)
|
||||
OCTSTR(mm4-port)
|
||||
OCTSTR(allow-ip)
|
||||
OCTSTR(deny-ip)
|
||||
OCTSTR(email2mms-relay-hosts)
|
||||
OCTSTR(billing-module-parameters)
|
||||
OCTSTR(billing-library)
|
||||
OCTSTR(resolver-module-parameters)
|
||||
OCTSTR(resolver-library)
|
||||
OCTSTR(detokenizer-module-parameters)
|
||||
OCTSTR(detokenizer-library)
|
||||
OCTSTR(prov-server-notify-script)
|
||||
OCTSTR(prov-server-sub-status-script)
|
||||
OCTSTR(notify-unprovisioned)
|
||||
OCTSTR(mms-notify-text)
|
||||
OCTSTR(mms-notify-unprovisioned-text)
|
||||
OCTSTR(mms-to-email-txt)
|
||||
OCTSTR(mms-to-email-html)
|
||||
OCTSTR(mms-to-email-default-subject)
|
||||
OCTSTR(mms-message-too-large-txt)
|
||||
OCTSTR(mms-client-msisdn-header)
|
||||
OCTSTR(mms-client-ip-header)
|
||||
OCTSTR(allow-ip-type)
|
||||
OCTSTR(optimize-notification-size)
|
||||
OCTSTR(content-adaptation)
|
||||
OCTSTR(send-dlr-on-fetch)
|
||||
OCTSTR(sendmms-port)
|
||||
OCTSTR(sendmms-port-ssl)
|
||||
|
||||
OCTSTR(mmsbox-mt-filter-library)
|
||||
OCTSTR(mmsbox-mt-always-multipart)
|
||||
|
||||
OCTSTR(mmsbox-admin-port)
|
||||
OCTSTR(mmsc-admin-port)
|
||||
OCTSTR(admin-port-ssl)
|
||||
OCTSTR(admin-password)
|
||||
|
||||
OCTSTR(admin-allow-ip)
|
||||
OCTSTR(admin-deny-ip)
|
||||
|
||||
OCTSTR(event-logger-module)
|
||||
OCTSTR(event-logger-module-parameters)
|
||||
|
||||
OCTSTR(mm5-module)
|
||||
OCTSTR(mm5-module-parameters)
|
||||
|
||||
OCTSTR(mmsbox-cdr-module)
|
||||
OCTSTR(mmsbox-cdr-module-parameters)
|
||||
OCTSTR(mmsc-services)
|
||||
OCTSTR(smtp-relay)
|
||||
)
|
||||
|
||||
MULTI_GROUP(mmsproxy,
|
||||
OCTSTR(name)
|
||||
OCTSTR(host)
|
||||
OCTSTR(allowed-prefix)
|
||||
OCTSTR(denied-prefix)
|
||||
OCTSTR(send-mail-prog)
|
||||
OCTSTR(confirmed-delivery)
|
||||
OCTSTR(unified-prefix)
|
||||
OCTSTR(strip-prefixes)
|
||||
)
|
||||
|
||||
MULTI_GROUP(mms-vasp,
|
||||
OCTSTR(vasp-id)
|
||||
OCTSTR(type)
|
||||
OCTSTR(mm7-version)
|
||||
OCTSTR(mm7-soap-xmlns)
|
||||
OCTSTR(use-mm7-soap-namespace-prefix)
|
||||
OCTSTR(short-code)
|
||||
OCTSTR(short-codes)
|
||||
OCTSTR(vasp-username)
|
||||
OCTSTR(vasp-password)
|
||||
OCTSTR(vasp-url)
|
||||
OCTSTR(mms-to-email-handler)
|
||||
OCTSTR(mms-to-local-copy-handler)
|
||||
OCTSTR(send-uaprof)
|
||||
OCTSTR(throughput)
|
||||
)
|
||||
|
||||
MULTI_GROUP(send-mms-user,
|
||||
OCTSTR(username)
|
||||
OCTSTR(password)
|
||||
OCTSTR(faked-sender)
|
||||
OCTSTR(delivery-report-url)
|
||||
OCTSTR(read-report-url)
|
||||
OCTSTR(mmsc)
|
||||
)
|
||||
|
||||
MULTI_GROUP(mmsc,
|
||||
OCTSTR(id)
|
||||
OCTSTR(group-id)
|
||||
OCTSTR(vasp-id)
|
||||
OCTSTR(mmsc-url)
|
||||
OCTSTR(incoming-username)
|
||||
OCTSTR(incoming-password)
|
||||
OCTSTR(incoming-port)
|
||||
OCTSTR(allow-ip)
|
||||
OCTSTR(deny-ip)
|
||||
OCTSTR(allowed-prefix)
|
||||
OCTSTR(denied-prefix)
|
||||
OCTSTR(denied-sender-prefix)
|
||||
OCTSTR(allowed-sender-prefix)
|
||||
OCTSTR(incoming-port-ssl)
|
||||
OCTSTR(max-throughput)
|
||||
OCTSTR(type)
|
||||
OCTSTR(allow-adaptations)
|
||||
OCTSTR(mm7-version)
|
||||
OCTSTR(mm7-soap-xmlns)
|
||||
OCTSTR(use-mm7-soap-namespace-prefix)
|
||||
OCTSTR(mm7-mt-filter-params)
|
||||
OCTSTR(reroute)
|
||||
OCTSTR(reroute-mmsc-id)
|
||||
OCTSTR(reroute-add-sender-to-subject)
|
||||
OCTSTR(mmsc-library)
|
||||
OCTSTR(custom-settings)
|
||||
OCTSTR(no-sender-address)
|
||||
|
||||
OCTSTR(default-vasid)
|
||||
OCTSTR(maximum-request-size)
|
||||
OCTSTR(strip-domain)
|
||||
|
||||
OCTSTR(max-recipients)
|
||||
|
||||
OCTSTR(strip-prefixes)
|
||||
OCTSTR(retry-statuses)
|
||||
OCTSTR(mm1-http-proxy)
|
||||
OCTSTR(mm1-gprs-on-command)
|
||||
OCTSTR(mm1-gprs-off-command)
|
||||
OCTSTR(mm1-gprs-pid-command)
|
||||
OCTSTR(mm1-sms-on-command)
|
||||
OCTSTR(mm1-sms-off-command)
|
||||
OCTSTR(mm1-msisdn)
|
||||
OCTSTR(mm1-ua-string)
|
||||
OCTSTR(carrier-id-header)
|
||||
)
|
||||
|
||||
MULTI_GROUP(mms-service,
|
||||
OCTSTR(name)
|
||||
OCTSTR(get-url)
|
||||
OCTSTR(post-url)
|
||||
OCTSTR(exec)
|
||||
OCTSTR(file)
|
||||
OCTSTR(text)
|
||||
OCTSTR(faked-sender)
|
||||
OCTSTR(catch-all)
|
||||
OCTSTR(omit-empty)
|
||||
OCTSTR(suppress-reply)
|
||||
OCTSTR(accept-x-mbuni-headers)
|
||||
OCTSTR(pass-thro-headers)
|
||||
OCTSTR(assume-plain-text)
|
||||
OCTSTR(accepted-mmscs)
|
||||
OCTSTR(denied-mmscs)
|
||||
OCTSTR(denied-receiver-prefix)
|
||||
OCTSTR(allowed-receiver-prefix)
|
||||
OCTSTR(keyword)
|
||||
OCTSTR(aliases)
|
||||
OCTSTR(http-post-parameters)
|
||||
OCTSTR(service-code)
|
||||
OCTSTR(extra-reply-content-header)
|
||||
)
|
||||
#undef OCTSTR
|
||||
#undef SINGLE_GROUP
|
||||
#undef MULTI_GROUP
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
/*
|
||||
* Mbuni - Open Source MMS Gateway
|
||||
*
|
||||
* config file functions
|
||||
*
|
||||
* Copyright (C) 2003 - 2008, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
*
|
||||
* Paul Bagyenda <bagyenda@dsmagic.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License, with a few exceptions granted (see LICENSE)
|
||||
*/
|
||||
#ifndef __MMS_CFG__INCLUDED__
|
||||
#define __MMS_CFG__INCLUDED__
|
||||
|
||||
#include "gwlib/gwlib.h"
|
||||
#include "gwlib/mime.h"
|
||||
|
||||
#include "mbuni-config.h"
|
||||
|
||||
typedef struct mCfg mCfg; /* config file structure. */
|
||||
typedef struct mCfgGrp mCfgGrp; /* A config group. */
|
||||
struct mCfgImpFuncs; /* Defined in mms_cfg-impl.h */
|
||||
|
||||
/* Read a config file, return the structure. */
|
||||
mCfg *mms_cfg_read(Octstr *file);
|
||||
|
||||
/* Read conf from a module */
|
||||
mCfg *mms_cfg_read2(struct mCfgImpFuncs *cfgfuncs, Octstr *init);
|
||||
|
||||
/* Destroy it all . */
|
||||
void mms_cfg_destroy(mCfg *cfg);
|
||||
|
||||
/* Get a single group object by name. */
|
||||
mCfgGrp *mms_cfg_get_single(mCfg *cfg, Octstr *name);
|
||||
|
||||
/* Get a multiple groups all of same name. */
|
||||
List *mms_cfg_get_multi(mCfg *cfg,Octstr *name);
|
||||
|
||||
mCfgGrp *mms_get_multi_by_field(mCfg *cfg, Octstr *name, Octstr *field, Octstr *value);
|
||||
|
||||
/* Destroy a group object after user -- call this to cleanup memory used by group object
|
||||
* always!
|
||||
*/
|
||||
void mms_cfg_destroy_grp(mCfg *, mCfgGrp *);
|
||||
|
||||
/* Get a string field value from a group. */
|
||||
Octstr *mms_cfg_get(mCfg *cfg, mCfgGrp *grp, Octstr *name);
|
||||
|
||||
|
||||
/* Get an integer field value from a group.
|
||||
* returns 0 on success, -1 on error.
|
||||
*/
|
||||
int mms_cfg_get_int(mCfg *cfg, mCfgGrp *grp, Octstr *name, long *n);
|
||||
|
||||
/* Get a boolean field value from a group.
|
||||
* returns 0 on success, -1 on error
|
||||
*/
|
||||
int mms_cfg_get_bool(mCfg *cfg, mCfgGrp *grp, Octstr *name, int *val);
|
||||
|
||||
/* Get a field value from a group. */
|
||||
List *mms_cfg_get_list(mCfg *cfg, mCfgGrp *grp, Octstr *name);
|
||||
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,147 @@
|
|||
/*
|
||||
* Mbuni - Open Source MMS Gateway
|
||||
*
|
||||
* Event logger module
|
||||
*
|
||||
* Copyright (C) 2003 - 2008, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
*
|
||||
* Paul Bagyenda <bagyenda@dsmagic.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License, with a few exceptions granted (see LICENSE)
|
||||
*/
|
||||
#include "mms_eventlogger.h"
|
||||
#include "mms_util.h"
|
||||
|
||||
static Octstr *shell_cmd;
|
||||
|
||||
/* So that below compiles fine. */
|
||||
#undef error
|
||||
#undef warning
|
||||
#undef info
|
||||
static void default_logger(enum mbuni_event_type_t type, const char *subtype, int err, const char *file,
|
||||
int line,
|
||||
const char *function,
|
||||
const char *interface, Octstr *id,
|
||||
Octstr *msg)
|
||||
{
|
||||
void (*f)(int, const char *,...);
|
||||
switch(type) {
|
||||
case MBUNI_INFO:
|
||||
f = info;
|
||||
break;
|
||||
case MBUNI_WARNING:
|
||||
f = warning;
|
||||
break;
|
||||
default: /* including error. */
|
||||
f = error;
|
||||
break;
|
||||
}
|
||||
|
||||
f(err, "%s:%d <%s> [%s] [%s] %s",
|
||||
file, line, function,
|
||||
interface ? interface : "n/a",
|
||||
id ? octstr_get_cstr(id) : "n/a",
|
||||
octstr_get_cstr(msg));
|
||||
}
|
||||
|
||||
|
||||
static void shell_logger(enum mbuni_event_type_t type, const char *subtype, int err, const char *file,
|
||||
int line, const char *function,
|
||||
const char *interface, Octstr *id,
|
||||
Octstr *msg)
|
||||
{
|
||||
char *xtype;
|
||||
Octstr *cmd, *xid = octstr_duplicate(id);
|
||||
|
||||
gw_assert(shell_cmd);
|
||||
|
||||
switch(type) {
|
||||
case MBUNI_INFO:
|
||||
xtype = "INFO";
|
||||
break;
|
||||
case MBUNI_WARNING:
|
||||
xtype = "WARNING";
|
||||
break;
|
||||
|
||||
default: /* including error. */
|
||||
xtype = "ERROR";
|
||||
break;
|
||||
}
|
||||
|
||||
escape_shell_chars(msg);
|
||||
escape_shell_chars(id);
|
||||
|
||||
|
||||
cmd = octstr_format("%S '%s' '%s' %d '%s' '%s' %d '%S' '%S'",
|
||||
shell_cmd, xtype, subtype ? subtype : "", err, interface ? interface : "", file, line, xid ? xid : octstr_imm(""), msg);
|
||||
system(octstr_get_cstr(cmd));
|
||||
|
||||
octstr_destroy(cmd);
|
||||
octstr_destroy(xid);
|
||||
}
|
||||
|
||||
static int init_default_logger(Octstr *param)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int init_shell_logger(Octstr *cmd)
|
||||
{
|
||||
shell_cmd = octstr_duplicate(cmd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int cleanup_shell_logger(void)
|
||||
{
|
||||
octstr_destroy(shell_cmd);
|
||||
shell_cmd = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static MmsEventLoggerFuncs default_handler = {init_default_logger, default_logger}, *log_handler = &default_handler;
|
||||
|
||||
MmsEventLoggerFuncs shell_event_logger = {
|
||||
init_shell_logger,
|
||||
shell_logger,
|
||||
cleanup_shell_logger
|
||||
};
|
||||
|
||||
int mms_event_logger_init(MmsEventLoggerFuncs *funcs, Octstr *init_param)
|
||||
{
|
||||
if (funcs && (funcs->init == NULL ||
|
||||
funcs->init(init_param) == 0)) {
|
||||
log_handler = funcs;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
extern void mms_event_logger(enum mbuni_event_type_t type, const char *subtype, int err, const char *file,
|
||||
int line, const char *function, char *interface, Octstr *id,
|
||||
char *fmt,...)
|
||||
{
|
||||
Octstr *x;
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
x = octstr_format_valist(fmt, ap);
|
||||
|
||||
va_end(ap);
|
||||
|
||||
log_handler->log_event(type,subtype, err, file, line, function, interface, id, x);
|
||||
|
||||
octstr_destroy(x);
|
||||
}
|
||||
|
||||
void mms_event_logger_cleanup(void)
|
||||
{
|
||||
if (log_handler->cleanup)
|
||||
log_handler->cleanup();
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
* Mbuni - Open Source MMS Gateway
|
||||
*
|
||||
* Event logger module
|
||||
*
|
||||
* Copyright (C) 2003 - 2008, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
*
|
||||
* Paul Bagyenda <bagyenda@dsmagic.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License, with a few exceptions granted (see LICENSE)
|
||||
*/
|
||||
#ifndef __MMS_EVENTLOGGER__INCLUDED__
|
||||
#define __MMS_EVENTLOGGER__INCLUDED__
|
||||
|
||||
#include <stdarg.h>
|
||||
#include "gwlib/gwlib.h"
|
||||
|
||||
typedef enum mbuni_event_type_t {MBUNI_ERROR, MBUNI_INFO, MBUNI_WARNING} mbuni_event_type_t;
|
||||
typedef struct MmsEventLoggerFuncs {
|
||||
int (*init)(Octstr *init_param);
|
||||
void (*log_event)(enum mbuni_event_type_t type, const char *subtype, int err, const char *file,
|
||||
int line,
|
||||
const char *function,
|
||||
const char *interface, Octstr *id,
|
||||
Octstr *msg);
|
||||
int (*cleanup)(void);
|
||||
} MmsEventLoggerFuncs;
|
||||
/* A module should expose a module of the above type with name: logger */
|
||||
|
||||
extern int mms_event_logger_init(MmsEventLoggerFuncs *funcs, Octstr *init_param);
|
||||
/* logger function:
|
||||
* - interface is one of MM1, MM4, etc.
|
||||
* - id is an id for the interface element (e.g. mmsc id)
|
||||
*/
|
||||
extern void mms_event_logger_cleanup(void);
|
||||
extern void mms_event_logger(enum mbuni_event_type_t type, const char *subtype,
|
||||
int err, const char *file,
|
||||
int line, const char *function,
|
||||
char *interface, Octstr *id,
|
||||
char *fmt,...);
|
||||
|
||||
#define mms_error(err,intf,id,fmt,...) mms_event_logger(MBUNI_ERROR, NULL, (err), __FILE__, __LINE__,__FUNCTION__,(intf), (id),(fmt),##__VA_ARGS__)
|
||||
#define mms_info(err,intf,id,fmt,...) mms_event_logger(MBUNI_INFO, NULL, (err), __FILE__, __LINE__,__FUNCTION__,(intf), (id),(fmt),##__VA_ARGS__)
|
||||
#define mms_warning(err,intf,id,fmt,...) mms_event_logger(MBUNI_WARNING, NULL, (err), __FILE__, __LINE__,__FUNCTION__,(intf), (id),(fmt),##__VA_ARGS__)
|
||||
|
||||
#define mms_error_ex(subtype,err,intf,id,fmt,...) mms_event_logger(MBUNI_ERROR, (subtype), (err), __FILE__, __LINE__,__FUNCTION__,(intf), (id),(fmt),##__VA_ARGS__)
|
||||
#define mms_info_ex(subtype,err,intf,id,fmt,...) mms_event_logger(MBUNI_INFO, (subtype), (err), __FILE__, __LINE__,__FUNCTION__,(intf), (id),(fmt),##__VA_ARGS__)
|
||||
#define mms_warning_ex(subtype,err,intf,id,fmt,...) mms_event_logger(MBUNI_WARNING, (subtype), (err), __FILE__, __LINE__,__FUNCTION__,(intf), (id),(fmt),##__VA_ARGS__)
|
||||
|
||||
|
||||
extern MmsEventLoggerFuncs shell_event_logger; /* For logging using a shell command. */
|
||||
|
||||
/* Stop all from using gwlib info, error and warning functions */
|
||||
#define error use_mms_error_instead
|
||||
#define warning use_mms_warning_instead
|
||||
#define info use_mms_info_instead
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* Mbuni - Open Source MMS Gateway
|
||||
*
|
||||
* MM7/SOAP message encoder/decoder and helper functions
|
||||
*
|
||||
* Copyright (C) 2003 - 2008, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
*
|
||||
* Paul Bagyenda <bagyenda@dsmagic.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License, with a few exceptions granted (see LICENSE)
|
||||
*/
|
||||
#ifndef __MMS_MM7SOAP_INCLUDED__
|
||||
#define __MMS_MM7SOAP_INCLUDED__
|
||||
#include "mms_util.h"
|
||||
|
||||
#define MM7_SOAP_OK 1000
|
||||
#define MM7_SOAP_FORMAT_CORRUPT 2007
|
||||
#define MM7_SOAP_COMMAND_REJECTED 3005
|
||||
#define MM7_SOAP_UNSUPPORTED_OPERATION 4003
|
||||
#define MM7_SOAP_STATUS_OK(e) (((e) / 1000) == 1)
|
||||
#define MM7_SOAP_CLIENT_ERROR(e) (((e) / 1000) == 2)
|
||||
|
||||
#if 0
|
||||
#define MM7_DEFAULT_VERSION MMS_3GPP_VERSION
|
||||
#define MM7_VERSION "5.3.0"
|
||||
#endif
|
||||
|
||||
#define DEFAULT_MM7_VERSION MAKE_VERSION(5,3,0)
|
||||
|
||||
typedef struct MSoapMsg_t MSoapMsg_t;
|
||||
|
||||
typedef struct MM7Version_t {
|
||||
int major, minor1, minor2; /* e.g. 5.1.0. */
|
||||
int use_mm7_namespace; /* whether to put in the namespace prefix. */
|
||||
char xmlns[128];
|
||||
} MM7Version_t;
|
||||
|
||||
/* Parse SOAP message given http headers and body. */
|
||||
extern MSoapMsg_t *mm7_parse_soap(List *headers, Octstr *body);
|
||||
|
||||
/* Convert message type to mm7 type code */
|
||||
extern int mm7_msgtype_to_soaptype(int mtype, int isclientside);
|
||||
|
||||
/* Convert SOAP message to http headers and body. */
|
||||
extern int mm7_soapmsg_to_httpmsg(MSoapMsg_t *m, MM7Version_t *ver, List **hdrs, Octstr **body);
|
||||
|
||||
/* Convert SOAP message to an MMS message. */
|
||||
extern MmsMsg *mm7_soap_to_mmsmsg(MSoapMsg_t *m, Octstr *from);
|
||||
|
||||
/* Return the message type. */
|
||||
extern int mm7_msgtype(MSoapMsg_t *m);
|
||||
|
||||
/* Collect and return envelope data:
|
||||
* - to -- list of recipients to send to
|
||||
* - subject -- subject
|
||||
* - msgid -- message id
|
||||
* - vasid/vaspid -- vasid and vaspid
|
||||
*/
|
||||
extern int mm7_get_envelope(MSoapMsg_t *m, Octstr **sender,
|
||||
List **to, Octstr **subject,
|
||||
Octstr **vasid,
|
||||
time_t *expiry_t,
|
||||
time_t *delivery_t,
|
||||
Octstr **uaprof,
|
||||
time_t *uaprof_tstamp);
|
||||
|
||||
/* Delete the thingie... */
|
||||
extern void mm7_soap_destroy(MSoapMsg_t *m);
|
||||
|
||||
/* Convert a message to a SOAP message. */
|
||||
MSoapMsg_t *mm7_mmsmsg_to_soap(MmsMsg *msg, Octstr *from, List *xto,
|
||||
Octstr *transid, Octstr *srvcode,
|
||||
Octstr *linkedid,
|
||||
int isclientside,
|
||||
char *vaspid, char *vasid,
|
||||
Octstr *uaprof,
|
||||
time_t uaprof_tstamp,
|
||||
List *extra_hdrs);
|
||||
MSoapMsg_t *mm7_make_resp(MSoapMsg_t *mreq, int status, Octstr *msgid, int isclientside);
|
||||
/* Return the header value for some header. */
|
||||
Octstr *mm7_soap_header_value(MSoapMsg_t *m, Octstr *header);
|
||||
|
||||
/* Return (a copy of) all the headers */
|
||||
List *mm7_soap_headers(MSoapMsg_t *m);
|
||||
#endif
|
|
@ -0,0 +1,807 @@
|
|||
/*
|
||||
* Mbuni - Open Source MMS Gateway
|
||||
*
|
||||
* Mbuni MMBox implementation
|
||||
*
|
||||
* Copyright (C) 2003 - 2008, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
*
|
||||
* Paul Bagyenda <bagyenda@dsmagic.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License, with a few exceptions granted (see LICENSE)
|
||||
*/
|
||||
|
||||
#include <sys/file.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "mms_mmbox.h"
|
||||
#include "mms_util.h"
|
||||
#include "gwlib/log.h"
|
||||
#include "gwlib/accesslog.h"
|
||||
|
||||
#define MAXTRIES 10
|
||||
#define MDF 'd'
|
||||
#define MTF 't'
|
||||
#define IDXFILE "00Index"
|
||||
|
||||
#define ITEM_ADD 1
|
||||
#define ITEM_DEL 2
|
||||
#define ITEM_MOD 3
|
||||
|
||||
|
||||
|
||||
/* Initialise the root of the mmbox. Should be called once from load settings. */
|
||||
int mmbox_root_init(char *mmbox_root)
|
||||
{
|
||||
int i, ret;
|
||||
if ((ret = mkdir(mmbox_root,
|
||||
S_IRWXU|S_IRWXG)) < 0 &&
|
||||
errno != EEXIST)
|
||||
return errno;
|
||||
for (i = 0; _TT[i]; i++) {
|
||||
char fbuf[256];
|
||||
|
||||
sprintf(fbuf, "%.128s/%c", mmbox_root, _TT[i]);
|
||||
if (mkdir(fbuf,
|
||||
S_IRWXU|S_IRWXG) < 0 &&
|
||||
errno != EEXIST)
|
||||
return errno;
|
||||
}
|
||||
srandom(time(NULL)); /* we need rands below...*/
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Initialise the mmbox home of the user/msisdn.
|
||||
* structure of mmbox is:
|
||||
* - index file [IDXFILE]
|
||||
* - directories a - z 0 - 9, which each can contain directories with two-character
|
||||
* names
|
||||
* on init we only create the directory itself. internal
|
||||
* directory structure and index will be made by first message put in.
|
||||
* return user dir, or NULL if something went wrong.
|
||||
*/
|
||||
static Octstr *user_mmbox_dir(char *mmbox_root, char *userid)
|
||||
{
|
||||
|
||||
unsigned long h = _mshash(userid);
|
||||
char d1[2], d2[3], fbuf[512];
|
||||
Octstr *t, *s;
|
||||
|
||||
/* Make toplevel dir. */
|
||||
d1[0] = _TT[h%_TTSIZE];
|
||||
d1[1] = '\0';
|
||||
|
||||
/* Then lower level. */
|
||||
h /= _TTSIZE;
|
||||
d2[0] = _TT[h%_TTSIZE];
|
||||
h /= _TTSIZE;
|
||||
d2[1] = _TT[h%_TTSIZE];
|
||||
d2[2] = '\0';
|
||||
|
||||
/* Try and create the next level dir (first level was created by root_init) */
|
||||
sprintf(fbuf, "%.128s/%s/%s", mmbox_root, d1, d2);
|
||||
if (mkdir(fbuf,
|
||||
S_IRWXU|S_IRWXG) < 0 &&
|
||||
errno != EEXIST) {
|
||||
mms_error(0, "mmbox", NULL, "Failed to create dir [%s] "
|
||||
"while initialising mmbox for %s: %s!",
|
||||
fbuf, userid, strerror(errno));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
t = octstr_create(userid);
|
||||
octstr_replace(t, octstr_imm("/"), octstr_imm("$")); /* XXX safe in all cases?? */
|
||||
s = octstr_format("%s/%S", fbuf, t);
|
||||
octstr_destroy(t);
|
||||
|
||||
if (mkdir(octstr_get_cstr(s),
|
||||
S_IRWXU|S_IRWXG) < 0 &&
|
||||
errno != EEXIST) {
|
||||
mms_error(0, "mmbox", NULL, "Failed to create dir [%s] "
|
||||
"while initialising mmbox for %s: %s!",
|
||||
octstr_get_cstr(s), userid, strerror(errno));
|
||||
octstr_destroy(s);
|
||||
return NULL;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
/* Makes a file name in the nested directory structure, where we can store
|
||||
* data. Makes a number of tries -- similar to mkqf in queue module.
|
||||
*/
|
||||
static int mkdf(char df[64], char *mmbox_home)
|
||||
{
|
||||
|
||||
int i = 0, fd = -1;
|
||||
static int ect;
|
||||
|
||||
if (!mmbox_home)
|
||||
gw_panic(0, "Mmbox directory passed as null!");
|
||||
|
||||
do {
|
||||
char d1[2], d2[3];
|
||||
Octstr *tmp;
|
||||
char *ctmp;
|
||||
|
||||
d1[0] = _TT[random() % _TTSIZE];
|
||||
d1[1] = '\0';
|
||||
|
||||
/* Make first level. */
|
||||
tmp = octstr_format("%.128s/%s", mmbox_home, d1);
|
||||
if (mkdir(octstr_get_cstr(tmp),
|
||||
S_IRWXU|S_IRWXG) < 0 &&
|
||||
errno != EEXIST) {
|
||||
mms_error(0, "mmbox", NULL, "failed to create dir [%s] "
|
||||
" in mmbox home %s: %s!",
|
||||
octstr_get_cstr(tmp), mmbox_home, strerror(errno));
|
||||
octstr_destroy(tmp);
|
||||
return -1;
|
||||
}
|
||||
|
||||
octstr_destroy(tmp);
|
||||
|
||||
d2[0] = _TT[random() % _TTSIZE];
|
||||
d2[1] = _TT[random() % _TTSIZE];
|
||||
d2[2] = '\0';
|
||||
|
||||
/* Make second level. */
|
||||
tmp = octstr_format("%.128s/%s/%s", mmbox_home, d1,d2);
|
||||
|
||||
if (mkdir(octstr_get_cstr(tmp),
|
||||
S_IRWXU|S_IRWXG) < 0 &&
|
||||
errno != EEXIST) {
|
||||
mms_error(0, "mmbox", NULL, "Failed to create dir [%s] "
|
||||
" in mmbox home %s: %s!",
|
||||
octstr_get_cstr(tmp), mmbox_home, strerror(errno));
|
||||
octstr_destroy(tmp);
|
||||
return -1;
|
||||
}
|
||||
octstr_destroy(tmp);
|
||||
|
||||
/* use df[] to store candidate so when we hit success it is already there...*/
|
||||
sprintf(df, "%s/%s/%cf%ld.%d.x%d%ld",
|
||||
d1,d2, MDF,
|
||||
time(NULL),
|
||||
++ect, getpid(), random() % 100);
|
||||
tmp = octstr_format("%s/%s", mmbox_home, df);
|
||||
ctmp = octstr_get_cstr(tmp);
|
||||
fd = open(ctmp, O_RDWR|O_CREAT|O_EXCL, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP);
|
||||
if (fd >= 0 &&
|
||||
mm_lockfile(fd,ctmp,1) != 0) {
|
||||
unlink(ctmp);
|
||||
unlock_and_close(fd);
|
||||
fd = -1;
|
||||
}
|
||||
octstr_destroy(tmp);
|
||||
|
||||
} while (i++ < MAXTRIES && fd < 0);
|
||||
|
||||
return fd;
|
||||
}
|
||||
|
||||
static int open_mmbox_index(char *mmbox_dir, int shouldblock)
|
||||
{
|
||||
char fbuf[256];
|
||||
int i, fd;
|
||||
|
||||
sprintf(fbuf, "%s/%s", mmbox_dir, IDXFILE);
|
||||
|
||||
i = 0;
|
||||
do
|
||||
if ((fd = open(fbuf, O_RDWR|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP)) < 0) {
|
||||
mms_error(0, "mmbox", NULL, "Failed to open mmbox index file [%s], error: %s!",
|
||||
fbuf, strerror(errno));
|
||||
break;
|
||||
} else if (mm_lockfile(fd, fbuf, shouldblock) != 0) {
|
||||
unlock_and_close(fd);
|
||||
fd = -1;
|
||||
}
|
||||
while (i++ < MAXTRIES && fd < 0);
|
||||
|
||||
return fd;
|
||||
}
|
||||
|
||||
static Octstr *linearise_string_list(List *l, char *sep)
|
||||
{
|
||||
int i, n;
|
||||
|
||||
Octstr *s = octstr_create("");
|
||||
|
||||
for (i = 0, n = gwlist_len(l); i < n; i++) {
|
||||
Octstr *p = gwlist_get(l,i);
|
||||
if (p)
|
||||
octstr_format_append(s, "%s%S", (i == 0) ? "" : sep, p);
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
static List *parse_string_list(char *buf)
|
||||
{
|
||||
int i = 0;
|
||||
char sbuf[128], *p = buf;
|
||||
List *l = gwlist_create();
|
||||
|
||||
while (sscanf(p, "%s%n", sbuf, &i) > 0) {
|
||||
gwlist_append(l, octstr_create(sbuf));
|
||||
p += i;
|
||||
}
|
||||
|
||||
return l;
|
||||
}
|
||||
|
||||
static char *skip_space(char *s)
|
||||
{
|
||||
while (*s && isspace(*s))
|
||||
s++;
|
||||
return s;
|
||||
}
|
||||
|
||||
/* Format of Index file:
|
||||
* each message is described by a single line:
|
||||
* df state flag1 flag2 flag3 ...
|
||||
*/
|
||||
static int update_mmbox_index(int fd, char *mmbox_dir, int cmd,
|
||||
Octstr *df, Octstr *state, List *flags, long msgsize)
|
||||
{
|
||||
char fbuf[256], linbuf[1024];
|
||||
int tempfd;
|
||||
FILE *fp;
|
||||
|
||||
/* Make a temp file. */
|
||||
|
||||
sprintf(fbuf, "%.128s/t%s.%ld.%ld",
|
||||
mmbox_dir, IDXFILE, time(NULL), random() % 1000);
|
||||
|
||||
tempfd = open(fbuf,
|
||||
O_RDWR|O_CREAT|O_EXCL, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP);
|
||||
if (tempfd < 0 ) {
|
||||
mms_error(0, "mmbox", NULL,"Failed to open temp file %s: error = %s\n",
|
||||
fbuf, strerror(errno));
|
||||
|
||||
goto done;
|
||||
} else if (mm_lockfile(tempfd, fbuf, 0) != 0) { /* Lock it. */
|
||||
mms_error(0, "mmbox", NULL,"Failed lock temp file %s: error = %s\n",
|
||||
fbuf, strerror(errno));
|
||||
|
||||
unlock_and_close(tempfd);
|
||||
tempfd = -1;
|
||||
goto done;
|
||||
|
||||
}
|
||||
fp = fdopen(fd, "r");
|
||||
|
||||
if (!fp) {
|
||||
mms_error(0, "mmbox", NULL,"Failed fdopen on tempfd, file %s: error = %s\n",
|
||||
|
||||
fbuf, strerror(errno));
|
||||
|
||||
unlock_and_close(tempfd);
|
||||
tempfd = -1;
|
||||
goto done;
|
||||
}
|
||||
|
||||
while (fgets(linbuf, sizeof linbuf, fp) != NULL) {
|
||||
char idx[128], xstate[32];
|
||||
Octstr *outs = NULL;
|
||||
int i;
|
||||
int size;
|
||||
|
||||
sscanf(linbuf, "%s %s %d%n", idx, xstate, &size, &i);
|
||||
|
||||
if (df && octstr_str_compare(df, idx) == 0)
|
||||
if (cmd == ITEM_DEL || cmd == ITEM_ADD)
|
||||
goto loop; /* Skip it. */
|
||||
else { /* MOD. */
|
||||
Octstr *p = linearise_string_list(flags, " ");
|
||||
outs = octstr_format("%S %S %d %S\n", df, state, msgsize, p);
|
||||
octstr_destroy(p);
|
||||
}
|
||||
else { /* Copy out as-is */
|
||||
char *p = skip_space(linbuf + i);
|
||||
outs = octstr_format("%s %s %d %s%s",
|
||||
idx, xstate,
|
||||
size,
|
||||
p,
|
||||
(strchr(p, '\n') != NULL ? "" : "\n"));
|
||||
}
|
||||
loop:
|
||||
if (outs) {
|
||||
if (octstr_len(outs) > 0)
|
||||
octstr_write_to_socket(tempfd, outs);
|
||||
octstr_destroy(outs);
|
||||
}
|
||||
}
|
||||
|
||||
if (cmd == ITEM_ADD) { /* Finally, for ADD, just add it. */
|
||||
Octstr *s, *p = linearise_string_list(flags, " ");
|
||||
s = octstr_format("%S %S %d %S\n", df, state, msgsize, p);
|
||||
octstr_destroy(p);
|
||||
octstr_write_to_socket(tempfd, s);
|
||||
octstr_destroy(s);
|
||||
}
|
||||
fsync(tempfd);
|
||||
|
||||
sprintf(linbuf, "%.128s/%s",
|
||||
mmbox_dir, IDXFILE);
|
||||
rename(fbuf, linbuf);
|
||||
|
||||
fclose(fp);
|
||||
done:
|
||||
|
||||
return tempfd;
|
||||
}
|
||||
|
||||
static List *make_mm_flags(List *oflags, List *flag_cmds)
|
||||
{
|
||||
List *l = oflags ? oflags : gwlist_create();
|
||||
int i, n;
|
||||
|
||||
for (i = 0, n = gwlist_len(l); i < n; i++) { /* cleanup list. */
|
||||
Octstr *x = gwlist_get(l,i);
|
||||
int ch = octstr_get_char(x, 0);
|
||||
|
||||
if (ch == '+' || ch == '-' || ch == '/')
|
||||
octstr_delete(x,0,1);
|
||||
}
|
||||
|
||||
for (i = 0, n = (flag_cmds ? gwlist_len(flag_cmds) : 0); i<n; i++) {
|
||||
Octstr *x = gwlist_get(flag_cmds,i);
|
||||
int ch = octstr_get_char(x, 0);
|
||||
char *s = octstr_get_cstr(x);
|
||||
int j, m, cmd;
|
||||
|
||||
if (ch == '+' || ch == '-' || ch == '/') {
|
||||
s++;
|
||||
cmd = ch;
|
||||
} else
|
||||
cmd = '+';
|
||||
|
||||
/* Find it in original. If existent, remove it. */
|
||||
for (j = 0, m = gwlist_len(l); j < m; j++)
|
||||
if (octstr_str_compare(gwlist_get(l,j),s) == 0) {
|
||||
Octstr *y = gwlist_get(l,j);
|
||||
gwlist_delete(l,j,1);
|
||||
octstr_destroy(y);
|
||||
j--;
|
||||
m--;
|
||||
}
|
||||
|
||||
if (cmd == '+' || cmd == '/')
|
||||
gwlist_append(l, octstr_create(s));
|
||||
}
|
||||
|
||||
|
||||
return l;
|
||||
}
|
||||
|
||||
Octstr *mms_mmbox_addmsg(char *mmbox_root, char *user, MmsMsg *msg, List *flag_cmds, Octstr *dfltstate)
|
||||
{
|
||||
int ifd = -1, nifd, dfd = -1;
|
||||
char df[128];
|
||||
Octstr *home = user_mmbox_dir(mmbox_root,user);
|
||||
Octstr *s = octstr_create(""), *sdf = NULL;
|
||||
List *flags = NULL;
|
||||
Octstr *state = NULL;
|
||||
int msize;
|
||||
|
||||
if (!home)
|
||||
goto done;
|
||||
ifd = open_mmbox_index(octstr_get_cstr(home),1);
|
||||
|
||||
if (ifd < 0)
|
||||
goto done;
|
||||
|
||||
if ((dfd = mkdf(df, octstr_get_cstr(home))) < 0) {
|
||||
mms_error(0, "mmbox", NULL, "failed to create data file, home=%s - %s!",
|
||||
octstr_get_cstr(home), strerror(errno));
|
||||
goto done;
|
||||
}
|
||||
|
||||
state = mms_get_header_value(msg, octstr_imm("X-Mms-MM-State"));
|
||||
flags = make_mm_flags(mms_get_header_values(msg, octstr_imm("X-Mms-MM-Flags")), flag_cmds);
|
||||
|
||||
if (state == NULL)
|
||||
state = dfltstate ? octstr_duplicate(dfltstate) : octstr_create("Sent");
|
||||
|
||||
mms_replace_header_values(msg, "X-Mms-MM-Flags", flags);
|
||||
mms_replace_header_value(msg, "X-Mms-MM-State", octstr_get_cstr(state));
|
||||
|
||||
s = mms_tobinary(msg);
|
||||
msize = octstr_len(s);
|
||||
|
||||
octstr_write_to_socket(dfd, s);
|
||||
sdf = octstr_create(df);
|
||||
|
||||
if ((nifd = update_mmbox_index(ifd, octstr_get_cstr(home), ITEM_ADD, sdf, state, flags, msize)) < 0 ) {
|
||||
char fbuf[256];
|
||||
sprintf(fbuf, "%s/%s", octstr_get_cstr(home), df);
|
||||
unlink(fbuf);
|
||||
octstr_destroy(sdf);
|
||||
sdf = NULL;
|
||||
goto done;
|
||||
}
|
||||
|
||||
ifd = nifd;
|
||||
octstr_replace(sdf, octstr_imm("/"), octstr_imm("-"));
|
||||
done:
|
||||
if (dfd > 0)
|
||||
unlock_and_close(dfd);
|
||||
if (ifd > 0)
|
||||
unlock_and_close(ifd);
|
||||
|
||||
octstr_destroy(s);
|
||||
octstr_destroy(home);
|
||||
octstr_destroy(state);
|
||||
gwlist_destroy(flags, (gwlist_item_destructor_t *)octstr_destroy);
|
||||
|
||||
return sdf;
|
||||
}
|
||||
|
||||
int mms_mmbox_modmsg(char *mmbox_root, char *user, Octstr *msgref,
|
||||
Octstr *state, List *flag_cmds)
|
||||
{
|
||||
Octstr *sdf = octstr_duplicate(msgref);
|
||||
Octstr *fname = NULL, *ftmp = NULL;
|
||||
Octstr *home = user_mmbox_dir(mmbox_root,user);
|
||||
Octstr *s = NULL;
|
||||
List *flags = NULL;
|
||||
Octstr *nstate = NULL;
|
||||
|
||||
int ifd = -1, nifd, tmpfd = -1;
|
||||
MmsMsg *m = NULL;
|
||||
int res = -1;
|
||||
int msize;
|
||||
|
||||
octstr_replace(sdf, octstr_imm("-"), octstr_imm("/"));
|
||||
|
||||
if (!home)
|
||||
goto done;
|
||||
|
||||
ifd = open_mmbox_index(octstr_get_cstr(home),1);
|
||||
|
||||
if (ifd < 0)
|
||||
goto done;
|
||||
|
||||
fname = octstr_format("%S/%S", home, sdf);
|
||||
s = octstr_read_file(octstr_get_cstr(fname));
|
||||
|
||||
if ( s == NULL || octstr_len(s) == 0) {
|
||||
mms_error(0, "mmbox", NULL, "Failed to read data file [%s] - %s!",
|
||||
octstr_get_cstr(fname), strerror(errno));
|
||||
goto done;
|
||||
}
|
||||
|
||||
m = mms_frombinary(s, octstr_imm("anon@anon"));
|
||||
|
||||
if (!m) {
|
||||
mms_error(0, "mmbox", NULL, "Failed to read data file [%s]!",
|
||||
octstr_get_cstr(fname));
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (state == NULL)
|
||||
nstate = mms_get_header_value(m, octstr_imm("X-Mms-MM-State"));
|
||||
else {
|
||||
nstate = octstr_duplicate(state);
|
||||
mms_replace_header_value(m, "X-Mms-MM-State", octstr_get_cstr(nstate));
|
||||
}
|
||||
|
||||
flags = mms_get_header_values(m, octstr_imm("X-Mms-MM-Flags"));
|
||||
flags = make_mm_flags(flags, flag_cmds);
|
||||
mms_replace_header_values(m, "X-Mms-MM-Flags", flags);
|
||||
|
||||
|
||||
ftmp = octstr_format("%S.%ld.%d", fname, time(NULL), getpid());
|
||||
tmpfd = open(octstr_get_cstr(ftmp), O_RDWR|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP);
|
||||
|
||||
if (tmpfd < 0)
|
||||
goto done;
|
||||
|
||||
s = mms_tobinary(m);
|
||||
msize = octstr_len(s);
|
||||
|
||||
octstr_write_to_socket(tmpfd, s);
|
||||
|
||||
rename(octstr_get_cstr(ftmp), octstr_get_cstr(fname));
|
||||
close(tmpfd);
|
||||
|
||||
if ((nifd = update_mmbox_index(ifd, octstr_get_cstr(home), ITEM_MOD, sdf, nstate, flags, msize)) < 0) {
|
||||
/* Not good, we wrote but could not update the index file. scream. */
|
||||
mms_error(0, "mmbox", NULL, "Failed to update index file, home is %s!",
|
||||
octstr_get_cstr(home));
|
||||
goto done;
|
||||
}
|
||||
ifd = nifd;
|
||||
res = 0;
|
||||
|
||||
done:
|
||||
if (ifd > 0)
|
||||
close(ifd);
|
||||
|
||||
if (fname)
|
||||
octstr_destroy(fname);
|
||||
|
||||
if (ftmp)
|
||||
octstr_destroy(ftmp);
|
||||
|
||||
if (sdf)
|
||||
octstr_destroy(sdf);
|
||||
|
||||
if (s)
|
||||
octstr_destroy(s);
|
||||
if (home)
|
||||
octstr_destroy(home);
|
||||
if (nstate)
|
||||
octstr_destroy(nstate);
|
||||
if (flags)
|
||||
gwlist_destroy(flags, (gwlist_item_destructor_t *)octstr_destroy);
|
||||
if (m)
|
||||
mms_destroy(m);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
int mms_mmbox_delmsg(char *mmbox_root, char *user, Octstr *msgref)
|
||||
{
|
||||
|
||||
Octstr *sdf = octstr_duplicate(msgref);
|
||||
Octstr *fname = NULL, *home = user_mmbox_dir(mmbox_root,user);
|
||||
Octstr *s = NULL;
|
||||
int res = -1;
|
||||
int ifd = -1, nifd;
|
||||
|
||||
|
||||
octstr_replace(sdf, octstr_imm("-"), octstr_imm("/"));
|
||||
|
||||
if (!home)
|
||||
goto done;
|
||||
|
||||
ifd = open_mmbox_index(octstr_get_cstr(home),1);
|
||||
|
||||
if (ifd < 0)
|
||||
goto done;
|
||||
|
||||
fname = octstr_format("%S/%S", home, sdf);
|
||||
|
||||
if ((nifd = update_mmbox_index(ifd, octstr_get_cstr(home), ITEM_DEL, sdf, NULL, NULL,0)) < 0) {
|
||||
|
||||
mms_error(0, "mmbox", NULL,"Failed to update index file, home is %s!",
|
||||
octstr_get_cstr(home));
|
||||
goto done;
|
||||
}
|
||||
unlink(octstr_get_cstr(fname));
|
||||
ifd = nifd;
|
||||
|
||||
res = 0;
|
||||
done:
|
||||
if (ifd > 0)
|
||||
close(ifd);
|
||||
|
||||
if (fname)
|
||||
octstr_destroy(fname);
|
||||
|
||||
if (s)
|
||||
octstr_destroy(s);
|
||||
if (home)
|
||||
octstr_destroy(home);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int string_in_list(Octstr *s, List *l)
|
||||
{
|
||||
int i, n;
|
||||
|
||||
for (i = 0, n = gwlist_len(l); i<n; i++) {
|
||||
Octstr *x = gwlist_get(l,i);
|
||||
char *p = octstr_get_cstr(x);
|
||||
|
||||
if (p[0] == '+' ||
|
||||
p[0] == '/' || p[0] == '-')
|
||||
p++;
|
||||
if (octstr_str_compare(s, p) == 0)
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int _x_octstr_str_compare(Octstr *s, char *p)
|
||||
{
|
||||
return (octstr_str_compare(s,p) == 0);
|
||||
}
|
||||
|
||||
static void replace_slash(char s[])
|
||||
{
|
||||
while (*s)
|
||||
if (*s == '/')
|
||||
*s++ = '-';
|
||||
else
|
||||
s++;
|
||||
}
|
||||
|
||||
List *mms_mmbox_search(char *mmbox_root, char *user,
|
||||
List *state, List *flag_cmds, int start, int limit,
|
||||
List *msgrefs)
|
||||
{
|
||||
int tmpfd = -1;
|
||||
FILE *fp = NULL;
|
||||
char linbuf[1024];
|
||||
|
||||
Octstr *home = user_mmbox_dir(mmbox_root,user);
|
||||
List *flags = NULL;
|
||||
List *dflist = NULL;
|
||||
|
||||
int ifd = -1;
|
||||
int ct;
|
||||
|
||||
ifd = open_mmbox_index(octstr_get_cstr(home),1);
|
||||
|
||||
if (ifd < 0)
|
||||
goto done;
|
||||
|
||||
if ((tmpfd = dup(ifd)) < 0 ||
|
||||
(fp = fdopen(tmpfd, "r")) == NULL) {
|
||||
mms_error(0, "mmbox", NULL, "%s Failed to dup descriptor for index "
|
||||
"file, fp = %p: error = %s\n", octstr_get_cstr(home),
|
||||
fp, strerror(errno));
|
||||
goto done;
|
||||
}
|
||||
|
||||
flags = make_mm_flags(NULL, flag_cmds);
|
||||
|
||||
ct = 1;
|
||||
dflist = gwlist_create();
|
||||
while (fgets(linbuf, sizeof linbuf, fp) != NULL) {
|
||||
char idx[128], xstate[32];
|
||||
List *xflags = NULL;
|
||||
int i, size;
|
||||
|
||||
int match = (!state && (!msgrefs || gwlist_len(msgrefs) == 0) && (!xflags || gwlist_len(xflags) == 0));
|
||||
|
||||
sscanf(linbuf, "%s %s %d%n", idx, xstate, &size, &i);
|
||||
|
||||
/* search: by id list if given, by states if given, by flags if given */
|
||||
if (!match && state && gwlist_search(state, xstate,
|
||||
(gwlist_item_matches_t *)_x_octstr_str_compare) != NULL)
|
||||
match = 1;
|
||||
|
||||
/* For the rest we only match if nothing else matched. Save time */
|
||||
replace_slash(idx);
|
||||
if (!match && msgrefs &&
|
||||
gwlist_search(msgrefs, idx,
|
||||
(gwlist_item_matches_t *)_x_octstr_str_compare) != NULL)
|
||||
match = 1;
|
||||
|
||||
if (!match &&
|
||||
flag_cmds &&
|
||||
((xflags = parse_string_list(linbuf + i)) != NULL &&
|
||||
gwlist_search(xflags, flags, (gwlist_item_matches_t *)string_in_list) != NULL))
|
||||
match = 1;
|
||||
|
||||
if (match && ct >= start && gwlist_len(dflist) <= limit) {
|
||||
Octstr *x = octstr_create(idx);
|
||||
/* octstr_replace(x, octstr_imm("/"), octstr_imm("-")); */
|
||||
gwlist_append(dflist, x);
|
||||
}
|
||||
ct++;
|
||||
if (xflags)
|
||||
gwlist_destroy(xflags, (gwlist_item_destructor_t *)octstr_destroy);
|
||||
}
|
||||
|
||||
done:
|
||||
if (fp)
|
||||
fclose(fp);
|
||||
else if (tmpfd)
|
||||
close(tmpfd);
|
||||
|
||||
if (ifd > 0)
|
||||
close(ifd);
|
||||
|
||||
if (flags)
|
||||
gwlist_destroy(flags, (gwlist_item_destructor_t *)octstr_destroy);
|
||||
|
||||
if (home)
|
||||
octstr_destroy(home);
|
||||
|
||||
return dflist;
|
||||
}
|
||||
|
||||
MmsMsg *mms_mmbox_get(char *mmbox_root, char *user, Octstr *msgref, unsigned long *msize)
|
||||
{
|
||||
Octstr *sdf = octstr_duplicate(msgref);
|
||||
Octstr *fname = NULL, *home = user_mmbox_dir(mmbox_root,user);
|
||||
Octstr *s = NULL;
|
||||
int ifd = -1;
|
||||
MmsMsg *m = NULL;
|
||||
|
||||
octstr_replace(sdf, octstr_imm("-"), octstr_imm("/"));
|
||||
|
||||
if (!home)
|
||||
goto done;
|
||||
|
||||
ifd = open_mmbox_index(octstr_get_cstr(home),1); /* Grab a lock on the index file. */
|
||||
|
||||
if (ifd < 0)
|
||||
goto done;
|
||||
|
||||
fname = octstr_format("%S/%S", home, sdf);
|
||||
s = octstr_read_file(octstr_get_cstr(fname));
|
||||
|
||||
if (s) {
|
||||
if (msize)
|
||||
*msize = octstr_len(s);
|
||||
m = mms_frombinary(s, octstr_imm("anon@anon"));
|
||||
} else if (msize)
|
||||
*msize = 0;
|
||||
done:
|
||||
if (ifd > 0)
|
||||
close(ifd);
|
||||
|
||||
if (fname)
|
||||
octstr_destroy(fname);
|
||||
|
||||
if (s)
|
||||
octstr_destroy(s);
|
||||
if (home)
|
||||
octstr_destroy(home);
|
||||
|
||||
return m;
|
||||
|
||||
}
|
||||
|
||||
int mms_mmbox_count(char *mmbox_root, char *user, unsigned long *msgcount, unsigned long *byte_count)
|
||||
{
|
||||
|
||||
int tmpfd = -1;
|
||||
FILE *fp = NULL;
|
||||
char linbuf[1024];
|
||||
int ret = -1;
|
||||
Octstr *home = user_mmbox_dir(mmbox_root,user);
|
||||
int ifd = -1;
|
||||
|
||||
|
||||
ifd = open_mmbox_index(octstr_get_cstr(home),1);
|
||||
|
||||
if (ifd < 0)
|
||||
goto done;
|
||||
|
||||
if ((tmpfd = dup(ifd)) < 0 ||
|
||||
(fp = fdopen(tmpfd, "r")) == NULL) {
|
||||
mms_error(0, "mmbox", NULL, "%s Failed to dup descriptor for index "
|
||||
"file, fp = %p: error = %s\n", octstr_get_cstr(home),
|
||||
fp, strerror(errno));
|
||||
goto done;
|
||||
}
|
||||
|
||||
*msgcount = 0;
|
||||
*byte_count = 0;
|
||||
|
||||
while (fgets(linbuf, sizeof linbuf, fp) != NULL) {
|
||||
int size = 0;
|
||||
|
||||
sscanf(linbuf, "%*s %*s %d", &size);
|
||||
++*msgcount;
|
||||
*byte_count = *byte_count + size;
|
||||
}
|
||||
ret = 0;
|
||||
|
||||
done:
|
||||
if (fp)
|
||||
fclose(fp);
|
||||
else if (tmpfd)
|
||||
close(tmpfd);
|
||||
|
||||
if (ifd > 0)
|
||||
close(ifd);
|
||||
|
||||
return ret;
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* Mbuni - Open Source MMS Gateway
|
||||
*
|
||||
* Mbuni MMBox implementation
|
||||
*
|
||||
* Copyright (C) 2003 - 2008, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
*
|
||||
* Paul Bagyenda <bagyenda@dsmagic.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License, with a few exceptions granted (see LICENSE)
|
||||
*/
|
||||
#ifndef __MMS_MMBOX__INCLUDED__
|
||||
#define __MMS_MMBOX__INCLUDED__
|
||||
#include "mms_msg.h"
|
||||
/* Initialise the root of the mmbox. Should be called once from load settings. */
|
||||
int mmbox_root_init(char *mmbox_root);
|
||||
Octstr *mms_mmbox_addmsg(char *mmbox_root, char *user, MmsMsg *msg, List *flag_cmds, Octstr *dfltstate);
|
||||
int mms_mmbox_modmsg(char *mmbox_root, char *user, Octstr *msgref,
|
||||
Octstr *state, List *flag_cmds);
|
||||
int mms_mmbox_delmsg(char *mmbox_root, char *user, Octstr *msgref);
|
||||
List *mms_mmbox_search(char *mmbox_root, char *user,
|
||||
List *state, List *flag_cmds, int start, int limit,
|
||||
List *msgrefs);
|
||||
|
||||
MmsMsg *mms_mmbox_get(char *mmbox_root, char *user, Octstr *msgref, unsigned long *msize);
|
||||
int mms_mmbox_count(char *mmbox_root, char *user, unsigned long *msgcount,
|
||||
unsigned long *byte_count);
|
||||
|
||||
#define USER_MMBOX_MSG_QUOTA 200000 /* Means nothing at the moment. */
|
||||
#define USER_MMBOX_DATA_QUOTA 2000000 /* ditto. */
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
|
@ -1,3 +1,16 @@
|
|||
/*
|
||||
* Mbuni - Open Source MMS Gateway
|
||||
*
|
||||
* MMS message encoder/decoder and helper functions
|
||||
*
|
||||
* Copyright (C) 2003 - 2008, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
*
|
||||
* Paul Bagyenda <bagyenda@dsmagic.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License, with a few exceptions granted (see LICENSE)
|
||||
*/
|
||||
|
||||
#ifndef __MMS_MSG_INCLUDED__
|
||||
#define __MMS_MSG_INCLUDED__
|
||||
#include "gwlib/gwlib.h"
|
||||
|
@ -9,49 +22,126 @@
|
|||
|
||||
typedef struct MmsMsg MmsMsg; /* Opaque type. */
|
||||
|
||||
extern int mms_validate_address(Octstr *s);
|
||||
typedef MmsMsg *MmsMsgGetFunc_t(void *p1, void *p2, Octstr *msgref, unsigned long *msize);
|
||||
|
||||
enum AddressType_t {MMS_UNKNOWN_ADDRESS=-1, MMS_EMAIL_ADDRESS, MMS_IPV4_ADDRESS, MMS_IPV6_ADDRESS, MMS_NUMBER_ADDRESS};
|
||||
extern int mms_validate_address_real(Octstr *s, enum AddressType_t *address_type);
|
||||
#define mms_validate_address(s) mms_validate_address_real((s), NULL)
|
||||
|
||||
/*
|
||||
* mms_frombinary: Parse MMS binary representation, return a Message or NULL.
|
||||
* errors are reported in errors string.
|
||||
* Takes from param which is put in if insert-address is requested.
|
||||
* NOTE: function may modify 'msg' argument as it parses.
|
||||
*/
|
||||
extern MmsMsg *mms_frombinary(Octstr *msg, Octstr *from);
|
||||
extern MmsMsg *mms_frombinary_ex(Octstr *msg, Octstr *from, char *unified_prefix, List *strip_prefixes);
|
||||
|
||||
#define mms_frombinary(msg, from) mms_frombinary_ex((msg), (from), NULL, NULL)
|
||||
|
||||
/*
|
||||
* mms_tobinary: Return binary encoded Mms message
|
||||
*/
|
||||
extern Octstr *mms_tobinary(MmsMsg *msg);
|
||||
|
||||
extern mms_encoding mms_message_enc(MmsMsg *msg);
|
||||
|
||||
extern int mms_messagetype(MmsMsg *msg);
|
||||
|
||||
/*
|
||||
* Convert Mms Message to standard Mime entity.
|
||||
* Does not recode any of the body parts.
|
||||
* Does base64 encoding of binary parts if base64 is true
|
||||
*/
|
||||
extern MIMEEntity *mms_tomime(MmsMsg *msg, int base64);
|
||||
/*
|
||||
* De-convert from mime.
|
||||
*/
|
||||
extern MIMEEntity *mms_tomime(MmsMsg *msg);
|
||||
extern MmsMsg *mms_frommime(MIMEEntity *mime);
|
||||
|
||||
extern void mms_msgdump(MmsMsg *m, int headers_only);
|
||||
extern void mms_destroy(MmsMsg *msg);
|
||||
|
||||
/* Make a delivery report message. */
|
||||
extern MmsMsg *mms_deliveryreport(Octstr *msgid, Octstr *to, time_t date, Octstr *status);
|
||||
extern MmsMsg *mms_deliveryreport(Octstr *msgid, Octstr *from,
|
||||
Octstr *to, time_t date, Octstr *status);
|
||||
|
||||
MmsMsg *mms_readreport(Octstr *msgid, Octstr *from, Octstr *to, time_t date, Octstr *status);
|
||||
|
||||
/* Return message headers. */
|
||||
extern List *mms_message_headers(MmsMsg *msg);
|
||||
|
||||
/* Make a notification message out of this one and the url given. */
|
||||
extern MmsMsg *mms_notification(MmsMsg *msg, unsigned int msize,
|
||||
extern MmsMsg *mms_notification(Octstr *from, Octstr *subject,
|
||||
Octstr *mclass, unsigned int msize,
|
||||
Octstr *url,
|
||||
Octstr *transactionid, time_t expiryt);
|
||||
Octstr *transactionid, time_t expiryt, int optimizesize);
|
||||
|
||||
MmsMsg *mms_retrieveconf(MmsMsg *msg, Octstr *transactionid, char *err, char *errtxt, Octstr *opt_from);
|
||||
MmsMsg *mms_notifyresp_ind(char *transid, int menc, char *status, int report_allowed);
|
||||
MmsMsg *mms_retrieveconf(MmsMsg *msg, Octstr *transactionid, char *err, char *errtxt, Octstr *opt_from, int menc);
|
||||
int mms_remove_headers(MmsMsg *m, char *name);
|
||||
MmsMsg *mms_sendconf(char *errstr, char *msgid, char *transid, int isforward);
|
||||
MmsMsg *mms_sendconf(char *errstr, char *msgid, char *transid, int isforward, int menc);
|
||||
|
||||
|
||||
Octstr *mms_get_header_value(MmsMsg *msg, Octstr *header);
|
||||
|
||||
/* Returns a list of values for the header given. */
|
||||
List *mms_get_header_values(MmsMsg *msg, Octstr *header);
|
||||
|
||||
int mms_replace_header_value(MmsMsg *msg, char *hname, char *value);
|
||||
int mms_replace_header_values(MmsMsg *msg, char *hname, List *values);
|
||||
|
||||
/* Get headers from 'headers' that are not already in message headers and add them. */
|
||||
int mms_add_missing_headers(MmsMsg *msg, List *headers);
|
||||
|
||||
int mms_convert_readrec2readorig(MmsMsg *msg);
|
||||
|
||||
|
||||
MmsMsg *mms_storeconf(char *errstr, char *transid, Octstr *msgloc, int isupload, int menc);
|
||||
MmsMsg *mms_deleteconf(int menc, char *transid);
|
||||
|
||||
/* Makes a view-conf message. Insane number of arguments I know,
|
||||
* but it seems a fair price to keep the interfaces clean
|
||||
*
|
||||
*/
|
||||
MmsMsg *mms_viewconf(char *transid,
|
||||
List *msgrefs,
|
||||
List *msglocs,
|
||||
char *err,
|
||||
List *required_headers,
|
||||
MmsMsgGetFunc_t *getmsg,
|
||||
void *p1, void *p2,
|
||||
int maxsize, int menc,
|
||||
List *otherhdrs);
|
||||
|
||||
/* Returns a copy of the message body. Either as list of MIME Entities or as string --
|
||||
* caller must consult content_type to determine which is returned.
|
||||
*/
|
||||
void *mms_msgbody(MmsMsg *msg);
|
||||
|
||||
/* Remove message body. */
|
||||
int mms_clearbody(MmsMsg *msg);
|
||||
|
||||
/* Put a new message body. Old one removed if it is there.
|
||||
* second param is a list of MIME entities or a string depending on content type
|
||||
* ismultipart tells us which. No copy is made of body.
|
||||
* Use function with extreme caution! It should be for testing only really!!!!
|
||||
*/
|
||||
int mms_putbody(MmsMsg *msg, void *body, int ismultipart);
|
||||
|
||||
/* Convert a retrieve_conf message to a send_req messagre
|
||||
* checked runtime error to pass anything but a send_req/retrieve_conf.
|
||||
* returns 0 on success.
|
||||
*/
|
||||
int mms_make_sendreq(MmsMsg *retrieveconf);
|
||||
|
||||
/* Compute message size -- not altogether efficiently */
|
||||
int mms_msgsize(MmsMsg *m);
|
||||
|
||||
/* MM4 stuff */
|
||||
enum MM4_types_t {MM4_FORWARD_REQ = 0, MM4_FORWARD_RES, MM4_READ_REPLY_REPORT_REQ,
|
||||
MM4_READ_REPLY_REPORT_RES, MM4_DELIVERY_REPORT_REQ, MM4_DELIVERY_REPORT_RES};
|
||||
extern struct MM4_types_map_t {
|
||||
char *mm4str;
|
||||
int mm1_type;
|
||||
} mm4_types[];
|
||||
|
||||
#endif
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,9 +1,25 @@
|
|||
#ifndef _MMSQUEUE_INCLUDED__
|
||||
#define _MMSQUEUE_INCLUDED__
|
||||
/*
|
||||
* Mbuni - Open Source MMS Gateway
|
||||
*
|
||||
* Queue management functions
|
||||
*
|
||||
* Copyright (C) 2003 - 2008, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
*
|
||||
* Paul Bagyenda <bagyenda@dsmagic.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License, with a few exceptions granted (see LICENSE)
|
||||
*/
|
||||
|
||||
#ifndef _MMS_QUEUE_INCLUDED__
|
||||
#define _MMS_QUEUE_INCLUDED__
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
#include "mms_msg.h"
|
||||
#include "mms_util.h"
|
||||
|
||||
#define QFNAMEMAX 32
|
||||
#define QFNAMEMAX 128
|
||||
|
||||
typedef struct MmsEnvelopeTo {
|
||||
Octstr *rcpt; /* Recipient address. */
|
||||
|
@ -11,6 +27,7 @@ typedef struct MmsEnvelopeTo {
|
|||
* Flags below for details.
|
||||
*/
|
||||
enum {SFailed=0, SSuccess, SDefered, SUnknown} flag;
|
||||
void *_x; /* Used by client modules */
|
||||
} MmsEnvelopeTo;
|
||||
|
||||
typedef struct MmsEnvelope {
|
||||
|
@ -18,8 +35,16 @@ typedef struct MmsEnvelope {
|
|||
Octstr *msgId; /* message id (for reference). */
|
||||
Octstr *token; /* User level token, may be null. */
|
||||
Octstr *from; /* from address. */
|
||||
Octstr *mclass; /* Message class. */
|
||||
|
||||
List *to; /* List of recipients: MmsEnvelopeTo */
|
||||
Octstr *vaspid; /* VASPID (if any) */
|
||||
Octstr *vasid; /* VASID (if any) */
|
||||
|
||||
Octstr *url1; /* Generic URLs (2) associated with message. */
|
||||
Octstr *url2;
|
||||
List *hdrs; /* Generic list of headers associated with message. */
|
||||
|
||||
List *to; /* List of recipients: MmsEnvelopeTo (if process=0 then already sent to)*/
|
||||
|
||||
Octstr *subject; /* Message subject (if any). */
|
||||
|
||||
|
@ -43,37 +68,61 @@ typedef struct MmsEnvelope {
|
|||
Octstr *mdata; /* Generic string data used by any interface. */
|
||||
Octstr *fromproxy; /* Which proxy sent us this message.*/
|
||||
Octstr *viaproxy; /* Which proxy must we send this message through. */
|
||||
struct { /* Name of the queue file, pointer to it (locked). DO NOT MUCK WITH THESE! */
|
||||
char name[QFNAMEMAX]; /* Name of the file. */
|
||||
char dir[QFNAMEMAX]; /* Directory in which file is .*/
|
||||
char _pad[16];
|
||||
int fd;
|
||||
} qf;
|
||||
|
||||
char src_interface[16]; /* source interface of this message. */
|
||||
char _extra_space; /* A bit of sugar, just in case... */
|
||||
|
||||
void *_x; /* Generic storage field used by module clients. */
|
||||
void *qfs_data; /* Queue handler module structure -- allocated for you by queue_create
|
||||
* function.
|
||||
*/
|
||||
char xqfname[64+QFNAMEMAX]; /* The full ID for the queue. Use this. */
|
||||
} MmsEnvelope;
|
||||
|
||||
typedef struct MmsQueueHandlerFuncs {
|
||||
/* Initialise queue module. Must be called at least once on each queue dir.
|
||||
* max_concurrent is a best guess as to number of concurrent queue requests
|
||||
*/
|
||||
int (*mms_init_queue_module)(Octstr *init_data, char *top_storage_dir, int max_concurrent);
|
||||
|
||||
/* initialise a queue directory. There can be multiple directories,
|
||||
* upperlevel decides what a directory is.
|
||||
* module returns a directory string.
|
||||
*/
|
||||
Octstr *(*mms_init_queue_dir)(char *qdir, int *error);
|
||||
|
||||
/* cleanup module, e.g. on exit. */
|
||||
int (*mms_cleanup_queue_module)(void);
|
||||
/*
|
||||
* Add a message to the queue, returns 0 on success -1 otherwise (error is logged).
|
||||
* 'to' is a list of Octstr * *.
|
||||
* Returns a queue file name.
|
||||
*/
|
||||
extern Octstr *mms_queue_add(Octstr *from, List *to, Octstr *msgid,
|
||||
Octstr *subject,
|
||||
Octstr *fromproxy, Octstr *viaproxy,
|
||||
time_t senddate, time_t expirydate, MmsMsg *m, Octstr *token,
|
||||
int dlr,
|
||||
char *directory);
|
||||
Octstr *(*mms_queue_add)(Octstr *from, List *to,
|
||||
Octstr *subject,
|
||||
Octstr *fromproxy, Octstr *viaproxy,
|
||||
time_t senddate, time_t expirydate, MmsMsg *m,
|
||||
Octstr *token,
|
||||
Octstr *vaspid, Octstr *vasid,
|
||||
Octstr *url1, Octstr *url2,
|
||||
List *hdrs,
|
||||
int dlr,
|
||||
char *directory, char *src_interface,
|
||||
Octstr *mmscname);
|
||||
|
||||
/*
|
||||
* Update queue status. Returns -1 on error, 0 if queue is updated fine and
|
||||
* envelope is still valid, 1 if envelope is no longer valid (no more recipients.)
|
||||
*/
|
||||
extern int mms_queue_update(MmsEnvelope *e);
|
||||
int (*mms_queue_update)(MmsEnvelope *e);
|
||||
|
||||
/*
|
||||
* Get the message associated with this queue entry.
|
||||
*/
|
||||
extern MmsMsg *mms_queue_getdata(MmsEnvelope *e);
|
||||
MmsMsg *(*mms_queue_getdata)(MmsEnvelope *e);
|
||||
|
||||
/* Replace data for this queue item -- used by mm7 interface. */
|
||||
int (*mms_queue_replacedata)(MmsEnvelope *e, MmsMsg *m);
|
||||
|
||||
/*
|
||||
* Reads queue, returns up to lim queue entries that are ready for processing. send 0 for no limit.
|
||||
|
@ -87,7 +136,7 @@ extern MmsMsg *mms_queue_getdata(MmsEnvelope *e);
|
|||
* - If should block is 1, then does a potentially blocking attempt to lock the file.
|
||||
*/
|
||||
|
||||
MmsEnvelope *mms_queue_readenvelope(char *qf, char *dir, int shouldblock);
|
||||
MmsEnvelope *(*mms_queue_readenvelope)(char *qf, char *dir, int shouldblock);
|
||||
|
||||
/*
|
||||
* Run the queue in the given directory. For each envelope that is due for sending, call
|
||||
|
@ -96,12 +145,43 @@ MmsEnvelope *mms_queue_readenvelope(char *qf, char *dir, int shouldblock);
|
|||
* if deliver() returns 1, it has deleted envelope.
|
||||
* Also if rstop becomes true, queue run must stop.
|
||||
*/
|
||||
void mms_queue_run(char *dir,
|
||||
int (*deliver)(MmsEnvelope *),
|
||||
double sleepsecs,
|
||||
int num_threads,
|
||||
int *rstop);
|
||||
void (*mms_queue_run)(char *dir,
|
||||
int (*deliver)(MmsEnvelope *),
|
||||
double sleepsecs,
|
||||
int num_threads,
|
||||
volatile sig_atomic_t *rstop);
|
||||
|
||||
/* Get rid of memory used by this. Typically does internal cleanup then calls
|
||||
* the general structure free-ing function below.
|
||||
*/
|
||||
int (*mms_queue_free_env)(MmsEnvelope *e);
|
||||
} MmsQueueHandlerFuncs;
|
||||
|
||||
/* Module must export this symbol:
|
||||
* extern MmsQueueHandlerFuncs qfuncs;
|
||||
*/
|
||||
|
||||
extern MmsQueueHandlerFuncs default_qfuncs; /* default queue handler module, file-based */
|
||||
/* Utility functions, generally defined. */
|
||||
/* Creates the queue envelope object, returns it. Returns the binary MMS in 'binary_mms' if NOT NULL */
|
||||
MmsEnvelope *mms_queue_create_envelope(Octstr *from, List *to,
|
||||
Octstr *subject,
|
||||
Octstr *fromproxy, Octstr *viaproxy,
|
||||
time_t senddate, time_t expirydate,
|
||||
Octstr *token,
|
||||
Octstr *vaspid, Octstr *vasid,
|
||||
Octstr *url1, Octstr *url2,
|
||||
List *hdrs,
|
||||
int dlr,
|
||||
Octstr *mmscname,
|
||||
MmsMsg *m,
|
||||
char *xqfname,
|
||||
char *src_interface,
|
||||
int extra_space,
|
||||
Octstr **binary_mms);
|
||||
/* Get rid of memory used by this. */
|
||||
extern int mms_queue_free_env(MmsEnvelope *e);
|
||||
void mms_queue_free_envelope(MmsEnvelope *e);
|
||||
|
||||
/* utility function for 'cleaning up' addresses. */
|
||||
Octstr *copy_and_clean_address(Octstr *addr);
|
||||
#endif
|
||||
|
|
|
@ -1,45 +0,0 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "mms_resolve.h"
|
||||
#include "mms_util.h"
|
||||
|
||||
static void *mms_resolvermodule_init(char *settings)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int mms_resolvermodule_fini(void *module_data)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static Octstr *mms_resolve(Octstr * phonenum, void *module_data, void *settings_p, void *proxyrelays_p)
|
||||
{
|
||||
/* Most custom implementations of this library will probably just ignore the two last arguments,
|
||||
* but this one needs them
|
||||
*/
|
||||
|
||||
MmsBoxSettings *settings = (MmsBoxSettings *) settings_p;
|
||||
List *proxyrelays = (List *) proxyrelays_p;
|
||||
int j, m;
|
||||
|
||||
if (does_prefix_match(settings->local_prefix, phonenum)) {
|
||||
return settings->hostname;
|
||||
} else if (proxyrelays && list_len(proxyrelays) > 0) /* Step through proxies. */
|
||||
for (j = 0, m = list_len(proxyrelays); j < m; j++) {
|
||||
MmsProxyRelay *mp = list_get(proxyrelays, j);
|
||||
if (does_prefix_match(mp->allowed_prefix, phonenum) &&
|
||||
!does_prefix_match(mp->denied_prefix, phonenum)) {
|
||||
return mp->host;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* The function itself. */
|
||||
MmsResolverFuncStruct mms_resolvefuncs = {
|
||||
mms_resolvermodule_init,
|
||||
mms_resolve,
|
||||
mms_resolvermodule_fini
|
||||
};
|
|
@ -1,13 +1,17 @@
|
|||
#include "gwlib/gwlib.h"
|
||||
#include "mms_strings.h"
|
||||
|
||||
|
||||
/* mms_strings.c: lookup code for various tables defined by MMS standard
|
||||
* Adapted from wsp_strings.c
|
||||
/*
|
||||
* Mbuni - Open Source MMS Gateway
|
||||
*
|
||||
* MMS strings module
|
||||
*
|
||||
* Copyright (C) 2003 - 2008, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
*
|
||||
* Paul Bagyenda <bagyenda@dsmagic.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License, with a few exceptions granted (see LICENSE)
|
||||
*/
|
||||
|
||||
#include "gwlib/gwlib.h"
|
||||
|
||||
#include "mms_strings.h"
|
||||
|
||||
|
||||
|
@ -53,13 +57,13 @@ static long string_to_versioned_number(Octstr *ostr, struct table *table, int ve
|
|||
#define LINEAR(name, strings) \
|
||||
static const struct linear_element name##_strings[] = { strings }; \
|
||||
static struct table name##_table;
|
||||
#define STRING(string) { string, 0 },
|
||||
#define VSTRING(version, string) { string, version },
|
||||
#define STRING(string) { (unsigned char *)string, 0 },
|
||||
#define VSTRING(version, string) { (unsigned char *)string, version },
|
||||
#define NUMBERED(name, strings) \
|
||||
static const struct numbered_element name##_strings[] = { strings }; \
|
||||
static struct table name##_table;
|
||||
#define ASSIGN(string, number) { string, number, 0 },
|
||||
#define VASSIGN(version, string, number) { string, number, version },
|
||||
#define ASSIGN(string, number) { (unsigned char *)string, number, 0 },
|
||||
#define VASSIGN(version, string, number) { (unsigned char *)string, number, version },
|
||||
#include "mms_strings.def"
|
||||
|
||||
/* Define the functions for translating number to Octstr */
|
||||
|
@ -103,7 +107,7 @@ static Octstr *number_to_string(long number, struct table *table)
|
|||
return octstr_duplicate(table->strings[i]);
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return octstr_imm("");
|
||||
}
|
||||
|
||||
static unsigned char *number_to_cstr(long number, struct table *table)
|
||||
|
@ -114,11 +118,11 @@ static unsigned char *number_to_cstr(long number, struct table *table)
|
|||
|
||||
if (table->linear) {
|
||||
if (number >= 0 && number < table->size)
|
||||
return octstr_get_cstr(table->strings[number]);
|
||||
return (unsigned char *)octstr_get_cstr(table->strings[number]);
|
||||
} else {
|
||||
for (i = 0; i < table->size; i++) {
|
||||
if (table->numbers[i] == number)
|
||||
return octstr_get_cstr(table->strings[i]);
|
||||
return (unsigned char *)octstr_get_cstr(table->strings[i]);
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
|
@ -175,7 +179,7 @@ static void construct_linear_table(struct table *table, const struct linear_elem
|
|||
table->linear = 1;
|
||||
|
||||
for (i = 0; i < size; i++) {
|
||||
table->strings[i] = octstr_imm(strings[i].str);
|
||||
table->strings[i] = octstr_imm((char *)strings[i].str);
|
||||
table->versions[i] = strings[i].version;
|
||||
}
|
||||
}
|
||||
|
@ -192,7 +196,7 @@ static void construct_numbered_table(struct table *table, const struct numbered_
|
|||
table->linear = 0;
|
||||
|
||||
for (i = 0; i < size; i++) {
|
||||
table->strings[i] = octstr_imm(strings[i].str);
|
||||
table->strings[i] = octstr_imm((char *)strings[i].str);
|
||||
table->numbers[i] = strings[i].number;
|
||||
table->versions[i] = strings[i].version;
|
||||
}
|
||||
|
@ -227,6 +231,7 @@ void mms_strings_init(void)
|
|||
|
||||
void mms_strings_shutdown(void)
|
||||
{
|
||||
wsp_strings_shutdown();
|
||||
/* If we were initialized more than once, then wait for more than
|
||||
* one shutdown. */
|
||||
if (initialized > 1) {
|
||||
|
|
|
@ -1,4 +1,16 @@
|
|||
/**** Preprocessor magic ****/
|
||||
/*
|
||||
* Mbuni - Open Source MMS Gateway
|
||||
*
|
||||
* MMS field & value definitions - pre-processor magic.
|
||||
*
|
||||
* Copyright (C) 2003 - 2005, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
*
|
||||
* Paul Bagyenda <bagyenda@dsmagic.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License, with a few exceptions granted (see LICENSE)
|
||||
*/
|
||||
|
||||
|
||||
/* String table with entries starting at 0 and numbered upwards. */
|
||||
#if !defined(LINEAR)
|
||||
|
@ -78,11 +90,36 @@ VNSTRING(MS_1_1, "X-Mms-Reply-Charging-ID",MMS_HEADER_REPLY_CHARGING_ID)
|
|||
VNSTRING(MS_1_1, "X-Mms-Reply-Charging-Size",MMS_HEADER_REPLY_CHARGING_SIZE)
|
||||
VNSTRING(MS_1_1, "X-Mms-Previously-Sent-By",MMS_HEADER_PREVIOUSLY_SENT_BY)
|
||||
VNSTRING(MS_1_1, "X-Mms-Previously-Sent-Date",MMS_HEADER_PREVIOUSLY_SENT_DATE)
|
||||
|
||||
VNSTRING(MS_1_2,"X-Mms-Store", MMS_HEADER_STORE)
|
||||
VNSTRING(MS_1_2,"X-Mms-MM-State", MMS_HEADER_MM_STATE)
|
||||
VNSTRING(MS_1_2,"X-Mms-MM-Flags", MMS_HEADER_MM_FLAGS)
|
||||
VNSTRING(MS_1_2,"X-Mms-Store-Status", MMS_HEADER_STORE_STATUS)
|
||||
VNSTRING(MS_1_2,"X-Mms-Store-Status-Text", MMS_HEADER_STORE_STATUS_TEXT)
|
||||
VNSTRING(MS_1_2,"X-Mms-Stored", MMS_HEADER_STORED)
|
||||
VNSTRING(MS_1_2,"X-Mms-Attributes", MMS_HEADER_ATTRIBUTES)
|
||||
VNSTRING(MS_1_2,"X-Mms-Totals", MMS_HEADER_TOTALS)
|
||||
VNSTRING(MS_1_2,"X-Mms-Mbox-Totals", MMS_HEADER_MBOX_TOTALS)
|
||||
VNSTRING(MS_1_2,"X-Mms-Quotas", MMS_HEADER_QUOTAS)
|
||||
VNSTRING(MS_1_2,"X-Mms-Mbox-Quotas", MMS_HEADER_MBOX_QUOTAS)
|
||||
VNSTRING(MS_1_2,"X-Mms-Message-Count", MMS_HEADER_MESSAGE_COUNT)
|
||||
VNSTRING(MS_1_2,"Content", CONTENT)
|
||||
VNSTRING(MS_1_2,"X-Mms-Start", MMS_HEADER_START)
|
||||
VNSTRING(MS_1_2,"Additional-headers", ADDITIONAL_HEADERS)
|
||||
VNSTRING(MS_1_2,"X-Mms-Distribution-Indicator", MMS_HEADER_DISTRIBUTION_INDICATOR)
|
||||
VNSTRING(MS_1_2,"X-Mms-Element-Descriptor", MMS_HEADER_ELEMENT_DESCRIPTOR)
|
||||
VNSTRING(MS_1_2,"X-Mms-Limit", MMS_HEADER_LIMIT)
|
||||
)
|
||||
|
||||
LINEAR(reports,
|
||||
STRING("yes")
|
||||
STRING("no")
|
||||
STRING("Yes")
|
||||
STRING("No")
|
||||
)
|
||||
|
||||
/* the ones below are wired to agree with flags above. */
|
||||
LINEAR(boolean_flag,
|
||||
STRING("true")
|
||||
STRING("false")
|
||||
)
|
||||
|
||||
NAMED(message_type,
|
||||
|
@ -97,6 +134,16 @@ VNSTRING(MS_1_1,"m-read-rec-ind", MMS_MSGTYPE_READ_REC_IND)
|
|||
VNSTRING(MS_1_1,"m-read-orig-ind", MMS_MSGTYPE_READ_ORIG_IND)
|
||||
VNSTRING(MS_1_1,"m-forward-req", MMS_MSGTYPE_FORWARD_REQ)
|
||||
VNSTRING(MS_1_1,"m-forward-conf", MMS_MSGTYPE_FORWARD_CONF)
|
||||
|
||||
VNSTRING(MS_1_2,"m-mbox-store-req",MMS_MSGTYPE_MBOX_STORE_REQ)
|
||||
VNSTRING(MS_1_2,"m-mbox-store-conf",MMS_MSGTYPE_MBOX_STORE_CONF)
|
||||
VNSTRING(MS_1_2,"m-mbox-view-req",MMS_MSGTYPE_MBOX_VIEW_REQ)
|
||||
VNSTRING(MS_1_2,"m-mbox-view-conf",MMS_MSGTYPE_MBOX_VIEW_CONF)
|
||||
VNSTRING(MS_1_2,"m-mbox-upload-req",MMS_MSGTYPE_MBOX_UPLOAD_REQ)
|
||||
VNSTRING(MS_1_2,"m-mbox-upload-conf",MMS_MSGTYPE_MBOX_UPLOAD_CONF)
|
||||
VNSTRING(MS_1_2,"m-mbox-delete-req",MMS_MSGTYPE_MBOX_DELETE_REQ)
|
||||
VNSTRING(MS_1_2,"m-mbox-delete-conf",MMS_MSGTYPE_MBOX_DELETE_CONF)
|
||||
VNSTRING(MS_1_2,"m-mbox-descr",MMS_MSGTYPE_MBOX_DESCR)
|
||||
)
|
||||
|
||||
LINEAR(message_class,
|
||||
|
@ -179,7 +226,118 @@ STRING("Forwarded")
|
|||
)
|
||||
|
||||
|
||||
LINEAR(mm_state,
|
||||
STRING("Draft")
|
||||
STRING("Sent")
|
||||
STRING("New")
|
||||
STRING("Retrieved")
|
||||
STRING("Forwarded")
|
||||
)
|
||||
|
||||
NUMBERED(store_status,
|
||||
ASSIGN("Success",128)
|
||||
ASSIGN("Error-transient-failure",192)
|
||||
ASSIGN("Error-transient-network-problem",193)
|
||||
ASSIGN("Error-permanent-failure",224)
|
||||
ASSIGN("Error-permanent-service-denied",225)
|
||||
ASSIGN("Error-permanent-message-format-corrupt",226)
|
||||
ASSIGN("Error-permanent-message-not-found",227)
|
||||
ASSIGN("Error-permanent-mmbox-full",228)
|
||||
)
|
||||
|
||||
NUMBERED(descriptor_params,
|
||||
ASSIGN("type", 130)
|
||||
)
|
||||
/* MM7/SOAP stuff -- *** order of these matters wrt Req/Rsp *** */
|
||||
NAMED(mm7tag,
|
||||
VNSTRING(MM7_5, "Bcc",MM7_TAG_Bcc)
|
||||
VNSTRING(MM7_5, "CancelReq",MM7_TAG_CancelReq)
|
||||
VNSTRING(MM7_5, "CancelRsp",MM7_TAG_CancelRsp)
|
||||
VNSTRING(MM7_5, "Cc",MM7_TAG_Cc)
|
||||
VNSTRING(MM7_5, "ChargedParty",MM7_TAG_ChargedParty)
|
||||
VNSTRING(MM7_5, "Content",MM7_TAG_Content)
|
||||
VNSTRING(MM7_5, "Date",MM7_TAG_Date)
|
||||
VNSTRING(MM7_5, "DeliverReq",MM7_TAG_DeliverReq)
|
||||
VNSTRING(MM7_5, "DeliverRsp",MM7_TAG_DeliverRsp)
|
||||
VNSTRING(MM7_5, "DeliveryReportReq",MM7_TAG_DeliveryReportReq)
|
||||
VNSTRING(MM7_5, "DeliveryReportRsp",MM7_TAG_DeliveryReportRsp)
|
||||
VNSTRING(MM7_5, "DistributionIndicator",MM7_TAG_DistributionIndicator)
|
||||
VNSTRING(MM7_5, "EarliestDeliveryTime",MM7_TAG_EarliestDeliveryTime)
|
||||
VNSTRING(MM7_5, "ExpiryDate",MM7_TAG_ExpiryDate)
|
||||
VNSTRING(MM7_5, "LinkedID",MM7_TAG_LinkedID)
|
||||
VNSTRING(MM7_5, "MM7Version",MM7_TAG_MM7Version)
|
||||
VNSTRING(MM7_5, "MMSRelayServerID",MM7_TAG_MMSRelayServerID)
|
||||
VNSTRING(MM7_5, "MMStatus",MM7_TAG_MMStatus)
|
||||
VNSTRING(MM7_5, "MessageClass",MM7_TAG_MessageClass)
|
||||
VNSTRING(MM7_5, "MessageID",MM7_TAG_MessageID)
|
||||
VNSTRING(MM7_5, "Number",MM7_TAG_Number)
|
||||
VNSTRING(MM7_5, "Priority",MM7_TAG_Priority)
|
||||
VNSTRING(MM7_5, "RFC2822Address",MM7_TAG_RFC2822Address)
|
||||
VNSTRING(MM7_5, "RSErrorRsp",MM7_TAG_RSErrorRsp)
|
||||
VNSTRING(MM7_5, "ReadReplyReq",MM7_TAG_ReadReplyReq)
|
||||
VNSTRING(MM7_5, "ReadReplyRsp",MM7_TAG_ReadReplyRsp)
|
||||
VNSTRING(MM7_5, "Recipient",MM7_TAG_Recipient)
|
||||
VNSTRING(MM7_5, "Recipients",MM7_TAG_Recipients)
|
||||
VNSTRING(MM7_5, "ReplaceReq",MM7_TAG_ReplaceReq)
|
||||
VNSTRING(MM7_5, "ReplaceRsp",MM7_TAG_ReplaceRsp)
|
||||
VNSTRING(MM7_5, "ReplyCharging",MM7_TAG_ReplyCharging)
|
||||
VNSTRING(MM7_5, "ReplyChargingID",MM7_TAG_ReplyChargingID)
|
||||
VNSTRING(MM7_5, "Sender",MM7_TAG_Sender)
|
||||
VNSTRING(MM7_5, "SenderAddress",MM7_TAG_SenderAddress)
|
||||
VNSTRING(MM7_5, "SenderIdentification",MM7_TAG_SenderIdentification)
|
||||
VNSTRING(MM7_5, "ServiceCode",MM7_TAG_ServiceCode)
|
||||
VNSTRING(MM7_5, "ShortCode",MM7_TAG_ShortCode)
|
||||
VNSTRING(MM7_5, "Status",MM7_TAG_Status)
|
||||
VNSTRING(MM7_5, "StatusCode",MM7_TAG_StatusCode)
|
||||
VNSTRING(MM7_5, "StatusText",MM7_TAG_StatusText)
|
||||
VNSTRING(MM7_5, "Subject",MM7_TAG_Subject)
|
||||
VNSTRING(MM7_5, "SubmitReq",MM7_TAG_SubmitReq)
|
||||
VNSTRING(MM7_5, "SubmitRsp",MM7_TAG_SubmitRsp)
|
||||
|
||||
VNSTRING(MM7_5, "TimeStamp",MM7_TAG_TimeStamp)
|
||||
VNSTRING(MM7_5, "To",MM7_TAG_To)
|
||||
VNSTRING(MM7_5, "TransactionID",MM7_TAG_TransactionID)
|
||||
VNSTRING(MM7_5, "VASID",MM7_TAG_VASID)
|
||||
VNSTRING(MM7_5, "VASPErrorRsp",MM7_TAG_VASPErrorRsp)
|
||||
VNSTRING(MM7_5, "VASPID",MM7_TAG_VASPID)
|
||||
VNSTRING(MM7_5, "Fault",MM7_TAG_Fault)
|
||||
VNSTRING(MM7_5, "Details",MM7_TAG_Details)
|
||||
VNSTRING(MM7_5, "faultcode",MM7_TAG_faultcode)
|
||||
VNSTRING(MM7_5, "faultstring",MM7_TAG_faultstring)
|
||||
VNSTRING(MM7_5, "MessageType",MM7_TAG_MessageType)
|
||||
VNSTRING(MM7_5, "replyChargingSize", MM7_TAG_replyChargingSize)
|
||||
VNSTRING(MM7_5, "replyDeadline", MM7_TAG_replyDeadline)
|
||||
VNSTRING(MM7_5, "DeliveryReport", MM7_TAG_DeliveryReport)
|
||||
VNSTRING(MM7_5, "allowAdaptations", MM7_TAG_allowAdaptations)
|
||||
VNSTRING(MM7_5, "DistributionIndicator",MM7_TAG_distributionIndicator)
|
||||
VNSTRING(MM7_5, "UACapabilities",MM7_TAG_UACapabilities)
|
||||
)
|
||||
|
||||
NUMBERED(soap_status,
|
||||
ASSIGN("Success", 1000)
|
||||
ASSIGN("Partial success", 1100)
|
||||
ASSIGN("Client error", 2000)
|
||||
ASSIGN("Operation restricted", 2001)
|
||||
ASSIGN("Address Error", 2002)
|
||||
ASSIGN("Address Not Found", 2003)
|
||||
ASSIGN("Multimedia content refused", 2004)
|
||||
ASSIGN("Message ID Not found", 2005)
|
||||
ASSIGN("LinkedID not found", 2006)
|
||||
ASSIGN("Message format corrupt", 2007)
|
||||
ASSIGN("Server Error", 3000)
|
||||
ASSIGN("Not Possible", 3001)
|
||||
ASSIGN("Message rejected", 3002)
|
||||
ASSIGN("Multiple addresses not supported", 3003)
|
||||
ASSIGN("Command Rejected", 3005)
|
||||
ASSIGN("General service error", 4000)
|
||||
ASSIGN("Improper identification", 4001)
|
||||
ASSIGN("Unsupported version", 4002)
|
||||
ASSIGN("Unsupported operation", 4003)
|
||||
ASSIGN("Validation error", 4004)
|
||||
ASSIGN("Service error", 4005)
|
||||
ASSIGN("Service unavailable", 4006)
|
||||
ASSIGN("Service denied", 4007)
|
||||
)
|
||||
#undef LINEAR
|
||||
#undef STRING
|
||||
#undef VSTRING
|
||||
|
|
|
@ -1,10 +1,24 @@
|
|||
/*
|
||||
* Mbuni - Open Source MMS Gateway
|
||||
*
|
||||
* MMS strings module
|
||||
*
|
||||
* Copyright (C) 2003 - 2008, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
*
|
||||
* Paul Bagyenda <bagyenda@dsmagic.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License, with a few exceptions granted (see LICENSE)
|
||||
*/
|
||||
#ifndef __MMS_STRINGS_DEFINED__
|
||||
#define __MMS_STRINGS_DEFINED__
|
||||
|
||||
typedef enum {
|
||||
MS_1_1 = 1
|
||||
MS_1_1 = 1,
|
||||
MS_1_2 = 2,
|
||||
MM7_5 = 5
|
||||
} mms_encoding;
|
||||
#define MMS_VERSION "1.0"
|
||||
#define MMS_DEFAULT_VERSION "1.0"
|
||||
/* Declare the functions */
|
||||
#define LINEAR(name, strings) \
|
||||
Octstr *mms_##name##_to_string(long number); \
|
||||
|
@ -16,7 +30,6 @@ long mms_string_to_versioned_##name(Octstr *ostr, int version);
|
|||
|
||||
|
||||
#define LINEAR(name,strings)
|
||||
#define LINEAR(name, strings)
|
||||
#define STRING(string)
|
||||
#define NAMED(name, strings) enum mms_##name##_enum { strings mms_##name##_dummy };
|
||||
#define NSTRING(string, name) name,
|
||||
|
@ -26,4 +39,5 @@ long mms_string_to_versioned_##name(Octstr *ostr, int version);
|
|||
#include "wap/wsp_strings.h"
|
||||
|
||||
void mms_strings_init(void);
|
||||
void mms_strings_shutdown(void);
|
||||
#endif
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,3 +1,15 @@
|
|||
/*
|
||||
* Mbuni - Open Source MMS Gateway
|
||||
*
|
||||
* User-Agent profiles handling, content adaptation.
|
||||
*
|
||||
* Copyright (C) 2003 - 2008, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
*
|
||||
* Paul Bagyenda <bagyenda@dsmagic.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License, with a few exceptions granted (see LICENSE)
|
||||
*/
|
||||
#ifndef __MMS_UAPROFILE_INCLUDED__
|
||||
#define __MMS_UAPROFILE_INCLUDED__
|
||||
#include "gwlib/gwlib.h"
|
||||
|
@ -30,12 +42,13 @@ extern int mms_transform_msg(MmsMsg *inmsg, MmsUaProfile *prof, MmsMsg **outmsg)
|
|||
|
||||
/* Transforms the mms into a more 'readable' format:
|
||||
* SMIL is turned into html (with an alternative of text) if trans_smil is set,
|
||||
* image and audio changed to email preferred formats.
|
||||
* image and audio changed to email preferred formats. Does not base64 mime parts of result!
|
||||
*/
|
||||
extern int mms_format_special(MmsMsg *inmsg,
|
||||
int trans_smil,
|
||||
char *txtmsg,
|
||||
char *htmlmsg, MIMEEntity **outmsg);
|
||||
|
||||
extern unsigned long mms_ua_maxmsgsize(MmsUaProfile *prof);
|
||||
#define DEFAULT_CHARSET "UTF-8"
|
||||
#endif
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,159 +1,327 @@
|
|||
#ifndef __MMS_GLOBAL__INCLUDED__
|
||||
#define __MMS_GLOBAL__INCLUDED__
|
||||
/*
|
||||
* Mbuni - Open Source MMS Gateway
|
||||
*
|
||||
* Misc. functions
|
||||
*
|
||||
* Copyright (C) 2003 - 2008, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
*
|
||||
* Paul Bagyenda <bagyenda@dsmagic.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License, with a few exceptions granted (see LICENSE)
|
||||
*/
|
||||
#ifndef __MMS_UTIL__INCLUDED__
|
||||
#define __MMS_UTIL__INCLUDED__
|
||||
|
||||
#include "gwlib/gwlib.h"
|
||||
#include "gwlib/mime.h"
|
||||
#include "gwlib/regex.h"
|
||||
|
||||
#include "config.h"
|
||||
#include "mbuni-config.h"
|
||||
#include "mms_strings.h"
|
||||
#include "mms_msg.h"
|
||||
#include "mms_billing.h"
|
||||
#include "mms_resolve.h"
|
||||
#include "mms_mm7soap.h"
|
||||
#include "mms_cfg.h"
|
||||
#include "mms_mmbox.h"
|
||||
#include "mms_eventlogger.h"
|
||||
|
||||
/* supported 3GPP MMS version */
|
||||
#define MAKE_VERSION(a,b,c) ((a)<<16 | (b)<<8 | (c))
|
||||
|
||||
#define MAJOR_VERSION(v) (((v)>>16)&0xF)
|
||||
#define MINOR1_VERSION(v) (((v)>>8)&0xF)
|
||||
#define MINOR2_VERSION(v) ((v)&0xF)
|
||||
|
||||
#define MMS_3GPP_VERSION MAKE_VERSION(5,5,0)
|
||||
|
||||
/* Send errors */
|
||||
#define MMS_SEND_OK 0
|
||||
#define MMS_SEND_QUEUED 1
|
||||
#define MMS_SEND_ERROR_TRANSIENT -1
|
||||
#define MMS_SEND_ERROR_FATAL -2
|
||||
|
||||
#define SEND_ERROR_STR(e) ((e) == MMS_SEND_OK ? "Sent" : (e) == MMS_SEND_ERROR_TRANSIENT ? "Retry later" : "Failed")
|
||||
/* Aging of old (internal) records... */
|
||||
#define DEFAULT_DELETE_AGE 10*60
|
||||
|
||||
#define SEND_ERROR_STR(e) ((e) == MMS_SEND_OK ? "Sent" : \
|
||||
(e) == MMS_SEND_ERROR_TRANSIENT ? "Retry later" : \
|
||||
((e) == MMS_SEND_QUEUED ? "Queued" : "Failed"))
|
||||
/* Useful headers. */
|
||||
#define XMSISDN_HEADER "X-WAP-Network-Client-MSISDN"
|
||||
#define XIP_HEADER "X-WAP-Network-Client-Address"
|
||||
#define MM_NAME "DS_MM"
|
||||
#define XIP_HEADER "X-WAP-Network-Client-IP"
|
||||
#define MM_NAME "Mbuni"
|
||||
|
||||
typedef struct MmsProxyRelay {
|
||||
Octstr *host;
|
||||
Octstr *name;
|
||||
Octstr *allowed_prefix;
|
||||
Octstr *denied_prefix;
|
||||
} MmsProxyRelay;
|
||||
#define EAIF_VERSION "%d.%d"
|
||||
|
||||
typedef struct MmsBoxSettings {
|
||||
Octstr *system_user;
|
||||
Octstr *name, *hostname, *host_alias;
|
||||
List *local_domains;
|
||||
Octstr *unified_prefix, *local_prefix;
|
||||
Octstr *sendmail;
|
||||
Octstr *global_queuedir, *mm1_queuedir, *mm4_queuedir;
|
||||
/* used by mmbox and queue code -- directory stuff. */
|
||||
#define _TT "0123456789abcdefghijklmnopqrstuvwxyz"
|
||||
#define _TTSIZE (-1 + sizeof _TT)
|
||||
|
||||
Octstr *ua_profile_cache_dir;
|
||||
|
||||
long maxthreads;
|
||||
long maxsendattempts;
|
||||
long default_msgexpiry;
|
||||
double queue_interval;
|
||||
long send_back_off;
|
||||
|
||||
long port;
|
||||
|
||||
Octstr *allow_ip;
|
||||
Octstr *deny_ip;
|
||||
|
||||
Octstr *email2mmsrelay_prefixes;
|
||||
Octstr *sendsms_url;
|
||||
#if 0
|
||||
Octstr *sendsms_user, *sendsms_pass, *sendsms_globalsender;
|
||||
#endif
|
||||
Octstr *billing_params;
|
||||
|
||||
MmsBillingFuncStruct *mms_billfuncs; /* Link to billing funcs. */
|
||||
void *mms_bill_module_data;
|
||||
|
||||
Octstr *resolver_params;
|
||||
MmsResolverFuncStruct *mms_resolvefuncs; /* Link to resolver funcs. */
|
||||
void *mms_resolver_module_data;
|
||||
|
||||
Octstr *prov_notify;
|
||||
Octstr *prov_notify_arg;
|
||||
Octstr *prov_getstatus;
|
||||
int notify_unprovisioned;
|
||||
Octstr *mms_notify_txt;
|
||||
Octstr *mms_notify_unprov_txt;
|
||||
Octstr *mms_toolarge;
|
||||
Octstr *mmbox_host;
|
||||
|
||||
Octstr *mms_email_txt;
|
||||
Octstr *mms_email_html;
|
||||
Octstr *wap_gw_msisdn_header;
|
||||
Octstr *wap_gw_ip_header;
|
||||
} MmsBoxSettings;
|
||||
#define MBUNI_MULTIPART_TYPE "application/vnd.mbuni.url-list"
|
||||
|
||||
/* Global variables and shared code used by all modules. */
|
||||
|
||||
|
||||
extern char *mms_hostname; /* Our hostname. */
|
||||
#define MMSC_VERSION VERSION
|
||||
#define MMSC_VERSION MBUNI_VERSION
|
||||
#define MMS_NAME PACKAGE
|
||||
|
||||
#if 0
|
||||
#define EMAILPROFILE "http://localhost/email.xml" /* For now we hard code it. */
|
||||
#define MMBOXPROFILE "http://localhost/mmbox.xml"
|
||||
#endif
|
||||
#define DRM_CONTENT_TYPE(ctype) ((ctype) && octstr_case_search(ctype, octstr_imm("application/vnd.oma.drm"), 0) == 0)
|
||||
|
||||
/* Returns mmsbox settings. */
|
||||
MmsBoxSettings *mms_load_mmsbox_settings(Cfg *cfg);
|
||||
/* Message location flags: Used to distinguish fetch-urls */
|
||||
enum mms_loc_t {MMS_LOC_MMBOX = 1, MMS_LOC_MQUEUE=2};
|
||||
|
||||
|
||||
/* Returns list of MmsProxyRelay */
|
||||
extern List *mms_proxy_relays(Cfg *cfg);
|
||||
|
||||
extern Octstr *mms_makefetchurl(char *qf, Octstr *token,
|
||||
MmsBoxSettings *settings);
|
||||
extern int mms_load_core_settings(mCfg *cfg, mCfgGrp *cgrp);
|
||||
|
||||
extern Octstr *mms_maketransid(char *qf, Octstr *mmscname);
|
||||
|
||||
extern Octstr *mms_make_msgid(char *qf, Octstr *mmscname);
|
||||
|
||||
extern Octstr *mms_getqf_fromtransid(Octstr *transid);
|
||||
|
||||
extern int mms_decodefetchurl(Octstr *fetch_url,
|
||||
Octstr **qf, Octstr **token);
|
||||
|
||||
Octstr *mms_find_sender_msisdn(Octstr **send_url, List *request_hdrs, Octstr *msisdn_header);
|
||||
Octstr *mms_find_sender_ip(List *request_hdrs, Octstr *ip_header, Octstr *ip, int *isv6);
|
||||
extern Octstr *mms_getqf_from_msgid(Octstr *msgid);
|
||||
|
||||
extern Octstr *mms_isodate(time_t t);
|
||||
void mms_lib_init(void);
|
||||
void mms_lib_shutdown(void);
|
||||
|
||||
/* get content type while stripping params. If any param is null, fails. */
|
||||
int get_content_type(List *hdrs, Octstr **type, Octstr **params);
|
||||
|
||||
/* Takes a header value, returns the value proper and any parameters... */
|
||||
int split_header_value(Octstr *value, Octstr **base_value, Octstr **params);
|
||||
/* Returns a list of parameters as http_headers given the semi-comma delimited string.*/
|
||||
List *get_value_parameters(Octstr *params);
|
||||
|
||||
Octstr *make_value_parameters(List *params);
|
||||
|
||||
/* Get parameter from http header value and strip it */
|
||||
Octstr *get_stripped_param_value(Octstr *value, Octstr *param);
|
||||
|
||||
/* Where value is comma-separated, make separate header items. */
|
||||
void unpack_mimeheaders(MIMEEntity *m);
|
||||
|
||||
/* Where element has base64 encoding, decode. */
|
||||
void unbase64_mimeparts(MIMEEntity *m);
|
||||
|
||||
/* Where element contains binary data, encode it base64. */
|
||||
void base64_mimeparts(MIMEEntity *m);
|
||||
|
||||
void notify_prov_server(char *cmd, char *from, char *event, char *arg);
|
||||
int mms_ind_send(Octstr *prov_cmd, Octstr *to);
|
||||
/* Where element contains binary data, encode it base64. Set all = 1 to ignore whether body is binary
|
||||
* and should be coded.
|
||||
*/
|
||||
void base64_mimeparts(MIMEEntity *m, int all);
|
||||
|
||||
|
||||
/* Send this message to email recipient: Returns 0 on success 1 or 2 on profile error
|
||||
* (negate to get right one), -ve on some other error
|
||||
*/
|
||||
int mms_sendtoemail(Octstr *from, Octstr *to,
|
||||
int mms_sendtoemail(Octstr *from, List *lto,
|
||||
Octstr *subject, Octstr *msgid,
|
||||
MmsMsg *msg, int dlr, Octstr **error,
|
||||
char *sendmail_cmd, Octstr *myhostname,
|
||||
int trans_msg,
|
||||
int trans_smil, char *txt, char *html, int append_hostname);
|
||||
int trans_smil, char *txt, char *html, int mm4,
|
||||
char *transid, List *extra_headers,
|
||||
Octstr *relay_host, int relay_port);
|
||||
|
||||
/* Send directly to email. */
|
||||
int mm_send_to_email(Octstr *to, Octstr *from, Octstr *subject,
|
||||
Octstr *msgid,
|
||||
MIMEEntity *m, int append_hostname, Octstr **error,
|
||||
char *sendmail_cmd, Octstr *myhostname,
|
||||
Octstr *relay_host, int relay_port);
|
||||
|
||||
/* log to access log. */
|
||||
void mms_log(char *logmsg, Octstr *from, List *to,
|
||||
int msize, Octstr *msgid,
|
||||
Octstr *acct,
|
||||
Octstr *viaproxy,
|
||||
char *interface, Octstr *ua);
|
||||
char *interface,
|
||||
Octstr *ua, Octstr *mmboxloc);
|
||||
|
||||
void mms_log2(char *logmsg, Octstr *from, Octstr *to,
|
||||
int msize, Octstr *msgid,
|
||||
Octstr *acct,
|
||||
Octstr *viaproxy,
|
||||
char *interface, Octstr *ua);
|
||||
char *interface,
|
||||
Octstr *ua, Octstr *mmboxloc);
|
||||
|
||||
/*
|
||||
* lockfile: tries to lock a file, returns 0 if success, errno (which could be +ve) otherwise.
|
||||
* we use flock()
|
||||
*/
|
||||
int mm_lockfile(int fd, char *fname, int shouldblock);
|
||||
|
||||
|
||||
/* Returns true if the character is printable or space */
|
||||
int _mms_gw_isprint(int c);
|
||||
|
||||
int lockfile(int fd, int shouldblock);
|
||||
/*
|
||||
* unlock_and_fclose/unlock_and_close are wrappers around fclose/close
|
||||
* needed to maintain the state of the global list on Solaris.
|
||||
*/
|
||||
int unlock_and_fclose(FILE *fp);
|
||||
int unlock_and_close(int fd);
|
||||
|
||||
/* Special form of cfg_get which returns zero-length string when there is nothing. */
|
||||
Octstr *_mms_cfg_getx(mCfg *cfg, mCfgGrp *grp, Octstr *item);
|
||||
|
||||
/* Get envelope data from message headers. */
|
||||
void mms_collect_envdata_from_msgheaders(List *mh, List **xto,
|
||||
Octstr **subject,
|
||||
Octstr **otransid, time_t *expiryt,
|
||||
time_t *deliveryt, long default_msgexpiry,
|
||||
long max_msgexpiry,
|
||||
char *unified_prefix, List *strip_prefixes);
|
||||
|
||||
/* Simple hash function */
|
||||
unsigned long _mshash(char *s);
|
||||
|
||||
/* Tell us whether address is a phone number. */
|
||||
int isphonenum(Octstr *s);
|
||||
int isphonenum_ex(Octstr *s, int offset);
|
||||
|
||||
/* Fixup an address: Normalize number (if prefix given), Add type (if keep_suffix is set), etc. */
|
||||
void _mms_fixup_address(Octstr **address, char *unified_prefix, List *strip_prefixes, int keep_suffix);
|
||||
|
||||
/* normalize a phone number: Strip any prefixes, then normalize. */
|
||||
void mms_normalize_phonenum(Octstr **num, char *unified_prefix, List *strip_prefixes);
|
||||
|
||||
/* Check that host is one of hosts in semi-colon separated list in host_list */
|
||||
int is_allowed_host(Octstr *host, Octstr *host_list);
|
||||
|
||||
/* escape (backlash) special shell characters. */
|
||||
void escape_shell_chars(Octstr *str);
|
||||
|
||||
/* Parse CGI variables out of a HTTP POST request.
|
||||
* This function understands both standard POST and enctype multipart/form-data
|
||||
* For the latter it puts the content type of each of the variables found into
|
||||
* cgivars_ctypes (as HTTPCGIVars where name is the field name and value is the content type)
|
||||
* cgivars argument is the cgivars as passed to us by http_accept_request. For GET
|
||||
* HTTP requests this is returned unchanged, otherwise it is augmented with the
|
||||
* variables found.
|
||||
*/
|
||||
int parse_cgivars(List *request_headers, Octstr *request_body,
|
||||
List **cgivars, List **cgivar_ctypes);
|
||||
|
||||
/* get content-ID header, fix: WAP decoder may leave " at beginning */
|
||||
Octstr *_x_get_content_id(List *headers);
|
||||
|
||||
/* Remove the boundary element from a list of headers. */
|
||||
void strip_boundary_element(List *headers, char *s);
|
||||
|
||||
/* Fetch a URL. If necessary, authenticate, etc. also understands data: url scheme. */
|
||||
int mms_url_fetch_content(int method, Octstr *url, List *request_headers,
|
||||
Octstr *body, List **reply_headers, Octstr **reply_body);
|
||||
|
||||
/* check that the token is valid. */
|
||||
int mms_is_token(Octstr *token);
|
||||
|
||||
/* try to guess content type from file name extension. */
|
||||
Octstr *filename2content_type(char *fname);
|
||||
|
||||
/* try to give a good extension name based on the url or content type. */
|
||||
char *make_file_ext(Octstr *url, Octstr *ctype, char fext[5]);
|
||||
|
||||
/* return true if node has a child... */
|
||||
int has_node_children(xmlNodePtr node);
|
||||
|
||||
/* strip non-essential headers from top-level */
|
||||
void strip_non_essential_headers(MIMEEntity *mime);
|
||||
|
||||
/* Get phone number out of mms formatted one, and unify. */
|
||||
Octstr *extract_phonenum(Octstr *num, Octstr *unified_prefix);
|
||||
|
||||
/* strip quotes off a quoted string. */
|
||||
void strip_quoted_string(Octstr *s);
|
||||
|
||||
/* Remove quotes from string */
|
||||
void strip_quotes(Octstr *s);
|
||||
|
||||
/* Make a mime entity representing a multipart/form-data HTTP request. */
|
||||
MIMEEntity *make_multipart_formdata(void);
|
||||
|
||||
/* Add a form field to the multipart/form-data entity. */
|
||||
void add_multipart_form_field(MIMEEntity *multipart, char *field_name,
|
||||
char *ctype, char *content_loc,
|
||||
Octstr *data);
|
||||
|
||||
/* Build a multipart message from a list of URLs. Fetch each one and add. Result is a multipart/mixed message. */
|
||||
MIMEEntity *multipart_from_urls(List *url_list);
|
||||
|
||||
/* load a shared object, then load a symbol from it. */
|
||||
void *_mms_load_module(mCfg *cfg, mCfgGrp *grp, char *config_key, char *symbolname,
|
||||
void *shell_builtin);
|
||||
|
||||
/* Clean addresses by type: remove prefixes, etc. */
|
||||
void fixup_address_type(List *headers, char *hdr,
|
||||
char *unified_prefix,
|
||||
List *strip_prefixes);
|
||||
|
||||
/* Convert charset mib enum to charset and vice versa */
|
||||
extern const char *mibenum_to_charset(int val);
|
||||
extern int charset_to_mibenum(char *charset);
|
||||
Octstr *pack_rfc2047_text(Octstr *in, int charset_mib_enum);
|
||||
Octstr *parse_rfc2047_text(Octstr *in, int *mibenum);
|
||||
|
||||
/* Utility func */
|
||||
void mygw_free(void *);
|
||||
|
||||
/* Authenticate using HTTP Basic auth */
|
||||
int http_auth_check(char *user, char *pass, List *headers, int *has_auth_hdr);
|
||||
|
||||
/* Add @host to an mms address */
|
||||
void addmmscname(Octstr *address, char *myhostname);
|
||||
|
||||
/* Get (copy of) keyword from mime thingie */
|
||||
Octstr *get_keyword_from_mime(MIMEEntity *me);
|
||||
|
||||
enum _xurltype {FILE_TYPE, URL_TYPE};
|
||||
void get_content_from_sendmms_request(Octstr *body, List *headers, List *cgivars, List *cgivar_ctypes,
|
||||
List **rh, Octstr **ctype, Octstr **data,
|
||||
Octstr **rb,
|
||||
Octstr **base_url, Octstr **data_url);
|
||||
|
||||
MmsMsg *make_msg_from_sendmms_request(Octstr *from, List *to,
|
||||
Octstr *msgId,
|
||||
Octstr *subject,
|
||||
Octstr *data, Octstr *ctype,
|
||||
List *reply_headers,
|
||||
Octstr *msg_url,
|
||||
Octstr *base_url, int type,
|
||||
Octstr *mmc,
|
||||
Octstr *svc_name,
|
||||
time_t expiryt,
|
||||
int do_multipart,
|
||||
int do_rr,
|
||||
int do_dlr,
|
||||
Octstr *allow_adaptations,
|
||||
int (*filter)(MIMEEntity **msg, Octstr *loc_url, Octstr *mmc_id),
|
||||
Octstr **err);
|
||||
#define US_ASCII_MIB_VAL 3
|
||||
#define UTF8_MIB_VAL 106
|
||||
|
||||
#define MAXQTRIES 100
|
||||
#define BACKOFF_FACTOR 5*60 /* In seconds */
|
||||
#define QUEUERUN_INTERVAL 1*60 /* 1 minutes. */
|
||||
#define DEFAULT_EXPIRE 3600*24*7 /* One week */
|
||||
|
||||
#define DEFAULT_SIMUL_RCPTS 10
|
||||
|
||||
#define HTTP_REPLACE_HEADER(hdr, hname, value) do { \
|
||||
http_header_remove_all((hdr), (hname)); \
|
||||
http_header_add((hdr), (hname), (value)); \
|
||||
} while (0)
|
||||
|
||||
List *gwlist_create_ex_real(const char *file, const char *func, int line,...);
|
||||
|
||||
#define gwlist_create_ex(...) gwlist_create_ex_real(__FILE__,__FUNCTION__,__LINE__, __VA_ARGS__, NULL)
|
||||
|
||||
#define LINEARISE_STR_LIST(res,lst,sep) do { \
|
||||
Octstr *__res; \
|
||||
int __i; \
|
||||
for (__res = octstr_create(""), __i = 0; __i < gwlist_len(lst); __i++) \
|
||||
octstr_format_append(__res, "%s%S", \
|
||||
octstr_len(__res) == 0 ? "" : (sep), gwlist_get((lst), __i)); \
|
||||
(res) = __res; \
|
||||
} while (0)
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
.*.sw[po]
|
||||
*~
|
||||
*.diff
|
||||
*.patch
|
||||
*.lo
|
||||
*.o
|
||||
Makefile
|
||||
Makefile.in
|
||||
.deps
|
||||
.libs
|
||||
mmsbox
|
|
@ -0,0 +1,8 @@
|
|||
libmms = $(top_builddir)/mmlib/libmms.la
|
||||
lib_LTLIBRARIES = libmmsbox.la
|
||||
libmmsbox_la_SOURCES = mmsbox_cdr.c mmsbox_cfg.h mmsbox_cfg.c dlr.c bearerbox.c mmsbox_resolve.c mmsbox_resolve_shell.c
|
||||
bin_PROGRAMS = mmsbox
|
||||
mmsbox_SOURCES = mmsbox.c mmsbox.h
|
||||
mmsbox_LDADD = libmmsbox.la $(libmms)
|
||||
|
||||
EXTRA_DIST = mmsbox_cdr.h mmsbox_cfg.h mmsbox.h mmsbox_mt_filter.h mmsbox_resolve_shell.h mmsbox_resolve.h mmsbox_mmsc.h
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,137 @@
|
|||
/*
|
||||
* Mbuni - Open Source MMS Gateway
|
||||
*
|
||||
* MMSBox Dlr: Dlr storage for MMSBox
|
||||
*
|
||||
* Copyright (C) 2003 - 2008, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
*
|
||||
* Paul Bagyenda <bagyenda@dsmagic.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License, with a few exceptions granted (see LICENSE)
|
||||
*/
|
||||
#include <sys/file.h>
|
||||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/wait.h>
|
||||
#include <errno.h>
|
||||
#include <dlfcn.h>
|
||||
|
||||
#ifdef SunOS
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include "mmsbox.h"
|
||||
#include "mms_queue.h"
|
||||
|
||||
#define MAXTRIES 10
|
||||
static int dlr_entry_fname(char *msgid, char *rtype, Octstr *mmc_gid, Octstr **efname)
|
||||
{
|
||||
char d1[2], d2[3], fbuf[512], *p;
|
||||
unsigned long h = _mshash(msgid);
|
||||
Octstr *t, *s;
|
||||
int i, fd;
|
||||
|
||||
/* Make toplevel dir. */
|
||||
d1[0] = _TT[h%_TTSIZE];
|
||||
d1[1] = '\0';
|
||||
|
||||
/* Then lower level. */
|
||||
h /= _TTSIZE;
|
||||
d2[0] = _TT[h%_TTSIZE];
|
||||
h /= _TTSIZE;
|
||||
d2[1] = _TT[h%_TTSIZE];
|
||||
d2[2] = '\0';
|
||||
|
||||
/* Try and create the next level dir (first level was created by root_init) */
|
||||
sprintf(fbuf, "%.128s/%s/%s", octstr_get_cstr(dlr_dir), d1, d2);
|
||||
if (mkdir(fbuf,
|
||||
S_IRWXU|S_IRWXG) < 0 &&
|
||||
errno != EEXIST) {
|
||||
mms_error(0, "mmsbox", NULL, "failed to create dir [%s] "
|
||||
"while initialising dlr dir for %s: %s!",
|
||||
fbuf, msgid, strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
t = octstr_format("%S-%s_%s", mmc_gid, msgid, rtype); /* Put mmc id into name. */
|
||||
|
||||
octstr_replace(t, octstr_imm("/"), octstr_imm("$")); /* XXX safe in all cases?? */
|
||||
s = octstr_format("%s/%S", fbuf, t);
|
||||
octstr_destroy(t);
|
||||
|
||||
|
||||
p = octstr_get_cstr(s);
|
||||
i = 0;
|
||||
do
|
||||
if ((fd = open(p, O_RDWR|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP)) < 0) {
|
||||
mms_error(0, "mmsbox", NULL, "Failed to open DLR URL store file [%s], error: %s!",
|
||||
p, strerror(errno));
|
||||
break;
|
||||
} else if (mm_lockfile(fd, p, 1) != 0) {
|
||||
unlock_and_close(fd);
|
||||
fd = -1;
|
||||
}
|
||||
while (i++ < MAXTRIES && fd < 0);
|
||||
|
||||
if (efname)
|
||||
*efname = s;
|
||||
else
|
||||
octstr_destroy(s);
|
||||
|
||||
return fd;
|
||||
}
|
||||
|
||||
void mms_dlr_url_put(Octstr *msgid, char *rtype, Octstr *mmc_gid, Octstr *dlr_url, Octstr *transid)
|
||||
{
|
||||
int fd = dlr_entry_fname(octstr_get_cstr(msgid), rtype, mmc_gid, NULL);
|
||||
|
||||
if (fd >= 0) {
|
||||
Octstr *x = octstr_format("%S %S", transid ? transid : octstr_imm("x"), dlr_url); /* better have no spaces in transid! */
|
||||
octstr_write_data(x, fd, 0);
|
||||
unlock_and_close(fd);
|
||||
octstr_destroy(x);
|
||||
}
|
||||
}
|
||||
|
||||
int mms_dlr_url_get(Octstr *msgid, char *rtype, Octstr *mmc_gid, Octstr **dlr_url, Octstr **transid)
|
||||
{
|
||||
int fd = dlr_entry_fname(octstr_get_cstr(msgid), rtype, mmc_gid, NULL);
|
||||
FILE *f;
|
||||
|
||||
if (fd >= 0 && (f = fdopen(fd, "r+")) != NULL) {
|
||||
Octstr *s = octstr_read_pipe(f);
|
||||
int i, ret;
|
||||
|
||||
unlock_and_fclose(f);
|
||||
if (s && octstr_len(s) == 0) {
|
||||
ret = -1;
|
||||
} else if ((i = octstr_search_char(s, ' ', 0)) >= 0) {
|
||||
*transid = octstr_copy(s, 0, i);
|
||||
*dlr_url = octstr_copy(s, i+1, octstr_len(s));
|
||||
ret = 0;
|
||||
} else
|
||||
ret = -1;
|
||||
octstr_destroy(s);
|
||||
return ret;
|
||||
} else if (fd >= 0)
|
||||
unlock_and_close(fd);
|
||||
return -1;
|
||||
}
|
||||
|
||||
void mms_dlr_url_remove(Octstr *msgid, char *rtype, Octstr *mmc_gid)
|
||||
{
|
||||
Octstr *fname = NULL;
|
||||
int fd = dlr_entry_fname(octstr_get_cstr(msgid), rtype, mmc_gid, &fname);
|
||||
|
||||
if (fname) {
|
||||
unlink(octstr_get_cstr(fname));
|
||||
octstr_destroy(fname);
|
||||
}
|
||||
if (fd >= 0)
|
||||
unlock_and_close(fd);
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* Mbuni - Open Source MMS Gateway
|
||||
*
|
||||
* MMSBOX CFG: MMC configuration and misc. functions
|
||||
*
|
||||
* Copyright (C) 2003 - 2008, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
*
|
||||
* Paul Bagyenda <bagyenda@dsmagic.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License, with a few exceptions granted (see LICENSE)
|
||||
*/
|
||||
#ifndef __MMSBOX_INCLUDED__
|
||||
#define __MMSBOX_INCLUDED__
|
||||
#include "mmsbox_cfg.h"
|
||||
|
||||
void mms_dlr_url_put(Octstr *msgid, char *rtype, Octstr *mmc_gid, Octstr *dlr_url, Octstr *transid);
|
||||
int mms_dlr_url_get(Octstr *msgid, char *rtype, Octstr *mmc_gid, Octstr **dlr_url, Octstr **transid);
|
||||
void mms_dlr_url_remove(Octstr *msgid, char *rtype, Octstr *mmc_gid);
|
||||
|
||||
Octstr *mmsbox_get_report_info(MmsMsg *m, MmscGrp *mmsc, Octstr *out_mmc_id,
|
||||
char *report_type,
|
||||
Octstr *status, List *qhdr, Octstr *uaprof,
|
||||
time_t uaprof_tstamp,
|
||||
Octstr *msgid);
|
||||
void mmsc_receive_func(MmscGrp *m);
|
||||
void mmsbox_outgoing_queue_runner(volatile sig_atomic_t *rstop);
|
||||
void mm4_receive_func(int *sock);
|
||||
void handle_mm1_mt_requests(MmscGrp *m); /* MM1 loop */
|
||||
/* Just a convenience, should go away in future! */
|
||||
#define mmsbox_url_fetch_content mms_url_fetch_content
|
||||
#endif
|
|
@ -0,0 +1,188 @@
|
|||
/*
|
||||
* Mbuni - Open Source MMS Gateway
|
||||
*
|
||||
* Mbuni MMSBOX base CDR handler module (writes to a CVS file)
|
||||
*
|
||||
* Copyright (C) 2003 - 2008, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
*
|
||||
* Paul Bagyenda <bagyenda@dsmagic.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License, with a few exceptions granted (see LICENSE)
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "mmsbox_cdr.h"
|
||||
#include "mmsbox_cfg.h"
|
||||
|
||||
static FILE *cdr_file;
|
||||
static List *req_list;
|
||||
static long th_id;
|
||||
|
||||
|
||||
#define CBUFSIZE 256
|
||||
typedef struct MmsBoxCdrStruct {
|
||||
time_t sdate;
|
||||
char from[CBUFSIZE];
|
||||
char to[CBUFSIZE];
|
||||
#if 0
|
||||
char src_ip[CBUFSIZE/4];
|
||||
char dest_ip[CBUFSIZE/4];
|
||||
#endif
|
||||
char msgid[CBUFSIZE];
|
||||
char mmsc_id[CBUFSIZE];
|
||||
|
||||
char src_int[CBUFSIZE/4];
|
||||
char dst_int[CBUFSIZE/4];
|
||||
|
||||
unsigned long msg_size;
|
||||
|
||||
char msgtype[CBUFSIZE/8];
|
||||
char prio[CBUFSIZE/8];
|
||||
char mclass[CBUFSIZE/8];
|
||||
char status[CBUFSIZE/8];
|
||||
unsigned char dlr;
|
||||
unsigned char rr;
|
||||
} MmsBoxCdrStruct;
|
||||
|
||||
|
||||
static void cdr_logger_func(void)
|
||||
{
|
||||
|
||||
MmsBoxCdrStruct *cdr;
|
||||
hmon->register_thread("cdr_logger");
|
||||
while ((cdr = gwlist_consume(req_list)) != NULL) {
|
||||
char buf[CBUFSIZE];
|
||||
struct tm tm;
|
||||
|
||||
localtime_r(&cdr->sdate, &tm);
|
||||
gw_strftime(buf, sizeof buf, "%Y-%m-%d %H:%M:%S", &tm);
|
||||
fprintf(cdr_file, "%s", buf);
|
||||
|
||||
/* Print rest of fields one by one. */
|
||||
#define PRINTF_STR_FIELD(fld) fprintf(cdr_file, "\t%.*s", (int)(sizeof cdr->fld), cdr->fld)
|
||||
|
||||
PRINTF_STR_FIELD(src_int);
|
||||
PRINTF_STR_FIELD(dst_int);
|
||||
PRINTF_STR_FIELD(from);
|
||||
PRINTF_STR_FIELD(to);
|
||||
PRINTF_STR_FIELD(msgid);
|
||||
PRINTF_STR_FIELD(mmsc_id);
|
||||
PRINTF_STR_FIELD(msgtype);
|
||||
PRINTF_STR_FIELD(prio);
|
||||
PRINTF_STR_FIELD(mclass);
|
||||
PRINTF_STR_FIELD(status);
|
||||
|
||||
fprintf(cdr_file, "\t%ld\t%s\t%s\n",
|
||||
(long)cdr->msg_size,
|
||||
cdr->dlr ? "Yes" : "No",
|
||||
cdr->rr ? "Yes" : "No");
|
||||
|
||||
fflush(cdr_file);
|
||||
|
||||
gw_free(cdr);
|
||||
}
|
||||
hmon->unregister_thread("cdr_logger");
|
||||
}
|
||||
|
||||
static int cdr_module_init(char *settings)
|
||||
{
|
||||
cdr_file = fopen(settings, "a"); /* Settings is interpreted as a file name. */
|
||||
if (cdr_file) {
|
||||
req_list = gwlist_create();
|
||||
|
||||
gwlist_add_producer(req_list);
|
||||
|
||||
th_id = gwthread_create((void *)cdr_logger_func, NULL);
|
||||
return 0;
|
||||
} else
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
static int module_fini(void)
|
||||
{
|
||||
gw_assert(req_list);
|
||||
gw_assert(cdr_file);
|
||||
|
||||
gwlist_remove_producer(req_list);
|
||||
|
||||
if (th_id >= 0)
|
||||
gwthread_join(th_id);
|
||||
gwlist_destroy(req_list, NULL); /* there shouldn't be any requests waiting */
|
||||
|
||||
if (cdr_file)
|
||||
fclose(cdr_file);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* utility function. */
|
||||
static void fill_cdr_struct(MmsBoxCdrStruct *cdr,
|
||||
time_t sdate, char *from, char *to, char *msgid,
|
||||
char *mmsc_id, char *src_int, char *dst_int,
|
||||
#if 0
|
||||
char *src_ip, char *dst_ip,
|
||||
#endif
|
||||
unsigned long msg_size,
|
||||
char *msgtype, char *prio, char *mclass,
|
||||
char *status,
|
||||
int dlr, int rr)
|
||||
{
|
||||
memset(cdr, 0, sizeof cdr[0]);
|
||||
|
||||
cdr->sdate = sdate;
|
||||
|
||||
#define COPY_CDR_FIELD(fld) if (fld) strncpy(cdr->fld, fld, sizeof cdr->fld)
|
||||
|
||||
COPY_CDR_FIELD(from);
|
||||
COPY_CDR_FIELD(to);
|
||||
COPY_CDR_FIELD(msgid);
|
||||
COPY_CDR_FIELD(mmsc_id);
|
||||
COPY_CDR_FIELD(src_int);
|
||||
COPY_CDR_FIELD(dst_int);
|
||||
COPY_CDR_FIELD(msgtype);
|
||||
COPY_CDR_FIELD(prio);
|
||||
COPY_CDR_FIELD(mclass);
|
||||
COPY_CDR_FIELD(status);
|
||||
|
||||
cdr->dlr = dlr;
|
||||
cdr->rr = rr;
|
||||
cdr->msg_size = msg_size;
|
||||
}
|
||||
|
||||
static int cdr_module_logcdr(time_t sdate, char *from, char *to, char *msgid,
|
||||
char *mmsc_id, char *src_int, char *dst_int,
|
||||
#if 0
|
||||
char *src_ip, char *dst_ip,
|
||||
#endif
|
||||
unsigned long msg_size,
|
||||
char *msgtype, char *prio, char *mclass,
|
||||
char *status,
|
||||
int dlr, int rr)
|
||||
{
|
||||
MmsBoxCdrStruct *xcdr = gw_malloc(sizeof xcdr[0]);
|
||||
|
||||
gw_assert(req_list);
|
||||
|
||||
|
||||
fill_cdr_struct(xcdr, sdate, from, to, msgid, mmsc_id, src_int, dst_int,
|
||||
#if 0
|
||||
src_ip, dst_ip,
|
||||
#endif
|
||||
msg_size, msgtype, prio, mclass, status, dlr, rr);
|
||||
|
||||
gwlist_produce(req_list, xcdr);
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
MmsBoxCdrFuncStruct mmsbox_cdrfuncs = {
|
||||
cdr_module_init,
|
||||
cdr_module_logcdr,
|
||||
module_fini
|
||||
};
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* Mbuni - Open Source MMS Gateway
|
||||
*
|
||||
* Mbuni billing integration interface
|
||||
*
|
||||
* Copyright (C) 2003 - 2008, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
*
|
||||
* Paul Bagyenda <bagyenda@dsmagic.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License, with a few exceptions granted (see LICENSE)
|
||||
*/
|
||||
|
||||
#ifndef __MMSBOX_CDR_INCLUDED__
|
||||
#define __MMSBOX_CDR_INCLUDED__
|
||||
|
||||
|
||||
#include <time.h>
|
||||
#include "gwlib/gwlib.h"
|
||||
|
||||
/* MMSBOX CDR module. This file provides prototypes for all CDR functions.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
typedef struct MmsBoxCdrFuncStruct {
|
||||
/* This function is called once to initialise the module. Return 0 on success */
|
||||
int (*init)(char *settings);
|
||||
|
||||
/* This function logs a cdr to wherever it is logging to. */
|
||||
int (*logcdr)(time_t sdate, char *from, char *to, char *msgid,
|
||||
char *mmsc_id, char *src_int, char *dst_int,
|
||||
#if 0
|
||||
char *src_ip, char *dst_ip,
|
||||
#endif
|
||||
unsigned long msg_size,
|
||||
char *msgtype, char *prio, char *mclass,
|
||||
char *status,
|
||||
int dlr, int rr);
|
||||
|
||||
int (*cleanup)(void);
|
||||
} MmsBoxCdrFuncStruct;
|
||||
|
||||
extern MmsBoxCdrFuncStruct mmsbox_cdrfuncs; /* The module must expose a symbol 'cdr_funcs' */
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,299 @@
|
|||
/*
|
||||
* Mbuni - Open Source MMS Gateway
|
||||
*
|
||||
* MMSBOX CFG: MMC configuration and misc. functions
|
||||
*
|
||||
* Copyright (C) 2003 - 2008, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
*
|
||||
* Paul Bagyenda <bagyenda@dsmagic.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License, with a few exceptions granted (see LICENSE)
|
||||
*/
|
||||
#ifndef __MMSBOX_CFG_INCLUDED__
|
||||
#define __MMSBOX_CFG_INCLUDED__
|
||||
#include "mms_util.h"
|
||||
#include "mmsbox_mt_filter.h"
|
||||
#include "mms_queue.h"
|
||||
#include "mmsbox_resolve.h"
|
||||
|
||||
#include "mmsbox_mmsc.h"
|
||||
#include "mmsbox_cdr.h"
|
||||
#include "mms_cfg.h"
|
||||
|
||||
/* Alarm callback mechanism */
|
||||
enum MmsBoxAlarms {
|
||||
MMSBOX_ALARM_HTTP_DOWN = 0,
|
||||
MMSBOX_ALARM_FILE_WRITE_ERROR,
|
||||
MMSBOX_ALARM_SOCKET_CONNECT_FAILED,
|
||||
MMSBOX_ALARM_QUEUE_WRITE_ERROR,
|
||||
MMSBOX_ALARM_STORAGE_API_ERROR,
|
||||
MMSBOX_ALARM_MM7_PARSING_FAILURE,
|
||||
MMSBOX_ALARM_MM7_NON_200_RESULT,
|
||||
MMSBOX_ALARM_RETRIEVE_MMS_ERROR,
|
||||
MMSBOX_ALARM_MM4_PARSING_FAILURE,
|
||||
MMSBOX_ALARM_MM1_ADDRESS_RESOLUTION_ERROR,
|
||||
MMSBOX_ALARM_MAX_ALARM /* Must be last one */
|
||||
};
|
||||
|
||||
typedef struct MmscGrp {
|
||||
Octstr *id; /* MMSC id (for logging). */
|
||||
Octstr *group_id; /* GROUP MMSC id (used for qf). */
|
||||
Octstr *vasp_id; /* vasp id for SOAP mmsc */
|
||||
Octstr *mmsc_url; /* URL at which MMSC can be reached. */
|
||||
struct {
|
||||
Octstr *user, *pass;
|
||||
Octstr *allow_ip;
|
||||
Octstr *deny_ip;
|
||||
long port;
|
||||
int ssl;
|
||||
} incoming; /* user, pass, port (and whether SSL) that MMSC uses to connect to us. */
|
||||
Octstr *allowed_prefix, *denied_prefix;
|
||||
Octstr *allowed_sender_prefix, *denied_sender_prefix;
|
||||
Octstr *carrier_id_header; /* http header that has carrier id */
|
||||
enum {UNKNOWN_MMSC = -1, CUSTOM_MMSC, SOAP_MMSC, EAIF_MMSC, MM4_MMSC, HTTP_MMSC, MM1_MMSC} type; /* type of connection. */
|
||||
double throughput; /* Max send rate. */
|
||||
int allow_adaptations; /* turns ON/OFF allow-adaptations in MM7 SOAP XML */
|
||||
long threadid; /* handler thread. */
|
||||
|
||||
int reroute; /* whether messages from this mmsc are re-routed outwards. */
|
||||
Octstr *reroute_mmsc_id;
|
||||
int no_senderaddress; /* used by SOAP interface: Don't add a sender address. */
|
||||
int reroute_mod_subject; /* Set to true if we'll change subject line on reroute. */
|
||||
MM7Version_t ver; /* supported MM7/SOAP version. */
|
||||
int use_mt_filter; /* whether to use MT filter on this connection. */
|
||||
Mutex *mutex;
|
||||
|
||||
Octstr *default_vasid; /* default vasid for mm7/soap */
|
||||
|
||||
MmsBoxMmscFuncs *fns; /* pointer to functions for handling this mmsc connection type */
|
||||
Octstr *settings; /* settings for the above module. */
|
||||
void *data; /* data for above module. */
|
||||
int started; /* Whether it is active */
|
||||
unsigned long mt_pdus; /* number of MT PDUs since start. */
|
||||
unsigned long mo_pdus; /* number of MO PDUs since start. */
|
||||
unsigned long mt_errors; /* number of MT errors since start */
|
||||
unsigned long mo_errors; /* number of MO errors since start */
|
||||
|
||||
time_t last_pdu; /* time of last PDU */
|
||||
time_t start_time; /* when was this connection started */
|
||||
|
||||
time_t last_alarm[MMSBOX_ALARM_MAX_ALARM];
|
||||
int use_count; /* use counter. */
|
||||
time_t delete_after; /* used to control deletion of object -- not very clean, but... */
|
||||
|
||||
long max_pkt_size;
|
||||
|
||||
int strip_domain; /* MM4 only */
|
||||
|
||||
long max_recipients; /* Max recpients per transaction */
|
||||
|
||||
List *strip_prefixes; /* List of prefixes to be stripped before sending out*/
|
||||
|
||||
List *retry_statuses; /* List of HTTP/MM7 statuses we do retry on, MM7 statuses are checked only on HTTP 200 - they do not overlap*/
|
||||
|
||||
struct MM1Info_t { /* Stuff used only by the MM1 MMSC */
|
||||
Octstr *proxy; /* Proxy within the operator network, form of host:port */
|
||||
Octstr *gprs_on; /* Command to start GPRS link. Must not exit. */
|
||||
Octstr *gprs_off; /* Command to stop GPRS link. */
|
||||
Octstr *gprs_pid; /* command to call to get PID of GPRS for stopping GPRS link (i.e. pppd). */
|
||||
Octstr *smsc_on; /* command to start smsc connection */
|
||||
Octstr *smsc_off; /* commadn to stop smsc connection */
|
||||
Octstr *msisdn; /* Our msisdn */
|
||||
Octstr *ua; /* User agent string, if given */
|
||||
List *requests; /* list of requests. */
|
||||
long d_tid;/* thread ID for mm1 handler. */
|
||||
|
||||
int sender_alive;
|
||||
} mm1;
|
||||
} MmscGrp;
|
||||
|
||||
#define DEFAULT_MAX_PKT_SIZE 1024*1024
|
||||
|
||||
#define MMSBOX_MMSC_MARK_INUSE(mmc) do {\
|
||||
mutex_lock((mmc)->mutex); \
|
||||
(mmc)->use_count++; \
|
||||
mutex_unlock(mmc->mutex); \
|
||||
} while (0)
|
||||
|
||||
#define MMSBOX_MMSC_UNMARK_INUSE(mmc) do {\
|
||||
mutex_lock((mmc)->mutex); \
|
||||
(mmc)->use_count--; \
|
||||
mutex_unlock(mmc->mutex); \
|
||||
} while (0)
|
||||
|
||||
|
||||
typedef struct MmsServiceUrlParam {
|
||||
Octstr *name;
|
||||
enum {NO_PART, AUDIO_PART, IMAGE_PART, VIDEO_PART,
|
||||
TEXT_PART, SMIL_PART , OTHER_PART,
|
||||
ANY_PART, WHOLE_BINARY, KEYWORD_PART,
|
||||
|
||||
RCPT_PART, FROM_PART, SUBJECT_PART, MMSCID_PART,
|
||||
MSGTYPE_PART, MSGID_PART} type;
|
||||
Octstr *value; /* for generic value (type == NO_PART),
|
||||
* or for value that follows spec (e.g. %Tisatest is allowed)
|
||||
*/
|
||||
} MmsServiceUrlParam;
|
||||
|
||||
typedef struct MmsService {
|
||||
Octstr *name; /* name of service. */
|
||||
int isdefault;
|
||||
int omitempty;
|
||||
int noreply;
|
||||
int accept_x_headers;
|
||||
List *passthro_headers;
|
||||
|
||||
int assume_plain_text;
|
||||
List *keywords; /* List of keywords matched. */
|
||||
enum {TRANS_TYPE_GET_URL, TRANS_TYPE_POST_URL, TRANS_TYPE_FILE, TRANS_TYPE_EXEC,
|
||||
TRANS_TYPE_TEXT} type;
|
||||
Octstr *url; /* The value. */
|
||||
List *params; /* of MmsServiceUrlParam */
|
||||
|
||||
Octstr *faked_sender;
|
||||
List *allowed_mmscs; /* List of MMSCs allowed to access this service (by ID). */
|
||||
List *denied_mmscs; /* List of MMSCs allowed to access this service (by ID). */
|
||||
Octstr *service_code; /* Service code (MM7/SOAP only) */
|
||||
|
||||
Octstr *allowed_receiver_prefix, *denied_receiver_prefix;
|
||||
Octstr *special_header; /* To be added to each content element. */
|
||||
} MmsService;
|
||||
|
||||
typedef struct SendMmsUser {
|
||||
Octstr *user, *pass;
|
||||
Octstr *faked_sender;
|
||||
Octstr *dlr_url, *rr_url, *mmsc;
|
||||
} SendMmsUser;
|
||||
|
||||
/* Basic settings for the mmsbox. */
|
||||
extern List *sendmms_users; /* list of SendMmsUser structs */
|
||||
extern List *mms_services; /* list of MMS Services */
|
||||
extern Octstr *incoming_qdir, *outgoing_qdir, *dlr_dir;
|
||||
extern Octstr *unified_prefix;
|
||||
extern Octstr *sendmail_cmd;
|
||||
extern Octstr *myhostname;
|
||||
extern List *strip_prefixes;
|
||||
extern long svc_maxsendattempts, maxsendattempts, mmsbox_send_back_off, default_msgexpiry, max_msgexpiry;
|
||||
extern long maxthreads;
|
||||
extern double queue_interval;
|
||||
extern struct SendMmsPortInfo {
|
||||
long port; /* Might be ssl-ed. */
|
||||
Octstr *allow_ip;
|
||||
Octstr *deny_ip;
|
||||
} sendmms_port;
|
||||
|
||||
extern struct MmsBoxMTfilter *mt_filter;
|
||||
extern MmsQueueHandlerFuncs *qfs;
|
||||
extern int mt_multipart;
|
||||
|
||||
extern MmsBoxResolverFuncStruct *rfs; /* resolver functions. */
|
||||
extern void *rfs_data;
|
||||
extern Octstr *rfs_settings;
|
||||
|
||||
extern struct SMTPRelay {
|
||||
Octstr *host;
|
||||
int port;
|
||||
} smtp_relay;
|
||||
|
||||
extern MmsBoxCdrFuncStruct *cdrfs;
|
||||
|
||||
|
||||
extern struct MmsBoxHealthMonitors {
|
||||
void (*register_thread)( char *name); /* Called by each thread to register itself with the health monitor */
|
||||
void (*unregister_thread)(char *name); /* Called by each thread to unregister itself with the health monitor */
|
||||
void (*register_port)(short port); /* Called to register each port on which we listen */
|
||||
void (*unregister_port)(short port); /* Called to unregister each port on which we listen */
|
||||
} *hmon; /* This should be set if you want to do any thread and port monitoring */
|
||||
|
||||
/* mmsbox_event_cb: Called with each mmsc event.
|
||||
* mmsc - mmsc ID
|
||||
* mm7_pkt_type - MM7 packet type (using MM7/SOAP codes)
|
||||
* mm7_ver - value for SOAP or EAIF only
|
||||
* status - 0 for Ok, -1 if failed (e.g. for submitack
|
||||
* msg_size - size of mms
|
||||
* num_retries - number of retries so far
|
||||
* from - sender (can be NULL)
|
||||
* to - recipient (can be NULL)
|
||||
* transid - transaction ID
|
||||
* message_id - Message ID (for submitack, deliverreq, deliveryreport or readreport)
|
||||
* hdrs - List of envelope headers
|
||||
* value - value associated with pkt type: e.g. for deliveryreport, report type
|
||||
*/
|
||||
extern void (*mmsbox_event_cb)(Octstr *mmsc, int mm7_pkt_type,
|
||||
int is_mm4,
|
||||
Octstr *mm7_ver, int status,
|
||||
int msg_size, int num_retries,
|
||||
Octstr *from, Octstr *to, Octstr *message_id, Octstr *transid,
|
||||
List *hdrs, Octstr *value);
|
||||
|
||||
/* mmsbox_alarm_cb: Called when an alarm is raised or cleared
|
||||
* mmsc - MMSC ID
|
||||
* alarm - alarm type
|
||||
* alarm_state - 0 = alarm cleared, 1 = alarm raised
|
||||
* lev = severity level, 1 = warning, 2 = minor, 3 = major, 4+ = critical
|
||||
*/
|
||||
extern void (*mmsbox_alarm_cb)(Octstr*mmsc, enum MmsBoxAlarms alarm, int alarm_state, int lev);
|
||||
|
||||
#define MMSC_ISSUE_ALARM(mmc,alarm,lev) do { \
|
||||
MmscGrp *_mmc = (mmc); \
|
||||
if (_mmc) \
|
||||
_mmc->last_alarm[(alarm)] = time(NULL); \
|
||||
mmsbox_alarm_cb(_mmc ? _mmc->id : NULL, (alarm), 1, (lev)); \
|
||||
} while (0)
|
||||
#define MMSC_CLEAR_ALARM(mmc,alarm) do { \
|
||||
MmscGrp *_mmc = (mmc); \
|
||||
if (_mmc && _mmc->last_alarm[(alarm)] > 0 ) { \
|
||||
mmsbox_alarm_cb(_mmc->id, (alarm), 0, 0); \
|
||||
_mmc->last_alarm[(alarm)] = 0; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
extern int mms_load_mmsbox_settings(struct mCfgImpFuncs *cfg_funcs, Octstr *init,
|
||||
gwthread_func_t *mmsc_handler_func,
|
||||
MmsQueueHandlerFuncs *,
|
||||
MmsEventLoggerFuncs *);
|
||||
extern void mmsbox_settings_cleanup(void);
|
||||
extern MmscGrp *get_handler_mmc(Octstr *id, Octstr *to, Octstr *from);
|
||||
extern void return_mmsc_conn(MmscGrp *m);
|
||||
|
||||
extern Octstr *get_mmsbox_queue_dir(Octstr *from, List *to, MmscGrp *m, Octstr **mmc_id);
|
||||
#if 0
|
||||
MmscGrp *start_mmsc_from_conf(mCfg *cfg, mCfgGrp *x, List *errors, List *warnings);
|
||||
#endif
|
||||
int mmsbox_stop_mmsc(Octstr *mmc);
|
||||
|
||||
int mmsbox_start_mmsc(Octstr *mmc_id);
|
||||
|
||||
MmscGrp *mmsbox_get_mmsc_by_url(Octstr *mmc_url);
|
||||
void mmsbox_stop_all_mmsc_conn(void);
|
||||
typedef struct MmsBoxHTTPClientInfo {
|
||||
HTTPClient *client;
|
||||
Octstr *ua;
|
||||
Octstr *ip;
|
||||
List *headers;
|
||||
Octstr *url;
|
||||
Octstr *body;
|
||||
List *cgivars;
|
||||
MmscGrp *m;
|
||||
} MmsBoxHTTPClientInfo;
|
||||
void free_mmsbox_http_clientInfo(MmsBoxHTTPClientInfo *h, int freeh);
|
||||
/* parse service url params in list of MmsServiceUrlParm structs */
|
||||
List *parse_service_url_params(Octstr *input, Octstr *id);
|
||||
|
||||
#define add_all_matching_parts(a,b,c,d,e,f,g) add_all_matching_parts_real((a),(b),(c),(d),(e),(f),(g),NULL,NULL,NULL,NULL,-1,NULL)
|
||||
|
||||
void add_all_matching_parts_real(MIMEEntity *plist, MmsServiceUrlParam *pm,
|
||||
Octstr *keyword,
|
||||
MIMEEntity *me,
|
||||
MmsMsg *msg, int lev, int count,
|
||||
Octstr *from, List *lto, char *subject,
|
||||
char *mmsc_id, int mtype, Octstr *msgid);
|
||||
|
||||
MIMEEntity *mmsbox_add_service_url_params(List *params,
|
||||
Octstr *from, List *lto, char *subject,
|
||||
char *mmsc_id, int mtype, Octstr *msgid,
|
||||
MmsMsg *m);
|
||||
|
||||
extern volatile sig_atomic_t rstop;
|
||||
#endif
|
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* Mbuni - Open Source MMS Gateway
|
||||
*
|
||||
* MMSBOX Custom MMSC types: MMC function definitions
|
||||
*
|
||||
* Copyright (C) 2003 - 2008, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
*
|
||||
* Paul Bagyenda <bagyenda@dsmagic.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License, with a few exceptions granted (see LICENSE)
|
||||
*/
|
||||
#ifndef __MMSBOX_MMSC_CFG_INCLUDED__
|
||||
#define __MMSBOX_MMSC_CFG_INCLUDED__
|
||||
#include "mms_util.h"
|
||||
#include "mms_queue.h"
|
||||
struct MmscGrp; /* so we compile. */
|
||||
typedef struct MmsBoxMmscFuncs {
|
||||
/* start_conn: called once with the module settings, ID of the connection
|
||||
* and a pointer where to store module specific info.
|
||||
* should return 0 on success, -1 on error.
|
||||
*/
|
||||
int (*start_conn)(struct MmscGrp *mmc, MmsQueueHandlerFuncs *qfs,
|
||||
Octstr *unified_prefix, List *strip_prefixes,
|
||||
void **data);
|
||||
|
||||
/* stop_conn: Called to stop the MMC connection. */
|
||||
int (*stop_conn)(void *data);
|
||||
|
||||
/* send_msg: called to send a message. Should msg ID if any. On error,
|
||||
* retry can be set to 1 for sending to be retried later.
|
||||
* Should set err to the error message (if any).
|
||||
*/
|
||||
Octstr *(*send_msg)(void *data, Octstr *from, Octstr *to,
|
||||
Octstr *transid,
|
||||
Octstr *linkedid, char *vasid, Octstr *service_code,
|
||||
MmsMsg *m, List *hdrs, Octstr **err, int *retry);
|
||||
|
||||
} MmsBoxMmscFuncs;
|
||||
|
||||
extern MmsBoxMmscFuncs mmsc_funcs; /* lib should expose this structure. */
|
||||
#endif
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Mbuni - Open Source MMS Gateway
|
||||
*
|
||||
* Empty wrapper library
|
||||
*
|
||||
* Copyright (C) 2008, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
*
|
||||
* Paul Bagyenda <bagyenda@dsmagic.com>
|
||||
*
|
||||
* This program is proprietary software, refer to licence holder for details
|
||||
*/
|
||||
#include <sys/file.h>
|
||||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/wait.h>
|
||||
#include <errno.h>
|
||||
#include <dlfcn.h>
|
||||
#include <strings.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include "mmsbox_mt_filter.h"
|
||||
|
||||
static int myinit(Octstr *mmc_url, Octstr *mmc_id, Octstr *startup_params)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int myfilter(MIMEEntity **msg, Octstr *loc_url, Octstr *mmc_id)
|
||||
{
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void myclose(Octstr *mmc_id)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
struct MmsBoxMTfilter mmsbox_mt_filter = {
|
||||
.name = "Empty Wrapper",
|
||||
.init = myinit,
|
||||
.filter = myfilter,
|
||||
.destroy = myclose
|
||||
};
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* Mbuni - Open Source MMS Gateway
|
||||
*
|
||||
* MMSBOX MT MMS filter: Optional filter for MT messages
|
||||
*
|
||||
* Copyright (C) 2003 - 2008, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
*
|
||||
* Paul Bagyenda <bagyenda@dsmagic.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License, with a few exceptions granted (see LICENSE)
|
||||
*/
|
||||
#ifndef __MMSMT_FILTER_INCLUDED__
|
||||
#define __MMSMT_FILTER_INCLUDED__
|
||||
#include "mms_util.h"
|
||||
|
||||
struct MmsBoxMTfilter {
|
||||
/* name of filter. */
|
||||
char *name;
|
||||
/* Init: called once for each mmc to determine if to use filter on MT MMS via the particular MMC. Returns 1
|
||||
* on success, error otherwise
|
||||
*/
|
||||
int (*init)(Octstr *mmc_url, Octstr *mmc_id, Octstr *startup_params);
|
||||
|
||||
/* filter: Filter/transform the message. Return 0 on success. May modify the message itself of course */
|
||||
int (*filter)(MIMEEntity **msg, Octstr *loc_url, Octstr *mmc_id);
|
||||
|
||||
/* destroy this mmc's settings in filter. */
|
||||
void (*destroy)(Octstr *mmc_id);
|
||||
};
|
||||
|
||||
/* Each module must export this symbol, a pointer to the structure.
|
||||
* WARNING: Ensure your module is thread-safe
|
||||
*/
|
||||
extern struct MmsBoxMTfilter mmsbox_mt_filter;
|
||||
#endif
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Mbuni - Open Source MMS Gateway
|
||||
*
|
||||
* Resolving MSISDNs to local/remote MMSBox MMSC - interface
|
||||
*
|
||||
* Copyright (C) 2003 - 2007, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
*
|
||||
* Paul Bagyenda <bagyenda@dsmagic.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License, with a few exceptions granted (see LICENSE)
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "mmsbox_resolve.h"
|
||||
#include "mmsbox_cfg.h"
|
||||
|
||||
static void *_resolvermodule_init(char *settings)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int _resolvermodule_fini(void *module_data)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static Octstr *_resolve(Octstr * pfrom, Octstr *pto, char *in_mmsc,
|
||||
void *module_data, void *settings_p)
|
||||
{
|
||||
/* route normally to mms-service. */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* The function itself. */
|
||||
MmsBoxResolverFuncStruct mmsbox_resolvefuncs = {
|
||||
_resolvermodule_init,
|
||||
_resolve,
|
||||
_resolvermodule_fini
|
||||
};
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* Mbuni - Open Source MMS Gateway
|
||||
*
|
||||
* Resolving MSISDNs to local/remote MMSBox MMSC - interface
|
||||
*
|
||||
* Copyright (C) 2003 - 2007, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
*
|
||||
* Paul Bagyenda <bagyenda@dsmagic.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License, with a few exceptions granted (see LICENSE)
|
||||
*/
|
||||
#ifndef __MMSBOX_RESOLVE_INCLUDED__
|
||||
#define __MMSBOX_RESOLVE_INCLUDED__
|
||||
|
||||
#include <time.h>
|
||||
#include "gwlib/gwlib.h"
|
||||
|
||||
/* Resolver module. This file provides prototypes for all resolver functions.
|
||||
* the module is loaded once and _init is called once at load.
|
||||
* _resolve is called for each incoming message to determine how to route it.
|
||||
*/
|
||||
|
||||
typedef struct MmsBoxResolverFuncStruct {
|
||||
/* This function is called once to initialise the resolver module. Return a generic object,
|
||||
* which is passed with each resolution request..
|
||||
*/
|
||||
void *(*mmsbox_resolvermodule_init)(char *settings);
|
||||
|
||||
/* Looks up the sender and receiver msisdns and returns the ID of the MMC connection through which
|
||||
* the received message should be sent.
|
||||
* Note: This function may modify sender and/or receive to match prefered usage.
|
||||
* Return NULL or the empty string to send the message to a service (normal behavior)
|
||||
*/
|
||||
Octstr *(*mmsbox_resolve)(Octstr *pfrom, Octstr *pto, char *from_mmsc,
|
||||
void *module_data, void *settings);
|
||||
|
||||
int (*mmsbox_resolvermodule_fini)(void *module_data);
|
||||
} MmsBoxResolverFuncStruct;
|
||||
|
||||
extern MmsBoxResolverFuncStruct mmsbox_resolvefuncs; /* The module must expose this symbol. */
|
||||
|
||||
#endif
|
|
@ -0,0 +1,70 @@
|
|||
/*
|
||||
* Mbuni - Open Source MMS Gateway
|
||||
*
|
||||
* Resolving MSISDNs to local/remote MMSCs - calling shell scripts
|
||||
*
|
||||
* Copyright (C) 2003 - 2008, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
*
|
||||
* Paul Bagyenda <bagyenda@dsmagic.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License, with a few exceptions granted (see LICENSE)
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "mmsbox_resolve.h"
|
||||
#include "mms_util.h"
|
||||
|
||||
static Octstr *script = NULL;
|
||||
|
||||
static void *_shell_resolvermodule_init(char *settings)
|
||||
{
|
||||
script = octstr_imm(settings);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int _shell_resolvermodule_fini(void *module_data)
|
||||
{
|
||||
octstr_destroy(script);
|
||||
script = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static Octstr *_shell_resolve(Octstr *pfrom, Octstr *pto, char *in_mmc, void *module_data, void *settings_p)
|
||||
{
|
||||
Octstr *s;
|
||||
FILE *fp;
|
||||
char buf[4096];
|
||||
|
||||
if (script == NULL || octstr_len(script) == 0)
|
||||
return 0;
|
||||
|
||||
s = octstr_format("%s '%s' '%s' '%s'",
|
||||
octstr_get_cstr(script), octstr_get_cstr(pfrom), octstr_get_cstr(pto),
|
||||
in_mmc);
|
||||
|
||||
mms_info(0, "mmsbox", NULL, "Preparing to call resolver as: %s", octstr_get_cstr(s));
|
||||
fp = popen(octstr_get_cstr(s), "r");
|
||||
octstr_destroy(s);
|
||||
|
||||
fgets(buf, sizeof buf, fp);
|
||||
s = octstr_create(buf);
|
||||
octstr_strip_crlfs(s);
|
||||
|
||||
pclose(fp);
|
||||
|
||||
mms_info(0, "mmsbox", NULL, "Resolver returned: %s", octstr_get_cstr(s));
|
||||
if (octstr_len(s) == 0) {
|
||||
octstr_destroy(s);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
/* The function struct itself. */
|
||||
MmsBoxResolverFuncStruct mmsbox_resolvefuncs_shell = {
|
||||
_shell_resolvermodule_init,
|
||||
_shell_resolve,
|
||||
_shell_resolvermodule_fini
|
||||
};
|
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* Mbuni - Open Source MMS Gateway
|
||||
*
|
||||
* Resolving MSISDNs to local/remote MMSCs - interface (shell)
|
||||
*
|
||||
* Copyright (C) 2003 - 2008, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
*
|
||||
* Paul Bagyenda <bagyenda@dsmagic.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License, with a few exceptions granted (see LICENSE)
|
||||
*/
|
||||
#ifndef __MMSBOX_RESOLVE_SHELL_INCLUDED__
|
||||
#define __MMSBOX_RESOLVE_SHELL_INCLUDED__
|
||||
|
||||
#include <time.h>
|
||||
#include "gwlib/gwlib.h"
|
||||
#include "mmsbox_resolve.h"
|
||||
|
||||
extern MmsBoxResolverFuncStruct mmsbox_resolvefuncs_shell;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,14 @@
|
|||
.*.sw[po]
|
||||
*~
|
||||
*.diff
|
||||
*.patch
|
||||
*.lo
|
||||
*.o
|
||||
Makefile
|
||||
Makefile.in
|
||||
.deps
|
||||
.libs
|
||||
mmsrelay
|
||||
mmsproxy
|
||||
mmsfromemail
|
||||
mmssend
|
|
@ -1,2 +1,13 @@
|
|||
bin_PROGRAMS = mmsglobalsender mmsproxy mmsmobilesender mmsfromemail mmssend
|
||||
libmms = $(top_builddir)/mmlib/libmms.la
|
||||
libmmsc = libmmsc.a
|
||||
|
||||
noinst_LIBRARIES = libmmsc.a
|
||||
libmmsc_a_SOURCES = mmsc_cfg.c mms_detokenize.c mms_resolve.c mms_billing.c mms_detokenize_shell.c mms_resolve_shell.c mms_billing_shell.c mmsc_mm5.c
|
||||
|
||||
bin_PROGRAMS = mmsc mmsfromemail mmssend
|
||||
mmsc_SOURCES = mmsc.c mmsglobalsender.c mmsmobilesender.c mmsrelay.c mmsproxy.c
|
||||
mmsc_LDADD = $(libmmsc) $(libmms)
|
||||
mmsfromemail_LDADD = $(libmmsc) $(libmms)
|
||||
mmssend_LDADD = $(libmmsc) $(libmms)
|
||||
|
||||
EXTRA_DIST = mmsc.h mms_billing.h mms_detokenize_shell.h mms_billing_shell.h mms_resolve_shell.h mmsc_cfg.h mms_detokenize.h mms_resolve.h mmsc_mm5.h
|
||||
|
|
|
@ -1,425 +0,0 @@
|
|||
# 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 = mmsfromemail.c mmsglobalsender.c mmsmobilesender.c mmsproxy.c mmssend.c
|
||||
|
||||
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 = :
|
||||
bin_PROGRAMS = mmsglobalsender$(EXEEXT) mmsproxy$(EXEEXT) \
|
||||
mmsmobilesender$(EXEEXT) mmsfromemail$(EXEEXT) \
|
||||
mmssend$(EXEEXT)
|
||||
subdir = mmsc
|
||||
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)
|
||||
mmsfromemail_SOURCES = mmsfromemail.c
|
||||
mmsfromemail_OBJECTS = mmsfromemail.$(OBJEXT)
|
||||
mmsfromemail_LDADD = $(LDADD)
|
||||
mmsglobalsender_SOURCES = mmsglobalsender.c
|
||||
mmsglobalsender_OBJECTS = mmsglobalsender.$(OBJEXT)
|
||||
mmsglobalsender_LDADD = $(LDADD)
|
||||
mmsmobilesender_SOURCES = mmsmobilesender.c
|
||||
mmsmobilesender_OBJECTS = mmsmobilesender.$(OBJEXT)
|
||||
mmsmobilesender_LDADD = $(LDADD)
|
||||
mmsproxy_SOURCES = mmsproxy.c
|
||||
mmsproxy_OBJECTS = mmsproxy.$(OBJEXT)
|
||||
mmsproxy_LDADD = $(LDADD)
|
||||
mmssend_SOURCES = mmssend.c
|
||||
mmssend_OBJECTS = mmssend.$(OBJEXT)
|
||||
mmssend_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)
|
||||
CCLD = $(CC)
|
||||
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
SOURCES = mmsfromemail.c mmsglobalsender.c mmsmobilesender.c \
|
||||
mmsproxy.c mmssend.c
|
||||
DIST_SOURCES = mmsfromemail.c mmsglobalsender.c mmsmobilesender.c \
|
||||
mmsproxy.c mmssend.c
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
AMTAR = @AMTAR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
EXE_EXT = @EXE_EXT@
|
||||
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@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJEXT = @OBJEXT@
|
||||
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_CC = @ac_ct_CC@
|
||||
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__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build_alias = @build_alias@
|
||||
datadir = @datadir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host_alias = @host_alias@
|
||||
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@
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .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 mmsc/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu mmsc/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 \
|
||||
; then \
|
||||
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
|
||||
echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
|
||||
$(INSTALL_PROGRAM_ENV) $(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:
|
||||
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
|
||||
mmsfromemail$(EXEEXT): $(mmsfromemail_OBJECTS) $(mmsfromemail_DEPENDENCIES)
|
||||
@rm -f mmsfromemail$(EXEEXT)
|
||||
$(LINK) $(mmsfromemail_LDFLAGS) $(mmsfromemail_OBJECTS) $(mmsfromemail_LDADD) $(LIBS)
|
||||
mmsglobalsender$(EXEEXT): $(mmsglobalsender_OBJECTS) $(mmsglobalsender_DEPENDENCIES)
|
||||
@rm -f mmsglobalsender$(EXEEXT)
|
||||
$(LINK) $(mmsglobalsender_LDFLAGS) $(mmsglobalsender_OBJECTS) $(mmsglobalsender_LDADD) $(LIBS)
|
||||
mmsmobilesender$(EXEEXT): $(mmsmobilesender_OBJECTS) $(mmsmobilesender_DEPENDENCIES)
|
||||
@rm -f mmsmobilesender$(EXEEXT)
|
||||
$(LINK) $(mmsmobilesender_LDFLAGS) $(mmsmobilesender_OBJECTS) $(mmsmobilesender_LDADD) $(LIBS)
|
||||
mmsproxy$(EXEEXT): $(mmsproxy_OBJECTS) $(mmsproxy_DEPENDENCIES)
|
||||
@rm -f mmsproxy$(EXEEXT)
|
||||
$(LINK) $(mmsproxy_LDFLAGS) $(mmsproxy_OBJECTS) $(mmsproxy_LDADD) $(LIBS)
|
||||
mmssend$(EXEEXT): $(mmssend_OBJECTS) $(mmssend_DEPENDENCIES)
|
||||
@rm -f mmssend$(EXEEXT)
|
||||
$(LINK) $(mmssend_LDFLAGS) $(mmssend_OBJECTS) $(mmssend_LDADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsfromemail.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsglobalsender.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsmobilesender.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsproxy.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmssend.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) '$<'`
|
||||
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 mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
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
|
||||
|
||||
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 ctags distclean distclean-compile \
|
||||
distclean-generic 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 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:
|
|
@ -0,0 +1,87 @@
|
|||
/*
|
||||
* Mbuni - Open Source MMS Gateway
|
||||
*
|
||||
* Mbuni sample billing handler module
|
||||
*
|
||||
* Copyright (C) 2003 - 2008, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
*
|
||||
* Paul Bagyenda <bagyenda@dsmagic.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License, with a few exceptions granted (see LICENSE)
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "mms_billing.h"
|
||||
|
||||
/* This module provides a basic biller and CDR implementation. Totally no frills, but a basis
|
||||
* for implementing a 'real' module.
|
||||
* It does CDR but no billing (of course).
|
||||
*/
|
||||
|
||||
|
||||
static void *mms_billingmodule_init(char *settings)
|
||||
{
|
||||
return fopen(settings, "a"); /* Settings is interpreted as a file name. */
|
||||
}
|
||||
|
||||
|
||||
static int mms_billingmodule_fini(void *module_data)
|
||||
{
|
||||
return module_data ? fclose(module_data) : -1;
|
||||
}
|
||||
|
||||
static int mms_billmsg(Octstr *from, List *to, unsigned long msg_size, Octstr *vaspid, Octstr *msgid, void *module_data)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mms_logcdr(MmsCdrStruct *cdr)
|
||||
{
|
||||
if (cdr && cdr->module_data) {
|
||||
char buf[CBUFSIZE];
|
||||
struct tm tm;
|
||||
|
||||
localtime_r(&cdr->sdate, &tm);
|
||||
gw_strftime(buf, sizeof buf, "%Y-%m-%d %H:%M:%S", &tm);
|
||||
fprintf(cdr->module_data, "%s\t%.128s\t%.128s\t%.128s\t%.256s\t%.256s\t%ld\n",
|
||||
buf,
|
||||
cdr->src_interface[0] ? cdr->src_interface : "MM2",
|
||||
cdr->dst_interface[0] ? cdr->dst_interface : "MM2",
|
||||
cdr->from, cdr->to, cdr->msgid, cdr->msg_size);
|
||||
fflush(cdr->module_data);
|
||||
} else
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
MmsCdrStruct *make_cdr_struct(void *module_data, time_t sdate, char *from, char *to, char *msgid,
|
||||
char *vaspid, char *src_int, char *dst_int, unsigned long msg_size)
|
||||
{
|
||||
|
||||
MmsCdrStruct *cdr = gw_malloc(sizeof *cdr);
|
||||
|
||||
cdr->module_data = module_data;
|
||||
cdr->sdate = sdate;
|
||||
strncpy(cdr->from, from ? from : "", sizeof cdr->from);
|
||||
strncpy(cdr->to, to ? to : "", sizeof cdr->to);
|
||||
strncpy(cdr->msgid, msgid ? msgid : "", sizeof cdr->msgid);
|
||||
strncpy(cdr->vaspid, vaspid ? vaspid : "", sizeof cdr->vaspid);
|
||||
strncpy(cdr->src_interface, src_int ? src_int : "MM2", sizeof cdr->src_interface);
|
||||
strncpy(cdr->dst_interface, dst_int ? dst_int : "MM2", sizeof cdr->dst_interface);
|
||||
|
||||
cdr->msg_size = msg_size;
|
||||
|
||||
return cdr;
|
||||
}
|
||||
|
||||
/* The function itself. */
|
||||
MmsBillingFuncStruct mms_billfuncs = {
|
||||
mms_billingmodule_init,
|
||||
mms_logcdr,
|
||||
mms_billmsg,
|
||||
mms_billingmodule_fini
|
||||
};
|
|
@ -1,6 +1,20 @@
|
|||
/*
|
||||
* Mbuni - Open Source MMS Gateway
|
||||
*
|
||||
* Mbuni billing integration interface
|
||||
*
|
||||
* Copyright (C) 2003 - 2008, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
*
|
||||
* Paul Bagyenda <bagyenda@dsmagic.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License, with a few exceptions granted (see LICENSE)
|
||||
*/
|
||||
|
||||
#ifndef __MMS_BILLING_INCLUDED__
|
||||
#define __MMS_BILLING_INCLUDED__
|
||||
|
||||
|
||||
#include <time.h>
|
||||
#include "gwlib/gwlib.h"
|
||||
|
||||
|
@ -16,6 +30,9 @@ typedef struct MmsCdrStruct {
|
|||
char from[CBUFSIZE];
|
||||
char to[CBUFSIZE];
|
||||
char msgid[CBUFSIZE];
|
||||
char vaspid[CBUFSIZE];
|
||||
char src_interface[CBUFSIZE];
|
||||
char dst_interface[CBUFSIZE];
|
||||
unsigned long msg_size;
|
||||
} MmsCdrStruct;
|
||||
|
||||
|
@ -32,11 +49,14 @@ typedef struct MmsBillingFuncStruct {
|
|||
/* Bills a message. Returns >= 0 if billed ok, -1 if message should be rejected,
|
||||
* -2 on internal (temporary) error.
|
||||
*/
|
||||
double (*mms_billmsg)(Octstr *from, List *to, unsigned long msg_size, void *module_data);
|
||||
int (*mms_billmsg)(Octstr *from, List *to, unsigned long msg_size, Octstr *vaspid, Octstr *msgid, void *module_data);
|
||||
|
||||
int (*mms_billingmodule_fini)(void *module_data);
|
||||
} MmsBillingFuncStruct;
|
||||
|
||||
extern MmsBillingFuncStruct mms_billfuncs; /* The module must expose this symbol. */
|
||||
|
||||
/* utility function. */
|
||||
MmsCdrStruct *make_cdr_struct(void *module_data, time_t sdate, char *from, char *to, char *msgid,
|
||||
char *vaspid, char *src_int, char *dst_int, unsigned long msg_size);
|
||||
#endif
|
|
@ -0,0 +1,76 @@
|
|||
/*
|
||||
* Mbuni - Open Source MMS Gateway
|
||||
*
|
||||
* Mbuni sample billing handler module
|
||||
*
|
||||
* Copyright (C) 2003 - 2005, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
*
|
||||
* Paul Bagyenda <bagyenda@dsmagic.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License, with a few exceptions granted (see LICENSE)
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#ifndef DARWIN
|
||||
#ifndef FREEBSD
|
||||
#include <wait.h>
|
||||
#endif
|
||||
#endif
|
||||
#include <sys/wait.h>
|
||||
|
||||
|
||||
#include "mms_billing.h"
|
||||
|
||||
static Octstr *script = NULL;
|
||||
|
||||
static void *mms_billingmodule_init(char *settings)
|
||||
{
|
||||
script = octstr_create(settings);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
static int mms_billingmodule_fini(void *module_data)
|
||||
{
|
||||
if (script) {
|
||||
octstr_destroy(script);
|
||||
script = NULL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mms_billmsg(Octstr *from, List *to, unsigned long msg_size, Octstr *vaspid, Octstr *msgid, void *module_data)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (script == NULL || octstr_len(script) == 0)
|
||||
return 0;
|
||||
for (i=0;i<gwlist_len(to);i++) {
|
||||
Octstr *s;
|
||||
s = octstr_format("%s '%s' '%s' '%S'", octstr_get_cstr(script), octstr_get_cstr(from),
|
||||
octstr_get_cstr(gwlist_get(to, i)), msgid);
|
||||
if (s) {
|
||||
int ret = system(octstr_get_cstr(s));
|
||||
octstr_destroy(s);
|
||||
if (ret < 0)
|
||||
return -2;
|
||||
else if (WEXITSTATUS(ret) != 0)
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mms_logcdr(MmsCdrStruct *cdr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* The function itself. */
|
||||
MmsBillingFuncStruct mms_billfuncs_shell = {
|
||||
mms_billingmodule_init,
|
||||
mms_logcdr,
|
||||
mms_billmsg,
|
||||
mms_billingmodule_fini
|
||||
};
|
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* Mbuni - Open Source MMS Gateway
|
||||
*
|
||||
* Mbuni billing integration interface (shell)
|
||||
*
|
||||
* Copyright (C) 2003 - 2008, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
*
|
||||
* Paul Bagyenda <bagyenda@dsmagic.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License, with a few exceptions granted (see LICENSE)
|
||||
*/
|
||||
|
||||
#ifndef __MMS_BILLING_SHELL_INCLUDED__
|
||||
#define __MMS_BILLING_SHELL_INCLUDED__
|
||||
|
||||
|
||||
#include <time.h>
|
||||
#include "gwlib/gwlib.h"
|
||||
#include "mms_billing.h"
|
||||
|
||||
extern MmsBillingFuncStruct mms_billfuncs_shell;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* Mbuni - Open Source MMS Gateway
|
||||
*
|
||||
* Mbuni MSISDN mapper sample
|
||||
*
|
||||
* Copyright (C) 2003 - 2008, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
*
|
||||
* Paul Bagyenda <bagyenda@dsmagic.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License, with a few exceptions granted (see LICENSE)
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "mms_detokenize.h"
|
||||
#include "mms_util.h"
|
||||
|
||||
static int mms_detokenizer_init(char *settings)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mms_detokenizer_fini(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static Octstr *mms_detokenize(Octstr * token, Octstr *request_ip)
|
||||
{
|
||||
/* Return the MSISDN matching the token as a new Octstr */
|
||||
return octstr_create("+45xxxxxx");
|
||||
}
|
||||
|
||||
static Octstr *mms_gettoken(Octstr *msisdn)
|
||||
{
|
||||
/* Return the MSISDN matching the token as a new Octstr */
|
||||
return octstr_create("yy");
|
||||
}
|
||||
|
||||
/* The function itself. */
|
||||
MmsDetokenizerFuncStruct mms_detokenizefuncs = {
|
||||
mms_detokenizer_init,
|
||||
mms_detokenize,
|
||||
mms_gettoken,
|
||||
mms_detokenizer_fini
|
||||
};
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue