diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-08-21 02:11:39 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-08-21 02:11:39 +0000 |
commit | 8b0c007ad990aa27d9868da49215fd1076ac77cc (patch) | |
tree | 270b9c46c1e644483d6d2a35b509f43218ba3252 | |
parent | a42edc84034f91932a3e12d503e07f76a6eb498a (diff) |
merge new_loader_completion branch, including (at least):
- restructured build tree and makefiles to eliminate recursion problems
- support for embedded modules
- support for static builds
- simpler cross-compilation support
- simpler module/loader interface (no exported symbols)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@40722 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | .cleancount | 2 | ||||
-rw-r--r-- | Makefile | 390 | ||||
-rw-r--r-- | Makefile.moddir_rules | 75 | ||||
-rw-r--r-- | Makefile.rules | 23 | ||||
-rw-r--r-- | acinclude.m4 | 13 | ||||
-rw-r--r-- | apps/Makefile | 21 | ||||
-rw-r--r-- | apps/app_adsiprog.c | 25 | ||||
-rw-r--r-- | apps/app_alarmreceiver.c | 31 | ||||
-rw-r--r-- | apps/app_amd.c | 31 | ||||
-rw-r--r-- | apps/app_authenticate.c | 26 | ||||
-rw-r--r-- | apps/app_cdr.c | 25 | ||||
-rw-r--r-- | apps/app_chanisavail.c | 30 | ||||
-rw-r--r-- | apps/app_channelredirect.c | 26 | ||||
-rw-r--r-- | apps/app_chanspy.c | 37 | ||||
-rw-r--r-- | apps/app_controlplayback.c | 25 | ||||
-rw-r--r-- | apps/app_db.c | 34 | ||||
-rw-r--r-- | apps/app_dial.c | 31 | ||||
-rw-r--r-- | apps/app_dictate.c | 26 | ||||
-rw-r--r-- | apps/app_directed_pickup.c | 24 | ||||
-rw-r--r-- | apps/app_directory.c | 26 | ||||
-rw-r--r-- | apps/app_disa.c | 37 | ||||
-rw-r--r-- | apps/app_dumpchan.c | 25 | ||||
-rw-r--r-- | apps/app_echo.c | 27 | ||||
-rw-r--r-- | apps/app_exec.c | 46 | ||||
-rw-r--r-- | apps/app_externalivr.c | 27 | ||||
-rw-r--r-- | apps/app_festival.c | 36 | ||||
-rw-r--r-- | apps/app_flash.c | 25 | ||||
-rw-r--r-- | apps/app_followme.c | 47 | ||||
-rw-r--r-- | apps/app_forkcdr.c | 25 | ||||
-rw-r--r-- | apps/app_getcpeid.c | 25 | ||||
-rw-r--r-- | apps/app_hasnewvoicemail.c | 31 | ||||
-rw-r--r-- | apps/app_ices.c | 31 | ||||
-rw-r--r-- | apps/app_image.c | 29 | ||||
-rw-r--r-- | apps/app_ivrdemo.c | 26 | ||||
-rw-r--r-- | apps/app_lookupblacklist.c | 27 | ||||
-rw-r--r-- | apps/app_lookupcidname.c | 49 | ||||
-rw-r--r-- | apps/app_macro.c | 45 | ||||
-rw-r--r-- | apps/app_meetme.c | 63 | ||||
-rw-r--r-- | apps/app_milliwatt.c | 27 | ||||
-rw-r--r-- | apps/app_mixmonitor.c | 34 | ||||
-rw-r--r-- | apps/app_morsecode.c | 29 | ||||
-rw-r--r-- | apps/app_mp3.c | 31 | ||||
-rw-r--r-- | apps/app_nbscat.c | 31 | ||||
-rw-r--r-- | apps/app_osplookup.c | 93 | ||||
-rw-r--r-- | apps/app_page.c | 27 | ||||
-rw-r--r-- | apps/app_parkandannounce.c | 39 | ||||
-rw-r--r-- | apps/app_playback.c | 35 | ||||
-rw-r--r-- | apps/app_privacy.c | 36 | ||||
-rw-r--r-- | apps/app_queue.c | 97 | ||||
-rw-r--r-- | apps/app_random.c | 27 | ||||
-rw-r--r-- | apps/app_read.c | 31 | ||||
-rw-r--r-- | apps/app_readfile.c | 29 | ||||
-rw-r--r-- | apps/app_realtime.c | 32 | ||||
-rw-r--r-- | apps/app_record.c | 33 | ||||
-rw-r--r-- | apps/app_rpt.c | 76 | ||||
-rw-r--r-- | apps/app_sayunixtime.c | 27 | ||||
-rw-r--r-- | apps/app_senddtmf.c | 27 | ||||
-rw-r--r-- | apps/app_sendtext.c | 29 | ||||
-rw-r--r-- | apps/app_setcallerid.c | 37 | ||||
-rw-r--r-- | apps/app_setcdruserfield.c | 33 | ||||
-rw-r--r-- | apps/app_settransfercapability.c | 27 | ||||
-rw-r--r-- | apps/app_skel.c | 24 | ||||
-rw-r--r-- | apps/app_sms.c | 39 | ||||
-rw-r--r-- | apps/app_softhangup.c | 27 | ||||
-rw-r--r-- | apps/app_speech_utils.c | 104 | ||||
-rw-r--r-- | apps/app_stack.c | 33 | ||||
-rw-r--r-- | apps/app_system.c | 27 | ||||
-rw-r--r-- | apps/app_talkdetect.c | 27 | ||||
-rw-r--r-- | apps/app_test.c | 34 | ||||
-rw-r--r-- | apps/app_transfer.c | 31 | ||||
-rw-r--r-- | apps/app_url.c | 31 | ||||
-rw-r--r-- | apps/app_userevent.c | 28 | ||||
-rw-r--r-- | apps/app_verbose.c | 36 | ||||
-rw-r--r-- | apps/app_voicemail.c | 70 | ||||
-rw-r--r-- | apps/app_waitforring.c | 27 | ||||
-rw-r--r-- | apps/app_waitforsilence.c | 26 | ||||
-rw-r--r-- | apps/app_while.c | 28 | ||||
-rw-r--r-- | apps/app_zapateller.c | 29 | ||||
-rw-r--r-- | apps/app_zapbarge.c | 30 | ||||
-rw-r--r-- | apps/app_zapras.c | 27 | ||||
-rw-r--r-- | apps/app_zapscan.c | 27 | ||||
-rw-r--r-- | build_tools/cflags.xml | 5 | ||||
-rw-r--r-- | build_tools/embed_modules.xml | 18 | ||||
-rw-r--r-- | build_tools/menuselect-deps.in | 3 | ||||
-rwxr-xr-x | build_tools/prep_moduledeps | 35 | ||||
-rw-r--r-- | cdr/Makefile | 9 | ||||
-rw-r--r-- | cdr/cdr_csv.c | 27 | ||||
-rw-r--r-- | cdr/cdr_custom.c | 26 | ||||
-rw-r--r-- | cdr/cdr_manager.c | 25 | ||||
-rw-r--r-- | cdr/cdr_odbc.c | 25 | ||||
-rw-r--r-- | cdr/cdr_pgsql.c | 25 | ||||
-rw-r--r-- | cdr/cdr_radius.c | 16 | ||||
-rw-r--r-- | cdr/cdr_sqlite.c | 25 | ||||
-rw-r--r-- | cdr/cdr_tds.c | 25 | ||||
-rw-r--r-- | channels/Makefile | 34 | ||||
-rw-r--r-- | channels/chan_agent.c | 56 | ||||
-rw-r--r-- | channels/chan_alsa.c | 17 | ||||
-rw-r--r-- | channels/chan_features.c | 16 | ||||
-rw-r--r-- | channels/chan_h323.c | 17 | ||||
-rw-r--r-- | channels/chan_iax2.c | 24 | ||||
-rw-r--r-- | channels/chan_jingle.c | 25 | ||||
-rw-r--r-- | channels/chan_local.c | 32 | ||||
-rw-r--r-- | channels/chan_mgcp.c | 31 | ||||
-rw-r--r-- | channels/chan_misdn.c | 33 | ||||
-rw-r--r-- | channels/chan_nbs.c | 35 | ||||
-rw-r--r-- | channels/chan_oss.c | 18 | ||||
-rw-r--r-- | channels/chan_phone.c | 19 | ||||
-rw-r--r-- | channels/chan_sip.c | 23 | ||||
-rw-r--r-- | channels/chan_skinny.c | 23 | ||||
-rw-r--r-- | channels/chan_zap.c | 24 | ||||
-rw-r--r-- | channels/h323/Makefile | 1 | ||||
-rw-r--r-- | channels/misdn/Makefile | 25 | ||||
-rw-r--r-- | channels/misdn/ie.c | 96 | ||||
-rw-r--r-- | channels/misdn/isdn_lib.c | 104 | ||||
-rw-r--r-- | channels/misdn/isdn_lib.h | 1 | ||||
-rw-r--r-- | channels/misdn/isdn_lib_intern.h | 8 | ||||
-rw-r--r-- | channels/misdn/isdn_msg_parser.c | 147 | ||||
-rw-r--r-- | codecs/Makefile | 29 | ||||
-rw-r--r-- | codecs/codec_a_mu.c | 24 | ||||
-rw-r--r-- | codecs/codec_adpcm.c | 30 | ||||
-rw-r--r-- | codecs/codec_alaw.c | 30 | ||||
-rw-r--r-- | codecs/codec_g726.c | 37 | ||||
-rw-r--r-- | codecs/codec_gsm.c | 30 | ||||
-rw-r--r-- | codecs/codec_ilbc.c | 26 | ||||
-rw-r--r-- | codecs/codec_lpc10.c | 31 | ||||
-rw-r--r-- | codecs/codec_speex.c | 40 | ||||
-rw-r--r-- | codecs/codec_ulaw.c | 35 | ||||
-rw-r--r-- | codecs/codec_zap.c | 38 | ||||
-rw-r--r-- | codecs/gsm/Makefile | 6 | ||||
-rwxr-xr-x | configure | 3518 | ||||
-rw-r--r-- | configure.ac | 167 | ||||
-rw-r--r-- | cygwin/Makefile | 9 | ||||
-rw-r--r-- | cygwin/cygloader.c | 33 | ||||
-rw-r--r-- | doc/asterisk.8 (renamed from asterisk.8) | 0 | ||||
-rw-r--r-- | doc/asterisk.sgml (renamed from asterisk.sgml) | 0 | ||||
-rw-r--r-- | formats/Makefile | 9 | ||||
-rw-r--r-- | formats/format_g723.c | 17 | ||||
-rw-r--r-- | formats/format_g726.c | 23 | ||||
-rw-r--r-- | formats/format_g729.c | 17 | ||||
-rw-r--r-- | formats/format_gsm.c | 17 | ||||
-rw-r--r-- | formats/format_h263.c | 17 | ||||
-rw-r--r-- | formats/format_h264.c | 17 | ||||
-rw-r--r-- | formats/format_ilbc.c | 17 | ||||
-rw-r--r-- | formats/format_jpeg.c | 20 | ||||
-rw-r--r-- | formats/format_ogg_vorbis.c | 21 | ||||
-rw-r--r-- | formats/format_pcm.c | 19 | ||||
-rw-r--r-- | formats/format_sln.c | 17 | ||||
-rw-r--r-- | formats/format_vox.c | 17 | ||||
-rw-r--r-- | formats/format_wav.c | 17 | ||||
-rw-r--r-- | formats/format_wav_gsm.c | 17 | ||||
-rw-r--r-- | funcs/Makefile | 9 | ||||
-rw-r--r-- | funcs/func_base64.c | 18 | ||||
-rw-r--r-- | funcs/func_callerid.c | 18 | ||||
-rw-r--r-- | funcs/func_cdr.c | 19 | ||||
-rw-r--r-- | funcs/func_channel.c | 18 | ||||
-rw-r--r-- | funcs/func_curl.c | 28 | ||||
-rw-r--r-- | funcs/func_cut.c | 35 | ||||
-rw-r--r-- | funcs/func_db.c | 19 | ||||
-rw-r--r-- | funcs/func_enum.c | 35 | ||||
-rw-r--r-- | funcs/func_env.c | 20 | ||||
-rw-r--r-- | funcs/func_global.c | 19 | ||||
-rw-r--r-- | funcs/func_groupcount.c | 18 | ||||
-rw-r--r-- | funcs/func_language.c | 19 | ||||
-rw-r--r-- | funcs/func_logic.c | 19 | ||||
-rw-r--r-- | funcs/func_math.c | 19 | ||||
-rw-r--r-- | funcs/func_md5.c | 19 | ||||
-rw-r--r-- | funcs/func_moh.c | 19 | ||||
-rw-r--r-- | funcs/func_odbc.c | 24 | ||||
-rw-r--r-- | funcs/func_rand.c | 28 | ||||
-rw-r--r-- | funcs/func_realtime.c | 45 | ||||
-rw-r--r-- | funcs/func_sha1.c | 19 | ||||
-rw-r--r-- | funcs/func_strings.c | 19 | ||||
-rw-r--r-- | funcs/func_timeout.c | 18 | ||||
-rw-r--r-- | funcs/func_uri.c | 17 | ||||
-rw-r--r-- | include/asterisk.h | 8 | ||||
-rw-r--r-- | include/asterisk/abstract_jb.h | 1 | ||||
-rw-r--r-- | include/asterisk/autoconfig.h.in | 81 | ||||
-rw-r--r-- | include/asterisk/cdr.h | 6 | ||||
-rw-r--r-- | include/asterisk/compiler.h | 28 | ||||
-rw-r--r-- | include/asterisk/dns.h | 2 | ||||
-rw-r--r-- | include/asterisk/file.h | 9 | ||||
-rw-r--r-- | include/asterisk/indications.h | 3 | ||||
-rw-r--r-- | include/asterisk/linkedlists.h | 15 | ||||
-rw-r--r-- | include/asterisk/lock.h | 2 | ||||
-rw-r--r-- | include/asterisk/module.h | 309 | ||||
-rw-r--r-- | include/asterisk/monitor.h | 2 | ||||
-rw-r--r-- | include/asterisk/srv.h | 2 | ||||
-rw-r--r-- | include/asterisk/translate.h | 13 | ||||
-rw-r--r-- | include/asterisk/utils.h | 10 | ||||
-rw-r--r-- | loader.c | 1015 | ||||
-rw-r--r-- | main/Makefile | 138 | ||||
-rw-r--r-- | main/abstract_jb.c (renamed from abstract_jb.c) | 0 | ||||
-rw-r--r-- | main/acl.c (renamed from acl.c) | 0 | ||||
-rw-r--r-- | main/aescrypt.c (renamed from aescrypt.c) | 0 | ||||
-rw-r--r-- | main/aeskey.c (renamed from aeskey.c) | 0 | ||||
-rw-r--r-- | main/aesopt.h (renamed from aesopt.h) | 0 | ||||
-rw-r--r-- | main/aestab.c (renamed from aestab.c) | 0 | ||||
-rw-r--r-- | main/alaw.c (renamed from alaw.c) | 0 | ||||
-rw-r--r-- | main/app.c (renamed from app.c) | 0 | ||||
-rw-r--r-- | main/ast_expr2.c (renamed from ast_expr2.c) | 2 | ||||
-rw-r--r-- | main/ast_expr2.fl (renamed from ast_expr2.fl) | 0 | ||||
-rw-r--r-- | main/ast_expr2.h (renamed from ast_expr2.h) | 0 | ||||
-rw-r--r-- | main/ast_expr2.y (renamed from ast_expr2.y) | 0 | ||||
-rw-r--r-- | main/ast_expr2f.c (renamed from ast_expr2f.c) | 6 | ||||
-rw-r--r-- | main/asterisk.c (renamed from asterisk.c) | 39 | ||||
-rw-r--r-- | main/astmm.c (renamed from astmm.c) | 0 | ||||
-rw-r--r-- | main/autoservice.c (renamed from autoservice.c) | 0 | ||||
-rw-r--r-- | main/buildinfo.c (renamed from buildinfo.c) | 0 | ||||
-rw-r--r-- | main/callerid.c (renamed from callerid.c) | 0 | ||||
-rw-r--r-- | main/cdr.c (renamed from cdr.c) | 4 | ||||
-rw-r--r-- | main/channel.c (renamed from channel.c) | 0 | ||||
-rw-r--r-- | main/chanvars.c (renamed from chanvars.c) | 0 | ||||
-rw-r--r-- | main/cli.c (renamed from cli.c) | 10 | ||||
-rw-r--r-- | main/coef_in.h (renamed from coef_in.h) | 0 | ||||
-rw-r--r-- | main/coef_out.h (renamed from coef_out.h) | 0 | ||||
-rw-r--r-- | main/config.c (renamed from config.c) | 0 | ||||
-rw-r--r-- | main/cryptostub.c (renamed from cryptostub.c) | 0 | ||||
-rw-r--r-- | main/db.c (renamed from db.c) | 0 | ||||
-rw-r--r-- | main/db1-ast/Makefile (renamed from db1-ast/Makefile) | 2 | ||||
-rw-r--r-- | main/db1-ast/btree/bt_close.c (renamed from db1-ast/btree/bt_close.c) | 0 | ||||
-rw-r--r-- | main/db1-ast/btree/bt_conv.c (renamed from db1-ast/btree/bt_conv.c) | 0 | ||||
-rw-r--r-- | main/db1-ast/btree/bt_debug.c (renamed from db1-ast/btree/bt_debug.c) | 0 | ||||
-rw-r--r-- | main/db1-ast/btree/bt_delete.c (renamed from db1-ast/btree/bt_delete.c) | 0 | ||||
-rw-r--r-- | main/db1-ast/btree/bt_get.c (renamed from db1-ast/btree/bt_get.c) | 0 | ||||
-rw-r--r-- | main/db1-ast/btree/bt_open.c (renamed from db1-ast/btree/bt_open.c) | 0 | ||||
-rw-r--r-- | main/db1-ast/btree/bt_overflow.c (renamed from db1-ast/btree/bt_overflow.c) | 0 | ||||
-rw-r--r-- | main/db1-ast/btree/bt_page.c (renamed from db1-ast/btree/bt_page.c) | 0 | ||||
-rw-r--r-- | main/db1-ast/btree/bt_put.c (renamed from db1-ast/btree/bt_put.c) | 0 | ||||
-rw-r--r-- | main/db1-ast/btree/bt_search.c (renamed from db1-ast/btree/bt_search.c) | 0 | ||||
-rw-r--r-- | main/db1-ast/btree/bt_seq.c (renamed from db1-ast/btree/bt_seq.c) | 0 | ||||
-rw-r--r-- | main/db1-ast/btree/bt_split.c (renamed from db1-ast/btree/bt_split.c) | 0 | ||||
-rw-r--r-- | main/db1-ast/btree/bt_utils.c (renamed from db1-ast/btree/bt_utils.c) | 0 | ||||
-rw-r--r-- | main/db1-ast/btree/btree.h (renamed from db1-ast/btree/btree.h) | 0 | ||||
-rw-r--r-- | main/db1-ast/btree/extern.h (renamed from db1-ast/btree/extern.h) | 0 | ||||
-rw-r--r-- | main/db1-ast/db/db.c (renamed from db1-ast/db/db.c) | 10 | ||||
-rw-r--r-- | main/db1-ast/hash/README (renamed from db1-ast/hash/README) | 0 | ||||
-rw-r--r-- | main/db1-ast/hash/extern.h (renamed from db1-ast/hash/extern.h) | 0 | ||||
-rw-r--r-- | main/db1-ast/hash/hash.c (renamed from db1-ast/hash/hash.c) | 0 | ||||
-rw-r--r-- | main/db1-ast/hash/hash.h (renamed from db1-ast/hash/hash.h) | 0 | ||||
-rw-r--r-- | main/db1-ast/hash/hash_bigkey.c (renamed from db1-ast/hash/hash_bigkey.c) | 0 | ||||
-rw-r--r-- | main/db1-ast/hash/hash_buf.c (renamed from db1-ast/hash/hash_buf.c) | 0 | ||||
-rw-r--r-- | main/db1-ast/hash/hash_func.c (renamed from db1-ast/hash/hash_func.c) | 0 | ||||
-rw-r--r-- | main/db1-ast/hash/hash_log2.c (renamed from db1-ast/hash/hash_log2.c) | 0 | ||||
-rw-r--r-- | main/db1-ast/hash/hash_page.c (renamed from db1-ast/hash/hash_page.c) | 0 | ||||
-rw-r--r-- | main/db1-ast/hash/hsearch.c (renamed from db1-ast/hash/hsearch.c) | 0 | ||||
-rw-r--r-- | main/db1-ast/hash/ndbm.c (renamed from db1-ast/hash/ndbm.c) | 0 | ||||
-rw-r--r-- | main/db1-ast/hash/page.h (renamed from db1-ast/hash/page.h) | 0 | ||||
-rw-r--r-- | main/db1-ast/hash/search.h (renamed from db1-ast/hash/search.h) | 0 | ||||
-rw-r--r-- | main/db1-ast/include/circ-queue.h (renamed from db1-ast/include/circ-queue.h) | 0 | ||||
-rw-r--r-- | main/db1-ast/include/compat.h (renamed from db1-ast/include/compat.h) | 0 | ||||
-rw-r--r-- | main/db1-ast/include/db.h (renamed from db1-ast/include/db.h) | 0 | ||||
-rw-r--r-- | main/db1-ast/include/mpool.h (renamed from db1-ast/include/mpool.h) | 0 | ||||
-rw-r--r-- | main/db1-ast/include/ndbm.h (renamed from db1-ast/include/ndbm.h) | 0 | ||||
-rw-r--r-- | main/db1-ast/libdb.map (renamed from db1-ast/libdb.map) | 0 | ||||
-rw-r--r-- | main/db1-ast/mpool/README (renamed from db1-ast/mpool/README) | 0 | ||||
-rw-r--r-- | main/db1-ast/mpool/mpool.c (renamed from db1-ast/mpool/mpool.c) | 0 | ||||
-rw-r--r-- | main/db1-ast/recno/extern.h (renamed from db1-ast/recno/extern.h) | 0 | ||||
-rw-r--r-- | main/db1-ast/recno/rec_close.c (renamed from db1-ast/recno/rec_close.c) | 0 | ||||
-rw-r--r-- | main/db1-ast/recno/rec_delete.c (renamed from db1-ast/recno/rec_delete.c) | 0 | ||||
-rw-r--r-- | main/db1-ast/recno/rec_get.c (renamed from db1-ast/recno/rec_get.c) | 0 | ||||
-rw-r--r-- | main/db1-ast/recno/rec_open.c (renamed from db1-ast/recno/rec_open.c) | 0 | ||||
-rw-r--r-- | main/db1-ast/recno/rec_put.c (renamed from db1-ast/recno/rec_put.c) | 0 | ||||
-rw-r--r-- | main/db1-ast/recno/rec_search.c (renamed from db1-ast/recno/rec_search.c) | 0 | ||||
-rw-r--r-- | main/db1-ast/recno/rec_seq.c (renamed from db1-ast/recno/rec_seq.c) | 0 | ||||
-rw-r--r-- | main/db1-ast/recno/rec_utils.c (renamed from db1-ast/recno/rec_utils.c) | 0 | ||||
-rw-r--r-- | main/db1-ast/recno/recno.h (renamed from db1-ast/recno/recno.h) | 0 | ||||
-rw-r--r-- | main/devicestate.c (renamed from devicestate.c) | 0 | ||||
-rw-r--r-- | main/dlfcn.c (renamed from dlfcn.c) | 0 | ||||
-rw-r--r-- | main/dns.c (renamed from dns.c) | 17 | ||||
-rw-r--r-- | main/dnsmgr.c (renamed from dnsmgr.c) | 0 | ||||
-rw-r--r-- | main/dsp.c (renamed from dsp.c) | 0 | ||||
-rw-r--r-- | main/ecdisa.h (renamed from ecdisa.h) | 0 | ||||
-rw-r--r-- | main/editline/CHANGES (renamed from editline/CHANGES) | 0 | ||||
-rw-r--r-- | main/editline/INSTALL (renamed from editline/INSTALL) | 0 | ||||
-rw-r--r-- | main/editline/Makefile.in (renamed from editline/Makefile.in) | 0 | ||||
-rw-r--r-- | main/editline/PLATFORMS (renamed from editline/PLATFORMS) | 0 | ||||
-rw-r--r-- | main/editline/README (renamed from editline/README) | 0 | ||||
-rw-r--r-- | main/editline/TEST/test.c (renamed from editline/TEST/test.c) | 0 | ||||
-rw-r--r-- | main/editline/chared.c (renamed from editline/chared.c) | 0 | ||||
-rw-r--r-- | main/editline/chared.h (renamed from editline/chared.h) | 0 | ||||
-rw-r--r-- | main/editline/common.c (renamed from editline/common.c) | 0 | ||||
-rwxr-xr-x | main/editline/config.guess (renamed from editline/config.guess) | 0 | ||||
-rw-r--r-- | main/editline/config.h.in (renamed from editline/config.h.in) | 0 | ||||
-rwxr-xr-x | main/editline/config.sub (renamed from editline/config.sub) | 0 | ||||
-rwxr-xr-x | main/editline/configure (renamed from editline/configure) | 0 | ||||
-rw-r--r-- | main/editline/configure.in (renamed from editline/configure.in) | 0 | ||||
-rw-r--r-- | main/editline/editline.3 (renamed from editline/editline.3) | 0 | ||||
-rw-r--r-- | main/editline/editrc.5 (renamed from editline/editrc.5) | 0 | ||||
-rw-r--r-- | main/editline/el.c (renamed from editline/el.c) | 0 | ||||
-rw-r--r-- | main/editline/el.h (renamed from editline/el.h) | 0 | ||||
-rw-r--r-- | main/editline/emacs.c (renamed from editline/emacs.c) | 0 | ||||
-rw-r--r-- | main/editline/hist.c (renamed from editline/hist.c) | 0 | ||||
-rw-r--r-- | main/editline/hist.h (renamed from editline/hist.h) | 0 | ||||
-rw-r--r-- | main/editline/histedit.h (renamed from editline/histedit.h) | 0 | ||||
-rw-r--r-- | main/editline/history.c (renamed from editline/history.c) | 0 | ||||
-rwxr-xr-x | main/editline/install-sh (renamed from editline/install-sh) | 0 | ||||
-rw-r--r-- | main/editline/key.c (renamed from editline/key.c) | 0 | ||||
-rw-r--r-- | main/editline/key.h (renamed from editline/key.h) | 0 | ||||
-rw-r--r-- | main/editline/makelist (renamed from editline/makelist) | 0 | ||||
-rw-r--r-- | main/editline/map.c (renamed from editline/map.c) | 0 | ||||
-rw-r--r-- | main/editline/map.h (renamed from editline/map.h) | 0 | ||||
-rw-r--r-- | main/editline/np/fgetln.c (renamed from editline/np/fgetln.c) | 0 | ||||
-rw-r--r-- | main/editline/np/strlcat.c (renamed from editline/np/strlcat.c) | 0 | ||||
-rw-r--r-- | main/editline/np/strlcpy.c (renamed from editline/np/strlcpy.c) | 0 | ||||
-rw-r--r-- | main/editline/np/unvis.c (renamed from editline/np/unvis.c) | 0 | ||||
-rw-r--r-- | main/editline/np/vis.c (renamed from editline/np/vis.c) | 0 | ||||
-rw-r--r-- | main/editline/np/vis.h (renamed from editline/np/vis.h) | 0 | ||||
-rw-r--r-- | main/editline/parse.c (renamed from editline/parse.c) | 0 | ||||
-rw-r--r-- | main/editline/parse.h (renamed from editline/parse.h) | 0 | ||||
-rw-r--r-- | main/editline/prompt.c (renamed from editline/prompt.c) | 0 | ||||
-rw-r--r-- | main/editline/prompt.h (renamed from editline/prompt.h) | 0 | ||||
-rw-r--r-- | main/editline/read.c (renamed from editline/read.c) | 0 | ||||
-rw-r--r-- | main/editline/read.h (renamed from editline/read.h) | 0 | ||||
-rw-r--r-- | main/editline/readline.c (renamed from editline/readline.c) | 0 | ||||
-rw-r--r-- | main/editline/readline/readline.h (renamed from editline/readline/readline.h) | 0 | ||||
-rw-r--r-- | main/editline/refresh.c (renamed from editline/refresh.c) | 0 | ||||
-rw-r--r-- | main/editline/refresh.h (renamed from editline/refresh.h) | 0 | ||||
-rw-r--r-- | main/editline/search.c (renamed from editline/search.c) | 0 | ||||
-rw-r--r-- | main/editline/search.h (renamed from editline/search.h) | 0 | ||||
-rw-r--r-- | main/editline/sig.c (renamed from editline/sig.c) | 0 | ||||
-rw-r--r-- | main/editline/sig.h (renamed from editline/sig.h) | 0 | ||||
-rw-r--r-- | main/editline/sys.h (renamed from editline/sys.h) | 0 | ||||
-rw-r--r-- | main/editline/term.c (renamed from editline/term.c) | 0 | ||||
-rw-r--r-- | main/editline/term.h (renamed from editline/term.h) | 0 | ||||
-rw-r--r-- | main/editline/tokenizer.c (renamed from editline/tokenizer.c) | 0 | ||||
-rw-r--r-- | main/editline/tokenizer.h (renamed from editline/tokenizer.h) | 0 | ||||
-rw-r--r-- | main/editline/tty.c (renamed from editline/tty.c) | 0 | ||||
-rw-r--r-- | main/editline/tty.h (renamed from editline/tty.h) | 0 | ||||
-rw-r--r-- | main/editline/vi.c (renamed from editline/vi.c) | 0 | ||||
-rw-r--r-- | main/enum.c (renamed from enum.c) | 0 | ||||
-rw-r--r-- | main/file.c (renamed from file.c) | 18 | ||||
-rw-r--r-- | main/fixedjitterbuf.c (renamed from fixedjitterbuf.c) | 0 | ||||
-rw-r--r-- | main/fixedjitterbuf.h (renamed from fixedjitterbuf.h) | 0 | ||||
-rw-r--r-- | main/frame.c (renamed from frame.c) | 0 | ||||
-rw-r--r-- | main/fskmodem.c (renamed from fskmodem.c) | 0 | ||||
-rw-r--r-- | main/http.c (renamed from http.c) | 0 | ||||
-rw-r--r-- | main/image.c (renamed from image.c) | 0 | ||||
-rw-r--r-- | main/indications.c (renamed from indications.c) | 0 | ||||
-rw-r--r-- | main/io.c (renamed from io.c) | 0 | ||||
-rw-r--r-- | main/jitterbuf.c (renamed from jitterbuf.c) | 0 | ||||
-rw-r--r-- | main/jitterbuf.h (renamed from jitterbuf.h) | 0 | ||||
-rw-r--r-- | main/loader.c | 883 | ||||
-rw-r--r-- | main/logger.c (renamed from logger.c) | 0 | ||||
-rw-r--r-- | main/manager.c (renamed from manager.c) | 0 | ||||
-rw-r--r-- | main/md5.c (renamed from md5.c) | 0 | ||||
-rw-r--r-- | main/netsock.c (renamed from netsock.c) | 0 | ||||
-rw-r--r-- | main/pbx.c (renamed from pbx.c) | 0 | ||||
-rw-r--r-- | main/plc.c (renamed from plc.c) | 0 | ||||
-rw-r--r-- | main/poll.c (renamed from poll.c) | 0 | ||||
-rw-r--r-- | main/privacy.c (renamed from privacy.c) | 0 | ||||
-rw-r--r-- | main/rtp.c (renamed from rtp.c) | 0 | ||||
-rw-r--r-- | main/say.c (renamed from say.c) | 0 | ||||
-rw-r--r-- | main/sched.c (renamed from sched.c) | 0 | ||||
-rw-r--r-- | main/sha1.c (renamed from sha1.c) | 0 | ||||
-rw-r--r-- | main/slinfactory.c (renamed from slinfactory.c) | 0 | ||||
-rw-r--r-- | main/srv.c (renamed from srv.c) | 0 | ||||
-rw-r--r-- | main/stdtime/Makefile (renamed from stdtime/Makefile) | 0 | ||||
-rw-r--r-- | main/stdtime/localtime.c (renamed from stdtime/localtime.c) | 0 | ||||
-rw-r--r-- | main/stdtime/private.h (renamed from stdtime/private.h) | 0 | ||||
-rw-r--r-- | main/stdtime/test.c (renamed from stdtime/test.c) | 0 | ||||
-rw-r--r-- | main/stdtime/tzfile.h (renamed from stdtime/tzfile.h) | 0 | ||||
-rw-r--r-- | main/strcompat.c (renamed from strcompat.c) | 0 | ||||
-rw-r--r-- | main/tdd.c (renamed from tdd.c) | 0 | ||||
-rw-r--r-- | main/term.c (renamed from term.c) | 0 | ||||
-rw-r--r-- | main/translate.c (renamed from translate.c) | 19 | ||||
-rw-r--r-- | main/udptl.c (renamed from udptl.c) | 0 | ||||
-rw-r--r-- | main/ulaw.c (renamed from ulaw.c) | 0 | ||||
-rw-r--r-- | main/utils.c (renamed from utils.c) | 0 | ||||
-rw-r--r-- | makeopts.in | 28 | ||||
-rw-r--r-- | pbx/Makefile | 15 | ||||
-rw-r--r-- | pbx/pbx_ael.c | 37 | ||||
-rw-r--r-- | pbx/pbx_config.c | 23 | ||||
-rw-r--r-- | pbx/pbx_dundi.c | 33 | ||||
-rw-r--r-- | pbx/pbx_loopback.c | 19 | ||||
-rw-r--r-- | pbx/pbx_realtime.c | 18 | ||||
-rw-r--r-- | pbx/pbx_spool.c | 16 | ||||
-rw-r--r-- | res/Makefile | 11 | ||||
-rw-r--r-- | res/res_adsi.c | 22 | ||||
-rw-r--r-- | res/res_agi.c | 27 | ||||
-rw-r--r-- | res/res_clioriginate.c | 29 | ||||
-rw-r--r-- | res/res_config_odbc.c | 23 | ||||
-rw-r--r-- | res/res_config_pgsql.c | 28 | ||||
-rw-r--r-- | res/res_convert.c | 30 | ||||
-rw-r--r-- | res/res_crypto.c | 26 | ||||
-rw-r--r-- | res/res_features.c | 63 | ||||
-rw-r--r-- | res/res_indications.c | 22 | ||||
-rw-r--r-- | res/res_jabber.c | 24 | ||||
-rw-r--r-- | res/res_monitor.c | 20 | ||||
-rw-r--r-- | res/res_musiconhold.c | 23 | ||||
-rw-r--r-- | res/res_odbc.c | 24 | ||||
-rw-r--r-- | res/res_smdi.c | 28 | ||||
-rw-r--r-- | res/res_snmp.c | 22 | ||||
-rw-r--r-- | res/res_speech.c | 19 | ||||
-rw-r--r-- | sounds.txt | 718 | ||||
-rw-r--r-- | sounds/Makefile | 4 | ||||
-rw-r--r-- | utils/Makefile | 34 | ||||
-rw-r--r-- | utils/ael_main.c | 4 | ||||
-rw-r--r-- | utils/muted.c (renamed from muted.c) | 0 |
398 files changed, 5945 insertions, 7172 deletions
diff --git a/.cleancount b/.cleancount index aabe6ec39..2bd5a0a98 100644 --- a/.cleancount +++ b/.cleancount @@ -1 +1 @@ -21 +22 @@ -22,33 +22,16 @@ .EXPORT_ALL_VARIABLES: +include makeopts + #Uncomment this to see all build commands instead of 'quiet' output #NOISY_BUILD=yes # Create OPTIONS variable OPTIONS= -# If cross compiling, define these to suit -#CROSS_COMPILE=/opt/montavista/pro/devkit/arm/xscale_be/bin/xscale_be- -#CROSS_COMPILE_BIN=/opt/montavista/pro/devkit/arm/xscale_be/bin/ -#CROSS_COMPILE_TARGET=/opt/montavista/pro/devkit/arm/xscale_be/target -#CROSS_ARCH=Linux -#CROSS_PROC=arm -#SUB_PROC=xscale # or maverick - -ifeq ($(CROSS_COMPILE),) - OSARCH:=$(shell uname -s) - PROC?:=$(shell uname -m) -else - OSARCH=$(CROSS_ARCH) - PROC=$(CROSS_PROC) -endif - ASTTOPDIR:=$(shell pwd) -# Remember the MAKELEVEL at the top -MAKETOPLEVEL?=$(MAKELEVEL) - # Overwite config files on "make samples" OVERWRITE=y @@ -60,21 +43,8 @@ DEBUG=-g3 # For example, make DESTDIR=/tmp/asterisk woud put things in # /tmp/asterisk/etc/asterisk # !!! Watch out, put no spaces or comments after the value !!! -DESTDIR?= #DESTDIR?=/tmp/asterisk -# Original busydetect routine -#BUSYDETECT = -DBUSYDETECT - -# Improved busydetect routine, comment the previous one if you use this one -#BUSYDETECT+= -DBUSYDETECT_MARTIN -# Detect the busy signal looking only at tone lengths -# For example if you have 3 beeps 100ms tone, 100ms silence separated by 500 ms of silence -#BUSYDETECT+= -DBUSYDETECT_TONEONLY -# Enforce the detection of busy signal (get rid of false hangups) -# Don't use together with -DBUSYDETECT_TONEONLY -#BUSYDETECT+= -DBUSYDETECT_COMPARE_TONE_AND_SILENCE - # Define standard directories for various platforms # These apply if they are not redefined in asterisk.conf ifeq ($(OSARCH),SunOS) @@ -131,59 +101,10 @@ ASTCFLAGS= GLOBAL_MAKEOPTS=$(wildcard /etc/asterisk.makeopts) USER_MAKEOPTS=$(wildcard ~/.asterisk.makeopts) -ifeq ($(strip $(foreach var,clean distclean dist-clean update,$(findstring $(var),$(MAKECMDGOALS)))),) - ifneq ($(wildcard menuselect.makeopts),) - include menuselect.makeopts - include menuselect.makedeps - endif -endif - -ifeq ($(strip $(foreach var,clean distclean dist-clean update,$(findstring $(var),$(MAKECMDGOALS)))),) - ifneq ($(wildcard makeopts),) - include makeopts - endif -endif - -TOPDIR_CFLAGS=-Iinclude -MOD_SUBDIR_CFLAGS=-I../include -I.. -OTHER_SUBDIR_CFLAGS=-I../include -I.. - -ifeq ($(origin MENUSELECT_CFLAGS),undefined) - MENUSELECT_CFLAGS:=$(shell grep MENUSELECT_CFLAGS $(USER_MAKEOPTS) .) - ifeq ($(MENUSELECT_CFLAGS),) - MENUSELECT_CFLAGS:=$(shell grep MENUSELECT_CFLAGS $(GLOBAL_MAKEOPTS) .) - endif - ifneq ($(MENUSELECT_CFLAGS),) - MENUSELECT_CFLAGS:=$(shell echo $(MENUSELECT_CFLAGS) | cut -f2 -d'=') - endif -endif - -ifeq ($(findstring dont-optimize,$(MAKECMDGOALS)),$(findstring DONT_OPTIMIZE,$(MENUSELECT_CFLAGS))) -# More GSM codec optimization -# Uncomment to enable MMXTM optimizations for x86 architecture CPU's -# which support MMX instructions. This should be newer pentiums, -# ppro's, etc, as well as the AMD K6 and K7. -#K6OPT = -DK6OPT - -# Tell gcc to optimize the code -OPTIMIZE+=-O6 -else - # Stack backtraces, while useful for debugging, are incompatible with optimizations - ifeq ($(OSARCH),Linux) - CFLAGS+=-DSTACK_BACKTRACES - endif -endif - -# *CLI> show memory allocations [filename] -# *CLI> show memory summary [filename] -ifneq ($(findstring MALLOC_DEBUG,$(MENUSELECT_CFLAGS)),) - TOPDIR_CFLAGS+=-include include/asterisk/astmm.h - MOD_SUBDIR_CFLAGS+=-include ../include/asterisk/astmm.h -endif +MOD_SUBDIR_CFLAGS=-I../include -I../main +OTHER_SUBDIR_CFLAGS=-I../include -MOD_SUBDIR_CFLAGS+=-fPIC - -ifeq ($(OSARCH),Linux) +ifeq ($(OSARCH),linux-gnu) ifeq ($(PROC),x86_64) # You must have GCC 3.4 to use k8, otherwise use athlon PROC=k8 @@ -216,28 +137,21 @@ ifeq ($(OSARCH),Linux) endif endif -GREP=grep ID=id ifeq ($(OSARCH),SunOS) - GREP=/usr/xpg4/bin/grep M4=/usr/local/bin/m4 ID=/usr/xpg4/bin/id endif ASTCFLAGS+=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) -ifneq ($(OPTIMIZE),) -ASTCFLAGS+=$(OPTIMIZE) -endif ifeq ($(AST_DEVMODE),yes) ASTCFLAGS+=-Werror -Wunused endif -ASTOBJ=-o asterisk - -ifeq ($(findstring BSD,$(OSARCH)),BSD) - ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib +ifneq ($(findstring BSD,$(OSARCH)),) + ASTCFLAGS+=-I/usr/local/include -L/usr/local/lib endif ifneq ($(PROC),ultrasparc) @@ -249,13 +163,13 @@ ifeq ($(PROC),ppc) endif ifeq ($(OSARCH),FreeBSD) - BSDVERSION=$(shell make -V OSVERSION -f $(CROSS_COMPILE_TARGET)/usr/share/mk/bsd.port.subdir.mk) + BSDVERSION=$(shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk) ASTCFLAGS+=$(shell if test $(BSDVERSION) -lt 500016 ; then echo "-D_THREAD_SAFE"; fi) AST_LIBS+=$(shell if test $(BSDVERSION) -lt 502102 ; then echo "-lc_r"; else echo "-pthread"; fi) -endif # FreeBSD +endif ifeq ($(OSARCH),NetBSD) - AST_CFLAGS+=-pthread -I$(CROSS_COMPILE_TARGET)/usr/pkg/include + ASTCFLAGS+=-pthread -I/usr/pkg/include endif ifeq ($(OSARCH),OpenBSD) @@ -263,11 +177,9 @@ ifeq ($(OSARCH),OpenBSD) endif ifeq ($(OSARCH),SunOS) - ASTCFLAGS+=-Wcast-align -DSOLARIS -Iinclude/solaris-compat -I$(CROSS_COMPILE_TARGET)/opt/ssl/include -I$(CROSS_COMPILE_TARGET)/usr/local/ssl/include + ASTCFLAGS+=-Wcast-align -DSOLARIS -Iinclude/solaris-compat -I/opt/ssl/include -I/usr/local/ssl/include endif -LIBEDIT=editline/libedit.a - ASTERISKVERSION:=$(shell build_tools/make_version .) ifneq ($(wildcard .version),) @@ -283,93 +195,35 @@ endif ASTCFLAGS+=$(MALLOC_DEBUG)$(BUSYDETECT)$(OPTIONS) -MOD_SUBDIRS:=res channels pbx apps codecs formats cdr funcs +MOD_SUBDIRS:=res channels pbx apps codecs formats cdr funcs main OTHER_SUBDIRS:=utils agi +# Note: OTHER_SUBDIRS must be after MOD_SUBDIRS, because 'utils' uses files from 'main' SUBDIRS:=$(MOD_SUBDIRS) $(OTHER_SUBDIRS) SUBDIRS_INSTALL:=$(SUBDIRS:%=%-install) SUBDIRS_CLEAN:=$(SUBDIRS:%=%-clean) SUBDIRS_CLEAN_DEPEND:=$(SUBDIRS:%=%-clean-depend) MOD_SUBDIRS_DEPEND:=$(MOD_SUBDIRS:%=%-depend) OTHER_SUBDIRS_DEPEND:=$(OTHER_SUBDIRS:%=%-depend) -SUBDIRS_DEPEND:=$(MOD_SUBDIRS_DEPEND) $(OTHER_SUBDIRS_DEPEND) +SUBDIRS_DEPEND:=$(OTHER_SUBDIRS_DEPEND) $(MOD_SUBDIRS_DEPEND) SUBDIRS_UNINSTALL:=$(SUBDIRS:%=%-uninstall) +MOD_SUBDIRS_EMBED_LDSCRIPT:=$(MOD_SUBDIRS:%=%-embed-ldscript) +MOD_SUBDIRS_EMBED_LDFLAGS:=$(MOD_SUBDIRS:%=%-embed-ldflags) +MOD_SUBDIRS_EMBED_LIBS:=$(MOD_SUBDIRS:%=%-embed-libs) -OBJS=io.o sched.o logger.o frame.o loader.o config.o channel.o \ - translate.o file.o pbx.o cli.o md5.o term.o \ - ulaw.o alaw.o callerid.o fskmodem.o image.o app.o \ - cdr.o tdd.o acl.o rtp.o udptl.o manager.o asterisk.o \ - dsp.o chanvars.o indications.o autoservice.o db.o privacy.o \ - astmm.o enum.o srv.o dns.o aescrypt.o aestab.o aeskey.o \ - utils.o plc.o jitterbuf.o dnsmgr.o devicestate.o \ - netsock.o slinfactory.o ast_expr2.o ast_expr2f.o \ - cryptostub.o sha1.o http.o fixedjitterbuf.o abstract_jb.o - -# we need to link in the objects statically, not as a library, because -# otherwise modules will not have them available if none of the static -# objects use it. -OBJS+=stdtime/localtime.o - -# At the moment say.o is an optional component which can be overridden -# by a module. -OBJS+=say.o - -ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/sys/poll.h),) - OBJS+= poll.o - ASTCFLAGS+=-DPOLLCOMPAT -endif - -ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/dlfcn.h),) - OBJS+= dlfcn.o - ASTCFLAGS+=-DDLFCNCOMPAT -endif - -ifeq ($(OSARCH),Linux) - AST_LIBS+=-ldl -lpthread $(EDITLINE_LIB) -lm -lresolv #-lnjamd -else - AST_LIBS+=$(EDITLINE_LIB) -lm -endif - -ifeq ($(OSARCH),Darwin) - AST_LIBS+=-lresolv +ifneq ($(findstring darwin,$(OSARCH)),) ASTCFLAGS+=-D__Darwin__ AUDIO_LIBS=-framework CoreAudio - ASTLINK=-Wl,-dynamic SOLINK=-dynamic -bundle -undefined suppress -force_flat_namespace - # Mac on Intel CoreDuo does not need poll compatibility layer - ifneq ($(PROC),i386) - OBJS+=poll.o - ASTCFLAGS+=-DPOLLCOMPAT - endif else # These are used for all but Darwin - ASTLINK=-Wl,-E SOLINK=-shared -Xlinker -x - ifeq ($(findstring BSD,$(OSARCH)),BSD) - LDFLAGS+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib + ifneq ($(findstring BSD,$(OSARCH)),) + LDFLAGS+=-L/usr/local/lib endif endif -ifeq ($(OSARCH),FreeBSD) - AST_LIBS+=-lcrypto -endif - -ifeq ($(OSARCH),NetBSD) - AST_LIBS+=-lpthread -lcrypto -lm -L$(CROSS_COMPILE_TARGET)/usr/pkg/lib $(EDITLINE_LIB) -endif - -ifeq ($(OSARCH),OpenBSD) - AST_LIBS+=-lcrypto -lpthread -lm $(EDITLINE_LIB) -endif - ifeq ($(OSARCH),SunOS) - AST_LIBS+=-lpthread -ldl -lnsl -lsocket -lresolv -L$(CROSS_COMPILE_TARGET)/opt/ssl/lib -L$(CROSS_COMPILE_TARGET)/usr/local/ssl/lib - OBJS+=strcompat.o - ASTLINK= - SOLINK=-shared -fpic -L$(CROSS_COMPILE_TARGET)/usr/local/ssl/lib -endif - -ifeq ($(MAKETOPLEVEL),$(MAKELEVEL)) - CFLAGS+=$(TOPDIR_CFLAGS)$(ASTCFLAGS) + SOLINK=-shared -fpic -L/usr/local/ssl/lib endif # This is used when generating the doxygen documentation @@ -379,9 +233,7 @@ else HAVEDOT=no endif -include Makefile.rules - -_all: all +all: cleantest $(SUBDIRS) @echo " +--------- Asterisk Build Complete ---------+" @echo " + Asterisk has successfully been built, but +" @echo " + cannot be run before being installed by +" @@ -390,94 +242,44 @@ _all: all @echo " + make install +" @echo " +-------------------------------------------+" -all: cleantest config.status menuselect.makeopts depend $(SUBDIRS) asterisk - -$(MOD_SUBDIRS): - @CFLAGS="$(MOD_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) -C $@ - -$(OTHER_SUBDIRS): - @CFLAGS="$(OTHER_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) -C $@ - -config.status: configure - @CFLAGS="" ./configure - @echo "****" - @echo "**** The configure script was just executed, so 'make' needs to be" - @echo "**** restarted." - @echo "****" - @exit 1 - -makeopts: configure - @CFLAGS="" ./configure +makeopts: @echo "****" - @echo "**** The configure script was just executed, so 'make' needs to be" - @echo "**** restarted." + @echo "**** The configure script must be executed before running 'make'." @echo "****" @exit 1 -menuselect.makeopts menuselect.makedeps: menuselect/menuselect menuselect-tree +menuselect.makeopts: menuselect/menuselect menuselect-tree menuselect/menuselect --check-deps $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS) menuselect.makeopts -#ifneq ($(wildcard tags),) -ctags: tags -#endif - -ifneq ($(wildcard TAGS),) -all: TAGS -endif - -editline/config.h: - cd editline && unset CFLAGS AST_LIBS && CFLAGS="$(OPTIMIZE)" ./configure ; \ - -editline/libedit.a: - cd editline && unset CFLAGS AST_LIBS && test -f config.h || CFLAGS="$(OPTIMIZE)" ./configure - $(MAKE) -C editline libedit.a - -db1-ast/libdb1.a: - $(MAKE) -C db1-ast libdb1.a - -ifeq ($(strip $(foreach var,clean distclean dist-clean update,$(findstring $(var),$(MAKECMDGOALS)))),) - ifneq ($(wildcard .depend),) - include .depend - endif -endif - -ifeq ($(strip $(foreach var,clean distclean dist-clean update,$(findstring $(var),$(MAKECMDGOALS)))),) - ifneq ($(wildcard .tags-depend),) - include .tags-depend - endif -endif +$(MOD_SUBDIRS_EMBED_LDSCRIPT): + @echo "EMBED_LDSCRIPTS+="`$(MAKE) --quiet --no-print-directory -C $(@:-embed-ldscript=) SUBDIR=$(@:-embed-ldscript=) __embed_ldscript` >> makeopts.embed_rules -ast_expr2.c ast_expr2.h: - bison -o $@ -d --name-prefix=ast_yy ast_expr2.y +$(MOD_SUBDIRS_EMBED_LDFLAGS): + @echo "EMBED_LDFLAGS+="`$(MAKE) --quiet --no-print-directory -C $(@:-embed-ldflags=) SUBDIR=$(@:-embed-ldflags=) __embed_ldflags` >> makeopts.embed_rules -ast_expr2f.c: - flex -o $@ --full ast_expr2.fl +$(MOD_SUBDIRS_EMBED_LIBS): + @echo "EMBED_LIBS+="`$(MAKE) --quiet --no-print-directory -C $(@:-embed-libs=) SUBDIR=$(@:-embed-libs=) __embed_libs` >> makeopts.embed_rules -testexpr2: config.status include/asterisk/buildopts.h ast_expr2f.c ast_expr2.c ast_expr2.h - $(CC) -g -c -Iinclude -DSTANDALONE ast_expr2f.c - $(CC) -g -c -Iinclude -DSTANDALONE ast_expr2.c - $(CC) -g -o testexpr2 ast_expr2f.o ast_expr2.o - rm ast_expr2.o ast_expr2f.o - -manpage: asterisk.8 - -asterisk.8: asterisk.sgml - rm -f asterisk.8 - docbook2man asterisk.sgml - mv ./*.8 asterisk.8 +makeopts.embed_rules: menuselect.makeopts + @echo "Generating embedded module rules ..." + @rm -f $@ + @$(MAKE) --no-print-directory $(MOD_SUBDIRS_EMBED_LDSCRIPT) + @$(MAKE) --no-print-directory $(MOD_SUBDIRS_EMBED_LDFLAGS) + @$(MAKE) --no-print-directory $(MOD_SUBDIRS_EMBED_LIBS) -asterisk.pdf: asterisk.sgml - docbook2pdf asterisk.sgml +$(SUBDIRS): depend makeopts.embed_rules -asterisk.ps: asterisk.sgml - docbook2ps asterisk.sgml +# ensure that all module subdirectories are processed before 'main' during +# a parallel build, since if there are modules selected to be embedded the +# directories containing them must be completed before the main Asterisk +# binary can be built +main: $(filter-out main,$(MOD_SUBDIRS)) -asterisk.html: asterisk.sgml - docbook2html asterisk.sgml - mv r1.html asterisk.html +$(MOD_SUBDIRS): + @CFLAGS="$(MOD_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) --no-print-directory -C $@ SUBDIR=$@ all -asterisk.txt: asterisk.sgml - docbook2txt asterisk.sgml +$(OTHER_SUBDIRS): + @CFLAGS="$(OTHER_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) --no-print-directory -C $@ SUBDIR=$@ all defaults.h: makeopts @build_tools/make_defaults_h > $@.tmp @@ -500,39 +302,19 @@ include/asterisk/buildopts.h: menuselect.makeopts fi @rm -f $@.tmp -channel.o: CFLAGS+=$(ZAPTEL_INCLUDE) - -asterisk: include/asterisk/buildopts.h editline/libedit.a db1-ast/libdb1.a $(OBJS) - @build_tools/make_build_h > include/asterisk/build.h.tmp - @if cmp -s include/asterisk/build.h.tmp include/asterisk/build.h ; then echo ; else \ - mv include/asterisk/build.h.tmp include/asterisk/build.h ; \ - fi - @rm -f include/asterisk/build.h.tmp - @$(CC) -c -o buildinfo.o $(CFLAGS) buildinfo.c - @echo " [LD] $(OBJS) buildinfo.o $(LIBEDIT) db1-ast/libdb1.1 $(AST_LIBS) -> $@" - @$(CC) $(DEBUG) $(ASTOBJ) $(ASTLINK) $(OBJS) buildinfo.o $(LIBEDIT) db1-ast/libdb1.a $(AST_LIBS) - -muted: muted.o -muted: LIBS+=$(AUDIO_LIBS) - $(SUBDIRS_CLEAN_DEPEND): - @$(MAKE) -C $(@:-clean-depend=) clean-depend + @$(MAKE) --no-print-directory -C $(@:-clean-depend=) clean-depend $(SUBDIRS_CLEAN): - @$(MAKE) -C $(@:-clean=) clean + @$(MAKE) --no-print-directory -C $(@:-clean=) clean clean-depend: $(SUBDIRS_CLEAN_DEPEND) clean: $(SUBDIRS_CLEAN) clean-depend - rm -f *.o *.so asterisk rm -f defaults.h rm -f include/asterisk/build.h rm -f include/asterisk/version.h - rm -f .tags-sources tags TAGS - rm -f .depend .tags-depend - @if [ -f editline/Makefile ]; then $(MAKE) -C editline distclean ; fi - @$(MAKE) -C db1-ast clean - @$(MAKE) -C stdtime clean + rm -f .depend @$(MAKE) -C menuselect clean dist-clean: distclean @@ -541,7 +323,8 @@ distclean: clean @$(MAKE) -C mxml clean @$(MAKE) -C menuselect dist-clean @$(MAKE) -C sounds dist-clean - rm -f menuselect.makeopts makeopts menuselect-tree menuselect.makedeps + rm -f menuselect.makeopts makeopts makeopts.xml menuselect.makedeps + rm -f makeopts.embed_rules rm -f config.log config.status rm -rf autom4te.cache rm -f include/asterisk/autoconfig.h @@ -595,8 +378,7 @@ bininstall: all mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/tmp mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/meetme mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/monitor - if [ -f asterisk ]; then $(INSTALL) -m 755 asterisk $(DESTDIR)$(ASTSBINDIR)/; fi - if [ -f asterisk.dll ]; then $(INSTALL) -m 755 asterisk.dll $(DESTDIR)$(ASTSBINDIR)/; fi + $(INSTALL) -m 755 main/asterisk $(DESTDIR)$(ASTSBINDIR)/ $(LN) -sf asterisk $(DESTDIR)$(ASTSBINDIR)/rasterisk $(INSTALL) -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/ $(INSTALL) -m 755 contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/ @@ -618,7 +400,7 @@ bininstall: all mkdir -p $(DESTDIR)$(ASTMANDIR)/man8 $(INSTALL) -m 644 keys/iaxtel.pub $(DESTDIR)$(ASTDATADIR)/keys $(INSTALL) -m 644 keys/freeworlddialup.pub $(DESTDIR)$(ASTDATADIR)/keys - $(INSTALL) -m 644 asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8 + $(INSTALL) -m 644 doc/asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8 $(INSTALL) -m 644 contrib/scripts/astgenkey.8 $(DESTDIR)$(ASTMANDIR)/man8 $(INSTALL) -m 644 contrib/scripts/autosupport.8 $(DESTDIR)$(ASTMANDIR)/man8 $(INSTALL) -m 644 contrib/scripts/safe_asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8 @@ -781,7 +563,7 @@ progdocs: echo "PROJECT_NUMBER=$(ASTERISKVERSION)") | doxygen - config: - @if [ "${OSARCH}" = "Linux" ]; then \ + @if [ "${OSARCH}" = "linux-gnu" ]; then \ if [ -f /etc/redhat-release -o -f /etc/fedora-release ]; then \ $(INSTALL) -m 755 contrib/init.d/rc.redhat.asterisk /etc/rc.d/init.d/asterisk; \ /sbin/chkconfig --add asterisk; \ @@ -806,69 +588,29 @@ config: echo "We could not install init scripts for your operating system."; \ fi -dont-optimize: _all - -valgrind: dont-optimize - $(MOD_SUBDIRS_DEPEND): - @CFLAGS="$(MOD_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) -C $(@:-depend=) depend + @CFLAGS="$(MOD_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) --no-print-directory -C $(@:-depend=) depend $(OTHER_SUBDIRS_DEPEND): - @CFLAGS="$(OTHER_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) -C $(@:-depend=) depend + @CFLAGS="$(OTHER_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) --no-print-directory -C $(@:-depend=) depend -depend: include/asterisk/version.h include/asterisk/buildopts.h .depend defaults.h $(SUBDIRS_DEPEND) - -.depend: include/asterisk/version.h include/asterisk/buildopts.h defaults.h - build_tools/mkdep $(CFLAGS) $(wildcard *.c) - -.tags-depend: - @echo -n ".tags-depend: " > $@ - @$(FIND) . -maxdepth 1 -name \*.c -printf "\t%p \\\\\n" >> $@ - @$(FIND) . -maxdepth 1 -name \*.h -printf "\t%p \\\\\n" >> $@ - @$(FIND) $(SUBDIRS) -name \*.c -printf "\t%p \\\\\n" >> $@ - @$(FIND) $(SUBDIRS) -name \*.h -printf "\t%p \\\\\n" >> $@ - @$(FIND) include -name \*.h -printf "\t%p \\\\\n" >> $@ - @echo >> $@ - -.tags-sources: - @rm -f $@ - @$(FIND) . -maxdepth 1 -name \*.c -print >> $@ - @$(FIND) . -maxdepth 1 -name \*.h -print >> $@ - @$(FIND) $(SUBDIRS) -name \*.c -print >> $@ - @$(FIND) $(SUBDIRS) -name \*.h -print >> $@ - @$(FIND) include -name \*.h -print >> $@ - -tags: .tags-depend .tags-sources - ctags -L .tags-sources -o $@ - -ctags: tags - -TAGS: .tags-depend .tags-sources - etags -o $@ `cat .tags-sources` - -etags: TAGS - -%_env: - $(MAKE) -C $(shell echo $@ | sed "s/_env//g") env +depend: include/asterisk/version.h include/asterisk/buildopts.h defaults.h $(SUBDIRS_DEPEND) sounds: $(MAKE) -C sounds all -env: - env - # If the cleancount has been changed, force a make clean. # .cleancount is the global clean count, and .lastclean is the # last clean count we had cleantest: - @if cmp -s .cleancount .lastclean ; then echo ; else \ + @if ! cmp -s .cleancount .lastclean ; then \ $(MAKE) clean; cp -f .cleancount .lastclean;\ $(MAKE) defaults.h;\ fi $(SUBDIRS_UNINSTALL): - @$(MAKE) -C $(@:-uninstall=) uninstall + @$(MAKE) --no-print-directory -C $(@:-uninstall=) uninstall _uninstall: $(SUBDIRS_UNINSTALL) rm -f $(DESTDIR)$(MODULES_DIR)/* @@ -905,15 +647,15 @@ uninstall-all: _uninstall menuselect: menuselect/menuselect menuselect-tree -@menuselect/menuselect $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS) menuselect.makeopts && echo "menuselect changes saved!" || echo "menuselect changes NOT saved!" -menuselect/menuselect: menuselect/menuselect.c menuselect/menuselect_curses.c menuselect/menuselect_stub.c menuselect/menuselect.h menuselect/linkedlists.h config.status mxml/libmxml.a - @CFLAGS="-include $(ASTTOPDIR)/include/asterisk/autoconfig.h -I$(ASTTOPDIR)/include" PARENTSRC="$(ASTTOPDIR)" $(MAKE) -C menuselect menuselect +menuselect/menuselect: makeopts menuselect/menuselect.c menuselect/menuselect_curses.c menuselect/menuselect_stub.c menuselect/menuselect.h menuselect/linkedlists.h makeopts mxml/libmxml.a + @CFLAGS="-include $(ASTTOPDIR)/include/asterisk/autoconfig.h -I$(ASTTOPDIR)/include" PARENTSRC="$(ASTTOPDIR)" $(MAKE) -C menuselect CC="$(HOST_CC)" menuselect mxml/libmxml.a: - @cd mxml && unset CFLAGS AST_LIBS && test -f config.h || ./configure + @cd mxml && unset CFLAGS AST_LIBS && test -f config.h || ./configure --build=$(BUILD_PLATFORM) --host=$(BUILD_PLATFORM) $(MAKE) -C mxml libmxml.a -menuselect-tree: $(foreach dir,$(MOD_SUBDIRS),$(wildcard $(dir)/*.c) $(wildcard $(dir)/*.cc)) build_tools/cflags.xml sounds/sounds.xml - @echo "Generating list of available modules ..." +menuselect-tree: $(foreach dir,$(MOD_SUBDIRS),$(wildcard $(dir)/*.c) $(wildcard $(dir)/*.cc)) build_tools/cflags.xml sounds/sounds.xml build_tools/embed_modules.xml + @echo "Generating input for menuselect ..." @build_tools/prep_moduledeps > $@ -.PHONY: menuselect sounds clean clean-depend dist-clean distclean all _all depend cleantest uninstall _uninstall uninstall-all dont-optimize valgrind $(SUBDIRS_INSTALL) $(SUBDIRS_CLEAN) $(SUBDIRS_CLEAN_DEPEND) $(SUBDIRS_DEPEND) $(SUBDIRS_UNINSTALL) $(SUBDIRS) +.PHONY: menuselect main sounds clean clean-depend dist-clean distclean all prereqs depend cleantest uninstall _uninstall uninstall-all dont-optimize $(SUBDIRS_INSTALL) $(SUBDIRS_CLEAN) $(SUBDIRS_CLEAN_DEPEND) $(SUBDIRS_DEPEND) $(SUBDIRS_UNINSTALL) $(SUBDIRS) $(MOD_SUBDIRS_EMBED_LDSCRIPT) $(MOD_SUBDIRS_EMBED_LDFLAGS) $(MOD_SUBDIRS_EMBED_LIBS) diff --git a/Makefile.moddir_rules b/Makefile.moddir_rules index 0a82471e4..8e9c082fe 100644 --- a/Makefile.moddir_rules +++ b/Makefile.moddir_rules @@ -1,7 +1,7 @@ # # Asterisk -- A telephony toolkit for Linux. # -# Makefile rules +# Makefile rules for subdirectories containing modules # # Copyright (C) 2006, Digium, Inc. # @@ -11,50 +11,83 @@ # the GNU General Public License # +ifneq ($(findstring MALLOC_DEBUG,$(MENUSELECT_CFLAGS)),) + CFLAGS+=-include $(ASTTOPDIR)/include/asterisk/astmm.h +endif + +ifneq ($(findstring STATIC_BUILD,$(MENUSELECT_CFLAGS)),) + STATIC_BUILD=-static +endif + include $(ASTTOPDIR)/Makefile.rules -define module_o_c_template -$(1).o: $(1).c -$(1).o: CFLAGS+=$$(MENUSELECT_OPTS_$(1):%=-D%) $(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_INCLUDE)) -endef +comma:=, -define module_oo_cc_template -$(1).oo: $(1).cc -$(1).oo: CFLAGS+=$$(MENUSELECT_OPTS_$(1):%=-D%) $(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_INCLUDE)) +define module_o_template +$(2): $(3) +$(2): CFLAGS+=-DAST_MODULE=\"$(1)\" $$(MENUSELECT_OPTS_$(1):%=-D%) $(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_INCLUDE)) endef -define module_so_o_template -$(1).so: $(1).o +define module_so_template +$(1)=$(1).so +$(1).so: CFLAGS+=-fPIC $(1).so: LIBS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LIB)) $(1).so: LDFLAGS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LDFLAGS)) +$(1).so: $(2) endef -define module_so_oo_template -$(1).so: $(1).oo -$(1).so: LIBS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LIB)) -$(1).so: LDFLAGS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LDFLAGS)) +define module_a_template +$(1)=modules.link +modules.link: $(2) endef -$(foreach mod,$(C_MODS),$(eval $(call module_o_c_template,$(mod)))) +$(foreach mod,$(C_MODS),$(eval $(call module_o_template,$(mod),$(mod).o,$(mod).c))) -$(foreach mod,$(C_MODS),$(eval $(call module_so_o_template,$(mod)))) +$(foreach mod,$(CC_MODS),$(eval $(call module_o_template,$(mod),$(mod).oo,$(mod).cc))) -$(foreach mod,$(CC_MODS),$(eval $(call module_oo_cc_template,$(mod)))) +$(foreach mod,$(filter-out $(EMBEDDED_MODS),$(C_MODS)),$(eval $(call module_so_template,$(mod),$(mod).o))) -$(foreach mod,$(CC_MODS),$(eval $(call module_so_oo_template,$(mod)))) +$(foreach mod,$(filter-out $(EMBEDDED_MODS),$(CC_MODS)),$(eval $(call module_so_template,$(mod),$(mod).oo))) + +$(foreach mod,$(filter $(EMBEDDED_MODS),$(C_MODS)),$(eval $(call module_a_template,$(mod),$(mod).o))) + +$(foreach mod,$(filter $(EMBEDDED_MODS),$(CC_MODS)),$(eval $(call module_a_template,$(mod),$(mod).oo))) .PHONY: clean clean-depend depend uninstall _all -_all: $(SELECTED_MODS:%=%.so) +ifneq ($(LOADABLE_MODS),) +_all: $(LOADABLE_MODS:%=%.so) +endif + +ifneq ($(EMBEDDED_MODS),) +_all: modules.link +__embed_ldscript: + @echo "../$(SUBDIR)/modules.link" +__embed_ldflags: + @echo "$(foreach mod,$(filter $(EMBEDDED_MODS),$(C_MODS)),$(foreach dep,$(MENUSELECT_DEPENDS_$(mod)),$(dep)_LDFLAGS))" + @echo "$(foreach mod,$(filter $(EMBEDDED_MODS),$(CC_MODS)),$(foreach dep,$(MENUSELECT_DEPENDS_$(mod)),$(dep)_LDFLAGS))" +__embed_libs: + @echo "$(foreach mod,$(filter $(EMBEDDED_MODS),$(C_MODS)),$(foreach dep,$(MENUSELECT_DEPENDS_$(mod)),$(dep)_LIB))" + @echo "$(foreach mod,$(filter $(EMBEDDED_MODS),$(CC_MODS)),$(foreach dep,$(MENUSELECT_DEPENDS_$(mod)),$(dep)_LIB))" +else +__embed_ldscript: +__embed_ldflags: +__embed_libs: +endif + +modules.link: + @rm -f $@ + @for file in $(patsubst $(ASTTOPDIR)/%,%,$(realpath $^)); do echo "INPUT (../$${file})" >> $@; done clean-depend:: rm -f .depend clean:: clean-depend rm -f *.so *.o *.oo + rm -f modules.link install:: all - for x in $(SELECTED_MODS:%=%.so); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done + for x in $(LOADABLE_MODS:%=%.so); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done uninstall:: @@ -65,4 +98,4 @@ endif depend: .depend .depend: - ../build_tools/mkdep $(CFLAGS) `ls *.c` + ../build_tools/mkdep $(CFLAGS) `ls *.c *.cc 2> /dev/null` diff --git a/Makefile.rules b/Makefile.rules index 47a92a5a9..0c2b97d62 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -15,6 +15,8 @@ # Prefixing one or the other with @\# or @ or nothing makes the desired # behaviour. ECHO_PREFIX prefixes the comment, CMD_PREFIX prefixes the command. +include $(ASTTOPDIR)/makeopts + ifeq ($(NOISY_BUILD),) ECHO_PREFIX=@ CMD_PREFIX=@ @@ -23,6 +25,17 @@ else CMD_PREFIX= endif +ifeq ($(findstring DONT_OPTIMIZE,$(MENUSELECT_CFLAGS)),) +# More GSM codec optimization +# Uncomment to enable MMXTM optimizations for x86 architecture CPU's +# which support MMX instructions. This should be newer pentiums, +# ppro's, etc, as well as the AMD K6 and K7. +#K6OPT=-DK6OPT + +OPTIMIZE?=-O6 +CFLAGS+=$(OPTIMIZE) +endif + define ast_make_o_c $(1): $(2) $(ECHO_PREFIX) echo " [CC] $$< -> $$@" @@ -50,13 +63,13 @@ endef define ast_make_so_o $(1): $(2) $(ECHO_PREFIX) echo " [LD] $$^ -> $$@" - $(CMD_PREFIX) $$(CC) -o $$@ $$(LDFLAGS) $$(SOLINK) $$^ $$(LIBS) + $(CMD_PREFIX) $$(CC) $$(STATIC_BUILD) -o $$@ $$(LDFLAGS) $$(SOLINK) $$^ $$(LIBS) endef define ast_make_so_oo $(1): $(2) $(ECHO_PREFIX) echo " [LDXX] $$^ -> $$@" - $(CMD_PREFIX) $$(CXX) -o $$@ $$(LDFLAGS) $$(SOLINK) $$^ $$(LIBS) + $(CMD_PREFIX) $$(CXX) $$(STATIC_BUILD) -o $$@ $$(LDFLAGS) $$(SOLINK) $$^ $$(LIBS) endef define ast_make_a_o @@ -69,13 +82,13 @@ endef define ast_make_final $(1): $(2) $(ECHO_PREFIX) echo " [LD] $$^ -> $$@" - $(CMD_PREFIX) $$(CC) -o $$@ $$(LDFLAGS) $$^ $$(LIBS) + $(CMD_PREFIX) $$(CXX) $$(STATIC_BUILD) -o $$@ $$(LDFLAGS) $$^ $$(LIBS) endef define ast_make_final_host $(1): $(2) $(ECHO_PREFIX) echo " [LD] $$^ -> $$@" - $(CMD_PREFIX) $$(HOST_CC) -o $$@ $$(CFLAGS) $$(LDFLAGS) $$^ $$(LIBS) + $(CMD_PREFIX) $$(HOST_CC) $$(STATIC_BUILD) -o $$@ $$(CFLAGS) $$(LDFLAGS) $$^ $$(LIBS) endef $(eval $(call ast_make_o_c,%.o,%.c)) @@ -84,8 +97,6 @@ $(eval $(call ast_make_oo_cc,%.oo,%.cc)) $(eval $(call ast_make_so_o,%.so,%.o)) -$(eval $(call ast_make_so_oo,%.so,%.oo)) - $(eval $(call ast_make_final,%,%.o)) $(eval $(call ast_make_c_y,%.c,%.y)) diff --git a/acinclude.m4 b/acinclude.m4 index 34eefe82b..1bd093703 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1,3 +1,16 @@ +# AST_GCC_ATTRIBUTE([attribute name]) + +AC_DEFUN([AST_GCC_ATTRIBUTE], +[ +AC_MSG_CHECKING(checking for compiler 'attribute $1' support) +AC_COMPILE_IFELSE( + AC_LANG_PROGRAM([static int __attribute__(($1)) test(void) {}], + []), + AC_MSG_RESULT(yes) + AC_DEFINE_UNQUOTED([HAVE_ATTRIBUTE_$1], 1, [Define to 1 if your GCC C compiler supports the '$1' attribute.]), + AC_MSG_RESULT(no)) +]) + # AST_EXT_LIB_SETUP([package symbol name], [package friendly name], [package option name], [additional help text]) AC_DEFUN([AST_EXT_LIB_SETUP], diff --git a/apps/Makefile b/apps/Makefile index df5f60a44..0373a3b63 100644 --- a/apps/Makefile +++ b/apps/Makefile @@ -9,7 +9,7 @@ # the GNU General Public License # -ifneq ($(wildcard ../menuselect.makeopts),) +ifneq ($(wildcard $(ASTTOPDIR)/menuselect.makeopts),) include ../menuselect.makeopts include ../menuselect.makedeps endif @@ -17,22 +17,25 @@ endif C_MODS:=$(filter-out $(MENUSELECT_APPS),$(patsubst %.c,%,$(wildcard app_*.c))) CC_MODS:=$(filter-out $(MENUSELECT_APPS),$(patsubst %.cc,%,$(wildcard app_*.cc))) -SELECTED_MODS:=$(C_MODS) $(CC_MODS) +LOADABLE_MODS:=$(C_MODS) $(CC_MODS) + +ifneq ($(findstring apps,$(MENUSELECT_EMBED)),) + EMBEDDED_MODS:=$(LOADABLE_MODS) + LOADABLE_MODS:= +endif ifneq ($(findstring ODBC_STORAGE,$(MENUSELECT_OPTS_app_voicemail)),) MENUSELECT_DEPENDS_app_voicemail+=$(MENUSELECT_DEPENDS_ODBC_STORAGE) endif -ifneq ($(findstring EXTENDED_ODBC_STORAGE,$(MENUSELECT_OPTS_app_voicemail)),) -MENUSELECT_DEPENDS_app_voicemail+=$(MENUSELECT_DEPENDS_EXTENDED_ODBC_STORAGE) -endif ifneq ($(findstring IMAP_STORAGE,$(MENUSELECT_OPTS_app_voicemail)),) MENUSELECT_DEPENDS_app_voicemail+=$(MENUSELECT_DEPENDS_IMAP_STORAGE) endif +ifeq (SunOS,$(shell uname)) +MENUSELECT_DEPENDS_app_chanspy+=RT +RT_LIB=-lrt +endif + all: _all include $(ASTTOPDIR)/Makefile.moddir_rules - -ifeq (SunOS,$(shell uname)) -app_chanspy.so: LIBS+=-lrt -endif diff --git a/apps/app_adsiprog.c b/apps/app_adsiprog.c index e8ab87802..04b9000fd 100644 --- a/apps/app_adsiprog.c +++ b/apps/app_adsiprog.c @@ -1545,9 +1545,9 @@ static int adsi_prog(struct ast_channel *chan, char *script) static int adsi_exec(struct ast_channel *chan, void *data) { int res=0; - struct localuser *u; + struct ast_module_user *u; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if (ast_strlen_zero(data)) data = "asterisk.adsi"; @@ -1561,16 +1561,16 @@ static int adsi_exec(struct ast_channel *chan, void *data) res = adsi_prog(chan, data); } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); res = ast_unregister_application(app); @@ -1578,20 +1578,9 @@ static int unload_module(void *mod) return res; } -static int load_module(void *mod) +static int load_module(void) { - __mod_desc = mod; return ast_register_application(app, adsi_exec, synopsis, descrip); } -static const char *description(void) -{ - return "Asterisk ADSI Programming Application"; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD(MOD_1, NULL, NULL, NULL); +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Asterisk ADSI Programming Application"); diff --git a/apps/app_alarmreceiver.c b/apps/app_alarmreceiver.c index faa2c6a00..5b745d0ab 100644 --- a/apps/app_alarmreceiver.c +++ b/apps/app_alarmreceiver.c @@ -626,13 +626,13 @@ static int receive_ademco_contact_id( struct ast_channel *chan, void *data, int static int alarmreceiver_exec(struct ast_channel *chan, void *data) { int res = 0; - struct localuser *u; + struct ast_module_user *u; event_node_t *elp, *efree; char signalling_type[64] = ""; event_node_t *event_head = NULL; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); /* Set write and read formats to ULAW */ @@ -641,13 +641,13 @@ static int alarmreceiver_exec(struct ast_channel *chan, void *data) if (ast_set_write_format(chan,AST_FORMAT_ULAW)){ ast_log(LOG_WARNING, "AlarmReceiver: Unable to set write format to Mu-law on %s\n",chan->name); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } if (ast_set_read_format(chan,AST_FORMAT_ULAW)){ ast_log(LOG_WARNING, "AlarmReceiver: Unable to set read format to Mu-law on %s\n",chan->name); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } @@ -666,7 +666,7 @@ static int alarmreceiver_exec(struct ast_channel *chan, void *data) res = ast_answer(chan); if (res) { - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } } @@ -721,7 +721,7 @@ static int alarmreceiver_exec(struct ast_channel *chan, void *data) } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } @@ -818,32 +818,21 @@ static int load_config(void) */ -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { - __mod_desc = mod; load_config(); return ast_register_application(app, alarmreceiver_exec, synopsis, descrip); } -static const char *description(void) -{ - return "Alarm Receiver for Asterisk"; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Alarm Receiver for Asterisk"); diff --git a/apps/app_amd.c b/apps/app_amd.c index 1ffc463b2..2f7148b9c 100644 --- a/apps/app_amd.c +++ b/apps/app_amd.c @@ -321,11 +321,11 @@ static void isAnsweringMachine(struct ast_channel *chan, void *data) static int amd_exec(struct ast_channel *chan, void *data) { - struct localuser *u; + struct ast_module_user *u; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); isAnsweringMachine(chan, data); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } @@ -385,33 +385,26 @@ static void load_config(void) return; } -static int unload_module(void *mod) +static int unload_module(void) { - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return ast_unregister_application(app); } -static int load_module(void *mod) +static int load_module(void) { - __mod_desc = mod; load_config(); return ast_register_application(app, amd_exec, synopsis, descrip); } -static int reload(void *mod) +static int reload(void) { load_config(); return 0; } -static const char *description(void) -{ - return "Answering Machine Detection Application"; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD(MOD_1, reload, NULL, NULL); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Answering Machine Detection Application", + .load = load_module, + .unload = unload_module, + .reload = reload, + ); diff --git a/apps/app_authenticate.c b/apps/app_authenticate.c index 0e6b8eb2c..03bc5ed81 100644 --- a/apps/app_authenticate.c +++ b/apps/app_authenticate.c @@ -95,7 +95,7 @@ static int auth_exec(struct ast_channel *chan, void *data) { int res=0; int retries; - struct localuser *u; + struct ast_module_user *u; char passwd[256]; char *prompt; int maxdigits; @@ -113,12 +113,12 @@ static int auth_exec(struct ast_channel *chan, void *data) return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if (chan->_state != AST_STATE_UP) { res = ast_answer(chan); if (res) { - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } } @@ -226,15 +226,15 @@ static int auth_exec(struct ast_channel *chan, void *data) res = -1; } } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); res = ast_unregister_application(app); @@ -242,19 +242,9 @@ static int unload_module(void *mod) return res; } -static int load_module(void *mod) +static int load_module(void) { return ast_register_application(app, auth_exec, synopsis, descrip); } -static const char *description(void) -{ - return "Authentication Application"; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD(MOD_1, NULL, NULL, NULL); +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Authentication Application"); diff --git a/apps/app_cdr.c b/apps/app_cdr.c index 8d20fb012..e8f76a602 100644 --- a/apps/app_cdr.c +++ b/apps/app_cdr.c @@ -43,48 +43,37 @@ static char *nocdr_descrip = static char *nocdr_app = "NoCDR"; static char *nocdr_synopsis = "Tell Asterisk to not maintain a CDR for the current call"; -LOCAL_USER_DECL; static int nocdr_exec(struct ast_channel *chan, void *data) { - struct localuser *u; + struct ast_module_user *u; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if (chan->cdr) { ast_cdr_free(chan->cdr); chan->cdr = NULL; } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(nocdr_app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { return ast_register_application(nocdr_app, nocdr_exec, nocdr_synopsis, nocdr_descrip); } -static const char *description(void) -{ - return "Tell Asterisk to not maintain a CDR for the current call"; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD(MOD_1, NULL, NULL, NULL); +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Tell Asterisk to not maintain a CDR for the current call"); diff --git a/apps/app_chanisavail.c b/apps/app_chanisavail.c index c23aa6edc..c6931d8db 100644 --- a/apps/app_chanisavail.c +++ b/apps/app_chanisavail.c @@ -63,13 +63,12 @@ static char *descrip = " s - Consider the channel unavailable if the channel is in use at all\n" " j - Support jumping to priority n+101 if no channel is available\n"; -LOCAL_USER_DECL; static int chanavail_exec(struct ast_channel *chan, void *data) { int res=-1, inuse=-1, option_state=0, priority_jump=0; int status; - struct localuser *u; + struct ast_module_user *u; char *info, tmp[512], trychan[512], *peers, *tech, *number, *rest, *cur; struct ast_channel *tempchan; AST_DECLARE_APP_ARGS(args, @@ -82,7 +81,7 @@ static int chanavail_exec(struct ast_channel *chan, void *data) return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); info = ast_strdupa(data); @@ -108,7 +107,7 @@ static int chanavail_exec(struct ast_channel *chan, void *data) number = strchr(tech, '/'); if (!number) { ast_log(LOG_WARNING, "ChanIsAvail argument takes format ([technology]/[device])\n"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } *number = '\0'; @@ -145,41 +144,30 @@ static int chanavail_exec(struct ast_channel *chan, void *data) pbx_builtin_setvar_helper(chan, "AVAILORIGCHAN", ""); if (priority_jump || ast_opt_priority_jumping) { if (ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101)) { - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } } } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } -static int unload_module(void *mod) +static int unload_module(void) { int res = 0; res = ast_unregister_application(app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { - __mod_desc = mod; return ast_register_application(app, chanavail_exec, synopsis, descrip); } -static const char *description(void) -{ - return "Check channel availability"; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Check channel availability"); diff --git a/apps/app_channelredirect.c b/apps/app_channelredirect.c index ada623018..a8eedf9b4 100644 --- a/apps/app_channelredirect.c +++ b/apps/app_channelredirect.c @@ -48,12 +48,11 @@ static char *descrip = "ChannelRedirect(channel|[[context|]extension|]priority):\n" " Sends the specified channel to the specified extension priority\n"; -LOCAL_USER_DECL; static int asyncgoto_exec(struct ast_channel *chan, void *data) { int res = -1; - struct localuser *u; + struct ast_module_user *u; char *info, *context, *exten, *priority; int prio = 1; struct ast_channel *chan2 = NULL; @@ -68,7 +67,7 @@ static int asyncgoto_exec(struct ast_channel *chan, void *data) return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); info = ast_strdupa(data); AST_STANDARD_APP_ARGS(args, info); @@ -117,36 +116,25 @@ static int asyncgoto_exec(struct ast_channel *chan, void *data) chanquit: ast_mutex_unlock(&chan2->lock); quit: - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { - __mod_desc = mod; return ast_register_application(app, asyncgoto_exec, synopsis, descrip); } -static const char *description(void) -{ - return "Channel Redirect"; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Channel Redirect"); diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c index a4fcb0b4a..1f8a9f01c 100644 --- a/apps/app_chanspy.c +++ b/apps/app_chanspy.c @@ -140,7 +140,6 @@ AST_APP_OPTIONS(spy_opts, { AST_APP_OPTION_ARG('r', OPTION_RECORD, OPT_ARG_RECORD), }); -LOCAL_USER_DECL; struct chanspy_translation_helper { /* spy data */ @@ -540,7 +539,7 @@ static int common_exec(struct ast_channel *chan, const struct ast_flags *flags, static int chanspy_exec(struct ast_channel *chan, void *data) { - struct localuser *u; + struct ast_module_user *u; char *options = NULL; char *spec = NULL; char *argv[2]; @@ -555,7 +554,7 @@ static int chanspy_exec(struct ast_channel *chan, void *data) data = ast_strdupa(data); - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if ((argc = ast_app_separate_args(data, '|', argv, sizeof(argv) / sizeof(argv[0])))) { spec = argv[0]; @@ -593,7 +592,7 @@ static int chanspy_exec(struct ast_channel *chan, void *data) oldwf = chan->writeformat; if (ast_set_write_format(chan, AST_FORMAT_SLINEAR) < 0) { ast_log(LOG_ERROR, "Could Not Set Write Format.\n"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } @@ -615,14 +614,14 @@ static int chanspy_exec(struct ast_channel *chan, void *data) if (oldwf && ast_set_write_format(chan, oldwf) < 0) ast_log(LOG_ERROR, "Could Not Set Write Format.\n"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } static int extenspy_exec(struct ast_channel *chan, void *data) { - struct localuser *u; + struct ast_module_user *u; char *options = NULL; char *exten = NULL; char *context = NULL; @@ -638,7 +637,7 @@ static int extenspy_exec(struct ast_channel *chan, void *data) data = ast_strdupa(data); - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if ((argc = ast_app_separate_args(data, '|', argv, sizeof(argv) / sizeof(argv[0])))) { context = argv[0]; @@ -676,7 +675,7 @@ static int extenspy_exec(struct ast_channel *chan, void *data) oldwf = chan->writeformat; if (ast_set_write_format(chan, AST_FORMAT_SLINEAR) < 0) { ast_log(LOG_ERROR, "Could Not Set Write Format.\n"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } @@ -698,43 +697,31 @@ static int extenspy_exec(struct ast_channel *chan, void *data) if (oldwf && ast_set_write_format(chan, oldwf) < 0) ast_log(LOG_ERROR, "Could Not Set Write Format.\n"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res = 0; res |= ast_unregister_application(app_chan); res |= ast_unregister_application(app_ext); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { int res = 0; - __mod_desc = mod; - res |= ast_register_application(app_chan, chanspy_exec, tdesc, desc_chan); res |= ast_register_application(app_ext, extenspy_exec, tdesc, desc_ext); return res; } -static const char *description(void) -{ - return (char *) tdesc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD(MOD_1, NULL, NULL, NULL); +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Listen to the audio of an active channel"); diff --git a/apps/app_controlplayback.c b/apps/app_controlplayback.c index a2e3929da..8a5a845cd 100644 --- a/apps/app_controlplayback.c +++ b/apps/app_controlplayback.c @@ -66,7 +66,6 @@ static const char *descrip = " CPLAYBACKSTATUS - This variable contains the status of the attempt as a text\n" " string, one of: SUCCESS | USERSTOPPED | ERROR\n"; -LOCAL_USER_DECL; static int is_on_phonepad(char key) { @@ -77,7 +76,7 @@ static int controlplayback_exec(struct ast_channel *chan, void *data) { int res = 0, priority_jump = 0; int skipms = 0; - struct localuser *u; + struct ast_module_user *u; char *tmp; int argc; char *argv[8]; @@ -97,7 +96,7 @@ static int controlplayback_exec(struct ast_channel *chan, void *data) return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); tmp = ast_strdupa(data); memset(argv, 0, sizeof(argv)); @@ -106,7 +105,7 @@ static int controlplayback_exec(struct ast_channel *chan, void *data) if (argc < 1) { ast_log(LOG_WARNING, "ControlPlayback requires an argument (filename)\n"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } @@ -149,31 +148,21 @@ static int controlplayback_exec(struct ast_channel *chan, void *data) pbx_builtin_setvar_helper(chan, "CPLAYBACKSTATUS", "SUCCESS"); } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app); return res; } -static int load_module(void *mod) +static int load_module(void) { return ast_register_application(app, controlplayback_exec, synopsis, descrip); } -static const char *description(void) -{ - return "Control Playback Application"; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD(MOD_1, NULL, NULL, NULL); +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Control Playback Application"); diff --git a/apps/app_db.c b/apps/app_db.c index fc8c52b1a..73d092ab6 100644 --- a/apps/app_db.c +++ b/apps/app_db.c @@ -64,14 +64,13 @@ static char *dt_app = "DBdeltree"; static char *d_synopsis = "Delete a key from the database"; static char *dt_synopsis = "Delete a family or keytree from the database"; -LOCAL_USER_DECL; static int deltree_exec(struct ast_channel *chan, void *data) { char *argv, *family, *keytree; - struct localuser *u; + struct ast_module_user *u; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); argv = ast_strdupa(data); @@ -80,7 +79,7 @@ static int deltree_exec(struct ast_channel *chan, void *data) keytree = strsep(&argv, "\0"); if (!family || !keytree) { ast_log(LOG_DEBUG, "Ignoring; Syntax error in argument\n"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } if (ast_strlen_zero(keytree)) @@ -102,7 +101,7 @@ static int deltree_exec(struct ast_channel *chan, void *data) ast_verbose(VERBOSE_PREFIX_3 "DBdeltree: Error deleting key from database.\n"); } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } @@ -110,10 +109,10 @@ static int deltree_exec(struct ast_channel *chan, void *data) static int del_exec(struct ast_channel *chan, void *data) { char *argv, *family, *key; - struct localuser *u; + struct ast_module_user *u; static int deprecation_warning = 0; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if (!deprecation_warning) { deprecation_warning = 1; @@ -127,7 +126,7 @@ static int del_exec(struct ast_channel *chan, void *data) key = strsep(&argv, "\0"); if (!family || !key) { ast_log(LOG_DEBUG, "Ignoring; Syntax error in argument\n"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } if (option_verbose > 2) @@ -140,12 +139,12 @@ static int del_exec(struct ast_channel *chan, void *data) ast_log(LOG_DEBUG, "Ignoring, no parameters\n"); } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } -static int unload_module(void *mod) +static int unload_module(void) { int retval; @@ -155,25 +154,14 @@ static int unload_module(void *mod) return retval; } -static int load_module(void *mod) +static int load_module(void) { int retval; - __mod_desc = mod; retval = ast_register_application(d_app, del_exec, d_synopsis, d_descrip); retval |= ast_register_application(dt_app, deltree_exec, dt_synopsis, dt_descrip); return retval; } -static const char *description(void) -{ - return "Database Access Functions"; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD(MOD_1, NULL, NULL, NULL); +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Database Access Functions"); diff --git a/apps/app_dial.c b/apps/app_dial.c index 99392abbc..13b5b3371 100644 --- a/apps/app_dial.c +++ b/apps/app_dial.c @@ -298,7 +298,6 @@ struct dial_localuser { struct dial_localuser *next; }; -LOCAL_USER_DECL; static void hanguptree(struct dial_localuser *outgoing, struct ast_channel *exception) { @@ -769,7 +768,7 @@ static int valid_priv_reply(struct ast_flags *opts, int res) static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags *peerflags) { int res = -1; - struct localuser *u; + struct ast_module_user *u; char *rest, *cur; struct dial_localuser *outgoing = NULL; struct ast_channel *peer; @@ -813,7 +812,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); parse = ast_strdupa(data); @@ -1634,7 +1633,7 @@ out: res = 0; done: - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } @@ -1650,7 +1649,7 @@ static int retrydial_exec(struct ast_channel *chan, void *data) char *announce = NULL, *dialdata = NULL; const char *context = NULL; int sleep = 0, loops = 0, res = -1; - struct localuser *u; + struct ast_module_user *u; struct ast_flags peerflags; if (ast_strlen_zero(data)) { @@ -1658,7 +1657,7 @@ static int retrydial_exec(struct ast_channel *chan, void *data) return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); announce = ast_strdupa(data); @@ -1739,23 +1738,23 @@ static int retrydial_exec(struct ast_channel *chan, void *data) if (ast_test_flag(chan, AST_FLAG_MOH)) ast_moh_stop(chan); done: - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app); res |= ast_unregister_application(rapp); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { int res; @@ -1765,14 +1764,4 @@ static int load_module(void *mod) return res; } -static const char *description(void) -{ - return "Dialing Application"; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD(MOD_1, NULL, NULL, NULL); +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Dialing Application"); diff --git a/apps/app_dictate.c b/apps/app_dictate.c index b77a389ae..0c46118e4 100644 --- a/apps/app_dictate.c +++ b/apps/app_dictate.c @@ -51,7 +51,6 @@ static char *synopsis = "Virtual Dictation Machine"; static char *desc = " Dictate([<base_dir>[|<filename>]])\n" "Start dictation machine using optional base dir for files.\n"; -LOCAL_USER_DECL; typedef enum { DFLAG_RECORD = (1 << 0), @@ -90,7 +89,7 @@ static int dictate_exec(struct ast_channel *chan, void *data) struct ast_flags flags = {0}; struct ast_filestream *fs; struct ast_frame *f = NULL; - struct localuser *u; + struct ast_module_user *u; int ffactor = 320 * 80, res = 0, done = 0, @@ -103,7 +102,7 @@ static int dictate_exec(struct ast_channel *chan, void *data) maxlen = 0, mode = 0; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); snprintf(dftbase, sizeof(dftbase), "%s/dictate", ast_config_AST_SPOOL_DIR); if (!ast_strlen_zero(data)) { @@ -123,7 +122,7 @@ static int dictate_exec(struct ast_channel *chan, void *data) oldr = chan->readformat; if ((res = ast_set_read_format(chan, AST_FORMAT_SLINEAR)) < 0) { ast_log(LOG_WARNING, "Unable to set to linear mode.\n"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } @@ -330,31 +329,20 @@ static int dictate_exec(struct ast_channel *chan, void *data) if (oldr) { ast_set_read_format(chan, oldr); } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app); return res; } -static int load_module(void *mod) +static int load_module(void) { - __mod_desc = mod; return ast_register_application(app, dictate_exec, synopsis, desc); } -static const char *description(void) -{ - return "Virtual Dictation Machine"; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD(MOD_1, NULL, NULL, NULL); +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Virtual Dictation Machine"); diff --git a/apps/app_directed_pickup.c b/apps/app_directed_pickup.c index c79bad26f..e45c87603 100644 --- a/apps/app_directed_pickup.c +++ b/apps/app_directed_pickup.c @@ -53,12 +53,11 @@ static const char *descrip = "10@PICKUPMARK, this application tries to find a channel which has defined a channel variable with the same context\n" "as \"extension\"."; -LOCAL_USER_DECL; static int pickup_exec(struct ast_channel *chan, void *data) { int res = 0; - struct localuser *u = NULL; + struct ast_module_user *u = NULL; struct ast_channel *origin = NULL, *target = NULL; char *tmp = NULL, *exten = NULL, *context = NULL, *rest=data; char workspace[256] = ""; @@ -69,7 +68,7 @@ static int pickup_exec(struct ast_channel *chan, void *data) return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); while (!target && (exten = rest) ) { res = 0; @@ -146,12 +145,12 @@ static int pickup_exec(struct ast_channel *chan, void *data) if (target) ast_mutex_unlock(&target->lock); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; @@ -160,20 +159,9 @@ static int unload_module(void *mod) return res; } -static int load_module(void *mod) +static int load_module(void) { - __mod_desc = mod; return ast_register_application(app, pickup_exec, synopsis, descrip); } -static const char *description(void) -{ - return "Directed Call Pickup Application"; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD(MOD_1, NULL, NULL, NULL); +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Directed Call Pickup Application"); diff --git a/apps/app_directory.c b/apps/app_directory.c index 55e91ce49..6f660e326 100644 --- a/apps/app_directory.c +++ b/apps/app_directory.c @@ -87,7 +87,6 @@ static char *descrip = /* How many digits to read in */ #define NUMDIGITS 3 -LOCAL_USER_DECL; #ifdef USE_ODBC_STORAGE static void retrieve_file(char *dir) @@ -514,7 +513,7 @@ static int do_directory(struct ast_channel *chan, struct ast_config *cfg, char * static int directory_exec(struct ast_channel *chan, void *data) { int res = 0; - struct localuser *u; + struct ast_module_user *u; struct ast_config *cfg; int last = 1; int readext = 0; @@ -531,7 +530,7 @@ static int directory_exec(struct ast_channel *chan, void *data) return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); parse = ast_strdupa(data); @@ -552,7 +551,7 @@ static int directory_exec(struct ast_channel *chan, void *data) cfg = realtime_directory(args.vmcontext); if (!cfg) { ast_log(LOG_ERROR, "Unable to read the configuration data!\n"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } @@ -583,20 +582,19 @@ static int directory_exec(struct ast_channel *chan, void *data) break; } ast_config_destroy(cfg); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app); return res; } -static int load_module(void *mod) +static int load_module(void) { - __mod_desc = mod; #ifdef USE_ODBC_STORAGE struct ast_config *cfg = ast_config_load(VOICEMAIL_CONFIG); char *tmp; @@ -619,14 +617,4 @@ static int load_module(void *mod) return ast_register_application(app, directory_exec, synopsis, descrip); } -static const char *description(void) -{ - return "Extension Directory"; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Extension Directory"); diff --git a/apps/app_disa.c b/apps/app_disa.c index 12019acbd..1ec0531bf 100644 --- a/apps/app_disa.c +++ b/apps/app_disa.c @@ -95,7 +95,6 @@ static char *descrip = "exists in the context, it will be used. Also, if you set the 5th argument\n" "to 'NOANSWER', the DISA application will not answer initially.\n"; -LOCAL_USER_DECL; static void play_dialtone(struct ast_channel *chan, char *mailbox) { @@ -115,7 +114,7 @@ static int disa_exec(struct ast_channel *chan, void *data) int i,j,k,x,did_ignore,special_noanswer; int firstdigittimeout = 20000; int digittimeout = 10000; - struct localuser *u; + struct ast_module_user *u; char *tmp, exten[AST_MAX_EXTENSION],acctcode[20]=""; char pwline[256]; char ourcidname[256],ourcidnum[256]; @@ -137,7 +136,7 @@ static int disa_exec(struct ast_channel *chan, void *data) return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if (chan->pbx) { firstdigittimeout = chan->pbx->rtimeout*1000; @@ -146,12 +145,12 @@ static int disa_exec(struct ast_channel *chan, void *data) if (ast_set_write_format(chan,AST_FORMAT_ULAW)) { ast_log(LOG_WARNING, "Unable to set write format to Mu-law on %s\n", chan->name); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } if (ast_set_read_format(chan,AST_FORMAT_ULAW)) { ast_log(LOG_WARNING, "Unable to set read format to Mu-law on %s\n", chan->name); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } @@ -209,13 +208,13 @@ static int disa_exec(struct ast_channel *chan, void *data) f = ast_read(chan); if (f == NULL) { - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } if ((f->frametype == AST_FRAME_CONTROL) && (f->subclass == AST_CONTROL_HANGUP)) { ast_frfree(f); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } if (f->frametype == AST_FRAME_VOICE) { @@ -245,7 +244,7 @@ static int disa_exec(struct ast_channel *chan, void *data) fp = fopen(args.passcode,"r"); if (!fp) { ast_log(LOG_WARNING,"DISA password file %s not found on chan %s\n",args.passcode,chan->name); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } pwline[0] = 0; @@ -346,7 +345,7 @@ static int disa_exec(struct ast_channel *chan, void *data) if (special_noanswer) flags.flags = 0; ast_cdr_reset(chan->cdr, &flags); ast_explicit_goto(chan, args.context, exten, 1); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } } @@ -367,34 +366,24 @@ reorder: ast_frfree(f); } ast_playtones_stop(chan); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { return ast_register_application(app, disa_exec, synopsis, descrip); } -static const char *description(void) -{ - return "DISA (Direct Inward System Access) Application"; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "DISA (Direct Inward System Access) Application"); diff --git a/apps/app_dumpchan.c b/apps/app_dumpchan.c index 8a06baef3..426ba4eab 100644 --- a/apps/app_dumpchan.c +++ b/apps/app_dumpchan.c @@ -56,7 +56,6 @@ static char *desc = "displayed when the verbose level is currently set to that number\n" "or greater. \n"; -LOCAL_USER_DECL; static int serialize_showchan(struct ast_channel *c, char *buf, size_t size) { @@ -137,13 +136,13 @@ static int serialize_showchan(struct ast_channel *c, char *buf, size_t size) static int dumpchan_exec(struct ast_channel *chan, void *data) { - struct localuser *u; + struct ast_module_user *u; char vars[BUFSIZ * 4]; char info[1024]; int level = 0; static char *line = "================================================================================"; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if (!ast_strlen_zero(data)) level = atoi(data); @@ -153,35 +152,25 @@ static int dumpchan_exec(struct ast_channel *chan, void *data) if (option_verbose >= level) ast_verbose("\nDumping Info For Channel: %s:\n%s\nInfo:\n%s\nVariables:\n%s%s\n", chan->name, line, info, vars, line); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { return ast_register_application(app, dumpchan_exec, synopsis, desc); } -static const char *description(void) -{ - return "Dump Info About The Calling Channel"; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Dump Info About The Calling Channel"); diff --git a/apps/app_echo.c b/apps/app_echo.c index 85df130f1..19a86382e 100644 --- a/apps/app_echo.c +++ b/apps/app_echo.c @@ -41,8 +41,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/pbx.h" #include "asterisk/module.h" -static char *tdesc = "Simple Echo Application"; - static char *app = "Echo"; static char *synopsis = "Echo audio, video, or DTMF back to the calling party"; @@ -52,15 +50,14 @@ static char *descrip = "the calling channel back to itself. If the DTMF digit '#' is received, the\n" "application will exit.\n"; -LOCAL_USER_DECL; static int echo_exec(struct ast_channel *chan, void *data) { int res = -1; int format; - struct localuser *u; + struct ast_module_user *u; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); format = ast_best_codec(chan->nativeformats); ast_set_write_format(chan, format); @@ -95,34 +92,24 @@ static int echo_exec(struct ast_channel *chan, void *data) ast_frfree(f); } end: - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { return ast_register_application(app, echo_exec, synopsis, descrip); } -static const char *description(void) -{ - return tdesc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Simple Echo Application"); diff --git a/apps/app_exec.c b/apps/app_exec.c index d0c2591df..0aafac343 100644 --- a/apps/app_exec.c +++ b/apps/app_exec.c @@ -45,8 +45,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") /* Maximum length of any variable */ #define MAXRESULT 1024 -static char *tdesc = "Executes dialplan applications"; - /*! Note * * The key difference between these two apps is exit status. In a @@ -90,16 +88,14 @@ static char *execif_descrip = "If <expr> is true, but <app> is not found, then the application\n" "will return a non-zero value.\n"; -LOCAL_USER_DECL; - static int exec_exec(struct ast_channel *chan, void *data) { int res=0; - struct localuser *u; + struct ast_module_user *u; char *s, *appname, *endargs, args[MAXRESULT] = ""; struct ast_app *app; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); /* Check and parse arguments */ if (data) { @@ -122,18 +118,18 @@ static int exec_exec(struct ast_channel *chan, void *data) } } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } static int tryexec_exec(struct ast_channel *chan, void *data) { int res=0; - struct localuser *u; + struct ast_module_user *u; char *s, *appname, *endargs, args[MAXRESULT] = ""; struct ast_app *app; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); /* Check and parse arguments */ if (data) { @@ -157,19 +153,20 @@ static int tryexec_exec(struct ast_channel *chan, void *data) } } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } -static int execif_exec(struct ast_channel *chan, void *data) { - int res=0; - struct localuser *u; +static int execif_exec(struct ast_channel *chan, void *data) +{ + int res = 0; + struct ast_module_user *u; char *myapp = NULL; char *mydata = NULL; char *expr = NULL; struct ast_app *app = NULL; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); expr = ast_strdupa(data); @@ -195,11 +192,12 @@ static int execif_exec(struct ast_channel *chan, void *data) { res = -1; } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); + return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; @@ -207,12 +205,12 @@ static int unload_module(void *mod) res |= ast_unregister_application(app_tryexec); res |= ast_unregister_application(app_execif); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { int res = ast_register_application(app_exec, exec_exec, exec_synopsis, exec_descrip); res |= ast_register_application(app_tryexec, tryexec_exec, tryexec_synopsis, tryexec_descrip); @@ -220,14 +218,4 @@ static int load_module(void *mod) return res; } -static const char *description(void) -{ - return tdesc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Executes dialplan applications"); diff --git a/apps/app_externalivr.c b/apps/app_externalivr.c index 787cc369c..e81f4f34f 100644 --- a/apps/app_externalivr.c +++ b/apps/app_externalivr.c @@ -83,7 +83,6 @@ struct ivr_localuser { int option_autoclear; }; -LOCAL_USER_DECL; struct gen_state { struct ivr_localuser *u; @@ -242,7 +241,7 @@ static struct playlist_entry *make_entry(const char *filename) static int app_exec(struct ast_channel *chan, void *data) { - struct localuser *lu = NULL; + struct ast_module_user *lu; struct playlist_entry *entry; const char *args = data; int child_stdin[2] = { 0,0 }; @@ -263,14 +262,14 @@ static int app_exec(struct ast_channel *chan, void *data) }; struct ivr_localuser *u = &foo; - LOCAL_USER_ADD(lu); + lu = ast_module_user_add(chan); u->abort_current_sound = 0; u->chan = chan; if (ast_strlen_zero(args)) { ast_log(LOG_WARNING, "ExternalIVR requires a command to execute\n"); - LOCAL_USER_REMOVE(lu); + ast_module_user_remove(lu); return -1; } @@ -545,35 +544,25 @@ static int app_exec(struct ast_channel *chan, void *data) while ((entry = AST_LIST_REMOVE_HEAD(&u->playlist, list))) free(entry); - LOCAL_USER_REMOVE(lu); + ast_module_user_remove(lu); return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { return ast_register_application(app, app_exec, synopsis, descrip); } -static const char *description(void) -{ - return "External IVR Interface Application"; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "External IVR Interface Application"); diff --git a/apps/app_festival.c b/apps/app_festival.c index caec727c8..f6e1d7503 100644 --- a/apps/app_festival.c +++ b/apps/app_festival.c @@ -68,7 +68,6 @@ static char *descrip = "play it to the user, allowing any given interrupt keys to immediately terminate and return\n" "the value, or 'any' to allow any number back (useful in dialplan)\n"; -LOCAL_USER_DECL; static char *socket_receive_file_to_buff(int fd,int *size) { @@ -275,7 +274,7 @@ static int festival_exec(struct ast_channel *chan, void *vdata) { int usecache; int res=0; - struct localuser *u; + struct ast_module_user *u; struct sockaddr_in serv_addr; struct hostent *serverhost; struct ast_hostent ahp; @@ -314,12 +313,12 @@ static int festival_exec(struct ast_channel *chan, void *vdata) return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); cfg = ast_config_load(FESTIVAL_CONFIG); if (!cfg) { ast_log(LOG_WARNING, "No such configuration file %s\n", FESTIVAL_CONFIG); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } if (!(host = ast_variable_retrieve(cfg, "general", "host"))) { @@ -376,7 +375,7 @@ static int festival_exec(struct ast_channel *chan, void *vdata) if (fd < 0) { ast_log(LOG_WARNING,"festival_client: can't get socket\n"); ast_config_destroy(cfg); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } memset(&serv_addr, 0, sizeof(serv_addr)); @@ -386,7 +385,7 @@ static int festival_exec(struct ast_channel *chan, void *vdata) if (serverhost == (struct hostent *)0) { ast_log(LOG_WARNING,"festival_client: gethostbyname failed\n"); ast_config_destroy(cfg); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } memmove(&serv_addr.sin_addr,serverhost->h_addr, serverhost->h_length); @@ -397,7 +396,7 @@ static int festival_exec(struct ast_channel *chan, void *vdata) if (connect(fd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) != 0) { ast_log(LOG_WARNING,"festival_client: connect to server failed\n"); ast_config_destroy(cfg); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } @@ -489,7 +488,7 @@ static int festival_exec(struct ast_channel *chan, void *vdata) ast_log(LOG_WARNING,"Unable to read from cache/festival fd"); close(fd); ast_config_destroy(cfg); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } n += read_data; @@ -516,36 +515,25 @@ static int festival_exec(struct ast_channel *chan, void *vdata) } while (strcmp(ack,"OK\n") != 0); close(fd); ast_config_destroy(cfg); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { return ast_register_application(app, festival_exec, synopsis, descrip); } -static const char *description(void) -{ - return "Simple Festival Interface"; - -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Simple Festival Interface"); diff --git a/apps/app_flash.c b/apps/app_flash.c index d237fbc06..446b2a1f8 100644 --- a/apps/app_flash.c +++ b/apps/app_flash.c @@ -59,7 +59,6 @@ static char *descrip = "people who want to perform transfers and such via AGI and is generally\n" "quite useless oths application will only work on Zap trunks.\n"; -LOCAL_USER_DECL; static inline int zt_wait_event(int fd) { @@ -75,9 +74,9 @@ static int flash_exec(struct ast_channel *chan, void *data) { int res = -1; int x; - struct localuser *u; + struct ast_module_user *u; struct zt_params ztp; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if (!strcasecmp(chan->tech->type, "Zap")) { memset(&ztp, 0, sizeof(ztp)); res = ioctl(chan->fds[0], ZT_GET_PARAMS, &ztp); @@ -101,35 +100,25 @@ static int flash_exec(struct ast_channel *chan, void *data) ast_log(LOG_WARNING, "Unable to get parameters of %s: %s\n", chan->name, strerror(errno)); } else ast_log(LOG_WARNING, "%s is not a Zap channel\n", chan->name); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { return ast_register_application(app, flash_exec, synopsis, descrip); } -static const char *description(void) -{ - return "Flash zap trunk application"; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Flash channel application"); diff --git a/apps/app_followme.c b/apps/app_followme.c index 09fb45169..24f134d85 100644 --- a/apps/app_followme.c +++ b/apps/app_followme.c @@ -72,10 +72,7 @@ static char *descrip = " s - Playback the incoming status message prior to starting the follow-me step(s)\n" " a - Record the caller's name so it can be announced to the callee on each step\n" " n - Playback the unreachable status message if we've run out of steps to reach the\n" -" or the callee has elected not to be reachable.\n" - - -LOCAL_USER_DECL; +" or the callee has elected not to be reachable.\n"; struct number { char number[512]; /*!< Phone Number(s) and/or Extension(s) */ @@ -916,7 +913,7 @@ static int app_exec(struct ast_channel *chan, void *data) struct ast_call_followme *f; struct number *nm, *newnm; int res = 0; - struct localuser *u; + struct ast_module_user *u; char *argstr; char namerecloc[255]; int duration = 0; @@ -938,7 +935,7 @@ static int app_exec(struct ast_channel *chan, void *data) return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); AST_STANDARD_APP_ARGS(args, argstr); @@ -1074,47 +1071,47 @@ static int app_exec(struct ast_channel *chan, void *data) } outrun: - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); + return res; } -static int unload_module(void *mod) +static int unload_module(void) { struct ast_call_followme *f; - STANDARD_HANGUP_LOCALUSERS; + + ast_module_user_hangup_all(); + ast_unregister_application(app); + /* Free Memory. Yeah! I'm free! */ AST_LIST_LOCK(&followmes); - AST_LIST_TRAVERSE_SAFE_BEGIN(&followmes, f, entry) { + while ((f = AST_LIST_REMOVE_HEAD(&followmes, entry))) { free_numbers(f); - AST_LIST_REMOVE_CURRENT(&followmes, entry); free(f); } - AST_LIST_TRAVERSE_SAFE_END + AST_LIST_UNLOCK(&followmes); + return 0; } -static int load_module(void *mod) +static int load_module(void) { reload_followme(); - return ast_register_application(app, app_exec, synopsis, descrip); -} -static const char *description(void) -{ - return "Find-Me/Follow-Me Application"; + return ast_register_application(app, app_exec, synopsis, descrip); } -static int reload(void *mod) +static int reload(void) { reload_followme(); - return 0; -} -static const char *key(void) -{ - return ASTERISK_GPL_KEY; + return 0; } -STD_MOD(MOD_1, reload, NULL, NULL); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Find-Me/Follow-Me Application", + .load = load_module, + .unload = unload_module, + .reload = reload, + ); diff --git a/apps/app_forkcdr.c b/apps/app_forkcdr.c index 620148604..d9c5b293f 100644 --- a/apps/app_forkcdr.c +++ b/apps/app_forkcdr.c @@ -50,7 +50,6 @@ static char *descrip = "cdr record starting from the time of the fork call\n" "If the option 'v' is passed all cdr variables will be passed along also.\n"; -LOCAL_USER_DECL; static void ast_cdr_fork(struct ast_channel *chan) { @@ -78,48 +77,38 @@ static void ast_cdr_fork(struct ast_channel *chan) static int forkcdr_exec(struct ast_channel *chan, void *data) { int res = 0; - struct localuser *u; + struct ast_module_user *u; if (!chan->cdr) { ast_log(LOG_WARNING, "Channel does not have a CDR\n"); return 0; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if (!ast_strlen_zero(data)) ast_set2_flag(chan->cdr, strchr(data, 'v'), AST_CDR_FLAG_KEEP_VARS); ast_cdr_fork(chan); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { return ast_register_application(app, forkcdr_exec, synopsis, descrip); } -static const char *description(void) -{ - return "Fork The CDR into 2 separate entities."; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Fork The CDR into 2 separate entities"); diff --git a/apps/app_getcpeid.c b/apps/app_getcpeid.c index be0e0657d..7dbd5f6fd 100644 --- a/apps/app_getcpeid.c +++ b/apps/app_getcpeid.c @@ -51,7 +51,6 @@ static char *descrip = " GetCPEID: Obtains and displays ADSI CPE ID and other information in order\n" "to properly setup zapata.conf for on-hook operations.\n"; -LOCAL_USER_DECL; static int cpeid_setstatus(struct ast_channel *chan, char *stuff[], int voice) { @@ -67,7 +66,7 @@ static int cpeid_setstatus(struct ast_channel *chan, char *stuff[], int voice) static int cpeid_exec(struct ast_channel *chan, void *idata) { int res=0; - struct localuser *u; + struct ast_module_user *u; unsigned char cpeid[4]; int gotgeometry = 0; int gotcpeid = 0; @@ -75,7 +74,7 @@ static int cpeid_exec(struct ast_channel *chan, void *idata) char data[4][80]; char *stuff[4]; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); stuff[0] = data[0]; stuff[1] = data[1]; stuff[2] = data[2]; @@ -127,34 +126,24 @@ static int cpeid_exec(struct ast_channel *chan, void *idata) adsi_unload_session(chan); } } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { return ast_register_application(app, cpeid_exec, synopsis, descrip); } -static const char *description(void) -{ - return "Get ADSI CPE ID"; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Get ADSI CPE ID"); diff --git a/apps/app_hasnewvoicemail.c b/apps/app_hasnewvoicemail.c index 22a5d3f30..33204bbe9 100644 --- a/apps/app_hasnewvoicemail.c +++ b/apps/app_hasnewvoicemail.c @@ -77,11 +77,10 @@ static char *hasnewvoicemail_descrip = " HASVMSTATUS The result of the new voicemail check returned as a text string as follows\n" " <# of messages in the folder, 0 for NONE>\n"; -LOCAL_USER_DECL; static int hasvoicemail_exec(struct ast_channel *chan, void *data) { - struct localuser *u; + struct ast_module_user *u; char *input, *varname = NULL, *vmbox, *context = "default"; char *vmfolder; int vmcount = 0; @@ -104,7 +103,7 @@ static int hasvoicemail_exec(struct ast_channel *chan, void *data) return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); input = ast_strdupa(data); @@ -146,21 +145,21 @@ static int hasvoicemail_exec(struct ast_channel *chan, void *data) snprintf(tmp, sizeof(tmp), "%d", vmcount); pbx_builtin_setvar_helper(chan, "HASVMSTATUS", tmp); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } static int acf_vmcount_exec(struct ast_channel *chan, char *cmd, char *argsstr, char *buf, size_t len) { - struct localuser *u; + struct ast_module_user *u; char *context; AST_DECLARE_APP_ARGS(args, AST_APP_ARG(vmbox); AST_APP_ARG(folder); ); - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); buf[0] = '\0'; @@ -179,7 +178,7 @@ static int acf_vmcount_exec(struct ast_channel *chan, char *cmd, char *argsstr, snprintf(buf, len, "%d", ast_app_messagecount(context, args.vmbox, args.folder)); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } @@ -194,7 +193,7 @@ struct ast_custom_function acf_vmcount = { .read = acf_vmcount_exec, }; -static int unload_module(void *mod) +static int unload_module(void) { int res; @@ -202,12 +201,12 @@ static int unload_module(void *mod) res |= ast_unregister_application(app_hasvoicemail); res |= ast_unregister_application(app_hasnewvoicemail); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { int res; @@ -218,14 +217,4 @@ static int load_module(void *mod) return res; } -static const char *description(void) -{ - return "Indicator for whether a voice mailbox has messages in a given folder."; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Indicator for whether a voice mailbox has messages in a given folder."); diff --git a/apps/app_ices.c b/apps/app_ices.c index 67b107e41..9d93dabdf 100644 --- a/apps/app_ices.c +++ b/apps/app_ices.c @@ -60,7 +60,6 @@ static char *descrip = "(available separately). A configuration file must be supplied\n" "for ices (see examples/asterisk-ices.conf). \n"; -LOCAL_USER_DECL; static int icesencode(char *filename, int fd) { @@ -91,7 +90,7 @@ static int icesencode(char *filename, int fd) static int ices_exec(struct ast_channel *chan, void *data) { int res=0; - struct localuser *u; + struct ast_module_user *u; int fds[2]; int ms = -1; int pid = -1; @@ -107,13 +106,13 @@ static int ices_exec(struct ast_channel *chan, void *data) return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); last = ast_tv(0, 0); if (pipe(fds)) { ast_log(LOG_WARNING, "Unable to create pipe\n"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } flags = fcntl(fds[1], F_GETFL); @@ -128,7 +127,7 @@ static int ices_exec(struct ast_channel *chan, void *data) close(fds[0]); close(fds[1]); ast_log(LOG_WARNING, "Answer failed!\n"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } @@ -138,7 +137,7 @@ static int ices_exec(struct ast_channel *chan, void *data) close(fds[0]); close(fds[1]); ast_log(LOG_WARNING, "Unable to set write format to signed linear\n"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } if (((char *)data)[0] == '/') @@ -188,35 +187,25 @@ static int ices_exec(struct ast_channel *chan, void *data) if (!res && oreadformat) ast_set_read_format(chan, oreadformat); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { return ast_register_application(app, ices_exec, synopsis, descrip); } -static const char *description(void) -{ - return "Encode and Stream via icecast and ices"; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Encode and Stream via icecast and ices"); diff --git a/apps/app_image.c b/apps/app_image.c index b6308f0be..f5f327197 100644 --- a/apps/app_image.c +++ b/apps/app_image.c @@ -44,8 +44,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/app.h" #include "asterisk/options.h" -static char *tdesc = "Image Transmission Application"; - static char *app = "SendImage"; static char *synopsis = "Send an image file"; @@ -61,12 +59,11 @@ static char *descrip = " SENDIMAGESTATUS The status is the result of the attempt as a text string, one of\n" " OK | NOSUPPORT \n"; -LOCAL_USER_DECL; static int sendimage_exec(struct ast_channel *chan, void *data) { int res = 0; - struct localuser *u; + struct ast_module_user *u; char *parse; int priority_jump = 0; AST_DECLARE_APP_ARGS(args, @@ -74,7 +71,7 @@ static int sendimage_exec(struct ast_channel *chan, void *data) AST_APP_ARG(options); ); - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); parse = ast_strdupa(data); @@ -95,7 +92,7 @@ static int sendimage_exec(struct ast_channel *chan, void *data) if (priority_jump || ast_opt_priority_jumping) ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101); pbx_builtin_setvar_helper(chan, "SENDIMAGESTATUS", "NOSUPPORT"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } @@ -104,35 +101,25 @@ static int sendimage_exec(struct ast_channel *chan, void *data) if (!res) pbx_builtin_setvar_helper(chan, "SENDIMAGESTATUS", "OK"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { return ast_register_application(app, sendimage_exec, synopsis, descrip); } -static const char *description(void) -{ - return tdesc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Image Transmission Application"); diff --git a/apps/app_ivrdemo.c b/apps/app_ivrdemo.c index d3dd2e9a0..933ae9040 100644 --- a/apps/app_ivrdemo.c +++ b/apps/app_ivrdemo.c @@ -88,19 +88,18 @@ AST_IVR_DECLARE_MENU(ivr_demo, "IVR Demo Main Menu", 0, { NULL }, }); -LOCAL_USER_DECL; static int skel_exec(struct ast_channel *chan, void *data) { int res=0; - struct localuser *u; + struct ast_module_user *u; if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "skel requires an argument (filename)\n"); return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); /* Do our thing here */ @@ -109,36 +108,25 @@ static int skel_exec(struct ast_channel *chan, void *data) if (!res) res = ast_ivr_menu_run(chan, &ivr_demo, data); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { return ast_register_application(app, skel_exec, tdesc, synopsis); } -static const char *description(void) -{ - return tdesc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; - +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "IVR Demo Application"); diff --git a/apps/app_lookupblacklist.c b/apps/app_lookupblacklist.c index b0f3a419f..2eb1e545a 100644 --- a/apps/app_lookupblacklist.c +++ b/apps/app_lookupblacklist.c @@ -47,8 +47,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/astdb.h" #include "asterisk/options.h" -static char *tdesc = "Look up Caller*ID name/number from blacklist database"; - static char *app = "LookupBlacklist"; static char *synopsis = "Look up Caller*ID name/number from blacklist database"; @@ -63,7 +61,6 @@ static char *descrip = " FOUND | NOTFOUND\n" "Example: exten => 1234,1,LookupBlacklist()\n"; -LOCAL_USER_DECL; static int blacklist_read(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len) { @@ -95,12 +92,12 @@ static int lookupblacklist_exec (struct ast_channel *chan, void *data) { char blacklist[1]; - struct localuser *u; + struct ast_module_user *u; int bl = 0; int priority_jump = 0; static int dep_warning = 0; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if (!dep_warning) { dep_warning = 1; @@ -134,38 +131,28 @@ lookupblacklist_exec (struct ast_channel *chan, void *data) } else pbx_builtin_setvar_helper(chan, "LOOKUPBLSTATUS", "NOTFOUND"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app); res |= ast_custom_function_unregister(&blacklist_function); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { int res = ast_custom_function_register(&blacklist_function); res |= ast_register_application (app, lookupblacklist_exec, synopsis,descrip); return res; } -static const char *description(void) -{ - return tdesc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Look up Caller*ID name/number from blacklist database"); diff --git a/apps/app_lookupcidname.c b/apps/app_lookupcidname.c index 711ca5b76..5a0042a29 100644 --- a/apps/app_lookupcidname.c +++ b/apps/app_lookupcidname.c @@ -45,8 +45,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/callerid.h" #include "asterisk/astdb.h" -static char *tdesc = "Look up CallerID Name from local database"; - static char *app = "LookupCIDName"; static char *synopsis = "Look up CallerID Name from local database"; @@ -59,56 +57,45 @@ static char *descrip = "name delivery, or if you want to change the names on some incoming\n" "calls.\n"; -LOCAL_USER_DECL; -static int -lookupcidname_exec (struct ast_channel *chan, void *data) +static int lookupcidname_exec (struct ast_channel *chan, void *data) { - char dbname[64]; - struct localuser *u; + char dbname[64]; + struct ast_module_user *u; static int dep_warning = 0; - LOCAL_USER_ADD (u); + u = ast_module_user_add(chan); if (!dep_warning) { dep_warning = 1; ast_log(LOG_WARNING, "LookupCIDName is deprecated. Please use ${DB(cidname/${CALLERID(num)})} instead.\n"); } - if (chan->cid.cid_num) { - if (!ast_db_get ("cidname", chan->cid.cid_num, dbname, sizeof (dbname))) { - ast_set_callerid (chan, NULL, dbname, NULL); - if (option_verbose > 2) - ast_verbose (VERBOSE_PREFIX_3 "Changed Caller*ID name to %s\n", - dbname); + if (chan->cid.cid_num) { + if (!ast_db_get ("cidname", chan->cid.cid_num, dbname, sizeof (dbname))) { + ast_set_callerid (chan, NULL, dbname, NULL); + if (option_verbose > 2) + ast_verbose (VERBOSE_PREFIX_3 "Changed Caller*ID name to %s\n", + dbname); + } } - } - LOCAL_USER_REMOVE (u); - return 0; + ast_module_user_remove(u); + + return 0; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application (app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { return ast_register_application (app, lookupcidname_exec, synopsis, descrip); } -static const char *description(void) -{ - return tdesc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Look up CallerID Name from local database"); diff --git a/apps/app_macro.c b/apps/app_macro.c index 13db5ce8a..5adc0a07f 100644 --- a/apps/app_macro.c +++ b/apps/app_macro.c @@ -50,8 +50,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") /* special result value used to force macro exit */ #define MACRO_EXIT_RESULT 1024 -static char *tdesc = "Extension Macros"; - static char *descrip = " Macro(macroname|arg1|arg2...): Executes a macro using the context\n" "'macro-<macroname>', jumping to the 's' extension of that context and\n" @@ -94,7 +92,6 @@ static char *if_synopsis = "Conditional Macro Implementation"; static char *exclusive_synopsis = "Exclusive Macro Implementation"; static char *exit_synopsis = "Exit From Macro"; -LOCAL_USER_DECL; static int _macro_exec(struct ast_channel *chan, void *data, int exclusive) { @@ -120,14 +117,14 @@ static int _macro_exec(struct ast_channel *chan, void *data, int exclusive) char *save_macro_context; char *save_macro_priority; char *save_macro_offset; - struct localuser *u; + struct ast_module_user *u; if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "Macro() requires arguments. See \"show application macro\" for help.\n"); return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); /* does the user want a deeper rabbit hole? */ s = pbx_builtin_getvar_helper(chan, "MACRO_RECURSION"); @@ -140,7 +137,7 @@ static int _macro_exec(struct ast_channel *chan, void *data, int exclusive) sscanf(s, "%d", &depth); if (depth >= maxdepth) { ast_log(LOG_ERROR, "Macro(): possible infinite loop detected. Returning early.\n"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } snprintf(depthc, sizeof(depthc), "%d", depth + 1); @@ -151,7 +148,7 @@ static int _macro_exec(struct ast_channel *chan, void *data, int exclusive) macro = strsep(&rest, "|"); if (ast_strlen_zero(macro)) { ast_log(LOG_WARNING, "Invalid macro name specified\n"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } @@ -161,7 +158,7 @@ static int _macro_exec(struct ast_channel *chan, void *data, int exclusive) ast_log(LOG_WARNING, "No such context '%s' for macro '%s'\n", fullmacro, macro); else ast_log(LOG_WARNING, "Context '%s' for macro '%s' lacks 's' extension, priority 1\n", fullmacro, macro); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } @@ -172,7 +169,8 @@ static int _macro_exec(struct ast_channel *chan, void *data, int exclusive) if (ast_context_lockmacro(fullmacro)) { ast_log(LOG_WARNING, "Failed to lock macro '%s' as in-use\n", fullmacro); ast_autoservice_stop(chan); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); + return 0; } ast_autoservice_stop(chan); @@ -339,7 +337,8 @@ static int _macro_exec(struct ast_channel *chan, void *data, int exclusive) } } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); + return res; } @@ -357,12 +356,12 @@ static int macroif_exec(struct ast_channel *chan, void *data) { char *expr = NULL, *label_a = NULL, *label_b = NULL; int res = 0; - struct localuser *u; + struct ast_module_user *u; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if (!(expr = ast_strdupa(data))) { - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } @@ -380,7 +379,7 @@ static int macroif_exec(struct ast_channel *chan, void *data) } else ast_log(LOG_WARNING, "Invalid Syntax.\n"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } @@ -390,7 +389,7 @@ static int macro_exit_exec(struct ast_channel *chan, void *data) return MACRO_EXIT_RESULT; } -static int unload_module(void *mod) +static int unload_module(void) { int res; @@ -399,12 +398,12 @@ static int unload_module(void *mod) res |= ast_unregister_application(app); res |= ast_unregister_application(exclusive_app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { int res; @@ -416,14 +415,4 @@ static int load_module(void *mod) return res; } -static const char *description(void) -{ - return tdesc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Extension Macros"); diff --git a/apps/app_meetme.c b/apps/app_meetme.c index 4abfdb3c3..1f2ffc5c7 100644 --- a/apps/app_meetme.c +++ b/apps/app_meetme.c @@ -64,8 +64,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "enter.h" #include "leave.h" -LOCAL_USER_DECL; - #define CONFIG_FILE_NAME "meetme.conf" /*! each buffer is 20ms, so this is 640ms total */ @@ -292,8 +290,6 @@ static const char *descripslat = #define CONFIG_FILE_NAME "meetme.conf" #define CONFIG_FILE_NAME_SLA "sla.conf" -LOCAL_USER_DECL; - /*! \brief The MeetMe Conference object */ struct ast_conference { ast_mutex_t playlock; /*!< Conference specific lock (players) */ @@ -2099,7 +2095,7 @@ static struct ast_conference *find_conf(struct ast_channel *chan, char *confno, /*! \brief The MeetmeCount application */ static int count_exec(struct ast_channel *chan, void *data) { - struct localuser *u; + struct ast_module_user *u; int res = 0; struct ast_conference *conf; int count; @@ -2115,10 +2111,10 @@ static int count_exec(struct ast_channel *chan, void *data) return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if (!(localdata = ast_strdupa(data))) { - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } @@ -2140,7 +2136,7 @@ static int count_exec(struct ast_channel *chan, void *data) ast_answer(chan); res = ast_say_number(chan, count, "", chan->language, (char *) NULL); /* Needs gender */ } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } @@ -2149,7 +2145,7 @@ static int count_exec(struct ast_channel *chan, void *data) static int conf_exec(struct ast_channel *chan, void *data) { int res=-1; - struct localuser *u; + struct ast_module_user *u; char confno[AST_MAX_EXTENSION] = ""; int allowretry = 0; int retrycnt = 0; @@ -2165,7 +2161,7 @@ static int conf_exec(struct ast_channel *chan, void *data) AST_APP_ARG(pin); ); - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if (ast_strlen_zero(data)) { allowretry = 1; @@ -2403,7 +2399,7 @@ static int conf_exec(struct ast_channel *chan, void *data) } } while (allowretry); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } @@ -2500,7 +2496,7 @@ static int sla_checkforhold(struct ast_conference *conf, int hangup) static int sla_exec(struct ast_channel *chan, void *data, int trunk) { int res=-1; - struct localuser *u; + struct ast_module_user *u; char confno[AST_MAX_EXTENSION] = ""; struct ast_sla *sla; struct ast_conference *cnf; @@ -2526,8 +2522,7 @@ static int sla_exec(struct ast_channel *chan, void *data, int trunk) return -1; } - LOCAL_USER_ADD(u); - + u = ast_module_user_add(chan); if (args.options) ast_app_parse_options(sla_opts, &confflags, NULL, args.options); @@ -2562,7 +2557,7 @@ static int sla_exec(struct ast_channel *chan, void *data, int trunk) ast_log(LOG_WARNING, "SLA%c: SLA '%s' not found!\n", trunk ? 'T' : 'S', args.confno); } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } @@ -2600,7 +2595,7 @@ static int admin_exec(struct ast_channel *chan, void *data) { char *params; struct ast_conference *cnf; struct ast_conf_user *user = NULL; - struct localuser *u; + struct ast_module_user *u; AST_DECLARE_APP_ARGS(args, AST_APP_ARG(confno); AST_APP_ARG(command); @@ -2612,7 +2607,7 @@ static int admin_exec(struct ast_channel *chan, void *data) { return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); AST_LIST_LOCK(&confs); @@ -2622,7 +2617,7 @@ static int admin_exec(struct ast_channel *chan, void *data) { if (!args.command) { ast_log(LOG_WARNING, "MeetmeAdmin requires a command!\n"); AST_LIST_UNLOCK(&confs); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } AST_LIST_TRAVERSE(&confs, cnf, list) { @@ -2632,8 +2627,8 @@ static int admin_exec(struct ast_channel *chan, void *data) { if (!cnf) { ast_log(LOG_WARNING, "Conference number '%s' not found!\n", args.confno); - LOCAL_USER_REMOVE(u); AST_LIST_UNLOCK(&confs); + ast_module_user_remove(u); return 0; } @@ -2740,7 +2735,7 @@ static int admin_exec(struct ast_channel *chan, void *data) { AST_LIST_UNLOCK(&confs); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } @@ -3051,11 +3046,11 @@ static void load_config(void) load_config_sla(); } -static int unload_module(void *mod) +static int unload_module(void) { - int res; + int res = 0; - res = ast_cli_unregister(&cli_show_confs); + res |= ast_cli_unregister(&cli_show_confs); res |= ast_cli_unregister(&cli_sla_show); res |= ast_cli_unregister(&cli_conf); res |= ast_manager_unregister("MeetmeMute"); @@ -3066,14 +3061,14 @@ static int unload_module(void *mod) res |= ast_unregister_application(appslas); res |= ast_unregister_application(appslat); + ast_module_user_hangup_all(); ast_devstate_prov_del("Meetme"); ast_devstate_prov_del("SLA"); - STANDARD_HANGUP_LOCALUSERS; return res; } -static int load_module(void *mod) +static int load_module(void) { int res; @@ -3095,22 +3090,16 @@ static int load_module(void *mod) return res; } -static int reload(void *mod) +static int reload(void) { load_config(); return 0; } -static const char *description(void) -{ - return "MeetMe conference bridge"; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD(MOD_1, reload, NULL, NULL); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "MeetMe conference bridge", + .load = load_module, + .unload = unload_module, + .reload = reload, + ); diff --git a/apps/app_milliwatt.c b/apps/app_milliwatt.c index 8c7fbe4c0..08a96f96b 100644 --- a/apps/app_milliwatt.c +++ b/apps/app_milliwatt.c @@ -50,7 +50,6 @@ static char *synopsis = "Generate a Constant 1000Hz tone at 0dbm (mu-law)"; static char *descrip = "Milliwatt(): Generate a Constant 1000Hz tone at 0dbm (mu-law)\n"; -LOCAL_USER_DECL; static char digital_milliwatt[] = {0x1e,0x0b,0x0b,0x1e,0x9e,0x8b,0x8b,0x9e} ; @@ -118,8 +117,8 @@ static struct ast_generator milliwattgen = static int milliwatt_exec(struct ast_channel *chan, void *data) { - struct localuser *u; - LOCAL_USER_ADD(u); + struct ast_module_user *u; + u = ast_module_user_add(chan); ast_set_write_format(chan, AST_FORMAT_ULAW); ast_set_read_format(chan, AST_FORMAT_ULAW); if (chan->_state != AST_STATE_UP) @@ -129,39 +128,29 @@ static int milliwatt_exec(struct ast_channel *chan, void *data) if (ast_activate_generator(chan,&milliwattgen,"milliwatt") < 0) { ast_log(LOG_WARNING,"Failed to activate generator on '%s'\n",chan->name); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } while(!ast_safe_sleep(chan, 10000)); ast_deactivate_generator(chan); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { return ast_register_application(app, milliwatt_exec, synopsis, descrip); } -static const char *description(void) -{ - return "Digital Milliwatt (mu-law) Test Application"; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Digital Milliwatt (mu-law) Test Application"); diff --git a/apps/app_mixmonitor.c b/apps/app_mixmonitor.c index 35511c4b2..2aaf7d6a8 100644 --- a/apps/app_mixmonitor.c +++ b/apps/app_mixmonitor.c @@ -164,7 +164,6 @@ static void *mixmonitor_thread(void *obj) struct mixmonitor *mixmonitor = obj; struct ast_frame *f = NULL; - ast_atomic_fetchadd_int(&__mod_desc->usecnt, +1); if (option_verbose > 1) ast_verbose(VERBOSE_PREFIX_2 "Begin MixMonitor Recording %s\n", mixmonitor->name); @@ -219,7 +218,6 @@ static void *mixmonitor_thread(void *obj) free(mixmonitor); - ast_atomic_fetchadd_int(&__mod_desc->usecnt, -1); return NULL; } @@ -322,7 +320,7 @@ static void launch_monitor_thread(struct ast_channel *chan, const char *filename static int mixmonitor_exec(struct ast_channel *chan, void *data) { int x, readvol = 0, writevol = 0; - struct localuser *u; + struct ast_module_user *u; struct ast_flags flags = {0}; char *parse; AST_DECLARE_APP_ARGS(args, @@ -336,7 +334,7 @@ static int mixmonitor_exec(struct ast_channel *chan, void *data) return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); parse = ast_strdupa(data); @@ -344,7 +342,7 @@ static int mixmonitor_exec(struct ast_channel *chan, void *data) if (ast_strlen_zero(args.filename)) { ast_log(LOG_WARNING, "MixMonitor requires an argument (filename)\n"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } @@ -396,22 +394,22 @@ static int mixmonitor_exec(struct ast_channel *chan, void *data) pbx_builtin_setvar_helper(chan, "MIXMONITOR_FILENAME", args.filename); launch_monitor_thread(chan, args.filename, flags.flags, readvol, writevol, args.post_process); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } static int stop_mixmonitor_exec(struct ast_channel *chan, void *data) { - struct localuser *u; + struct ast_module_user *u; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); ast_channel_lock(chan); ast_channel_spy_stop_by_type(chan, mixmonitor_spy_type); ast_channel_unlock(chan); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } @@ -453,7 +451,7 @@ static struct ast_cli_entry cli_mixmonitor = { complete_mixmonitor_cli }; -static int unload_module(void *mod) +static int unload_module(void) { int res; @@ -461,12 +459,12 @@ static int unload_module(void *mod) res |= ast_unregister_application(stop_app); res |= ast_unregister_application(app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { int res; @@ -477,14 +475,4 @@ static int load_module(void *mod) return res; } -static const char *description(void) -{ - return "Mixed Audio Monitoring Application"; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Mixed Audio Monitoring Application"); diff --git a/apps/app_morsecode.c b/apps/app_morsecode.c index 9bb02479e..cd4211231 100644 --- a/apps/app_morsecode.c +++ b/apps/app_morsecode.c @@ -41,8 +41,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/module.h" #include "asterisk/indications.h" -static char *tdesc = "Morse code"; - static char *app_morsecode = "Morsecode"; static char *morsecode_synopsis = "Plays morse code"; @@ -54,7 +52,6 @@ static char *morsecode_descrip = "(defaults to 80). Additionally, if MORSETONE is set, it will use that tone\n" "(in Hz). The tone default is 800.\n"; -LOCAL_USER_DECL; static char *morsecode[] = { "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", /* 0-15 */ @@ -114,13 +111,13 @@ static int morsecode_exec(struct ast_channel *chan, void *data) int res=0, ditlen, tone; char *digit; const char *ditlenc, *tonec; - struct localuser *u; + struct ast_module_user *u; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "Syntax: Morsecode(<string>) - no argument found\n"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } @@ -158,34 +155,24 @@ static int morsecode_exec(struct ast_channel *chan, void *data) playtone(chan, 0, 2 * ditlen); } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app_morsecode); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { return ast_register_application(app_morsecode, morsecode_exec, morsecode_synopsis, morsecode_descrip); } -static const char *description(void) -{ - return tdesc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Morse code"); diff --git a/apps/app_mp3.c b/apps/app_mp3.c index 3a48e7ef8..667de67ad 100644 --- a/apps/app_mp3.c +++ b/apps/app_mp3.c @@ -50,8 +50,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #define LOCAL_MPG_123 "/usr/local/bin/mpg123" #define MPG_123 "/usr/bin/mpg123" -static char *tdesc = "Silly MP3 Application"; - static char *app = "MP3Player"; static char *synopsis = "Play an MP3 file or stream"; @@ -61,7 +59,6 @@ static char *descrip = "which typically would be a filename or a URL. User can exit by pressing\n" "any key on the dialpad, or by hanging up."; -LOCAL_USER_DECL; static int mp3play(char *filename, int fd) { @@ -118,7 +115,7 @@ static int timed_read(int fd, void *data, int datalen, int timeout) static int mp3_exec(struct ast_channel *chan, void *data) { int res=0; - struct localuser *u; + struct ast_module_user *u; int fds[2]; int ms = -1; int pid = -1; @@ -137,11 +134,11 @@ static int mp3_exec(struct ast_channel *chan, void *data) return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if (pipe(fds)) { ast_log(LOG_WARNING, "Unable to create pipe\n"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } @@ -151,7 +148,7 @@ static int mp3_exec(struct ast_channel *chan, void *data) res = ast_set_write_format(chan, AST_FORMAT_SLINEAR); if (res < 0) { ast_log(LOG_WARNING, "Unable to set write format to signed linear\n"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } @@ -224,35 +221,25 @@ static int mp3_exec(struct ast_channel *chan, void *data) if (!res && owriteformat) ast_set_write_format(chan, owriteformat); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { return ast_register_application(app, mp3_exec, synopsis, descrip); } -static const char *description(void) -{ - return tdesc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Silly MP3 Application"); diff --git a/apps/app_nbscat.c b/apps/app_nbscat.c index 188aa3c97..346584346 100644 --- a/apps/app_nbscat.c +++ b/apps/app_nbscat.c @@ -55,8 +55,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #define AF_LOCAL AF_UNIX #endif -static char *tdesc = "Silly NBS Stream Application"; - static char *app = "NBScat"; static char *synopsis = "Play an NBS local stream"; @@ -65,7 +63,6 @@ static char *descrip = " NBScat: Executes nbscat to listen to the local NBS stream.\n" "User can exit by pressing any key\n."; -LOCAL_USER_DECL; static int NBScatplay(int fd) { @@ -109,7 +106,7 @@ static int timed_read(int fd, void *data, int datalen) static int NBScat_exec(struct ast_channel *chan, void *data) { int res=0; - struct localuser *u; + struct ast_module_user *u; int fds[2]; int ms = -1; int pid = -1; @@ -122,11 +119,11 @@ static int NBScat_exec(struct ast_channel *chan, void *data) short frdata[160]; } myf; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if (socketpair(AF_LOCAL, SOCK_STREAM, 0, fds)) { ast_log(LOG_WARNING, "Unable to create socketpair\n"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } @@ -136,7 +133,7 @@ static int NBScat_exec(struct ast_channel *chan, void *data) res = ast_set_write_format(chan, AST_FORMAT_SLINEAR); if (res < 0) { ast_log(LOG_WARNING, "Unable to set write format to signed linear\n"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } @@ -206,35 +203,25 @@ static int NBScat_exec(struct ast_channel *chan, void *data) if (!res && owriteformat) ast_set_write_format(chan, owriteformat); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { return ast_register_application(app, NBScat_exec, synopsis, descrip); } -static const char *description(void) -{ - return tdesc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Silly NBS Stream Application"); diff --git a/apps/app_osplookup.c b/apps/app_osplookup.c index 88d90a984..c700e81ce 100644 --- a/apps/app_osplookup.c +++ b/apps/app_osplookup.c @@ -878,29 +878,29 @@ static int osp_finish(int handle, int recorded, int cause, time_t start, time_t static int ospauth_exec(struct ast_channel* chan, void* data) { int res; - struct localuser* u; + struct ast_module_user *u; const char* provider = OSP_DEF_PROVIDER; int priority_jump = 0; - struct varshead* headp; - struct ast_var_t* current; - const char* source = ""; - const char* token = ""; + struct varshead *headp; + struct ast_var_t *current; + const char *source = ""; + const char *token = ""; int handle; unsigned int timelimit; char buffer[OSP_INTSTR_SIZE]; - const char* status; - char* tmp; + const char *status; + char *tmp; AST_DECLARE_APP_ARGS(args, AST_APP_ARG(provider); AST_APP_ARG(options); ); - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if (!(tmp = ast_strdupa(data))) { ast_log(LOG_ERROR, "Out of memory\n"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } @@ -959,7 +959,7 @@ static int ospauth_exec(struct ast_channel* chan, void* data) res = 0; } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } @@ -973,16 +973,16 @@ static int ospauth_exec(struct ast_channel* chan, void* data) static int osplookup_exec(struct ast_channel* chan, void* data) { int res, cres; - struct localuser* u; - const char* provider = OSP_DEF_PROVIDER; + struct ast_module_user *u; + const char *provider = OSP_DEF_PROVIDER; int priority_jump = 0; - struct varshead* headp; + struct varshead *headp; struct ast_var_t* current; - const char* srcdev = ""; + const char *srcdev = ""; char buffer[OSP_TOKSTR_SIZE]; struct osp_result result; - const char* status; - char* tmp; + const char *status; + char *tmp; AST_DECLARE_APP_ARGS(args, AST_APP_ARG(exten); @@ -995,11 +995,11 @@ static int osplookup_exec(struct ast_channel* chan, void* data) return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if (!(tmp = ast_strdupa(data))) { ast_log(LOG_ERROR, "Out of memory\n"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } @@ -1039,7 +1039,7 @@ static int osplookup_exec(struct ast_channel* chan, void* data) ast_log(LOG_DEBUG, "OSPLookup: source device '%s'\n", srcdev); if ((cres = ast_autoservice_start(chan)) < 0) { - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } @@ -1090,7 +1090,7 @@ static int osplookup_exec(struct ast_channel* chan, void* data) } if ((cres = ast_autoservice_stop(chan)) < 0) { - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } @@ -1105,7 +1105,7 @@ static int osplookup_exec(struct ast_channel* chan, void* data) res = 0; } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } @@ -1119,7 +1119,7 @@ static int osplookup_exec(struct ast_channel* chan, void* data) static int ospnext_exec(struct ast_channel* chan, void* data) { int res; - struct localuser* u; + struct ast_module_user *u; int priority_jump = 0; int cause = 0; struct varshead* headp; @@ -1139,11 +1139,11 @@ static int ospnext_exec(struct ast_channel* chan, void* data) return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if (!(tmp = ast_strdupa(data))) { ast_log(LOG_ERROR, "Out of memory\n"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } @@ -1243,7 +1243,7 @@ static int ospnext_exec(struct ast_channel* chan, void* data) res = 0; } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } @@ -1257,30 +1257,30 @@ static int ospnext_exec(struct ast_channel* chan, void* data) static int ospfinished_exec(struct ast_channel* chan, void* data) { int res = 1; - struct localuser* u; + struct ast_module_user *u; int priority_jump = 0; int cause = 0; - struct varshead* headp; - struct ast_var_t* current; + struct varshead *headp; + struct ast_var_t *current; int inhandle = OSP_INVALID_HANDLE; int outhandle = OSP_INVALID_HANDLE; int recorded = 0; time_t start, connect, end; unsigned int release; char buffer[OSP_INTSTR_SIZE]; - const char* status; - char* tmp; + const char *status; + char *tmp; AST_DECLARE_APP_ARGS(args, AST_APP_ARG(cause); AST_APP_ARG(options); ); - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if (!(tmp = ast_strdupa(data))) { ast_log(LOG_ERROR, "Out of memory\n"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } @@ -1376,7 +1376,7 @@ static int ospfinished_exec(struct ast_channel* chan, void* data) res = 0; } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } @@ -1602,9 +1602,7 @@ static struct ast_cli_entry osp_cli = { osp_usage }; -LOCAL_USER_DECL; - -static int load_module(void* mod) +static int load_module(void) { int res; @@ -1618,7 +1616,7 @@ static int load_module(void* mod) return res; } -static int unload_module(void* mod) +static int unload_module(void) { int res; @@ -1629,26 +1627,21 @@ static int unload_module(void* mod) res |= ast_cli_unregister(&osp_cli); osp_unload(); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int reload(void* mod) +static int reload(void) { osp_unload(); osp_load(); - return 0; -} -static const char* description(void) -{ - return "Open Settlement Protocol Applications"; -} - -static const char* key(void) -{ - return ASTERISK_GPL_KEY; + return 0; } -STD_MOD(MOD_1, reload, NULL, NULL); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Open Settlement Protocol Applications", + .load = load_module, + .unload = unload_module, + .reload = reload, + ); diff --git a/apps/app_page.c b/apps/app_page.c index 0d8965976..93146c9cd 100644 --- a/apps/app_page.c +++ b/apps/app_page.c @@ -63,7 +63,6 @@ static const char *page_descrip = " q - quiet, do not play beep to caller\n" " r - record the page into a file (see 'r' for app_meetme)\n"; -LOCAL_USER_DECL; enum { PAGE_DUPLEX = (1 << 0), @@ -143,7 +142,7 @@ static void launch_page(struct ast_channel *chan, const char *meetmeopts, const static int page_exec(struct ast_channel *chan, void *data) { - struct localuser *u; + struct ast_module_user *u; char *options; char *tech, *resource; char meetmeopts[80]; @@ -159,11 +158,11 @@ static int page_exec(struct ast_channel *chan, void *data) return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if (!(app = pbx_findapp("MeetMe"))) { ast_log(LOG_WARNING, "There is no MeetMe application available!\n"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; }; @@ -204,36 +203,26 @@ static int page_exec(struct ast_channel *chan, void *data) pbx_exec(chan, app, meetmeopts); } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app_page); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { return ast_register_application(app_page, page_exec, page_synopsis, page_descrip); } -static const char *description(void) -{ - return "Page Multiple Phones"; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Page Multiple Phones"); diff --git a/apps/app_parkandannounce.c b/apps/app_parkandannounce.c index 1b30a4902..66203b1b0 100644 --- a/apps/app_parkandannounce.c +++ b/apps/app_parkandannounce.c @@ -51,8 +51,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/lock.h" #include "asterisk/utils.h" -static char *tdesc = "Call Parking and Announce Application"; - static char *app = "ParkAndAnnounce"; static char *synopsis = "Park and Announce"; @@ -75,7 +73,6 @@ static char *descrip = "call was placed. Use with the Local channel to allow the dialplan to make\n" "use of this information.\n"; -LOCAL_USER_DECL; static int parkandannounce_exec(struct ast_channel *chan, void *data) { @@ -93,18 +90,18 @@ static int parkandannounce_exec(struct ast_channel *chan, void *data) struct outgoing_helper oh; int outstate; - struct localuser *u; + struct ast_module_user *u; if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "ParkAndAnnounce requires arguments: (announce:template|timeout|dial|[return_context])\n"); return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); l=strlen(data)+2; if (!(orig_s = ast_malloc(l))) { - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } s=orig_s; @@ -114,7 +111,7 @@ static int parkandannounce_exec(struct ast_channel *chan, void *data) if(! template) { ast_log(LOG_WARNING, "PARK: An announce template must be defined\n"); free(orig_s); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } @@ -126,7 +123,7 @@ static int parkandannounce_exec(struct ast_channel *chan, void *data) if(!dial) { ast_log(LOG_WARNING, "PARK: A dial resource must be specified i.e: Console/dsp or Zap/g1/5551212\n"); free(orig_s); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } else { dialtech=strsep(&dial, "/"); @@ -159,7 +156,7 @@ static int parkandannounce_exec(struct ast_channel *chan, void *data) if(atoi(priority) < 0) { ast_log(LOG_WARNING, "Priority '%s' must be a number > 0\n", priority); free(orig_s); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } /* At this point we have a priority and maybe an extension and a context */ @@ -206,13 +203,13 @@ static int parkandannounce_exec(struct ast_channel *chan, void *data) ast_log(LOG_WARNING, "PARK: Channel %s was never answered for the announce.\n", dchan->name); ast_hangup(dchan); free(orig_s); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } } else { ast_log(LOG_WARNING, "PARK: Unable to allocate announce channel.\n"); free(orig_s); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } @@ -250,36 +247,26 @@ static int parkandannounce_exec(struct ast_channel *chan, void *data) ast_hangup(dchan); free(orig_s); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { /* return ast_register_application(app, park_exec); */ return ast_register_application(app, parkandannounce_exec, synopsis, descrip); } -static const char *description(void) -{ - return tdesc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Call Parking and Announce Application"); diff --git a/apps/app_playback.c b/apps/app_playback.c index 32114cad7..f3788c351 100644 --- a/apps/app_playback.c +++ b/apps/app_playback.c @@ -47,8 +47,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/localtime.h" #include "asterisk/say.h" -static char *tdesc = "Sound File Playback Application"; - static char *app = "Playback"; static char *synopsis = "Play a file"; @@ -69,7 +67,6 @@ static char *descrip = " SUCCESS | FAILED\n" ; -LOCAL_USER_DECL; static struct ast_config *say_cfg; /* save the say' api calls. @@ -381,7 +378,7 @@ static struct ast_cli_entry myclis[] = { static int playback_exec(struct ast_channel *chan, void *data) { int res = 0; - struct localuser *u; + struct ast_module_user *u; char *tmp; int option_skip=0; int option_say=0; @@ -400,7 +397,7 @@ static int playback_exec(struct ast_channel *chan, void *data) tmp = ast_strdupa(data); - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); AST_STANDARD_APP_ARGS(args, tmp); if (args.options) { @@ -446,11 +443,11 @@ static int playback_exec(struct ast_channel *chan, void *data) pbx_builtin_setvar_helper(chan, "PLAYBACKSTATUS", mres ? "FAILED" : "SUCCESS"); } done: - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int reload(void *mod) +static int reload(void) { if (say_cfg) { ast_config_destroy(say_cfg); @@ -464,13 +461,13 @@ static int reload(void *mod) return 0; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); if (say_cfg) ast_config_destroy(say_cfg); @@ -478,21 +475,15 @@ static int unload_module(void *mod) return res; } -static int load_module(void *mod) +static int load_module(void) { - reload(mod); + reload(); ast_cli_register_multiple(myclis, sizeof(myclis)/sizeof(struct ast_cli_entry)); return ast_register_application(app, playback_exec, synopsis, descrip); } -static const char *description(void) -{ - return tdesc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD(MOD_1,reload,NULL,NULL); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Sound File Playback Application", + .load = load_module, + .unload = unload_module, + .reload = reload, + ); diff --git a/apps/app_privacy.c b/apps/app_privacy.c index 45c80ac16..277ffba4c 100644 --- a/apps/app_privacy.c +++ b/apps/app_privacy.c @@ -49,8 +49,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #define PRIV_CONFIG "privacy.conf" -static char *tdesc = "Require phone number to be entered, if no CallerID sent"; - static char *app = "PrivacyManager"; static char *synopsis = "Require phone number to be entered, if no CallerID sent"; @@ -76,7 +74,6 @@ static char *descrip = " SUCCESS | FAILED \n" ; -LOCAL_USER_DECL; static int privacy_exec (struct ast_channel *chan, void *data) { @@ -87,7 +84,7 @@ static int privacy_exec (struct ast_channel *chan, void *data) int x = 0; char *s; char phone[30]; - struct localuser *u; + struct ast_module_user *u; struct ast_config *cfg = NULL; char *parse = NULL; int priority_jump = 0; @@ -97,7 +94,8 @@ static int privacy_exec (struct ast_channel *chan, void *data) AST_APP_ARG(options); ); - LOCAL_USER_ADD (u); + u = ast_module_user_add(chan); + if (!ast_strlen_zero(chan->cid.cid_num)) { if (option_verbose > 2) ast_verbose (VERBOSE_PREFIX_3 "CallerID Present: Skipping\n"); @@ -106,13 +104,12 @@ static int privacy_exec (struct ast_channel *chan, void *data) if (chan->_state != AST_STATE_UP) { res = ast_answer(chan); if (res) { - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } } - if (!ast_strlen_zero((char *)data)) - { + if (!ast_strlen_zero(data)) { parse = ast_strdupa(data); AST_STANDARD_APP_ARGS(args, parse); @@ -211,34 +208,25 @@ static int privacy_exec (struct ast_channel *chan, void *data) ast_config_destroy(cfg); } - LOCAL_USER_REMOVE (u); - return 0; + ast_module_user_remove(u); + + return 0; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application (app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { return ast_register_application (app, privacy_exec, synopsis, descrip); } -static const char *description(void) -{ - return tdesc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Require phone number to be entered, if no CallerID sent"); diff --git a/apps/app_queue.c b/apps/app_queue.c index 3e2f15340..448e8ca74 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -124,8 +124,6 @@ static struct strategy { #define RES_OUTOFMEMORY (-2) /* Out of memory */ #define RES_NOSUCHQUEUE (-3) /* No such queue */ -static char *tdesc = "True Call Queueing"; - static char *app = "Queue"; static char *synopsis = "Queue a call for a call queue"; @@ -289,7 +287,6 @@ struct callattempt { struct member *member; }; -LOCAL_USER_DECL; struct queue_ent { struct call_queue *parent; /*!< What queue is our parent */ @@ -2936,7 +2933,7 @@ static void reload_queue_members(void) static int pqm_exec(struct ast_channel *chan, void *data) { - struct localuser *lu; + struct ast_module_user *lu; char *parse; int priority_jump = 0; AST_DECLARE_APP_ARGS(args, @@ -2954,7 +2951,7 @@ static int pqm_exec(struct ast_channel *chan, void *data) AST_STANDARD_APP_ARGS(args, parse); - LOCAL_USER_ADD(lu); + lu = ast_module_user_add(chan); if (args.options) { if (strchr(args.options, 'j')) @@ -2963,7 +2960,7 @@ static int pqm_exec(struct ast_channel *chan, void *data) if (ast_strlen_zero(args.interface)) { ast_log(LOG_WARNING, "Missing interface argument to PauseQueueMember ([queuename]|interface[|options])\n"); - LOCAL_USER_REMOVE(lu); + ast_module_user_remove(lu); return -1; } @@ -2972,16 +2969,16 @@ static int pqm_exec(struct ast_channel *chan, void *data) if (priority_jump || ast_opt_priority_jumping) { if (ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101)) { pbx_builtin_setvar_helper(chan, "PQMSTATUS", "NOTFOUND"); - LOCAL_USER_REMOVE(lu); + ast_module_user_remove(lu); return 0; } } - LOCAL_USER_REMOVE(lu); + ast_module_user_remove(lu); pbx_builtin_setvar_helper(chan, "PQMSTATUS", "NOTFOUND"); return -1; } - LOCAL_USER_REMOVE(lu); + ast_module_user_remove(lu); pbx_builtin_setvar_helper(chan, "PQMSTATUS", "PAUSED"); return 0; @@ -2989,7 +2986,7 @@ static int pqm_exec(struct ast_channel *chan, void *data) static int upqm_exec(struct ast_channel *chan, void *data) { - struct localuser *lu; + struct ast_module_user *lu; char *parse; int priority_jump = 0; AST_DECLARE_APP_ARGS(args, @@ -3007,7 +3004,7 @@ static int upqm_exec(struct ast_channel *chan, void *data) AST_STANDARD_APP_ARGS(args, parse); - LOCAL_USER_ADD(lu); + lu = ast_module_user_add(chan); if (args.options) { if (strchr(args.options, 'j')) @@ -3016,7 +3013,7 @@ static int upqm_exec(struct ast_channel *chan, void *data) if (ast_strlen_zero(args.interface)) { ast_log(LOG_WARNING, "Missing interface argument to PauseQueueMember ([queuename]|interface[|options])\n"); - LOCAL_USER_REMOVE(lu); + ast_module_user_remove(lu); return -1; } @@ -3025,16 +3022,16 @@ static int upqm_exec(struct ast_channel *chan, void *data) if (priority_jump || ast_opt_priority_jumping) { if (ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101)) { pbx_builtin_setvar_helper(chan, "UPQMSTATUS", "NOTFOUND"); - LOCAL_USER_REMOVE(lu); + ast_module_user_remove(lu); return 0; } } - LOCAL_USER_REMOVE(lu); + ast_module_user_remove(lu); pbx_builtin_setvar_helper(chan, "UPQMSTATUS", "NOTFOUND"); return -1; } - LOCAL_USER_REMOVE(lu); + ast_module_user_remove(lu); pbx_builtin_setvar_helper(chan, "UPQMSTATUS", "UNPAUSED"); return 0; @@ -3043,7 +3040,7 @@ static int upqm_exec(struct ast_channel *chan, void *data) static int rqm_exec(struct ast_channel *chan, void *data) { int res=-1; - struct localuser *lu; + struct ast_module_user *lu; char *parse, *temppos = NULL; int priority_jump = 0; AST_DECLARE_APP_ARGS(args, @@ -3062,7 +3059,7 @@ static int rqm_exec(struct ast_channel *chan, void *data) AST_STANDARD_APP_ARGS(args, parse); - LOCAL_USER_ADD(lu); + lu = ast_module_user_add(chan); if (ast_strlen_zero(args.interface)) { args.interface = ast_strdupa(chan->name); @@ -3096,7 +3093,7 @@ static int rqm_exec(struct ast_channel *chan, void *data) break; } - LOCAL_USER_REMOVE(lu); + ast_module_user_remove(lu); return res; } @@ -3104,7 +3101,7 @@ static int rqm_exec(struct ast_channel *chan, void *data) static int aqm_exec(struct ast_channel *chan, void *data) { int res=-1; - struct localuser *lu; + struct ast_module_user *lu; char *parse, *temppos = NULL; int priority_jump = 0; AST_DECLARE_APP_ARGS(args, @@ -3124,7 +3121,7 @@ static int aqm_exec(struct ast_channel *chan, void *data) AST_STANDARD_APP_ARGS(args, parse); - LOCAL_USER_ADD(lu); + lu = ast_module_user_add(chan); if (ast_strlen_zero(args.interface)) { args.interface = ast_strdupa(chan->name); @@ -3169,14 +3166,14 @@ static int aqm_exec(struct ast_channel *chan, void *data) break; } - LOCAL_USER_REMOVE(lu); + ast_module_user_remove(lu); return res; } static int ql_exec(struct ast_channel *chan, void *data) { - struct localuser *u; + struct ast_module_user *u; char *parse; AST_DECLARE_APP_ARGS(args, @@ -3192,7 +3189,7 @@ static int ql_exec(struct ast_channel *chan, void *data) return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); parse = ast_strdupa(data); @@ -3201,14 +3198,14 @@ static int ql_exec(struct ast_channel *chan, void *data) if (ast_strlen_zero(args.queuename) || ast_strlen_zero(args.uniqueid) || ast_strlen_zero(args.peer) || ast_strlen_zero(args.event)) { ast_log(LOG_WARNING, "QueueLog requires arguments (queuename|uniqueid|peer|event[|additionalinfo])\n"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } ast_queue_log(args.queuename, args.uniqueid, args.peer, args.event, "%s", args.params ? args.params : ""); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } @@ -3217,7 +3214,7 @@ static int queue_exec(struct ast_channel *chan, void *data) { int res=-1; int ringing=0; - struct localuser *lu; + struct ast_module_user *lu; const char *user_priority; const char *max_penalty_str; int prio; @@ -3245,7 +3242,7 @@ static int queue_exec(struct ast_channel *chan, void *data) parse = ast_strdupa(data); AST_STANDARD_APP_ARGS(args, parse); - LOCAL_USER_ADD(lu); + lu = ast_module_user_add(chan); /* Setup our queue entry */ memset(&qe, 0, sizeof(qe)); @@ -3473,7 +3470,7 @@ check_turns: set_queue_result(chan, reason); res = 0; } - LOCAL_USER_REMOVE(lu); + ast_module_user_remove(lu); return res; } @@ -3482,7 +3479,7 @@ static int queue_function_qac(struct ast_channel *chan, char *cmd, char *data, c { int count = 0; struct call_queue *q; - struct localuser *lu; + struct ast_module_user *lu; struct member *m; buf[0] = '\0'; @@ -3492,7 +3489,7 @@ static int queue_function_qac(struct ast_channel *chan, char *cmd, char *data, c return -1; } - LOCAL_USER_ADD(lu); + lu = ast_module_user_add(chan); AST_LIST_LOCK(&queues); AST_LIST_TRAVERSE(&queues, q, list) { @@ -3515,7 +3512,7 @@ static int queue_function_qac(struct ast_channel *chan, char *cmd, char *data, c ast_log(LOG_WARNING, "queue %s was not found\n", data); snprintf(buf, len, "%d", count); - LOCAL_USER_REMOVE(lu); + ast_module_user_remove(lu); return 0; } @@ -3524,7 +3521,7 @@ static int queue_function_queuewaitingcount(struct ast_channel *chan, char *cmd, { int count = 0; struct call_queue *q; - struct localuser *lu; + struct ast_module_user *lu; buf[0] = '\0'; @@ -3533,7 +3530,7 @@ static int queue_function_queuewaitingcount(struct ast_channel *chan, char *cmd, return -1; } - LOCAL_USER_ADD(lu); + lu = ast_module_user_add(chan); AST_LIST_LOCK(&queues); AST_LIST_TRAVERSE(&queues, q, list) { @@ -3551,13 +3548,13 @@ static int queue_function_queuewaitingcount(struct ast_channel *chan, char *cmd, ast_log(LOG_WARNING, "queue %s was not found\n", data); snprintf(buf, len, "%d", count); - LOCAL_USER_REMOVE(lu); + ast_module_user_remove(lu); return 0; } static int queue_function_queuememberlist(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len) { - struct localuser *u; + struct ast_module_user *u; struct call_queue *q; struct member *m; @@ -3569,7 +3566,7 @@ static int queue_function_queuememberlist(struct ast_channel *chan, char *cmd, c return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); AST_LIST_LOCK(&queues); AST_LIST_TRAVERSE(&queues, q, list) { @@ -3603,7 +3600,7 @@ static int queue_function_queuememberlist(struct ast_channel *chan, char *cmd, c /* We should already be terminated, but let's make sure. */ buf[len - 1] = '\0'; - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } @@ -4328,7 +4325,7 @@ static struct ast_cli_entry cli_remove_queue_member = { { "remove", "queue", "member", NULL }, handle_remove_queue_member, "Removes a channel from a specified queue", rqm_cmd_usage, complete_remove_queue_member }; -static int unload_module(void *mod) +static int unload_module(void) { int res; @@ -4352,14 +4349,14 @@ static int unload_module(void *mod) res |= ast_custom_function_unregister(&queuewaitingcount_function); res |= ast_unregister_application(app); - clear_and_free_interfaces(); + ast_module_user_hangup_all(); - STANDARD_HANGUP_LOCALUSERS; + clear_and_free_interfaces(); return res; } -static int load_module(void *mod) +static int load_module(void) { int res; @@ -4393,21 +4390,15 @@ static int load_module(void *mod) return res; } -static int reload(void *mod) +static int reload(void) { reload_queues(); return 0; } -static const char *description(void) -{ - return tdesc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD(MOD_1, reload, NULL, NULL); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "True Call Queueing", + .load = load_module, + .unload = unload_module, + .reload = reload, + ); diff --git a/apps/app_random.c b/apps/app_random.c index 60ac2c141..8484f656d 100644 --- a/apps/app_random.c +++ b/apps/app_random.c @@ -41,8 +41,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") /*! \todo The Random() app should be removed from trunk following the release of 1.4 */ -static char *tdesc = "Random goto"; - static char *app_random = "Random"; static char *random_synopsis = "Conditionally branches, based upon a probability"; @@ -52,12 +50,11 @@ static char *random_descrip = " probability := INTEGER in the range 1 to 100\n" "DEPRECATED: Use GotoIf($[${RAND(1,100)} > <number>]?<label>)\n"; -LOCAL_USER_DECL; static int random_exec(struct ast_channel *chan, void *data) { int res=0; - struct localuser *u; + struct ast_module_user *u; char *s; char *prob; @@ -69,7 +66,7 @@ static int random_exec(struct ast_channel *chan, void *data) return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); s = ast_strdupa(data); @@ -88,34 +85,24 @@ static int random_exec(struct ast_channel *chan, void *data) ast_verbose( VERBOSE_PREFIX_3 "Random branches to (%s,%s,%d)\n", chan->context,chan->exten, chan->priority+1); } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app_random); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { return ast_register_application(app_random, random_exec, random_synopsis, random_descrip); } -static const char *description(void) -{ - return tdesc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Random goto"); diff --git a/apps/app_read.c b/apps/app_read.c index f9c1f486f..262bbbbd2 100644 --- a/apps/app_read.c +++ b/apps/app_read.c @@ -57,8 +57,6 @@ AST_APP_OPTIONS(read_app_options, { AST_APP_OPTION('n', OPT_NOANSWER), }); -static char *tdesc = "Read Variable Application"; - static char *app = "Read"; static char *synopsis = "Read a variable"; @@ -82,14 +80,13 @@ static char *descrip = " timeout -- if greater than 0, that value will override the default timeout.\n\n" "Read should disconnect if the function fails or errors out.\n"; -LOCAL_USER_DECL; #define ast_next_data(instr,ptr,delim) if((ptr=strchr(instr,delim))) { *(ptr) = '\0' ; ptr++;} static int read_exec(struct ast_channel *chan, void *data) { int res = 0; - struct localuser *u; + struct ast_module_user *u; char tmp[256]; int maxdigits=255; int tries = 1; @@ -113,7 +110,7 @@ static int read_exec(struct ast_channel *chan, void *data) return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); argcopy = ast_strdupa(data); @@ -149,7 +146,7 @@ static int read_exec(struct ast_channel *chan, void *data) } if (ast_strlen_zero(arglist.variable)) { ast_log(LOG_WARNING, "Invalid! Usage: Read(variable[|filename][|maxdigits][|option][|attempts][|timeout])\n\n"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } ts=NULL; @@ -162,7 +159,7 @@ static int read_exec(struct ast_channel *chan, void *data) if (ast_test_flag(&flags,OPT_SKIP)) { /* At the user's option, skip if the line is not up */ pbx_builtin_setvar_helper(chan, arglist.variable, "\0"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } else if (!ast_test_flag(&flags,OPT_NOANSWER)) { /* Otherwise answer unless we're supposed to read while on-hook */ @@ -214,34 +211,24 @@ static int read_exec(struct ast_channel *chan, void *data) } } } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { return ast_register_application(app, read_exec, synopsis, descrip); } -static const char *description(void) -{ - return tdesc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Read Variable Application"); diff --git a/apps/app_readfile.c b/apps/app_readfile.c index 8c5c4b1b5..7e43a3806 100644 --- a/apps/app_readfile.c +++ b/apps/app_readfile.c @@ -42,8 +42,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/app.h" #include "asterisk/module.h" -static char *tdesc = "Stores output of file into a variable"; - static char *app_readfile = "ReadFile"; static char *readfile_synopsis = "ReadFile(varname=file,length)"; @@ -54,12 +52,11 @@ static char *readfile_descrip = " File - The name of the file to read.\n" " Length - Maximum number of characters to capture.\n"; -LOCAL_USER_DECL; static int readfile_exec(struct ast_channel *chan, void *data) { int res=0; - struct localuser *u; + struct ast_module_user *u; char *s, *varname=NULL, *file=NULL, *length=NULL, *returnvar=NULL; int len=0; @@ -68,7 +65,7 @@ static int readfile_exec(struct ast_channel *chan, void *data) return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); s = ast_strdupa(data); @@ -78,7 +75,7 @@ static int readfile_exec(struct ast_channel *chan, void *data) if (!varname || !file) { ast_log(LOG_ERROR, "No file or variable specified!\n"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } @@ -99,35 +96,25 @@ static int readfile_exec(struct ast_channel *chan, void *data) pbx_builtin_setvar_helper(chan, varname, returnvar); free(returnvar); } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app_readfile); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { return ast_register_application(app_readfile, readfile_exec, readfile_synopsis, readfile_descrip); } -static const char *description(void) -{ - return tdesc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Stores output of file into a variable"); diff --git a/apps/app_realtime.c b/apps/app_realtime.c index 3a974b629..cc7ad7dd4 100644 --- a/apps/app_realtime.c +++ b/apps/app_realtime.c @@ -49,7 +49,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #define next_one(var) var = var->next #define crop_data(str) { *(str) = '\0' ; (str)++; } -static char *tdesc = "Realtime Data Lookup/Rewrite"; static char *app = "RealTime"; static char *uapp = "RealTimeUpdate"; static char *synopsis = "Realtime Data Lookup"; @@ -69,7 +68,6 @@ static char *udesc = "Use the RealTime config handler system to update a value\n "updated to <newval>. REALTIMECOUNT will be set with the number of rows\n" "updated or -1 if an error occurs.\n"; -LOCAL_USER_DECL; static int cli_load_realtime(int fd, int argc, char **argv) { @@ -136,7 +134,7 @@ static struct ast_cli_entry cli_update_realtime_cmd = { static int realtime_update_exec(struct ast_channel *chan, void *data) { char *family=NULL, *colmatch=NULL, *value=NULL, *newcol=NULL, *newval=NULL; - struct localuser *u; + struct ast_module_user *u; int res = 0, count = 0; char countc[13]; @@ -147,7 +145,7 @@ static int realtime_update_exec(struct ast_channel *chan, void *data) return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); family = ast_strdupa(data); if ((colmatch = strchr(family,'|'))) { @@ -171,7 +169,7 @@ static int realtime_update_exec(struct ast_channel *chan, void *data) snprintf(countc, sizeof(countc), "%d", count); pbx_builtin_setvar_helper(chan, "REALTIMECOUNT", countc); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } @@ -180,7 +178,7 @@ static int realtime_update_exec(struct ast_channel *chan, void *data) static int realtime_exec(struct ast_channel *chan, void *data) { int res=0, count=0; - struct localuser *u; + struct ast_module_user *u; struct ast_variable *var, *itt; char *family=NULL, *colmatch=NULL, *value=NULL, *prefix=NULL, *vname=NULL; char countc[13]; @@ -193,7 +191,7 @@ static int realtime_exec(struct ast_channel *chan, void *data) return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); family = ast_strdupa(data); if ((colmatch = strchr(family,'|'))) { @@ -230,11 +228,11 @@ static int realtime_exec(struct ast_channel *chan, void *data) snprintf(countc, sizeof(countc), "%d", count); pbx_builtin_setvar_helper(chan, "REALTIMECOUNT", countc); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; @@ -243,12 +241,12 @@ static int unload_module(void *mod) res |= ast_unregister_application(uapp); res |= ast_unregister_application(app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { int res; @@ -260,14 +258,4 @@ static int load_module(void *mod) return res; } -static const char *description(void) -{ - return tdesc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Realtime Data Lookup/Rewrite"); diff --git a/apps/app_record.c b/apps/app_record.c index d30a3a791..243977ffb 100644 --- a/apps/app_record.c +++ b/apps/app_record.c @@ -72,7 +72,6 @@ static char *descrip = "If the user should hangup during a recording, all data will be lost and the\n" "application will teminate. \n"; -LOCAL_USER_DECL; static int record_exec(struct ast_channel *chan, void *data) { @@ -85,7 +84,7 @@ static int record_exec(struct ast_channel *chan, void *data) char tmp[256]; struct ast_filestream *s = '\0'; - struct localuser *u; + struct ast_module_user *u; struct ast_frame *f = NULL; struct ast_dsp *sildet = NULL; /* silence detector dsp */ @@ -111,7 +110,7 @@ static int record_exec(struct ast_channel *chan, void *data) return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); /* Yay for strsep being easy */ vdata = ast_strdupa(data); @@ -135,7 +134,7 @@ static int record_exec(struct ast_channel *chan, void *data) } if (!ext) { ast_log(LOG_WARNING, "No extension specified to filename!\n"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } if (silstr) { @@ -194,7 +193,7 @@ static int record_exec(struct ast_channel *chan, void *data) if (chan->_state != AST_STATE_UP) { if (option_skip) { /* At the user's option, skip if the line is not up */ - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } else if (!option_noanswer) { /* Otherwise answer unless we're supposed to record while on-hook */ @@ -225,13 +224,13 @@ static int record_exec(struct ast_channel *chan, void *data) res = ast_set_read_format(chan, AST_FORMAT_SLINEAR); if (res < 0) { ast_log(LOG_WARNING, "Unable to set to linear mode, giving up\n"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } sildet = ast_dsp_new(); if (!sildet) { ast_log(LOG_WARNING, "Unable to create silence detector :(\n"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } ast_dsp_set_threshold(sildet, 256); @@ -335,35 +334,25 @@ static int record_exec(struct ast_channel *chan, void *data) ast_dsp_free(sildet); } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { return ast_register_application(app, record_exec, synopsis, descrip); } -static const char *description(void) -{ - return "Trivial Record Application"; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Trivial Record Application"); diff --git a/apps/app_rpt.c b/apps/app_rpt.c index 8449bd465..e1da544c9 100644 --- a/apps/app_rpt.c +++ b/apps/app_rpt.c @@ -1,4 +1,3 @@ -/* #define OLD_ASTERISK */ /* * Asterisk -- An open source telephony toolkit. * @@ -243,8 +242,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/say.h" #include "asterisk/localtime.h" -static char *tdesc = "Radio Repeater / Remote Base version 0.48 06/13/2006"; - static char *app = "Rpt"; static char *synopsis = "Radio Repeater/Remote Base Control System"; @@ -284,6 +281,9 @@ static char *descrip = " available to the phone user.\n" "\n"; +static unsigned int vmajor = 0; +static unsigned int vminor = 47; + static int debug = 0; /* FIXME Set this >0 for extra debug output */ static int nrpts = 0; @@ -295,7 +295,6 @@ static char *remote_rig_rbi="rbi"; STANDARD_LOCAL_USER; #endif -LOCAL_USER_DECL; #define MSWAIT 200 #define HANGTIME 5000 @@ -1960,7 +1959,6 @@ struct rpt_tele *tlist; struct rpt *myrpt; struct rpt_link *l,*m,linkbase; struct ast_channel *mychannel; -int vmajor, vminor; char *p,*ct,*ct_copy,*ident, *nodename; time_t t; struct tm localtm; @@ -2454,11 +2452,6 @@ struct tm localtm; imdone = 1; break; case STATS_VERSION: - p = strstr(tdesc, "version"); - if(!p) - break; - if(sscanf(p, "version %d.%d", &vmajor, &vminor) != 2) - break; wait_interval(myrpt, DLY_TELEM, mychannel); /* Wait a little bit */ /* Say "version" */ if (sayfile(mychannel,"rpt/version") == -1) @@ -7275,7 +7268,7 @@ char *this,*val; static int rpt_exec(struct ast_channel *chan, void *data) { int res=-1,i,rem_totx,n,phone_mode = 0; - struct localuser *u; + struct ast_module_user *u; char tmp[256], keyed = 0; char *options,*stringp,*tele,c; struct rpt *myrpt; @@ -7644,7 +7637,7 @@ static int rpt_exec(struct ast_channel *chan, void *data) ast_log(LOG_WARNING, "Cant get io permission on IO port %x hex\n",myrpt->p.iobase); return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); rpt_mutex_unlock(&myrpt->lock); /* find our index, and load the vars initially */ for(i = 0; i < nrpts; i++) @@ -8009,19 +8002,15 @@ static int rpt_exec(struct ast_channel *chan, void *data) myrpt->remoteon = 0; rpt_mutex_unlock(&myrpt->lock); closerem(myrpt); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -#ifdef OLD_ASTERISK -int unload_module() -#else -static int unload_module(void* mod) -#endif +static int unload_module(void) { int i; - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); for(i = 0; i < nrpts; i++) { if (!strcmp(rpt_vars[i].name,rpt_vars[i].p.nodes)) continue; ast_mutex_destroy(&rpt_vars[i].lock); @@ -8039,11 +8028,7 @@ static int unload_module(void* mod) return i; } -#ifdef OLD_ASTERISK -int load_module() -#else -static int load_module(void *mod) -#endif +static int load_module(void) { ast_pthread_create(&rpt_master_thread,NULL,rpt_master,NULL); @@ -8058,45 +8043,16 @@ static int load_module(void *mod) return ast_register_application(app, rpt_exec, synopsis, descrip); } -#ifdef OLD_ASTERISK -char *description() -#else -static const char *description(void) -#endif -{ - return tdesc; -} - -#ifdef OLD_ASTERISK -int usecount(void) -{ - int res; - STANDARD_USECOUNT(res); - return res; -} -#endif - -#ifdef OLD_ASTERISK -char *key() -#else -static const char *key(void) -#endif +static int reload(void) { - return ASTERISK_GPL_KEY; -} - -#ifdef OLD_ASTERISK -int reload() -#else -static int reload(void *mod) -#endif -{ -int n; + int n; for(n = 0; n < nrpts; n++) rpt_vars[n].reload = 1; return(0); } -#ifndef OLD_ASTERISK -STD_MOD(MOD_1, reload, NULL, NULL); -#endif +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Radio Repeater / Remote Base", + .load = load_module, + .unload = unload_module, + .reload = reload, + ); diff --git a/apps/app_sayunixtime.c b/apps/app_sayunixtime.c index 31b69f9f9..2e9c9b323 100644 --- a/apps/app_sayunixtime.c +++ b/apps/app_sayunixtime.c @@ -43,8 +43,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/say.h" #include "asterisk/app.h" -static char *tdesc = "Say time"; - static char *app_sayunixtime = "SayUnixTime"; static char *app_datetime = "DateTime"; @@ -67,7 +65,6 @@ static char *datetime_descrip = " format: a format the time is to be said in. See voicemail.conf.\n" " defaults to \"ABdY 'digits/at' IMp\"\n"; -LOCAL_USER_DECL; static int sayunixtime_exec(struct ast_channel *chan, void *data) { @@ -78,7 +75,7 @@ static int sayunixtime_exec(struct ast_channel *chan, void *data) ); char *parse; int res = 0; - struct localuser *u; + struct ast_module_user *u; time_t unixtime; if (!data) @@ -86,7 +83,7 @@ static int sayunixtime_exec(struct ast_channel *chan, void *data) parse = ast_strdupa(data); - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); AST_STANDARD_APP_ARGS(args, parse); @@ -99,24 +96,24 @@ static int sayunixtime_exec(struct ast_channel *chan, void *data) res = ast_say_date_with_format(chan, unixtime, AST_DIGIT_ANY, chan->language, args.format, args.timezone); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app_sayunixtime); res |= ast_unregister_application(app_datetime); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { int res; @@ -126,14 +123,4 @@ static int load_module(void *mod) return res; } -static const char *description(void) -{ - return tdesc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Say time"); diff --git a/apps/app_senddtmf.c b/apps/app_senddtmf.c index 5ee4ecb01..67cb2d5c1 100644 --- a/apps/app_senddtmf.c +++ b/apps/app_senddtmf.c @@ -45,8 +45,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/app.h" #include "asterisk/manager.h" -static char *tdesc = "Send DTMF digits Application"; - static char *app = "SendDTMF"; static char *synopsis = "Sends arbitrary DTMF digits"; @@ -57,12 +55,11 @@ static char *descrip = " The application will either pass the assigned digits or terminate if it\n" " encounters an error.\n"; -LOCAL_USER_DECL; static int senddtmf_exec(struct ast_channel *chan, void *data) { int res = 0; - struct localuser *u; + struct ast_module_user *u; char *digits = NULL, *to = NULL; int timeout = 250; @@ -71,7 +68,7 @@ static int senddtmf_exec(struct ast_channel *chan, void *data) return 0; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); digits = ast_strdupa(data); @@ -86,7 +83,7 @@ static int senddtmf_exec(struct ast_channel *chan, void *data) res = ast_dtmf_stream(chan,NULL,digits,timeout); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } @@ -122,19 +119,19 @@ static int manager_play_dtmf(struct mansession *s, struct message *m) return 0; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app); res |= ast_manager_unregister("PlayDTMF"); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { int res; @@ -144,14 +141,4 @@ static int load_module(void *mod) return res; } -static const char *description(void) -{ - return tdesc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Send DTMF digits Application"); diff --git a/apps/app_sendtext.c b/apps/app_sendtext.c index 5be7726de..6828e3f76 100644 --- a/apps/app_sendtext.c +++ b/apps/app_sendtext.c @@ -63,12 +63,11 @@ static const char *descrip = "'j' -- jump to n+101 priority if the channel doesn't support\n" " text transport\n"; -LOCAL_USER_DECL; static int sendtext_exec(struct ast_channel *chan, void *data) { int res = 0; - struct localuser *u; + struct ast_module_user *u; char *status = "UNSUPPORTED"; char *parse = NULL; int priority_jump = 0; @@ -77,11 +76,11 @@ static int sendtext_exec(struct ast_channel *chan, void *data) AST_APP_ARG(options); ); - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "SendText requires an argument (text[|options])\n"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } else parse = ast_strdupa(data); @@ -99,7 +98,7 @@ static int sendtext_exec(struct ast_channel *chan, void *data) /* Does not support transport */ if (priority_jump || ast_opt_priority_jumping) ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } status = "FAILURE"; @@ -108,34 +107,24 @@ static int sendtext_exec(struct ast_channel *chan, void *data) if (!res) status = "SUCCESS"; pbx_builtin_setvar_helper(chan, "SENDTEXTSTATUS", status); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { return ast_register_application(app, sendtext_exec, synopsis, descrip); } -static const char *description(void) -{ - return "Send Text Applications"; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Send Text Applications"); diff --git a/apps/app_setcallerid.c b/apps/app_setcallerid.c index b8b079a39..4456e1ee0 100644 --- a/apps/app_setcallerid.c +++ b/apps/app_setcallerid.c @@ -47,7 +47,6 @@ static char *app2 = "SetCallerPres"; static char *synopsis2 = "Set CallerID Presentation"; -LOCAL_USER_DECL; static char *descrip2 = " SetCallerPres(presentation): Set Caller*ID presentation on a call.\n" @@ -67,29 +66,25 @@ static char *descrip2 = static int setcallerid_pres_exec(struct ast_channel *chan, void *data) { - struct localuser *u; + struct ast_module_user *u; int pres = -1; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); pres = ast_parse_caller_presentation(data); if (pres < 0) { ast_log(LOG_WARNING, "'%s' is not a valid presentation (see 'show application SetCallerPres')\n", (char *) data); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } chan->cid.cid_pres = pres; - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } - - -static char *tdesc = "Set CallerID Application"; - static char *app = "SetCallerID"; static char *synopsis = "Set CallerID"; @@ -104,7 +99,7 @@ static int setcallerid_exec(struct ast_channel *chan, void *data) char *tmp = NULL; char name[256]; char num[256]; - struct localuser *u; + struct ast_module_user *u; char *opt; int anitoo = 0; static int dep_warning = 0; @@ -114,7 +109,7 @@ static int setcallerid_exec(struct ast_channel *chan, void *data) return 0; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if (!dep_warning) { dep_warning = 1; @@ -134,24 +129,24 @@ static int setcallerid_exec(struct ast_channel *chan, void *data) ast_callerid_split(tmp, name, sizeof(name), num, sizeof(num)); ast_set_callerid(chan, num, name, anitoo ? num : NULL); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app2); res |= ast_unregister_application(app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { int res; @@ -161,14 +156,4 @@ static int load_module(void *mod) return res; } -static const char *description(void) -{ - return tdesc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Set CallerID Application"); diff --git a/apps/app_setcdruserfield.c b/apps/app_setcdruserfield.c index 363532fe6..f6c83f48b 100644 --- a/apps/app_setcdruserfield.c +++ b/apps/app_setcdruserfield.c @@ -43,8 +43,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/utils.h" -static char *tdesc = "CDR user field apps"; - static char *setcdruserfield_descrip = "[Synopsis]\n" "SetCDRUserField(value)\n\n" @@ -74,7 +72,6 @@ static char *appendcdruserfield_descrip = static char *appendcdruserfield_app = "AppendCDRUserField"; static char *appendcdruserfield_synopsis = "Append to the CDR user field"; -LOCAL_USER_DECL; static int action_setcdruserfield(struct mansession *s, struct message *m) { @@ -107,11 +104,11 @@ static int action_setcdruserfield(struct mansession *s, struct message *m) static int setcdruserfield_exec(struct ast_channel *chan, void *data) { - struct localuser *u; + struct ast_module_user *u; int res = 0; static int dep_warning = 0; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if (chan->cdr && data) { ast_cdr_setuserfield(chan, (char*)data); @@ -122,18 +119,18 @@ static int setcdruserfield_exec(struct ast_channel *chan, void *data) ast_log(LOG_WARNING, "SetCDRUserField is deprecated. Please use CDR(userfield) instead.\n"); } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } static int appendcdruserfield_exec(struct ast_channel *chan, void *data) { - struct localuser *u; + struct ast_module_user *u; int res = 0; static int dep_warning = 0; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if (chan->cdr && data) { ast_cdr_appenduserfield(chan, (char*)data); @@ -144,12 +141,12 @@ static int appendcdruserfield_exec(struct ast_channel *chan, void *data) ast_log(LOG_WARNING, "AppendCDRUserField is deprecated. Please use CDR(userfield) instead.\n"); } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; @@ -157,12 +154,12 @@ static int unload_module(void *mod) res |= ast_unregister_application(appendcdruserfield_app); res |= ast_manager_unregister("SetCDRUserField"); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { int res; @@ -173,14 +170,4 @@ static int load_module(void *mod) return res; } -static const char *description(void) -{ - return tdesc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "CDR user field apps"); diff --git a/apps/app_settransfercapability.c b/apps/app_settransfercapability.c index 6aff25c3b..ff67a4282 100644 --- a/apps/app_settransfercapability.c +++ b/apps/app_settransfercapability.c @@ -44,7 +44,6 @@ static char *app = "SetTransferCapability"; static char *synopsis = "Set ISDN Transfer Capability"; -LOCAL_USER_DECL; static struct { int val; char *name; } transcaps[] = { { AST_TRANS_CAP_SPEECH, "SPEECH" }, @@ -72,13 +71,13 @@ static char *descrip = static int settransfercapability_exec(struct ast_channel *chan, void *data) { char *tmp = NULL; - struct localuser *u; + struct ast_module_user *u; int x; char *opts; int transfercapability = -1; static int dep_warning = 0; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if (!dep_warning) { dep_warning = 1; @@ -102,7 +101,7 @@ static int settransfercapability_exec(struct ast_channel *chan, void *data) } if (transfercapability < 0) { ast_log(LOG_WARNING, "'%s' is not a valid transfer capability (see 'show application SetTransferCapability')\n", tmp); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } @@ -111,36 +110,26 @@ static int settransfercapability_exec(struct ast_channel *chan, void *data) if (option_verbose > 2) ast_verbose(VERBOSE_PREFIX_3 "Setting transfer capability to: 0x%.2x - %s.\n", transfercapability, tmp); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { return ast_register_application(app, settransfercapability_exec, synopsis, descrip); } -static const char *description(void) -{ - return synopsis; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Set ISDN Transfer Capability"); diff --git a/apps/app_skel.c b/apps/app_skel.c index 33cc28a94..55830ebee 100644 --- a/apps/app_skel.c +++ b/apps/app_skel.c @@ -72,13 +72,12 @@ AST_APP_OPTIONS(app_opts,{ AST_APP_OPTION_ARG('c', OPTION_C, OPTION_ARG_C), }); -LOCAL_USER_DECL; static int app_exec(struct ast_channel *chan, void *data) { int res = 0; struct ast_flags flags; - struct localuser *u; + struct ast_module_user *u; char *parse, *opts[OPTION_ARG_ARRAY_SIZE]; AST_DECLARE_APP_ARGS(args, AST_APP_ARG(dummy); @@ -90,7 +89,7 @@ static int app_exec(struct ast_channel *chan, void *data) return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); /* Do our thing here */ @@ -114,32 +113,21 @@ static int app_exec(struct ast_channel *chan, void *data) if (ast_test_flag(&flags, OPTION_C)) ast_log(LOG_NOTICE, "Option C is set with : %s\n", opts[OPTION_ARG_C] ? opts[OPTION_ARG_C] : "<unspecified>"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app); return res; } -static int load_module(void *mod) +static int load_module(void) { return ast_register_application(app, app_exec, synopsis, descrip); } -static const char *description(void) -{ - return "Trivial skeleton Application"; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; - +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Skeleton (sample) Application"); diff --git a/apps/app_sms.c b/apps/app_sms.c index 816cc426f..aa9619b76 100644 --- a/apps/app_sms.c +++ b/apps/app_sms.c @@ -61,8 +61,6 @@ static volatile unsigned int seq; /* arbitrary message sequence number for static char log_file[255]; static char spool_dir[255]; -static char *tdesc = "SMS/PSTN handler"; - static char *app = "SMS"; static char *synopsis = "Communicates with SMS service centres and SMS capable analogue phones"; @@ -95,7 +93,6 @@ static signed short wave[] = { static unsigned char wavea[80]; #endif -LOCAL_USER_DECL; /* SMS 7 bit character mapping to UCS-2 */ static const unsigned short defaultalphabet[] = { @@ -1359,17 +1356,17 @@ static struct ast_generator smsgen = { static int sms_exec (struct ast_channel *chan, void *data) { int res = -1; - struct localuser *u; + struct ast_module_user *u; struct ast_frame *f; sms_t h = { 0 }; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); h.ipc0 = h.ipc1 = 20; /* phase for cosine */ h.dcs = 0xF1; /* default */ if (!data) { ast_log (LOG_ERROR, "Requires queue name at least\n"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } @@ -1382,13 +1379,13 @@ static int sms_exec (struct ast_channel *chan, void *data) answer = 0; if (!*d || *d == '|') { ast_log (LOG_ERROR, "Requires queue name\n"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } for (p = d; *p && *p != '|'; p++); if (p - d >= sizeof (h.queue)) { ast_log (LOG_ERROR, "Queue name too long\n"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } strncpy (h.queue, (char *)d, p - d); @@ -1457,7 +1454,7 @@ static int sms_exec (struct ast_channel *chan, void *data) h.rx = 0; /* sent message */ h.mr = -1; sms_writefile (&h); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } @@ -1481,13 +1478,13 @@ static int sms_exec (struct ast_channel *chan, void *data) res = ast_set_read_format (chan, AST_FORMAT_SLINEAR); if (res < 0) { ast_log (LOG_ERROR, "Unable to set to linear mode, giving up\n"); - LOCAL_USER_REMOVE (u); + ast_module_user_remove(u); return -1; } if (ast_activate_generator (chan, &smsgen, &h) < 0) { ast_log (LOG_ERROR, "Failed to activate generator on '%s'\n", chan->name); - LOCAL_USER_REMOVE (u); + ast_module_user_remove(u); return -1; } @@ -1506,22 +1503,22 @@ static int sms_exec (struct ast_channel *chan, void *data) sms_log (&h, '?'); /* log incomplete message */ - LOCAL_USER_REMOVE (u); + ast_module_user_remove(u); return (h.err); } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application (app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { #ifdef OUTALAW { @@ -1535,14 +1532,4 @@ static int load_module(void *mod) return ast_register_application (app, sms_exec, synopsis, descrip); } -static const char *description(void) -{ - return tdesc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "SMS/PSTN handler"); diff --git a/apps/app_softhangup.c b/apps/app_softhangup.c index 5f2666561..46584c3e7 100644 --- a/apps/app_softhangup.c +++ b/apps/app_softhangup.c @@ -44,8 +44,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") static char *synopsis = "Soft Hangup Application"; -static char *tdesc = "Hangs up the requested channel"; - static char *desc = " SoftHangup(Technology/resource|options)\n" "Hangs up the requested channel. If there are no channels to hangup,\n" "the application will report it.\n" @@ -54,11 +52,10 @@ static char *desc = " SoftHangup(Technology/resource|options)\n" static char *app = "SoftHangup"; -LOCAL_USER_DECL; static int softhangup_exec(struct ast_channel *chan, void *data) { - struct localuser *u; + struct ast_module_user *u; struct ast_channel *c=NULL; char *options, *cut, *cdata, *match; char name[AST_CHANNEL_NAME] = ""; @@ -69,7 +66,7 @@ static int softhangup_exec(struct ast_channel *chan, void *data) return 0; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); cdata = ast_strdupa(data); match = strsep(&cdata, "|"); @@ -100,35 +97,25 @@ static int softhangup_exec(struct ast_channel *chan, void *data) c = ast_channel_walk_locked(c); } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { return ast_register_application(app, softhangup_exec, synopsis, desc); } -static const char *description(void) -{ - return tdesc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Hangs up the requested channel"); diff --git a/apps/app_speech_utils.c b/apps/app_speech_utils.c index a63eee828..397022fd4 100644 --- a/apps/app_speech_utils.c +++ b/apps/app_speech_utils.c @@ -43,10 +43,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$"); #include "asterisk/app.h" #include "asterisk/speech.h" -static char *tdesc = "Dialplan Speech Applications"; - -LOCAL_USER_DECL; - /* Descriptions for each application */ static char *speechcreate_descrip = "SpeechCreate(engine name)\n" @@ -312,18 +308,18 @@ static struct ast_custom_function speech_function = { /*! \brief SpeechCreate() Dialplan Application */ static int speech_create(struct ast_channel *chan, void *data) { - struct localuser *u = NULL; + struct ast_module_user *u = NULL; struct ast_speech *speech = NULL; struct ast_datastore *datastore = NULL; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); /* Request a speech object */ speech = ast_speech_new(data, AST_FORMAT_SLINEAR); if (speech == NULL) { /* Not available */ pbx_builtin_setvar_helper(chan, "ERROR", "1"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } @@ -331,13 +327,13 @@ static int speech_create(struct ast_channel *chan, void *data) if (datastore == NULL) { ast_speech_destroy(speech); pbx_builtin_setvar_helper(chan, "ERROR", "1"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } datastore->data = speech; ast_channel_datastore_add(chan, datastore); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } @@ -346,23 +342,23 @@ static int speech_create(struct ast_channel *chan, void *data) static int speech_load(struct ast_channel *chan, void *data) { int res = 0, argc = 0; - struct localuser *u = NULL; + struct ast_module_user *u = NULL; struct ast_speech *speech = find_speech(chan); char *argv[2], *args = NULL, *name = NULL, *path = NULL; args = ast_strdupa(data); - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if (speech == NULL) { - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } /* Parse out arguments */ argc = ast_app_separate_args(args, '|', argv, sizeof(argv) / sizeof(argv[0])); if (argc != 2) { - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } name = argv[0]; @@ -371,7 +367,7 @@ static int speech_load(struct ast_channel *chan, void *data) /* Load the grammar locally on the object */ res = ast_speech_grammar_load(speech, name, path); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } @@ -380,20 +376,20 @@ static int speech_load(struct ast_channel *chan, void *data) static int speech_unload(struct ast_channel *chan, void *data) { int res = 0; - struct localuser *u = NULL; + struct ast_module_user *u = NULL; struct ast_speech *speech = find_speech(chan); - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if (speech == NULL) { - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } /* Unload the grammar */ res = ast_speech_grammar_unload(speech, data); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } @@ -402,20 +398,20 @@ static int speech_unload(struct ast_channel *chan, void *data) static int speech_deactivate(struct ast_channel *chan, void *data) { int res = 0; - struct localuser *u = NULL; + struct ast_module_user *u = NULL; struct ast_speech *speech = find_speech(chan); - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if (speech == NULL) { - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } /* Deactivate the grammar on the speech object */ res = ast_speech_grammar_deactivate(speech, data); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } @@ -424,20 +420,20 @@ static int speech_deactivate(struct ast_channel *chan, void *data) static int speech_activate(struct ast_channel *chan, void *data) { int res = 0; - struct localuser *u = NULL; + struct ast_module_user *u = NULL; struct ast_speech *speech = find_speech(chan); - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if (speech == NULL) { - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } /* Activate the grammar on the speech object */ res = ast_speech_grammar_activate(speech, data); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } @@ -446,19 +442,19 @@ static int speech_activate(struct ast_channel *chan, void *data) static int speech_start(struct ast_channel *chan, void *data) { int res = 0; - struct localuser *u = NULL; + struct ast_module_user *u = NULL; struct ast_speech *speech = find_speech(chan); - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if (speech == NULL) { - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } ast_speech_start(speech); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } @@ -467,13 +463,13 @@ static int speech_start(struct ast_channel *chan, void *data) static int speech_processing_sound(struct ast_channel *chan, void *data) { int res = 0; - struct localuser *u = NULL; + struct ast_module_user *u = NULL; struct ast_speech *speech = find_speech(chan); - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if (speech == NULL) { - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } @@ -484,7 +480,7 @@ static int speech_processing_sound(struct ast_channel *chan, void *data) speech->processing_sound = strdup(data); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } @@ -517,7 +513,7 @@ static int speech_background(struct ast_channel *chan, void *data) { unsigned int timeout = 0; int res = 0, done = 0, argc = 0, started = 0; - struct localuser *u = NULL; + struct ast_module_user *u = NULL; struct ast_speech *speech = find_speech(chan); struct ast_frame *f = NULL; int oldreadformat = AST_FORMAT_SLINEAR; @@ -528,16 +524,16 @@ static int speech_background(struct ast_channel *chan, void *data) args = ast_strdupa(data); - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if (speech == NULL) { - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } /* If channel is not already answered, then answer it */ if (chan->_state != AST_STATE_UP && ast_answer(chan)) { - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } @@ -546,7 +542,7 @@ static int speech_background(struct ast_channel *chan, void *data) /* Change read format to be signed linear */ if (ast_set_read_format(chan, AST_FORMAT_SLINEAR)) { - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } @@ -563,7 +559,7 @@ static int speech_background(struct ast_channel *chan, void *data) if (filename != NULL && ast_streamfile(chan, filename, chan->language)) { /* An error occured while streaming */ ast_set_read_format(chan, oldreadformat); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } @@ -718,7 +714,7 @@ static int speech_background(struct ast_channel *chan, void *data) ast_set_read_format(chan, oldreadformat); } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } @@ -728,14 +724,14 @@ static int speech_background(struct ast_channel *chan, void *data) static int speech_destroy(struct ast_channel *chan, void *data) { int res = 0; - struct localuser *u = NULL; + struct ast_module_user *u = NULL; struct ast_speech *speech = find_speech(chan); struct ast_datastore *datastore = NULL; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if (speech == NULL) { - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } @@ -747,12 +743,12 @@ static int speech_destroy(struct ast_channel *chan, void *data) ast_channel_datastore_remove(chan, datastore); } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res = 0; @@ -771,12 +767,12 @@ static int unload_module(void *mod) res |= ast_custom_function_unregister(&speech_grammar_function); res |= ast_custom_function_unregister(&speech_engine_function); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { int res = 0; @@ -798,14 +794,4 @@ static int load_module(void *mod) return res; } -static const char *description(void) -{ - return tdesc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Dialplan Speech Applications"); diff --git a/apps/app_stack.c b/apps/app_stack.c index af1967799..34aa8693f 100644 --- a/apps/app_stack.c +++ b/apps/app_stack.c @@ -70,7 +70,6 @@ static const char *pop_descrip = "StackPop()\n" " Removes last label on the stack, discarding it.\n"; -LOCAL_USER_DECL; static int pop_exec(struct ast_channel *chan, void *data) { @@ -98,30 +97,30 @@ static int return_exec(struct ast_channel *chan, void *data) static int gosub_exec(struct ast_channel *chan, void *data) { char newlabel[AST_MAX_EXTENSION * 2 + 3 + 11]; - struct localuser *u; + struct ast_module_user *u; if (ast_strlen_zero(data)) { ast_log(LOG_ERROR, "%s requires an argument: %s([[context|]exten|]priority)\n", app_gosub, app_gosub); return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); snprintf(newlabel, sizeof(newlabel), "%s|%s|%d", chan->context, chan->exten, chan->priority + 1); if (ast_parseable_goto(chan, data)) { - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } pbx_builtin_pushvar_helper(chan, STACKVAR, newlabel); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } static int gosubif_exec(struct ast_channel *chan, void *data) { - struct localuser *u; + struct ast_module_user *u; char *condition="", *label1, *label2, *args; int res=0; @@ -132,7 +131,7 @@ static int gosubif_exec(struct ast_channel *chan, void *data) args = ast_strdupa(data); - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); condition = strsep(&args, "?"); label1 = strsep(&args, ":"); @@ -146,23 +145,23 @@ static int gosubif_exec(struct ast_channel *chan, void *data) res = gosub_exec(chan, label2); } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { ast_unregister_application(app_return); ast_unregister_application(app_pop); ast_unregister_application(app_gosubif); ast_unregister_application(app_gosub); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return 0; } -static int load_module(void *mod) +static int load_module(void) { ast_register_application(app_pop, pop_exec, pop_synopsis, pop_descrip); ast_register_application(app_return, return_exec, return_synopsis, return_descrip); @@ -172,14 +171,4 @@ static int load_module(void *mod) return 0; } -static const char *description(void) -{ - return "Stack Routines"; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Stack Routines"); diff --git a/apps/app_system.c b/apps/app_system.c index 31585ab94..4bada66b2 100644 --- a/apps/app_system.c +++ b/apps/app_system.c @@ -44,8 +44,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/app.h" #include "asterisk/options.h" -static char *tdesc = "Generic System() application"; - static char *app = "System"; static char *app2 = "TrySystem"; @@ -83,12 +81,11 @@ static char *descrip2 = "instance, then the channel will be setup to continue at that\n" "priority level. Otherwise, System will terminate.\n"; -LOCAL_USER_DECL; static int system_exec_helper(struct ast_channel *chan, void *data, int failmode) { int res=0; - struct localuser *u; + struct ast_module_user *u; if (ast_strlen_zero(data)) { ast_log(LOG_WARNING, "System requires an argument(command)\n"); @@ -96,7 +93,7 @@ static int system_exec_helper(struct ast_channel *chan, void *data, int failmode return failmode; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); /* Do our thing here */ res = ast_safe_system((char *)data); @@ -121,7 +118,7 @@ static int system_exec_helper(struct ast_channel *chan, void *data, int failmode res = 0; } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } @@ -136,19 +133,19 @@ static int trysystem_exec(struct ast_channel *chan, void *data) return system_exec_helper(chan, data, 0); } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app); res |= ast_unregister_application(app2); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { int res; @@ -158,14 +155,4 @@ static int load_module(void *mod) return res; } -static const char *description(void) -{ - return tdesc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Generic System() application"); diff --git a/apps/app_talkdetect.c b/apps/app_talkdetect.c index 84368ec72..79cbbd5d0 100644 --- a/apps/app_talkdetect.c +++ b/apps/app_talkdetect.c @@ -43,8 +43,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/utils.h" #include "asterisk/dsp.h" -static char *tdesc = "Playback with Talk Detection"; - static char *app = "BackgroundDetect"; static char *synopsis = "Background a file with talk detect"; @@ -60,12 +58,11 @@ static char *descrip = "if available. If unspecified, sil, min, and max default to 1000, 100, and\n" "infinity respectively.\n"; -LOCAL_USER_DECL; static int background_detect_exec(struct ast_channel *chan, void *data) { int res = 0; - struct localuser *u; + struct ast_module_user *u; char *tmp; char *options; char *stringp; @@ -84,7 +81,7 @@ static int background_detect_exec(struct ast_channel *chan, void *data) return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); tmp = ast_strdupa(data); @@ -207,34 +204,24 @@ static int background_detect_exec(struct ast_channel *chan, void *data) } if (dsp) ast_dsp_free(dsp); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { return ast_register_application(app, background_detect_exec, synopsis, descrip); } -static const char *description(void) -{ - return tdesc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Playback with Talk Detection"); diff --git a/apps/app_test.c b/apps/app_test.c index 885dd2572..b38fe4ca7 100644 --- a/apps/app_test.c +++ b/apps/app_test.c @@ -48,10 +48,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/pbx.h" #include "asterisk/utils.h" -LOCAL_USER_DECL; - -static char *tdesc = "Interface Test Application"; - static char *tests_descrip = "TestServer(): Perform test server function and write call report.\n" "Results stored in /var/log/asterisk/testreports/<testid>-server.txt"; @@ -133,7 +129,7 @@ static int sendnoise(struct ast_channel *chan, int ms) static int testclient_exec(struct ast_channel *chan, void *data) { - struct localuser *u; + struct ast_module_user *u; int res = 0; char *testid=data; char fn[80]; @@ -146,7 +142,7 @@ static int testclient_exec(struct ast_channel *chan, void *data) return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if (chan->_state != AST_STATE_UP) res = ast_answer(chan); @@ -318,18 +314,18 @@ static int testclient_exec(struct ast_channel *chan, void *data) ast_log(LOG_NOTICE, "Did not read a test ID on '%s'\n", chan->name); res = -1; } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } static int testserver_exec(struct ast_channel *chan, void *data) { - struct localuser *u; + struct ast_module_user *u; int res = 0; char testid[80]=""; char fn[80]; FILE *f; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if (chan->_state != AST_STATE_UP) res = ast_answer(chan); /* Read version */ @@ -487,23 +483,23 @@ static int testserver_exec(struct ast_channel *chan, void *data) ast_log(LOG_NOTICE, "Did not read a test ID on '%s'\n", chan->name); res = -1; } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(testc_app); res |= ast_unregister_application(tests_app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { int res; @@ -513,14 +509,4 @@ static int load_module(void *mod) return res; } -static const char *description(void) -{ - return tdesc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Interface Test Application"); diff --git a/apps/app_transfer.c b/apps/app_transfer.c index ff3182702..cda2914c7 100644 --- a/apps/app_transfer.c +++ b/apps/app_transfer.c @@ -45,7 +45,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/options.h" #include "asterisk/app.h" -LOCAL_USER_DECL; static const char *app = "Transfer"; @@ -70,7 +69,7 @@ static int transfer_exec(struct ast_channel *chan, void *data) { int res; int len; - struct localuser *u; + struct ast_module_user *u; char *slash; char *tech = NULL; char *dest = NULL; @@ -82,11 +81,11 @@ static int transfer_exec(struct ast_channel *chan, void *data) AST_APP_ARG(options); ); - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if (ast_strlen_zero((char *)data)) { ast_log(LOG_WARNING, "Transfer requires an argument ([Tech/]destination[|options])\n"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); pbx_builtin_setvar_helper(chan, "TRANSFERSTATUS", "FAILURE"); return 0; } else @@ -107,7 +106,7 @@ static int transfer_exec(struct ast_channel *chan, void *data) /* Allow execution only if the Tech/destination agrees with the type of the channel */ if (strncasecmp(chan->tech->type, tech, len)) { pbx_builtin_setvar_helper(chan, "TRANSFERSTATUS", "FAILURE"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } } @@ -115,7 +114,7 @@ static int transfer_exec(struct ast_channel *chan, void *data) /* Check if the channel supports transfer before we try it */ if (!chan->tech->transfer) { pbx_builtin_setvar_helper(chan, "TRANSFERSTATUS", "UNSUPPORTED"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } @@ -133,35 +132,25 @@ static int transfer_exec(struct ast_channel *chan, void *data) pbx_builtin_setvar_helper(chan, "TRANSFERSTATUS", status); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { return ast_register_application(app, transfer_exec, synopsis, descrip); } -static const char *description(void) -{ - return "Transfer"; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Transfer"); diff --git a/apps/app_url.c b/apps/app_url.c index 3c5d873a8..272c18928 100644 --- a/apps/app_url.c +++ b/apps/app_url.c @@ -43,8 +43,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/image.h" #include "asterisk/options.h" -static char *tdesc = "Send URL Applications"; - static char *app = "SendURL"; static char *synopsis = "Send a URL"; @@ -70,12 +68,11 @@ static char *descrip = " SendURL only returns 0 if the URL was sent correctly or if\n" " the channel does not support HTML transport, and -1 otherwise.\n"; -LOCAL_USER_DECL; static int sendurl_exec(struct ast_channel *chan, void *data) { int res = 0; - struct localuser *u; + struct ast_module_user *u; char *tmp; char *options; int local_option_wait=0; @@ -90,7 +87,7 @@ static int sendurl_exec(struct ast_channel *chan, void *data) return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); tmp = ast_strdupa(data); @@ -107,13 +104,13 @@ static int sendurl_exec(struct ast_channel *chan, void *data) if (local_option_jump || ast_opt_priority_jumping) ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101); pbx_builtin_setvar_helper(chan, "SENDURLSTATUS", "UNSUPPORTED"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } res = ast_channel_sendurl(chan, tmp); if (res == -1) { pbx_builtin_setvar_helper(chan, "SENDURLSTATUS", "FAILURE"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } status = "SUCCESS"; @@ -155,34 +152,24 @@ static int sendurl_exec(struct ast_channel *chan, void *data) } out: pbx_builtin_setvar_helper(chan, "SENDURLSTATUS", status); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { return ast_register_application(app, sendurl_exec, synopsis, descrip); } -static const char *description(void) -{ - return tdesc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Send URL Applications"); diff --git a/apps/app_userevent.c b/apps/app_userevent.c index 9e7c3b107..075618507 100644 --- a/apps/app_userevent.c +++ b/apps/app_userevent.c @@ -39,8 +39,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/manager.h" #include "asterisk/app.h" -static char *tdesc = "Custom User Event Application"; - static char *app = "UserEvent"; static char *synopsis = "Send an arbitrary event to the manager interface"; @@ -56,11 +54,10 @@ static char *descrip = " [body]\n" "If no body is specified, only Event and UserEvent headers will be present.\n"; -LOCAL_USER_DECL; static int userevent_exec(struct ast_channel *chan, void *data) { - struct localuser *u; + struct ast_module_user *u; char *parse, buf[2048] = ""; int x, buflen = 0; AST_DECLARE_APP_ARGS(args, @@ -73,7 +70,7 @@ static int userevent_exec(struct ast_channel *chan, void *data) return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); parse = ast_strdupa(data); @@ -88,34 +85,25 @@ static int userevent_exec(struct ast_channel *chan, void *data) manager_event(EVENT_FLAG_USER, "UserEvent", "UserEvent: %s\r\n%s\r\n", args.eventname, buf); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); + return 0; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { return ast_register_application(app, userevent_exec, synopsis, descrip); } -static const char *description(void) -{ - return tdesc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Custom User Event Application"); diff --git a/apps/app_verbose.c b/apps/app_verbose.c index 33f666025..f9bcfd116 100644 --- a/apps/app_verbose.c +++ b/apps/app_verbose.c @@ -39,9 +39,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/pbx.h" #include "asterisk/module.h" - -static char *tdesc = "Send verbose output"; - static char *app_verbose = "Verbose"; static char *verbose_synopsis = "Send arbitrary text to verbose output"; static char *verbose_descrip = @@ -54,15 +51,14 @@ static char *log_descrip = "Log(<level>|<message>)\n" " level must be one of ERROR, WARNING, NOTICE, DEBUG, VERBOSE, DTMF\n"; -LOCAL_USER_DECL; static int verbose_exec(struct ast_channel *chan, void *data) { char *vtext; int vsize; - struct localuser *u; + struct ast_module_user *u; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if (data) { char *tmp; @@ -97,7 +93,7 @@ static int verbose_exec(struct ast_channel *chan, void *data) } } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } @@ -105,13 +101,13 @@ static int verbose_exec(struct ast_channel *chan, void *data) static int log_exec(struct ast_channel *chan, void *data) { char *level, *ltext; - struct localuser *u; + struct ast_module_user *u; int lnum = -1; char extension[AST_MAX_EXTENSION + 5], context[AST_MAX_EXTENSION + 2]; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if (ast_strlen_zero(data)) { - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } @@ -143,23 +139,23 @@ static int log_exec(struct ast_channel *chan, void *data) ast_log(lnum, extension, chan->priority, context, "%s\n", ltext); } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app_verbose); res |= ast_unregister_application(app_log); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { int res; @@ -169,14 +165,4 @@ static int load_module(void *mod) return res; } -static const char *description(void) -{ - return tdesc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Send verbose output"); diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index c6520ec75..60df5dcea 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -397,12 +397,12 @@ static char VM_SPOOL_DIR[PATH_MAX]; static char ext_pass_cmd[128]; #ifdef ODBC_STORAGE -static char *tdesc = "Comedian Mail (Voicemail System) with ODBC Storage"; +#define tdesc "Comedian Mail (Voicemail System) with ODBC Storage" #else #ifdef IMAP_STORAGE -static char *tdesc = "Comedian Mail (Voicemail System) with IMAP Storage"; +#define tdesc "Comedian Mail (Voicemail System) with IMAP Storage" #else -static char *tdesc = "Comedian Mail (Voicemail System)"; +#define tdesc "Comedian Mail (Voicemail System)" #endif #endif @@ -531,7 +531,6 @@ static unsigned char adsisec[4] = "\x9B\xDB\xF7\xAC"; static int adsiver = 1; static char emaildateformat[32] = "%A, %B %d, %Y at %r"; -LOCAL_USER_DECL; static void populate_defaults(struct ast_vm_user *vmu) { @@ -5971,7 +5970,7 @@ static int vm_execmain(struct ast_channel *chan, void *data) int res=-1; int cmd=0; int valid = 0; - struct localuser *u; + struct ast_module_user *u; char prefixstr[80] =""; char ext_context[256]=""; int box; @@ -5988,7 +5987,7 @@ static int vm_execmain(struct ast_channel *chan, void *data) #ifdef IMAP_STORAGE int deleted = 0; #endif - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); /* Add the vm_state to the active list and keep it active */ memset(&vms, 0, sizeof(vms)); @@ -6015,7 +6014,7 @@ static int vm_execmain(struct ast_channel *chan, void *data) if (args.argc == 2) { if (ast_app_parse_options(vm_app_options, &flags, opts, args.argv1)) { - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } if (ast_test_flag(&flags, OPT_RECORDGAIN)) { @@ -6023,7 +6022,7 @@ static int vm_execmain(struct ast_channel *chan, void *data) if (opts[OPT_ARG_RECORDGAIN]) { if (sscanf(opts[OPT_ARG_RECORDGAIN], "%d", &gain) != 1) { ast_log(LOG_WARNING, "Invalid value '%s' provided for record gain option\n", opts[OPT_ARG_RECORDGAIN]); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } else { record_gain = (signed char) gain; @@ -6493,7 +6492,7 @@ out: free(vms.deleted); if (vms.heard) free(vms.heard); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } @@ -6501,7 +6500,7 @@ out: static int vm_exec(struct ast_channel *chan, void *data) { int res = 0; - struct localuser *u; + struct ast_module_user *u; char *tmp; struct leave_vm_options leave_options; struct ast_flags flags = { 0 }; @@ -6512,7 +6511,7 @@ static int vm_exec(struct ast_channel *chan, void *data) AST_APP_ARG(argv1); ); - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); memset(&leave_options, 0, sizeof(leave_options)); @@ -6524,7 +6523,7 @@ static int vm_exec(struct ast_channel *chan, void *data) AST_STANDARD_APP_ARGS(args, tmp); if (args.argc == 2) { if (ast_app_parse_options(vm_app_options, &flags, opts, args.argv1)) { - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } ast_copy_flags(&leave_options, &flags, OPT_SILENT | OPT_BUSY_GREETING | OPT_UNAVAIL_GREETING | OPT_PRIORITY_JUMP); @@ -6533,7 +6532,7 @@ static int vm_exec(struct ast_channel *chan, void *data) if (sscanf(opts[OPT_ARG_RECORDGAIN], "%d", &gain) != 1) { ast_log(LOG_WARNING, "Invalid value '%s' provided for record gain option\n", opts[OPT_ARG_RECORDGAIN]); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } else { leave_options.record_gain = (signed char) gain; @@ -6570,11 +6569,11 @@ static int vm_exec(struct ast_channel *chan, void *data) char tmp[256]; res = ast_app_getdata(chan, "vm-whichbox", tmp, sizeof(tmp) - 1, 0); if (res < 0) { - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } if (ast_strlen_zero(tmp)) { - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } args.argv0 = ast_strdupa(tmp); @@ -6592,7 +6591,7 @@ static int vm_exec(struct ast_channel *chan, void *data) res = 0; } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } @@ -6631,7 +6630,7 @@ static int append_mailbox(char *context, char *mbox, char *data) static int vm_box_exists(struct ast_channel *chan, void *data) { - struct localuser *u; + struct ast_module_user *u; struct ast_vm_user svm; char *context, *box; int priority_jump = 0; @@ -6645,7 +6644,7 @@ static int vm_box_exists(struct ast_channel *chan, void *data) return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); box = ast_strdupa(data); @@ -6668,20 +6667,20 @@ static int vm_box_exists(struct ast_channel *chan, void *data) ast_log(LOG_WARNING, "VM box %s@%s exists, but extension %s, priority %d doesn't exist\n", box, context, chan->exten, chan->priority + 101); } else pbx_builtin_setvar_helper(chan, "VMBOXEXISTSSTATUS", "FAILED"); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } static int vmauthenticate(struct ast_channel *chan, void *data) { - struct localuser *u; + struct ast_module_user *u; char *s = data, *user=NULL, *context=NULL, mailbox[AST_MAX_EXTENSION] = ""; struct ast_vm_user vmus; char *options = NULL; int silent = 0, skipuser = 0; int res = -1; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if (s) { s = ast_strdupa(s); @@ -6708,7 +6707,7 @@ static int vmauthenticate(struct ast_channel *chan, void *data) res = 0; } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } @@ -7333,12 +7332,12 @@ static int load_config(void) } } -static int reload(void *mod) +static int reload(void) { return(load_config()); } -static int unload_module(void *mod) +static int unload_module(void) { int res; @@ -7350,12 +7349,12 @@ static int unload_module(void *mod) res |= ast_cli_unregister(&show_voicemail_zones_cli); ast_uninstall_vm_functions(); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { int res; res = ast_register_application(app, vm_exec, synopsis_vm, descrip_vm); @@ -8556,16 +8555,11 @@ static void get_mailbox_delimiter(MAILSTREAM *stream) { mail_list(stream, "", "*"); } -#endif - -static const char *description(void) -{ - return tdesc; -} -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD(MOD_1, reload, NULL, NULL); +#endif /* IMAP_STORAGE */ + +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, tdesc, + .load = load_module, + .unload = unload_module, + .reload = reload, + ); diff --git a/apps/app_waitforring.c b/apps/app_waitforring.c index 9da5d0702..a4f69ae77 100644 --- a/apps/app_waitforring.c +++ b/apps/app_waitforring.c @@ -45,8 +45,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") static char *synopsis = "Wait for Ring Application"; -static char *tdesc = "Waits until first ring after time"; - static char *desc = " WaitForRing(timeout)\n" "Returns 0 after waiting at least timeout seconds. and\n" "only after the next ring has completed. Returns 0 on\n" @@ -54,11 +52,10 @@ static char *desc = " WaitForRing(timeout)\n" static char *app = "WaitForRing"; -LOCAL_USER_DECL; static int waitforring_exec(struct ast_channel *chan, void *data) { - struct localuser *u; + struct ast_module_user *u; struct ast_frame *f; int res = 0; int ms; @@ -68,7 +65,7 @@ static int waitforring_exec(struct ast_channel *chan, void *data) return 0; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); ms *= 1000; while(ms > 0) { @@ -115,35 +112,25 @@ static int waitforring_exec(struct ast_channel *chan, void *data) } } } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { return ast_register_application(app, waitforring_exec, synopsis, desc); } -static const char *description(void) -{ - return tdesc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Waits until first ring after time"); diff --git a/apps/app_waitforsilence.c b/apps/app_waitforsilence.c index 3352aa4b9..890bf01eb 100644 --- a/apps/app_waitforsilence.c +++ b/apps/app_waitforsilence.c @@ -48,7 +48,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/module.h" #include "asterisk/options.h" -static char *tdesc = "Wait For Silence"; static char *app = "WaitForSilence"; static char *synopsis = "Waits for a specified amount of silence"; static char *descrip = @@ -61,7 +60,6 @@ static char *descrip = " - WaitForSilence(500|2) will wait for 1/2 second of silence, twice\n" " - WaitForSilence(1000) will wait for 1 second of silence, once\n"; -LOCAL_USER_DECL; static int do_waiting(struct ast_channel *chan, int maxsilence) { @@ -149,11 +147,11 @@ static int do_waiting(struct ast_channel *chan, int maxsilence) { static int waitforsilence_exec(struct ast_channel *chan, void *data) { int res = 1; - struct localuser *u; + struct ast_module_user *u; int maxsilence = 1000; int iterations = 1, i; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); res = ast_answer(chan); /* Answer the channel */ @@ -169,36 +167,26 @@ static int waitforsilence_exec(struct ast_channel *chan, void *data) for (i=0; (i<iterations) && (res == 1); i++) { res = do_waiting(chan, maxsilence); } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); if (res > 0) res = 0; return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { return ast_register_application(app, waitforsilence_exec, synopsis, descrip); } -static const char *description(void) -{ - return tdesc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Wait For Silence"); diff --git a/apps/app_while.c b/apps/app_while.c index 2aec886bc..33f9bbb51 100644 --- a/apps/app_while.c +++ b/apps/app_while.c @@ -44,7 +44,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/lock.h" #include "asterisk/options.h" -#define ALL_DONE(u,ret) {LOCAL_USER_REMOVE(u); return ret;} +#define ALL_DONE(u,ret) {ast_module_user_remove(u); return ret;} static char *start_app = "While"; @@ -75,10 +75,6 @@ static char *continue_desc = "Returns to the top of the while loop and re-evaluates the conditional.\n"; static char *continue_synopsis = "Restart a While loop"; -static char *tdesc = "While Loops and Conditional Execution"; - -LOCAL_USER_DECL; - #define VAR_SIZE 64 @@ -168,7 +164,7 @@ static int find_matching_endwhile(struct ast_channel *chan) static int _while_exec(struct ast_channel *chan, void *data, int end) { int res=0; - struct localuser *u; + struct ast_module_user *u; const char *while_pri = NULL; char *my_name = NULL; const char *condition = NULL, *label = NULL; @@ -183,7 +179,7 @@ static int _while_exec(struct ast_channel *chan, void *data, int end) return -1; } - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); /* dont want run away loops if the chan isn't even up this is up for debate since it slows things down a tad ...... @@ -310,7 +306,7 @@ static int while_continue_exec(struct ast_channel *chan, void *data) return 0; } -static int unload_module(void *mod) +static int unload_module(void) { int res; @@ -319,12 +315,12 @@ static int unload_module(void *mod) res |= ast_unregister_application(exit_app); res |= ast_unregister_application(continue_app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { int res; @@ -336,14 +332,4 @@ static int load_module(void *mod) return res; } -static const char *description(void) -{ - return tdesc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "While Loops and Conditional Execution"); diff --git a/apps/app_zapateller.c b/apps/app_zapateller.c index 21f6e2fa4..06941b16a 100644 --- a/apps/app_zapateller.c +++ b/apps/app_zapateller.c @@ -41,8 +41,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/module.h" #include "asterisk/translate.h" -static char *tdesc = "Block Telemarketers with Special Information Tone"; - static char *app = "Zapateller"; static char *synopsis = "Block telemarketers with SIT"; @@ -56,17 +54,16 @@ static char *descrip = "is no callerid information available. Options should be separated by |\n" "characters\n"; -LOCAL_USER_DECL; static int zapateller_exec(struct ast_channel *chan, void *data) { int res = 0; - struct localuser *u; + struct ast_module_user *u; int answer = 0, nocallerid = 0; char *c; char *stringp=NULL; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); stringp=data; c = strsep(&stringp, "|"); @@ -89,7 +86,7 @@ static int zapateller_exec(struct ast_channel *chan, void *data) } } if (chan->cid.cid_num && nocallerid) { - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } if (!res) @@ -100,34 +97,24 @@ static int zapateller_exec(struct ast_channel *chan, void *data) res = ast_tonepair(chan, 1800, 0, 330, 0); if (!res) res = ast_tonepair(chan, 0, 0, 1000, 0); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { return ast_register_application(app, zapateller_exec, synopsis, descrip); } -static const char *description(void) -{ - return tdesc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Block Telemarketers with Special Information Tone"); diff --git a/apps/app_zapbarge.c b/apps/app_zapbarge.c index 843e6151a..735020f60 100644 --- a/apps/app_zapbarge.c +++ b/apps/app_zapbarge.c @@ -60,8 +60,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/say.h" #include "asterisk/utils.h" -static char *tdesc = "Barge in on Zap channel application"; - static char *app = "ZapBarge"; static char *synopsis = "Barge in (monitor) Zap channel"; @@ -72,7 +70,6 @@ static char *descrip = "-1 when caller user hangs up and is independent of the\n" "state of the channel being monitored."; -LOCAL_USER_DECL; #define CONF_SIZE 160 @@ -263,19 +260,19 @@ outrun: static int conf_exec(struct ast_channel *chan, void *data) { int res=-1; - struct localuser *u; + struct ast_module_user *u; int retrycnt = 0; int confflags = 0; int confno = 0; char confstr[80] = ""; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if (!ast_strlen_zero(data)) { if ((sscanf(data, "Zap/%d", &confno) != 1) && (sscanf(data, "%d", &confno) != 1)) { ast_log(LOG_WARNING, "ZapBarge Argument (if specified) must be a channel number, not '%s'\n", (char *)data); - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } } @@ -298,35 +295,24 @@ static int conf_exec(struct ast_channel *chan, void *data) } out: /* Do the conference */ - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { return ast_register_application(app, conf_exec, synopsis, descrip); } -static const char *description(void) -{ - return tdesc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; - +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Barge in on Zap channel application"); diff --git a/apps/app_zapras.c b/apps/app_zapras.c index 8896eb274..de682f72c 100644 --- a/apps/app_zapras.c +++ b/apps/app_zapras.c @@ -58,8 +58,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/module.h" #include "asterisk/options.h" -static char *tdesc = "Zap RAS Application"; - static char *app = "ZapRAS"; static char *synopsis = "Executes Zaptel ISDN RAS application"; @@ -71,7 +69,6 @@ static char *descrip = "Your pppd must be patched to be zaptel aware. Arguments should be\n" "separated by | characters.\n"; -LOCAL_USER_DECL; #define PPP_MAX_ARGS 32 #define PPP_EXEC "/usr/sbin/pppd" @@ -195,13 +192,13 @@ static int zapras_exec(struct ast_channel *chan, void *data) { int res=-1; char *args; - struct localuser *u; + struct ast_module_user *u; ZT_PARAMS ztp; if (!data) data = ""; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); args = ast_strdupa(data); @@ -229,35 +226,25 @@ static int zapras_exec(struct ast_channel *chan, void *data) run_ras(chan, args); } } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { return ast_register_application(app, zapras_exec, synopsis, descrip); } -static const char *description(void) -{ - return tdesc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Zap RAS Application"); diff --git a/apps/app_zapscan.c b/apps/app_zapscan.c index d0a017072..690d9a5cc 100644 --- a/apps/app_zapscan.c +++ b/apps/app_zapscan.c @@ -59,8 +59,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/cli.h" #include "asterisk/say.h" -static char *tdesc = "Scan Zap channels application"; - static char *app = "ZapScan"; static char *synopsis = "Scan Zap channels to monitor calls"; @@ -70,7 +68,6 @@ static char *descrip = "a convenient way. Use '#' to select the next channel and use '*' to exit\n" "Limit scanning to a channel GROUP by setting the option group argument.\n"; -LOCAL_USER_DECL; #define CONF_SIZE 160 @@ -290,7 +287,7 @@ static int conf_run(struct ast_channel *chan, int confno, int confflags) static int conf_exec(struct ast_channel *chan, void *data) { int res=-1; - struct localuser *u; + struct ast_module_user *u; int confflags = 0; int confno = 0; char confstr[80] = "", *tmp = NULL; @@ -299,7 +296,7 @@ static int conf_exec(struct ast_channel *chan, void *data) char *desired_group; int input=0,search_group=0; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if (chan->_state != AST_STATE_UP) ast_answer(chan); @@ -360,35 +357,25 @@ static int conf_exec(struct ast_channel *chan, void *data) ast_mutex_unlock(&tempchan->lock); lastchan = tempchan; } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return res; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { return ast_register_application(app, conf_exec, synopsis, descrip); } -static const char *description(void) -{ - return tdesc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Scan Zap channels application"); diff --git a/build_tools/cflags.xml b/build_tools/cflags.xml index 1fe28f30d..7b251650d 100644 --- a/build_tools/cflags.xml +++ b/build_tools/cflags.xml @@ -21,4 +21,9 @@ </member> <member name="TRACE_FRAMES" displayname="Trace Frame Allocations"> </member> + <member name="STATIC_BUILD" displayname="Build static binaries"> + </member> + <member name="LOADABLE_MODULES" displayname="Runtime module loading"> + <defaultenabled>yes</defaultenabled> + </member> </category> diff --git a/build_tools/embed_modules.xml b/build_tools/embed_modules.xml new file mode 100644 index 000000000..85c3d6298 --- /dev/null +++ b/build_tools/embed_modules.xml @@ -0,0 +1,18 @@ + <category name="MENUSELECT_EMBED" displayname="Module Embedding" positive_output="yes" remove_on_change="main/asterisk"> + <member name="apps" displayname="Applications" remove_on_change="apps/*.o"> + </member> + <member name="cdr" displayname="Call Detail Recording" remove_on_change="cdr/*.o"> + </member> + <member name="channels" displayname="Channels" remove_on_change="channels/*.o channels/misdn/*.o"> + </member> + <member name="codecs" displayname="Coders/Decoders" remove_on_change="codecs/*.o"> + </member> + <member name="formats" displayname="File Formats" remove_on_change="formats/*.o"> + </member> + <member name="funcs" displayname="Dialplan Functions" remove_on_change="funcs/*.o"> + </member> + <member name="pbx" displayname="PBX Functionality" remove_on_change="pbx/*.o pbx/ael/*.o"> + </member> + <member name="res" displayname="Resource Modules" remove_on_change="res/*.o res/snmp/*.o"> + </member> + </category> diff --git a/build_tools/menuselect-deps.in b/build_tools/menuselect-deps.in index 96b4c5d1b..005e1537b 100644 --- a/build_tools/menuselect-deps.in +++ b/build_tools/menuselect-deps.in @@ -29,3 +29,6 @@ VPBAPI=@PBX_VPB@ WIN32=@OSISWIN32@ ZAPTEL=@PBX_ZAPTEL@ ZLIB=@PBX_ZLIB@ +ISDNNET=@PBX_ISDNNET@ +MISDN=@PBX_MISDN@ +SUPPSERV=@PBX_SUPPSERV@ diff --git a/build_tools/prep_moduledeps b/build_tools/prep_moduledeps index 0e35cb0ec..7e6b7d332 100755 --- a/build_tools/prep_moduledeps +++ b/build_tools/prep_moduledeps @@ -1,29 +1,7 @@ #!/bin/sh get_description() { - x=${1} - TDESC=`cat $x | grep -e *tdesc | cut -f 2 -d '"'` - if [ "$TDESC" = "" ]; then - TDESC=`cat $x | grep -A 2 -e *description | grep -e '\"' | cut -f 2 -d '"'` - fi - if [ "$TDESC" = "" ]; then - TDESC=`cat $x | grep -e MODULE_DESCRIPTION | grep -v return | cut -f 2 -d '"'` - fi - if [ "$TDESC" = "" ]; then - TDESC=`cat $x | grep -e tdesc\\\[\\\] | cut -f 2 -d '"'` - fi - if [ "$TDESC" = "" ]; then - TDESC=`cat $x | grep -e desc\\\[\\\] | grep -v description | cut -f 2 -d '"'` - fi - if [ "$TDESC" = "" ]; then - TDESC=`cat $x | grep -e *desc | grep -v descrip | cut -f 2 -d '"'` - fi - if [ "$TDESC" = "" ]; then - TDESC=`cat $x | grep -e *dtext | grep static | cut -f 2 -d '"'` - fi - if [ "$TDESC" = "" ]; then - TDESC=`cat $x | grep -A 2 -e *synopsis | grep -e '\"' | cut -f 2 -d '"'` - fi + TDESC=`grep -e AST_MODULE_INFO ${1} | cut -d '"' -f 2` } process_dir() { @@ -32,7 +10,7 @@ process_dir() { catsuffix=${3} displayname=${4} - echo -e "\t<category name=\"MENUSELECT_${catsuffix}\" displayname=\"${displayname}\">" + echo -e "\t<category name=\"MENUSELECT_${catsuffix}\" displayname=\"${displayname}\" remove_on_change=\"${dir}/modules.link\">" for file in `ls ${dir}/${prefix}*.c ${dir}/${prefix}*.cc 2> /dev/null | sort` do if [ ! -f ${file} ]; then @@ -45,13 +23,9 @@ process_dir() { echo -e "\t\t<member name=\"${fname}\" displayname=\"${desc}\" remove_on_change=\"${dir}/${fname}.o ${dir}/${fname}.oo ${dir}/${fname}.so\">" awk -f build_tools/get_moduleinfo ${file} echo -e "\t\t</member>" - done - echo -e "\t</category>" - - for file in ${dir}/${prefix}*.c - do awk -f build_tools/get_makeopts ${file} >> .makeoptstmp done + echo -e "\t</category>" } echo "<?xml version="1.0"?>" @@ -66,8 +40,9 @@ process_dir formats format FORMATS "Format Interpreters" process_dir funcs func FUNCS "Dialplan Functions" process_dir pbx pbx PBX "PBX Modules" process_dir res res RES "Resource Modules" +cat .makeoptstmp cat build_tools/cflags.xml +cat build_tools/embed_modules.xml cat sounds/sounds.xml -cat .makeoptstmp rm -f .makeoptstmp echo "</menu>" diff --git a/cdr/Makefile b/cdr/Makefile index 49fc0e3d5..08dc25a2d 100644 --- a/cdr/Makefile +++ b/cdr/Makefile @@ -9,7 +9,7 @@ # the GNU General Public License # -ifneq ($(wildcard ../menuselect.makeopts),) +ifneq ($(wildcard $(ASTTOPDIR)/menuselect.makeopts),) include ../menuselect.makeopts include ../menuselect.makedeps endif @@ -17,7 +17,12 @@ endif C_MODS:=$(filter-out $(MENUSELECT_CDR),$(patsubst %.c,%,$(wildcard cdr_*.c))) CC_MODS:=$(filter-out $(MENUSELECT_CDR),$(patsubst %.cc,%,$(wildcard cdr_*.cc))) -SELECTED_MODS:=$(C_MODS) $(CC_MODS) +LOADABLE_MODS:=$(C_MODS) $(CC_MODS) + +ifneq ($(findstring cdr,$(MENUSELECT_EMBED)),) + EMBEDDED_MODS:=$(LOADABLE_MODS) + LOADABLE_MODS:= +endif all: _all diff --git a/cdr/cdr_csv.c b/cdr/cdr_csv.c index b1612f4b2..a599fb08f 100644 --- a/cdr/cdr_csv.c +++ b/cdr/cdr_csv.c @@ -89,8 +89,6 @@ static char *config = "cdr.conf"; "userfield" user field set via SetCDRUserField ----------------------------------------------------------*/ -static char *desc = "Comma Separated Values CDR Backend"; - static char *name = "csv"; static FILE *mf = NULL; @@ -311,12 +309,7 @@ static int csv_log(struct ast_cdr *cdr) return 0; } -static const char *description(void) -{ - return desc; -} - -static int unload_module(void *mod) +static int unload_module(void) { if (mf) fclose(mf); @@ -324,13 +317,13 @@ static int unload_module(void *mod) return 0; } -static int load_module(void *mod) +static int load_module(void) { int res; load_config(); - res = ast_cdr_register(name, desc, csv_log); + res = ast_cdr_register(name, ast_module_info->description, csv_log); if (res) { ast_log(LOG_ERROR, "Unable to register CSV CDR handling\n"); if (mf) @@ -339,15 +332,15 @@ static int load_module(void *mod) return res; } -static int reload(void *mod) +static int reload(void) { load_config(); - return 0; -} -static const char *key(void) -{ - return ASTERISK_GPL_KEY; + return 0; } -STD_MOD(MOD_1 | NO_USECOUNT, reload, NULL, NULL); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Comma Separated Values CDR Backend", + .load = load_module, + .unload = unload_module, + .reload = reload, + ); diff --git a/cdr/cdr_custom.c b/cdr/cdr_custom.c index 5d7152b04..e89f022d0 100644 --- a/cdr/cdr_custom.c +++ b/cdr/cdr_custom.c @@ -57,8 +57,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") AST_MUTEX_DEFINE_STATIC(lock); -static char *desc = "Customizable Comma Separated Values CDR Backend"; - static char *name = "cdr-custom"; static FILE *mf = NULL; @@ -137,12 +135,7 @@ static int custom_log(struct ast_cdr *cdr) return 0; } -static const char *description(void) -{ - return desc; -} - -static int unload_module(void *mod) +static int unload_module(void) { if (mf) fclose(mf); @@ -150,12 +143,12 @@ static int unload_module(void *mod) return 0; } -static int load_module(void *mod) +static int load_module(void) { int res = 0; if (!load_config(0)) { - res = ast_cdr_register(name, desc, custom_log); + res = ast_cdr_register(name, ast_module_info->description, custom_log); if (res) ast_log(LOG_ERROR, "Unable to register custom CDR handling\n"); if (mf) @@ -164,15 +157,14 @@ static int load_module(void *mod) return res; } -static int reload(void *mod) +static int reload(void) { return load_config(1); } -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD(MOD_1 | NO_USECOUNT, reload, NULL, NULL); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Customizable Comma Separated Values CDR Backend", + .load = load_module, + .unload = unload_module, + .reload = reload, + ); diff --git a/cdr/cdr_manager.c b/cdr/cdr_manager.c index 1e1db4890..07406734d 100644 --- a/cdr/cdr_manager.c +++ b/cdr/cdr_manager.c @@ -45,7 +45,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #define DATE_FORMAT "%Y-%m-%d %T" #define CONF_FILE "cdr_manager.conf" -static char *desc = "Asterisk Call Manager CDR Backend"; static char *name = "cdr_manager"; static int enablecdr = 0; @@ -135,25 +134,20 @@ static int manager_log(struct ast_cdr *cdr) return 0; } -static const char *description(void) -{ - return desc; -} - -static int unload_module(void *mod) +static int unload_module(void) { ast_cdr_unregister(name); return 0; } -static int load_module(void *mod) +static int load_module(void) { int res; /* Configuration file */ loadconfigurationfile(); - res = ast_cdr_register(name, desc, manager_log); + res = ast_cdr_register(name, "Asterisk Manager Interface CDR Backend", manager_log); if (res) { ast_log(LOG_ERROR, "Unable to register Asterisk Call Manager CDR handling\n"); } @@ -161,15 +155,14 @@ static int load_module(void *mod) return res; } -static int reload(void *mod) +static int reload(void) { loadconfigurationfile(); return 0; } -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD(MOD_1 | NO_USECOUNT, reload, NULL, NULL); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Asterisk Manager Interface CDR Backend", + .load = load_module, + .unload = unload_module, + .reload = reload, + ); diff --git a/cdr/cdr_odbc.c b/cdr/cdr_odbc.c index e7bafb886..51d77a140 100644 --- a/cdr/cdr_odbc.c +++ b/cdr/cdr_odbc.c @@ -64,7 +64,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #define DATE_FORMAT "%Y-%m-%d %T" -static char *desc = "ODBC CDR Backend"; static char *name = "ODBC"; static char *config = "cdr_odbc.conf"; static char *dsn = NULL, *username = NULL, *password = NULL, *table = NULL; @@ -207,11 +206,6 @@ static int odbc_log(struct ast_cdr *cdr) return 0; } -static const char *description(void) -{ - return desc; -} - static int odbc_unload_module(void) { ast_mutex_lock(&odbc_lock); @@ -365,7 +359,7 @@ static int odbc_load_module(void) ast_verbose( VERBOSE_PREFIX_3 "cdr_odbc: Unable to connect to datasource: %s\n", dsn); } } - res = ast_cdr_register(name, desc, odbc_log); + res = ast_cdr_register(name, ast_module_info->description, odbc_log); if (res) { ast_log(LOG_ERROR, "cdr_odbc: Unable to register ODBC CDR handling\n"); } @@ -452,25 +446,24 @@ static int odbc_init(void) return 0; } -static int load_module(void *mod) +static int load_module(void) { return odbc_load_module(); } -static int unload_module(void *mod) +static int unload_module(void) { return odbc_unload_module(); } -static int reload(void *mod) +static int reload(void) { odbc_unload_module(); return odbc_load_module(); } -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD(MOD_0, reload, NULL, NULL); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "ODBC CDR Backend", + .load = load_module, + .unload = unload_module, + .reload = reload, + ); diff --git a/cdr/cdr_pgsql.c b/cdr/cdr_pgsql.c index 7ee41927e..f477584b5 100644 --- a/cdr/cdr_pgsql.c +++ b/cdr/cdr_pgsql.c @@ -59,7 +59,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #define DATE_FORMAT "%Y-%m-%d %T" -static char *desc = "PostgreSQL CDR Backend"; static char *name = "pgsql"; static char *config = "cdr_pgsql.conf"; static char *pghostname = NULL, *pgdbname = NULL, *pgdbuser = NULL, *pgpassword = NULL, *pgdbport = NULL, *table = NULL; @@ -179,11 +178,6 @@ static int pgsql_log(struct ast_cdr *cdr) return 0; } -static const char *description(void) -{ - return desc; -} - static int my_unload_module(void) { if (conn) @@ -285,7 +279,7 @@ static int process_my_load_module(struct ast_config *cfg) connected = 0; } - return ast_cdr_register(name, desc, pgsql_log); + return ast_cdr_register(name, ast_module_info->description, pgsql_log); } static int my_load_module(void) @@ -304,25 +298,24 @@ static int my_load_module(void) return res; } -static int load_module(void *mod) +static int load_module(void) { return my_load_module(); } -static int unload_module(void *mod) +static int unload_module(void) { return my_unload_module(); } -static int reload(void *mod) +static int reload(void) { my_unload_module(); return my_load_module(); } -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD(MOD_0, reload, NULL, NULL); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "PostgreSQL CDR Backend", + .load = load_module, + .unload = unload_module, + .reload = reload, + ); diff --git a/cdr/cdr_radius.c b/cdr/cdr_radius.c index 8fe6d4459..ac59d4bd1 100644 --- a/cdr/cdr_radius.c +++ b/cdr/cdr_radius.c @@ -229,18 +229,13 @@ static int radius_log(struct ast_cdr *cdr) return result; } -static const char *description(void) -{ - return desc; -} - -static int unload_module(void *mod) +static int unload_module(void) { ast_cdr_unregister(name); return 0; } -static int load_module(void *mod) +static int load_module(void) { struct ast_config *cfg; char *tmp; @@ -272,9 +267,4 @@ static int load_module(void *mod) return ast_cdr_register(name, desc, radius_log); } -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD(MOD_0, NULL, NULL, NULL); +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "RADIUS CDR Backend"); diff --git a/cdr/cdr_sqlite.c b/cdr/cdr_sqlite.c index 718ef4838..146f7a209 100644 --- a/cdr/cdr_sqlite.c +++ b/cdr/cdr_sqlite.c @@ -57,7 +57,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") /* When you change the DATE_FORMAT, be sure to change the CHAR(19) below to something else */ #define DATE_FORMAT "%Y-%m-%d %T" -static char *desc = "SQLite CDR Backend"; static char *name = "sqlite"; static sqlite* db = NULL; @@ -166,13 +165,7 @@ static int sqlite_log(struct ast_cdr *cdr) return res; } - -static const char *description(void) -{ - return desc; -} - -static int unload_module(void *mod) +static int unload_module(void) { if (db) sqlite_close(db); @@ -180,7 +173,7 @@ static int unload_module(void *mod) return 0; } -static int load_module(void *mod) +static int load_module(void) { char *zErr; char fn[PATH_MAX]; @@ -208,7 +201,7 @@ static int load_module(void *mod) /* TODO: here we should probably create an index */ } - res = ast_cdr_register(name, desc, sqlite_log); + res = ast_cdr_register(name, ast_module_info->description, sqlite_log); if (res) { ast_log(LOG_ERROR, "Unable to register SQLite CDR handling\n"); return -1; @@ -221,14 +214,4 @@ err: return -1; } -static int reload(void *mod) -{ - return 0; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD(MOD_0, reload, NULL, NULL); +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "SQLite CDR Backend"); diff --git a/cdr/cdr_tds.c b/cdr/cdr_tds.c index 7541d260e..868768e64 100644 --- a/cdr/cdr_tds.c +++ b/cdr/cdr_tds.c @@ -88,7 +88,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #define DATE_FORMAT "%Y/%m/%d %T" -static char *desc = "MSSQL CDR Backend"; static char *name = "mssql"; static char *config = "cdr_tds.conf"; @@ -297,11 +296,6 @@ static void get_date(char *dateField, struct timeval tv) } } -static const char *description(void) -{ - return desc; -} - static int mssql_disconnect(void) { if (tds) { @@ -494,7 +488,7 @@ static int tds_load_module(void) mssql_connect(); /* Register MSSQL CDR handler */ - res = ast_cdr_register(name, desc, tds_log); + res = ast_cdr_register(name, ast_module_info->description, tds_log); if (res) { ast_log(LOG_ERROR, "Unable to register MSSQL CDR handling\n"); @@ -503,25 +497,24 @@ static int tds_load_module(void) return res; } -static int reload(void *mod) +static int reload(void) { tds_unload_module(); return tds_load_module(); } -static int load_module(void *mod) +static int load_module(void) { return tds_load_module(); } -static int unload_module(void *mod) +static int unload_module(void) { return tds_unload_module(); } -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD(MOD_0, reload, NULL, NULL); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "MSSQL CDR Backend", + .load = load_module, + .unload = unload_module, + .reload = reload, + ); diff --git a/channels/Makefile b/channels/Makefile index 044f95237..ad898681a 100644 --- a/channels/Makefile +++ b/channels/Makefile @@ -9,7 +9,7 @@ # the GNU General Public License # -ifneq ($(wildcard ../menuselect.makeopts),) +ifneq ($(wildcard $(ASTTOPDIR)/menuselect.makeopts),) include ../menuselect.makeopts include ../menuselect.makedeps endif @@ -22,7 +22,7 @@ ifeq ($(OSARCH),OpenBSD) H323LIB=-lh323_OpenBSD_x86_r endif -ifeq ($(OSARCH),Linux) +ifeq ($(OSARCH),linux-gnu) PTLIB=-lpt_linux_x86_r H323LIB=-lh323_linux_x86_r CHANH323LIB=-ldl @@ -43,10 +43,6 @@ ifeq ($(wildcard h323/libchanh323.a),) CC_MODS:=$(filter-out chan_h323,$(CC_MODS)) endif -ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/mISDNuser/mISDNlib.h),) - C_MODS:=$(filter-out chan_misdn,$(C_MODS)) -endif - ifndef OPENH323DIR OPENH323DIR=$(HOME)/openh323 endif @@ -55,7 +51,12 @@ ifndef PWLIBDIR PWLIBDIR=$(HOME)/pwlib endif -SELECTED_MODS:=$(C_MODS) $(CC_MODS) +LOADABLE_MODS:=$(C_MODS) $(CC_MODS) + +ifneq ($(findstring channels,$(MENUSELECT_EMBED)),) + EMBEDDED_MODS:=$(LOADABLE_MODS) + LOADABLE_MODS:= +endif all: _all @@ -63,6 +64,7 @@ include $(ASTTOPDIR)/Makefile.moddir_rules clean:: rm -f busy.h ringtone.h gentone + make -C misdn clean ifneq ($(wildcard $(PWD)/Makefile.ast),) include $(PWD)/Makefile.ast @@ -79,24 +81,20 @@ ringtone.h: gentone chan_oss.o: busy.h ringtone.h -chan_iax2.so: iax2-parser.o iax2-provision.o +$(chan_iax2): iax2-parser.o iax2-provision.o chan_alsa.o: busy.h ringtone.h -ifeq ($(OSARCH),Linux) -chan_h323.so: chan_h323.o h323/libchanh323.a $(PWD)/Makefile.ast - $(CC) $(SOLINK) $(H323LDFLAGS) -o $@ $< h323/libchanh323.a $(H323LDLIBS) -lstdc++ +ifeq ($(OSARCH),linux-gnu) +chan_h323.so: chan_h323.o h323_module_interface.so h323/libchanh323.a h323/Makefile.ast + $(CC) $(SOLINK) $(H323LDFLAGS) -o $@ $^ h323/libchanh323.a $(H323LDLIBS) -lstdc++ else -chan_h323.so: chan_h323.o h323/libchanh323.a - $(CC) $(SOLINK) -o $@ $< h323/libchanh323.a $(CHANH323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -L$(OPENH323DIR)/lib $(H323LIB) -L/usr/lib -lcrypto -lssl -lexpat +chan_h323.so: chan_h323.o h323_module_interface.so h323/libchanh323.a + $(CC) $(SOLINK) -o $@ $^ h323/libchanh323.a $(CHANH323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -L$(OPENH323DIR)/lib $(H323LIB) -L/usr/lib -lcrypto -lssl -lexpat endif -misdn/chan_misdn_lib.a: - make -C misdn - chan_misdn.o: CFLAGS+=-Imisdn -DCHAN_MISDN_VERSION=\"0.3.0\" misdn_config.o: CFLAGS+=-Imisdn -DCHAN_MISDN_VERSION=\"0.3.0\" -chan_misdn.so: chan_misdn.o misdn_config.o misdn/chan_misdn_lib.a -chan_misdn.so: LIBS+=-lisdnnet -lmISDN -lsuppserv +$(chan_misdn): chan_misdn.o misdn_config.o misdn/isdn_lib.o misdn/isdn_msg_parser.o diff --git a/channels/chan_agent.c b/channels/chan_agent.c index b8a54e74b..0a9b8906a 100644 --- a/channels/chan_agent.c +++ b/channels/chan_agent.c @@ -189,14 +189,15 @@ struct agent_pvt { char agent[AST_MAX_AGENT]; /*!< Agent ID */ char password[AST_MAX_AGENT]; /*!< Password for Agent login */ char name[AST_MAX_AGENT]; - ast_mutex_t app_lock; /*!< Synchronization between owning applications */ - volatile pthread_t owning_app; /*!< Owning application thread id */ - volatile int app_sleep_cond; /*!< Sleep condition for the login app */ - struct ast_channel *owner; /*!< Agent */ - char loginchan[80]; /*!< channel they logged in from */ - char logincallerid[80]; /*!< Caller ID they had when they logged in */ - struct ast_channel *chan; /*!< Channel we use */ - AST_LIST_ENTRY(agent_pvt) list; /*!< Next Agent in the linked list. */ + ast_mutex_t app_lock; /**< Synchronization between owning applications */ + volatile pthread_t owning_app; /**< Owning application thread id */ + volatile int app_sleep_cond; /**< Sleep condition for the login app */ + struct ast_channel *owner; /**< Agent */ + char loginchan[80]; /**< channel they logged in from */ + char logincallerid[80]; /**< Caller ID they had when they logged in */ + struct ast_channel *chan; /**< Channel we use */ + struct ast_module_user *u; /*! reference to keep our module in memory while in use */ + AST_LIST_ENTRY(agent_pvt) list; /**< Next Agent in the linked list. */ }; static AST_LIST_HEAD_STATIC(agents, agent_pvt); /*!< Holds the list of agents (loaded form agents.conf). */ @@ -727,8 +728,7 @@ static int agent_hangup(struct ast_channel *ast) * as in apps/app_chanisavail.c:chanavail_exec() */ - ast_atomic_fetchadd_int(&__mod_desc->usecnt, -1); - /* XXX do we need ast_update_use_count(); */ + ast_module_user_remove(p->u); if (option_debug) ast_log(LOG_DEBUG, "Hangup called for state %s\n", ast_state2str(ast->_state)); @@ -932,7 +932,10 @@ static struct ast_channel *agent_new(struct agent_pvt *p, int state) ast_setstate(tmp, state); tmp->tech_pvt = p; p->owner = tmp; + /* XXX: this needs fixing */ +#if 0 ast_atomic_fetchadd_int(&__mod_desc->usecnt, +1); +#endif ast_update_use_count(); tmp->priority = 1; /* Wake up and wait for other applications (by definition the login app) @@ -1707,7 +1710,7 @@ static int __login_exec(struct ast_channel *chan, void *data, int callbackmode) int tries = 0; int max_login_tries = maxlogintries; struct agent_pvt *p; - struct localuser *u; + struct ast_module_user *u; int login_state = 0; char user[AST_MAX_AGENT] = ""; char pass[AST_MAX_AGENT]; @@ -1728,7 +1731,7 @@ static int __login_exec(struct ast_channel *chan, void *data, int callbackmode) char *filename = "agent-loginok"; char tmpchan[AST_MAX_BUF] = ""; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); parse = ast_strdupa(data); @@ -2088,7 +2091,7 @@ static int __login_exec(struct ast_channel *chan, void *data, int callbackmode) /* AgentLogin() exit */ if (!callbackmode) { - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return -1; } else { /* AgentCallbackLogin() exit*/ /* Set variables */ @@ -2103,7 +2106,7 @@ static int __login_exec(struct ast_channel *chan, void *data, int callbackmode) pbx_builtin_setvar_helper(chan, "AGENTSTATUS", "fail"); } if (ast_exists_extension(chan, chan->context, chan->exten, chan->priority + 1, chan->cid.cid_num)) { - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } /* Do we need to play agent-goodbye now that we will be hanging up? */ @@ -2118,7 +2121,7 @@ static int __login_exec(struct ast_channel *chan, void *data, int callbackmode) } } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); /* We should never get here if next priority exists when in callbackmode */ return -1; @@ -2525,9 +2528,8 @@ struct ast_custom_function agent_function = { * * \returns int Always 0. */ -static int load_module(void *mod) +static int load_module(void) { - __mod_desc = mod; /* Make sure we can register our agent channel type */ if (ast_channel_register(&agent_tech)) { ast_log(LOG_ERROR, "Unable to register channel class 'Agent'\n"); @@ -2558,7 +2560,7 @@ static int load_module(void *mod) return 0; } -static int reload(void *mod) +static int reload(void) { read_agent_config(); if (persistent_agents) @@ -2566,7 +2568,7 @@ static int reload(void *mod) return 0; } -static int unload_module(void *mod) +static int unload_module(void) { struct agent_pvt *p; /* First, take us out of the channel loop */ @@ -2598,14 +2600,8 @@ static int unload_module(void *mod) return 0; } -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -static const char *description(void) -{ - return "Agent Proxy Channel"; -} - -STD_MOD(MOD_0, reload, NULL, NULL); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Agent Proxy Channel", + .load = load_module, + .unload = unload_module, + .reload = reload, + ); diff --git a/channels/chan_alsa.c b/channels/chan_alsa.c index 2702621f7..5a4d6276f 100644 --- a/channels/chan_alsa.c +++ b/channels/chan_alsa.c @@ -121,7 +121,6 @@ static int silencethreshold = 1000; AST_MUTEX_DEFINE_STATIC(usecnt_lock); AST_MUTEX_DEFINE_STATIC(alsalock); -static const char desc[] = "ALSA Console Channel Driver"; static const char tdesc[] = "ALSA Console Channel Driver"; static const char config[] = "alsa.conf"; @@ -1070,7 +1069,7 @@ static struct ast_cli_entry myclis[] = { { { "autoanswer", NULL }, console_autoanswer, "Sets/displays autoanswer", autoanswer_usage, autoanswer_complete } }; -static int load_module(void *mod) +static int load_module(void) { int res; int x; @@ -1140,7 +1139,7 @@ static int load_module(void *mod) return 0; } -static int unload_module(void *mod) +static int unload_module(void) { int x; @@ -1162,14 +1161,4 @@ static int unload_module(void *mod) return 0; } -static const char *description(void) -{ - return (char *) desc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD(MOD_0, NULL, NULL, NULL); +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "ALSA Console Channel Driver"); diff --git a/channels/chan_features.c b/channels/chan_features.c index 8b1fe4f86..d1feadbea 100644 --- a/channels/chan_features.c +++ b/channels/chan_features.c @@ -519,7 +519,7 @@ static struct ast_cli_entry cli_show_features = { { "feature", "show", "channels", NULL }, features_show, "Show status of feature channels", show_features_usage, NULL }; -static int load_module(void *mod) +static int load_module(void) { /* Make sure we can register our sip channel type */ if (ast_channel_register(&features_tech)) { @@ -530,7 +530,7 @@ static int load_module(void *mod) return 0; } -static int unload_module(void *mod) +static int unload_module(void) { struct feature_pvt *p; @@ -553,15 +553,5 @@ static int unload_module(void *mod) return 0; } -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -static const char *description(void) -{ - return "Feature Proxy Channel"; -} - -STD_MOD(MOD_1, NULL, NULL, NULL); +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Feature Proxy Channel"); diff --git a/channels/chan_h323.c b/channels/chan_h323.c index 1ce5b345e..6b956e517 100644 --- a/channels/chan_h323.c +++ b/channels/chan_h323.c @@ -129,7 +129,6 @@ static struct ast_jb_conf global_jbconf; /** Variables required by Asterisk */ static const char desc[] = "The NuFone Network's Open H.323 Channel Driver"; -static const char tdesc[] = "The NuFone Network's Open H.323 Channel Driver"; static const char config[] = "h323.conf"; static char default_context[AST_MAX_CONTEXT] = "default"; static struct sockaddr_in bindaddr; @@ -2508,14 +2507,8 @@ static int unload_module(void *mod) return 0; } -static const char *description(void) -{ - return desc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD(MOD_1, reload, NULL, NULL); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "The NuFone Network's OpenH323 Channel Driver", + .load = load_module, + .unload = unload_module, + .reload = reload, + ); diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index 2809003e6..97e8b6cfa 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -98,7 +98,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "iax2.h" #include "iax2-parser.h" #include "iax2-provision.h" -#include "../jitterbuf.h" +#include "jitterbuf.h" /* Define SCHED_MULTITHREADED to run the scheduler in a special multithreaded mode. */ @@ -9050,7 +9050,7 @@ static int iax2_reload(int fd, int argc, char *argv[]) return reload_config(); } -static int reload(void *mod) +static int reload(void) { return reload_config(); } @@ -9747,7 +9747,7 @@ static int __unload_module(void) return 0; } -static int unload_module(void *mod) +static int unload_module(void) { ast_mutex_destroy(&iaxq.lock); ast_mutex_destroy(&waresl.lock); @@ -9757,7 +9757,7 @@ static int unload_module(void *mod) /*! \brief Load IAX2 module, load configuraiton ---*/ -static int load_module(void *mod) +static int load_module(void) { char *config = "iax.conf"; int res = 0; @@ -9845,14 +9845,8 @@ static int load_module(void *mod) return res; } -static const char *description(void) -{ - return "Inter Asterisk eXchange (Ver 2)"; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD(MOD_1, reload, NULL, NULL); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Inter Asterisk eXchange (Ver 2)", + .load = load_module, + .unload = unload_module, + .reload = reload, + ); diff --git a/channels/chan_jingle.c b/channels/chan_jingle.c index bfa79e454..b296334ed 100644 --- a/channels/chan_jingle.c +++ b/channels/chan_jingle.c @@ -161,7 +161,6 @@ struct jingle_container { static const char desc[] = "Jingle Channel"; static const char type[] = "Jingle"; -static const char tdesc[] = "Jingle Channel Driver"; static int usecnt = 0; AST_MUTEX_DEFINE_STATIC(usecnt_lock); @@ -192,7 +191,7 @@ static int jingle_get_codec(struct ast_channel *chan); /*! \brief PBX interface structure for channel registration */ static const struct ast_channel_tech jingle_tech = { .type = type, - .description = tdesc, + .description = "Jingle Channel Driver", .capabilities = ((AST_FORMAT_MAX_AUDIO << 1) - 1), .requester = jingle_request, .send_digit = jingle_digit, @@ -1652,7 +1651,7 @@ static int jingle_load_config(void) } /*! \brief Load module into PBX, register channel */ -static int load_module(void *mod) +static int load_module(void) { ASTOBJ_CONTAINER_INIT(&jingles); if (!jingle_load_config()) { @@ -1684,13 +1683,13 @@ static int load_module(void *mod) } /*! \brief Reload module */ -static int reload(void *mod) +static int reload(void) { return 0; } /*! \brief Unload the jingle channel from Asterisk */ -static int unload_module(void *mod) +static int unload_module(void) { struct jingle_pvt *privates = NULL; @@ -1721,14 +1720,8 @@ static int unload_module(void *mod) return 0; } -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -static const char *description(void) -{ - return desc; -} - -STD_MOD(MOD_1, reload, NULL, NULL); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Jingle Channel Driver", + .load = load_module, + .unload = unload_module, + .reload = reload, + ); diff --git a/channels/chan_local.c b/channels/chan_local.c index 29f5d8afe..815f9cc1a 100644 --- a/channels/chan_local.c +++ b/channels/chan_local.c @@ -112,6 +112,8 @@ struct local_pvt { int nooptimization; /* Don't leave masq state */ struct ast_channel *owner; /* Master Channel */ struct ast_channel *chan; /* Outbound channel */ + struct ast_module_user *u_owner; /*! reference to keep the module loaded while in use */ + struct ast_module_user *u_chan; /*! reference to keep the module loaded while in use */ AST_LIST_ENTRY(local_pvt) list; /* Next entity */ }; @@ -451,11 +453,13 @@ static int local_hangup(struct ast_channel *ast) pbx_builtin_setvar_helper(p->owner, "CHANLOCALSTATUS", status); p->chan = NULL; p->launchedpbx = 0; - } else + ast_module_user_remove(p->u_chan); + } else { p->owner = NULL; - ast->tech_pvt = NULL; + ast_module_user_remove(p->u_owner); + } - ast_atomic_fetchadd_int(&__mod_desc->usecnt, -1); + ast->tech_pvt = NULL; if (!p->owner && !p->chan) { /* Okay, done with the private part now, too. */ @@ -564,8 +568,8 @@ static struct ast_channel *local_new(struct local_pvt *p, int state) tmp2->tech_pvt = p; p->owner = tmp; p->chan = tmp2; - ast_atomic_fetchadd_int(&__mod_desc->usecnt, +2); /* we allocate 2 new channels */ - ast_update_use_count(); + p->u_owner = ast_module_user_add(p->owner); + p->u_chan = ast_module_user_add(p->chan); ast_copy_string(tmp->context, p->context, sizeof(tmp->context)); ast_copy_string(tmp2->context, p->context, sizeof(tmp2->context)); ast_copy_string(tmp2->exten, p->exten, sizeof(tmp->exten)); @@ -616,10 +620,8 @@ static struct ast_cli_entry cli_show_locals = { "Show status of local channels", show_locals_usage, NULL }; /*! \brief Load module into PBX, register channel */ -static int load_module(void *mod) +static int load_module(void) { - __mod_desc = mod; - /* Make sure we can register our channel type */ if (ast_channel_register(&local_tech)) { ast_log(LOG_ERROR, "Unable to register channel class 'Local'\n"); @@ -630,7 +632,7 @@ static int load_module(void *mod) } /*! \brief Unload the local proxy channel from Asterisk */ -static int unload_module(void *mod) +static int unload_module(void) { struct local_pvt *p; @@ -652,14 +654,4 @@ static int unload_module(void *mod) return 0; } -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -static const char *description(void) -{ - return "Local Proxy Channel"; -} - -STD_MOD(MOD_1, NULL, NULL, NULL); +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Local Proxy Channel"); diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c index 434d2ece0..94cb20f02 100644 --- a/channels/chan_mgcp.c +++ b/channels/chan_mgcp.c @@ -981,10 +981,7 @@ static int mgcp_hangup(struct ast_channel *ast) sub->rtp = NULL; } - /* Decrement use count */ - ast_atomic_fetchadd_int(&__mod_desc->usecnt, -1); - ast_update_use_count(); - /* Decrement use count */ + ast_module_unref(ast_module_info->self); if ((p->hookstate == MGCP_ONHOOK) && (!sub->next->rtp)) { p->hidecallerid = 0; @@ -1408,8 +1405,7 @@ static struct ast_channel *mgcp_new(struct mgcp_subchannel *sub, int state) if (i->amaflags) tmp->amaflags = i->amaflags; sub->owner = tmp; - ast_atomic_fetchadd_int(&__mod_desc->usecnt, +1); - ast_update_use_count(); + ast_module_ref(ast_module_info->self); tmp->callgroup = i->callgroup; tmp->pickupgroup = i->pickupgroup; ast_string_field_set(tmp, call_forward, i->call_forward); @@ -4222,11 +4218,10 @@ static int reload_config(void) } /*! \brief load_module: PBX load module - initialization ---*/ -static int load_module(void *mod) +static int load_module(void) { int res; - __mod_desc = mod; sched = sched_context_create(); if (!sched) { ast_log(LOG_WARNING, "Unable to create schedule context\n"); @@ -4277,13 +4272,13 @@ static int mgcp_reload(int fd, int argc, char *argv[]) return 0; } -static int reload(void *mod) +static int reload(void) { mgcp_reload(0, 0, NULL); return 0; } -static int unload_module(void *mod) +static int unload_module(void) { struct mgcp_endpoint *e; struct mgcp_gateway *g; @@ -4350,14 +4345,8 @@ static int unload_module(void *mod) return 0; } -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -static const char *description(void) -{ - return "Media Gateway Control Protocol (MGCP)"; -} - -STD_MOD(MOD_1, reload, NULL, NULL); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Media Gateway Control Protocol (MGCP)", + .load = load_module, + .unload = unload_module, + .reload = reload, + ); diff --git a/channels/chan_misdn.c b/channels/chan_misdn.c index 54ac7bec8..9631a8cb5 100644 --- a/channels/chan_misdn.c +++ b/channels/chan_misdn.c @@ -26,6 +26,11 @@ * \ingroup channel_drivers */ +/*** MODULEINFO + <depend>isdnnet</depend> + <depend>misdn</depend> + <depend>suppserv</depend> + ***/ #include "asterisk.h" ASTERISK_FILE_VERSION(__FILE__, "$Revision$") @@ -283,7 +288,6 @@ static int pbx_start_chan(struct chan_list *ch); /* #define MISDN_DEBUG 1 */ -static char *desc = "Channel driver for mISDN Support (Bri/Pri)"; static const char misdn_type[] = "mISDN"; static int tracing = 0 ; @@ -4441,7 +4445,7 @@ cb_events(enum event_e event, struct misdn_bchannel *bc, void *user_data) static int g_config_initialized=0; -static int unload_module(void *mod) +static int unload_module(void) { /* First, take us out of the channel loop */ ast_log(LOG_VERBOSE, "-- Unregistering mISDN Channel Driver --\n"); @@ -4472,7 +4476,7 @@ static int unload_module(void *mod) return 0; } -static int load_module(void *mod) +static int load_module(void) { int i, port; @@ -4547,7 +4551,7 @@ static int load_module(void *mod) { if (ast_channel_register(&misdn_tech)) { ast_log(LOG_ERROR, "Unable to register channel class %s\n", misdn_type); - unload_module(mod); + unload_module(); return -1; } } @@ -4601,26 +4605,13 @@ static int load_module(void *mod) -static int reload(void *mod) +static int reload(void) { reload_config(); return 0; } -static const char *description(void) -{ - return desc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - - - - /*** SOME APPS ;)***/ static int misdn_facility_exec(struct ast_channel *chan, void *data) @@ -5099,4 +5090,8 @@ void chan_misdn_log(int level, int port, char *tmpl, ...) } } -STD_MOD(MOD_0, reload, NULL, NULL); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Channel driver for mISDN Support (BRI/PRI)", + .load = load_module, + .unload = unload_module, + .reload = reload, + ); diff --git a/channels/chan_nbs.c b/channels/chan_nbs.c index 10e1d1fb2..30ee32346 100644 --- a/channels/chan_nbs.c +++ b/channels/chan_nbs.c @@ -54,16 +54,11 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/options.h" #include "asterisk/utils.h" -static const char desc[] = "Network Broadcast Sound Support"; static const char tdesc[] = "Network Broadcast Sound Driver"; -static int usecnt =0; - /* Only linear is allowed */ static int prefformat = AST_FORMAT_SLINEAR; -AST_MUTEX_DEFINE_STATIC(usecnt_lock); - static char context[AST_MAX_EXTENSION] = "default"; static char type[] = "NBS"; @@ -75,6 +70,7 @@ struct nbs_pvt { char app[16]; /* Our app */ char stream[80]; /* Our stream */ struct ast_frame fr; /* "null" frame */ + struct ast_module_user *u; /*! for holding a reference to this module */ }; static struct ast_channel *nbs_request(const char *type, int format, void *data, int *cause); @@ -125,6 +121,7 @@ static void nbs_destroy(struct nbs_pvt *p) { if (p->nbs) nbs_delstream(p->nbs); + ast_module_user_remove(p->u); free(p); } @@ -134,6 +131,7 @@ static struct nbs_pvt *nbs_alloc(void *data) int flags = 0; char stream[256] = ""; char *opts; + strncpy(stream, data, sizeof(stream) - 1); if ((opts = strchr(stream, ':'))) { *opts = '\0'; @@ -252,10 +250,7 @@ static struct ast_channel *nbs_new(struct nbs_pvt *i, int state) strncpy(tmp->exten, "s", sizeof(tmp->exten) - 1); ast_string_field_set(tmp, language, ""); i->owner = tmp; - ast_mutex_lock(&usecnt_lock); - usecnt++; - ast_mutex_unlock(&usecnt_lock); - ast_update_use_count(); + i->u = ast_module_user_add(tmp); if (state != AST_STATE_DOWN) { if (ast_pbx_start(tmp)) { ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name); @@ -289,37 +284,21 @@ static struct ast_channel *nbs_request(const char *type, int format, void *data, return tmp; } -static int __unload_module(void) +static int unload_module(void) { /* First, take us out of the channel loop */ ast_channel_unregister(&nbs_tech); return 0; } -static int unload_module(void *mod) -{ - return __unload_module(); -} - -static int load_module(void *mod) +static int load_module(void) { /* Make sure we can register our channel type */ if (ast_channel_register(&nbs_tech)) { ast_log(LOG_ERROR, "Unable to register channel class %s\n", type); - __unload_module(); return -1; } return 0; } -static const char *description(void) -{ - return (char *) desc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD(MOD_0, NULL, NULL, NULL); +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Network Broadcast Sound Support"); diff --git a/channels/chan_oss.c b/channels/chan_oss.c index 99ad26046..b2981463c 100644 --- a/channels/chan_oss.c +++ b/channels/chan_oss.c @@ -1525,7 +1525,7 @@ error: return NULL; } -static int load_module(void *mod) +static int load_module(void) { int i; struct ast_config *cfg; @@ -1563,7 +1563,7 @@ static int load_module(void *mod) } -static int unload_module(void *mod) +static int unload_module(void) { struct chan_oss_pvt *o; @@ -1587,16 +1587,4 @@ static int unload_module(void *mod) return 0; } -static const char *description(void) -{ - return (char *)oss_tech.description; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD(MOD_1, NULL, NULL, NULL); - - +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "OSS Console Channel Driver"); diff --git a/channels/chan_phone.c b/channels/chan_phone.c index c6455111f..87e971abb 100644 --- a/channels/chan_phone.c +++ b/channels/chan_phone.c @@ -88,7 +88,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #define PHONE_MAX_BUF 480 #define DEFAULT_GAIN 0x100 -static const char desc[] = "Linux Telephony API Support"; static const char tdesc[] = "Standard Linux Telephony API Driver"; static const char config[] = "phone.conf"; @@ -1328,12 +1327,12 @@ static int __unload_module(void) return 0; } -static int unload_module(void *mod) +static int unload_module(void) { return __unload_module(); } -static int load_module(void *mod) +static int load_module(void) { struct ast_config *cfg; struct ast_variable *v; @@ -1442,16 +1441,4 @@ static int load_module(void *mod) return 0; } -static const char *description(void) -{ - return (char *) desc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; - - +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Linux Telephony API Support"); diff --git a/channels/chan_sip.c b/channels/chan_sip.c index b512cd974..a2647b3fc 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -215,7 +215,6 @@ static struct ast_jb_conf default_jbconf = }; static struct ast_jb_conf global_jbconf; -static const char tdesc[] = "Session Initiation Protocol (SIP)"; static const char config[] = "sip.conf"; static const char notify_config[] = "sip_notify.conf"; static int usecnt = 0; @@ -16408,7 +16407,7 @@ static int sip_reload(int fd, int argc, char *argv[]) } /*! \brief reload: Part of Asterisk module interface */ -static int reload(void *mod) +static int reload(void) { return sip_reload(0, 0, NULL); } @@ -16444,7 +16443,7 @@ static struct ast_cli_entry my_clis[] = { }; /*! \brief load_module: PBX load module - initialization */ -static int load_module(void *mod) +static int load_module(void) { ASTOBJ_CONTAINER_INIT(&userl); /* User object list */ ASTOBJ_CONTAINER_INIT(&peerl); /* Peer object list */ @@ -16502,7 +16501,7 @@ static int load_module(void *mod) return 0; } -static int unload_module(void *mod) +static int unload_module(void) { struct sip_pvt *p, *pl; @@ -16578,14 +16577,8 @@ static int unload_module(void *mod) return 0; } -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -static const char *description(void) -{ - return (char *) tdesc; -} - -STD_MOD(MOD_1, reload, NULL, NULL); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Session Initiation Protocol (SIP)", + .load = load_module, + .unload = unload_module, + .reload = reload, + ); diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c index 3edd4463f..4d31969dc 100644 --- a/channels/chan_skinny.c +++ b/channels/chan_skinny.c @@ -4342,7 +4342,7 @@ static void delete_devices(void) ast_mutex_unlock(&devicelock); } -static int reload(void *mod) +static int reload(void) { delete_devices(); reload_config(); @@ -4350,8 +4350,7 @@ static int reload(void *mod) return 0; } - -static int load_module(void *mod) +static int load_module(void) { int res = 0; @@ -4389,7 +4388,7 @@ static int load_module(void *mod) return res; } -static int unload_module(void *mod) +static int unload_module(void) { #if 0 struct skinnysession *s; @@ -4443,14 +4442,8 @@ static int unload_module(void *mod) return -1; } -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -static const char *description(void) -{ - return "Skinny Client Control Protocol (Skinny)"; -} - -STD_MOD(MOD_1, reload, NULL, NULL); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Skinny Client Control Protocol (Skinny)", + .load = load_module, + .unload = unload_module, + .reload = reload, + ); diff --git a/channels/chan_zap.c b/channels/chan_zap.c index f8a81e931..27714f9c5 100644 --- a/channels/chan_zap.c +++ b/channels/chan_zap.c @@ -10212,7 +10212,7 @@ static int __unload_module(void) return 0; } -static int unload_module(void *mod) +static int unload_module(void) { #ifdef HAVE_PRI int y; @@ -11064,7 +11064,7 @@ static int setup_zap(int reload) return 0; } -static int load_module(void *mod) +static int load_module(void) { int res; @@ -11210,7 +11210,7 @@ static int zt_sendtext(struct ast_channel *c, const char *text) } -static int reload(void *mod) +static int reload(void) { int res = 0; @@ -11222,20 +11222,14 @@ static int reload(void *mod) return 0; } -static const char *description(void) -{ - return "Zapata Telephony" +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Zapata Telephony" #ifdef ZAPATA_PRI " w/PRI" #endif - ; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD(MOD_1, reload, NULL, NULL); + , + .load = load_module, + .unload = unload_module, + .reload = reload, + ); diff --git a/channels/h323/Makefile b/channels/h323/Makefile index 35023177e..2b9fb4d4c 100644 --- a/channels/h323/Makefile +++ b/channels/h323/Makefile @@ -10,7 +10,6 @@ STDCCFLAGS += -DNDEBUG STDCCFLAGS += $(shell grep ^DEBUG_THREADS ../../Makefile | sed -e "s/^DEBUG_THREADS[ ]*=//" -e "s/\([^\#]*\)\#.*/\1/") STDCCFLAGS += -I../../include -include autoconfig.h -STDCCFLAGS += -fPIC #OPTCCFLAGS += CFLAGS += -pipe TARGET += libchanh323.a diff --git a/channels/misdn/Makefile b/channels/misdn/Makefile index f1838d13e..895dc9dee 100644 --- a/channels/misdn/Makefile +++ b/channels/misdn/Makefile @@ -1,30 +1,13 @@ # -# Makefile +# Makefile for chan_misdn support # -# Make file for chan_misdn support -# - -# Verify those options with main Makefile -CFLAGS = -pipe -c -Wall -ggdb -ifeq ($(shell uname -m),x86_64) -CFLAGS += -fPIC -endif -SOURCES = isdn_lib.c isdn_msg_parser.c -OBJDIR = . -OBJS = isdn_lib.o isdn_msg_parser.o - -all: chan_misdn_lib.a +all: %.o: %.c - $(CC) $(CFLAGS) -o $@ $< - -chan_misdn_lib.a: $(OBJS) - ar crv $@ $(OBJS) - + $(CC) $(CFLAGS) -c -o $@ $< portinfo: portinfo.o - $(CC) -L/usr/lib -o $@ $^ -lisdnnet -lmISDN -lpthread - + $(CC) -o $@ $^ -lisdnnet -lmISDN -lpthread clean: rm -rf *.a *.o *.so portinfo diff --git a/channels/misdn/ie.c b/channels/misdn/ie.c index 712f8132b..892daa7c5 100644 --- a/channels/misdn/ie.c +++ b/channels/misdn/ie.c @@ -43,7 +43,8 @@ static void strnncpy(char *dest, char *src, int len, int dst_len) /* IE_COMPLETE */ -void enc_ie_complete(unsigned char **ntmode, msg_t *msg, int complete, int nt, struct misdn_bchannel *bc) +#if 0 +static void enc_ie_complete(unsigned char **ntmode, msg_t *msg, int complete, int nt, struct misdn_bchannel *bc) { unsigned char *p; Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN); @@ -69,8 +70,9 @@ void enc_ie_complete(unsigned char **ntmode, msg_t *msg, int complete, int nt, s p[0] = IE_COMPLETE; } } +#endif -void dec_ie_complete(unsigned char *p, Q931_info_t *qi, int *complete, int nt, struct misdn_bchannel *bc) +static void dec_ie_complete(unsigned char *p, Q931_info_t *qi, int *complete, int nt, struct misdn_bchannel *bc) { *complete = 0; if (!nt) @@ -87,7 +89,7 @@ void dec_ie_complete(unsigned char *p, Q931_info_t *qi, int *complete, int nt, s /* IE_BEARER */ -void enc_ie_bearer(unsigned char **ntmode, msg_t *msg, int coding, int capability, int mode, int rate, int multi, int user, int nt, struct misdn_bchannel *bc) +static void enc_ie_bearer(unsigned char **ntmode, msg_t *msg, int coding, int capability, int mode, int rate, int multi, int user, int nt, struct misdn_bchannel *bc) { unsigned char *p; Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN); @@ -147,7 +149,7 @@ void enc_ie_bearer(unsigned char **ntmode, msg_t *msg, int coding, int capabilit p[4+(multi>=0)] = 0xa0 + user; } -void dec_ie_bearer(unsigned char *p, Q931_info_t *qi, int *coding, int *capability, int *mode, int *rate, int *multi, int *user, +static void dec_ie_bearer(unsigned char *p, Q931_info_t *qi, int *coding, int *capability, int *mode, int *rate, int *multi, int *user, int *async, int *urate, int *stopbits, int *dbits, int *parity, int nt, struct misdn_bchannel *bc) { int octet; @@ -260,7 +262,8 @@ void dec_ie_bearer(unsigned char *p, Q931_info_t *qi, int *coding, int *capabili /* IE_CALL_ID */ -void enc_ie_call_id(unsigned char **ntmode, msg_t *msg, char *callid, int callid_len, int nt, struct misdn_bchannel *bc) +#if 0 +static void enc_ie_call_id(unsigned char **ntmode, msg_t *msg, char *callid, int callid_len, int nt, struct misdn_bchannel *bc) { unsigned char *p; Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN); @@ -298,8 +301,10 @@ void enc_ie_call_id(unsigned char **ntmode, msg_t *msg, char *callid, int callid p[1] = l; memcpy(p+2, callid, callid_len); } +#endif -void dec_ie_call_id(unsigned char *p, Q931_info_t *qi, char *callid, int *callid_len, int nt, struct misdn_bchannel *bc) +#if 0 +static void dec_ie_call_id(unsigned char *p, Q931_info_t *qi, char *callid, int *callid_len, int nt, struct misdn_bchannel *bc) { char debug[25]; int i; @@ -332,10 +337,10 @@ void dec_ie_call_id(unsigned char *p, Q931_info_t *qi, char *callid, int *callid if (MISDN_IE_DEBG) printf(" callid%s\n", debug); } - +#endif /* IE_CALLED_PN */ -void enc_ie_called_pn(unsigned char **ntmode, msg_t *msg, int type, int plan, char *number, int nt, struct misdn_bchannel *bc) +static void enc_ie_called_pn(unsigned char **ntmode, msg_t *msg, int type, int plan, char *number, int nt, struct misdn_bchannel *bc) { unsigned char *p; Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN); @@ -371,7 +376,7 @@ void enc_ie_called_pn(unsigned char **ntmode, msg_t *msg, int type, int plan, ch strncpy((char *)p+3, (char *)number, strlen((char *)number)); } -void dec_ie_called_pn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, char *number, int number_len, int nt, struct misdn_bchannel *bc) +static void dec_ie_called_pn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, char *number, int number_len, int nt, struct misdn_bchannel *bc) { *type = -1; *plan = -1; @@ -400,7 +405,7 @@ void dec_ie_called_pn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, c /* IE_CALLING_PN */ -void enc_ie_calling_pn(unsigned char **ntmode, msg_t *msg, int type, int plan, int present, int screen, char *number, int nt, struct misdn_bchannel *bc) +static void enc_ie_calling_pn(unsigned char **ntmode, msg_t *msg, int type, int plan, int present, int screen, char *number, int nt, struct misdn_bchannel *bc) { unsigned char *p; Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN); @@ -455,7 +460,7 @@ void enc_ie_calling_pn(unsigned char **ntmode, msg_t *msg, int type, int plan, i } } -void dec_ie_calling_pn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, int *present, int *screen, char *number, int number_len, int nt, struct misdn_bchannel *bc) +static void dec_ie_calling_pn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, int *present, int *screen, char *number, int number_len, int nt, struct misdn_bchannel *bc) { *type = -1; *plan = -1; @@ -502,7 +507,7 @@ void dec_ie_calling_pn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, /* IE_CONNECTED_PN */ -void enc_ie_connected_pn(unsigned char **ntmode, msg_t *msg, int type, int plan, int present, int screen, char *number, int nt, struct misdn_bchannel *bc) +static void enc_ie_connected_pn(unsigned char **ntmode, msg_t *msg, int type, int plan, int present, int screen, char *number, int nt, struct misdn_bchannel *bc) { unsigned char *p; Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN); @@ -557,7 +562,7 @@ void enc_ie_connected_pn(unsigned char **ntmode, msg_t *msg, int type, int plan, } } -void dec_ie_connected_pn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, int *present, int *screen, char *number, int number_len, int nt, struct misdn_bchannel *bc) +static void dec_ie_connected_pn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, int *present, int *screen, char *number, int number_len, int nt, struct misdn_bchannel *bc) { *type = -1; *plan = -1; @@ -601,7 +606,7 @@ void dec_ie_connected_pn(unsigned char *p, Q931_info_t *qi, int *type, int *plan /* IE_CAUSE */ -void enc_ie_cause(unsigned char **ntmode, msg_t *msg, int location, int cause, int nt, struct misdn_bchannel *bc) +static void enc_ie_cause(unsigned char **ntmode, msg_t *msg, int location, int cause, int nt, struct misdn_bchannel *bc) { unsigned char *p; Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN); @@ -631,7 +636,9 @@ void enc_ie_cause(unsigned char **ntmode, msg_t *msg, int location, int cause, i p[2] = 0x80 + location; p[3] = 0x80 + cause; } -void enc_ie_cause_standalone(unsigned char **ntmode, msg_t *msg, int location, int cause, int nt, struct misdn_bchannel *bc) + +#if 0 +static void enc_ie_cause_standalone(unsigned char **ntmode, msg_t *msg, int location, int cause, int nt, struct misdn_bchannel *bc) { unsigned char *p = msg_put(msg, 4); Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN); @@ -644,9 +651,9 @@ void enc_ie_cause_standalone(unsigned char **ntmode, msg_t *msg, int location, i p[2] = 0x80 + location; p[3] = 0x80 + cause; } +#endif - -void dec_ie_cause(unsigned char *p, Q931_info_t *qi, int *location, int *cause, int nt, struct misdn_bchannel *bc) +static void dec_ie_cause(unsigned char *p, Q931_info_t *qi, int *location, int *cause, int nt, struct misdn_bchannel *bc) { *location = -1; *cause = -1; @@ -673,7 +680,7 @@ void dec_ie_cause(unsigned char *p, Q931_info_t *qi, int *location, int *cause, /* IE_CHANNEL_ID */ -void enc_ie_channel_id(unsigned char **ntmode, msg_t *msg, int exclusive, int channel, int nt, struct misdn_bchannel *bc) +static void enc_ie_channel_id(unsigned char **ntmode, msg_t *msg, int exclusive, int channel, int nt, struct misdn_bchannel *bc) { unsigned char *p; Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN); @@ -748,7 +755,7 @@ void enc_ie_channel_id(unsigned char **ntmode, msg_t *msg, int exclusive, int ch } } -void dec_ie_channel_id(unsigned char *p, Q931_info_t *qi, int *exclusive, int *channel, int nt, struct misdn_bchannel *bc) +static void dec_ie_channel_id(unsigned char *p, Q931_info_t *qi, int *exclusive, int *channel, int nt, struct misdn_bchannel *bc) { struct misdn_stack *stack=get_stack_by_bc(bc); int pri =stack->pri; @@ -842,7 +849,7 @@ void dec_ie_channel_id(unsigned char *p, Q931_info_t *qi, int *exclusive, int *c /* IE_DATE */ -void enc_ie_date(unsigned char **ntmode, msg_t *msg, time_t ti, int nt, struct misdn_bchannel *bc) +static void enc_ie_date(unsigned char **ntmode, msg_t *msg, time_t ti, int nt, struct misdn_bchannel *bc) { unsigned char *p; Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN); @@ -876,7 +883,7 @@ void enc_ie_date(unsigned char **ntmode, msg_t *msg, time_t ti, int nt, struct m /* IE_DISPLAY */ -void enc_ie_display(unsigned char **ntmode, msg_t *msg, char *display, int nt, struct misdn_bchannel *bc) +static void enc_ie_display(unsigned char **ntmode, msg_t *msg, char *display, int nt, struct misdn_bchannel *bc) { unsigned char *p; Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN); @@ -907,7 +914,8 @@ void enc_ie_display(unsigned char **ntmode, msg_t *msg, char *display, int nt, s strncpy((char *)p+2, (char *)display, strlen((char *)display)); } -void dec_ie_display(unsigned char *p, Q931_info_t *qi, char *display, int display_len, int nt, struct misdn_bchannel *bc) +#if 0 +static void dec_ie_display(unsigned char *p, Q931_info_t *qi, char *display, int display_len, int nt, struct misdn_bchannel *bc) { *display = '\0'; @@ -929,10 +937,11 @@ void dec_ie_display(unsigned char *p, Q931_info_t *qi, char *display, int displa if (MISDN_IE_DEBG) printf(" display='%s'\n", display); } - +#endif /* IE_KEYPAD */ -void enc_ie_keypad(unsigned char **ntmode, msg_t *msg, char *keypad, int nt, struct misdn_bchannel *bc) +#if 0 +static void enc_ie_keypad(unsigned char **ntmode, msg_t *msg, char *keypad, int nt, struct misdn_bchannel *bc) { unsigned char *p; Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN); @@ -956,8 +965,9 @@ void enc_ie_keypad(unsigned char **ntmode, msg_t *msg, char *keypad, int nt, str p[1] = l; strncpy((char *)p+2, (char *)keypad, strlen((char *)keypad)); } +#endif -void dec_ie_keypad(unsigned char *p, Q931_info_t *qi, char *keypad, int keypad_len, int nt, struct misdn_bchannel *bc) +static void dec_ie_keypad(unsigned char *p, Q931_info_t *qi, char *keypad, int keypad_len, int nt, struct misdn_bchannel *bc) { *keypad = '\0'; @@ -982,7 +992,8 @@ void dec_ie_keypad(unsigned char *p, Q931_info_t *qi, char *keypad, int keypad_l /* IE_NOTIFY */ -void enc_ie_notify(unsigned char **ntmode, msg_t *msg, int notify, int nt, struct misdn_bchannel *bc) +#if 0 +static void enc_ie_notify(unsigned char **ntmode, msg_t *msg, int notify, int nt, struct misdn_bchannel *bc) { unsigned char *p; Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN); @@ -1006,8 +1017,10 @@ void enc_ie_notify(unsigned char **ntmode, msg_t *msg, int notify, int nt, struc p[1] = l; p[2] = 0x80 + notify; } +#endif -void dec_ie_notify(unsigned char *p, Q931_info_t *qi, int *notify, int nt, struct misdn_bchannel *bc) +#if 0 +static void dec_ie_notify(unsigned char *p, Q931_info_t *qi, int *notify, int nt, struct misdn_bchannel *bc) { *notify = -1; @@ -1029,10 +1042,11 @@ void dec_ie_notify(unsigned char *p, Q931_info_t *qi, int *notify, int nt, struc if (MISDN_IE_DEBG) printf(" notify=%d\n", *notify); } +#endif /* IE_PROGRESS */ -void enc_ie_progress(unsigned char **ntmode, msg_t *msg, int coding, int location, int progress, int nt, struct misdn_bchannel *bc) +static void enc_ie_progress(unsigned char **ntmode, msg_t *msg, int coding, int location, int progress, int nt, struct misdn_bchannel *bc) { unsigned char *p; Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN); @@ -1068,7 +1082,7 @@ void enc_ie_progress(unsigned char **ntmode, msg_t *msg, int coding, int locatio p[3] = 0x80 + progress; } -void dec_ie_progress(unsigned char *p, Q931_info_t *qi, int *coding, int *location, int *progress, int nt, struct misdn_bchannel *bc) +static void dec_ie_progress(unsigned char *p, Q931_info_t *qi, int *coding, int *location, int *progress, int nt, struct misdn_bchannel *bc) { *coding = -1; *location = -1; @@ -1098,7 +1112,7 @@ void dec_ie_progress(unsigned char *p, Q931_info_t *qi, int *coding, int *locati /* IE_REDIR_NR (redirecting = during MT_SETUP) */ -void enc_ie_redir_nr(unsigned char **ntmode, msg_t *msg, int type, int plan, int present, int screen, int reason, char *number, int nt, struct misdn_bchannel *bc) +static void enc_ie_redir_nr(unsigned char **ntmode, msg_t *msg, int type, int plan, int present, int screen, int reason, char *number, int nt, struct misdn_bchannel *bc) { unsigned char *p; Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN); @@ -1172,7 +1186,7 @@ void enc_ie_redir_nr(unsigned char **ntmode, msg_t *msg, int type, int plan, int } } -void dec_ie_redir_nr(unsigned char *p, Q931_info_t *qi, int *type, int *plan, int *present, int *screen, int *reason, char *number, int number_len, int nt, struct misdn_bchannel *bc) +static void dec_ie_redir_nr(unsigned char *p, Q931_info_t *qi, int *type, int *plan, int *present, int *screen, int *reason, char *number, int number_len, int nt, struct misdn_bchannel *bc) { *type = -1; *plan = -1; @@ -1219,7 +1233,8 @@ void dec_ie_redir_nr(unsigned char *p, Q931_info_t *qi, int *type, int *plan, in /* IE_REDIR_DN (redirection = during MT_NOTIFY) */ -void enc_ie_redir_dn(unsigned char **ntmode, msg_t *msg, int type, int plan, int present, char *number, int nt, struct misdn_bchannel *bc) +#if 0 +static void enc_ie_redir_dn(unsigned char **ntmode, msg_t *msg, int type, int plan, int present, char *number, int nt, struct misdn_bchannel *bc) { unsigned char *p; /* Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN); */ @@ -1269,8 +1284,10 @@ void enc_ie_redir_dn(unsigned char **ntmode, msg_t *msg, int type, int plan, int strncpy((char *)p+3, (char *)number, strlen((char *)number)); } } +#endif -void dec_ie_redir_dn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, int *present, char *number, int number_len, int nt, struct misdn_bchannel *bc) +#if 0 +static void dec_ie_redir_dn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, int *present, char *number, int number_len, int nt, struct misdn_bchannel *bc) { *type = -1; *plan = -1; @@ -1305,11 +1322,12 @@ void dec_ie_redir_dn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, in if (MISDN_IE_DEBG) printf(" type=%d plan=%d present=%d number='%s'\n", *type, *plan, *present, number); } - +#endif /* IE_USERUSER */ -void enc_ie_useruser(unsigned char **ntmode, msg_t *msg, int protocol, char *user, int user_len, int nt, struct misdn_bchannel *bc) +#if 0 +static void enc_ie_useruser(unsigned char **ntmode, msg_t *msg, int protocol, char *user, int user_len, int nt, struct misdn_bchannel *bc) { unsigned char *p; Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN); @@ -1348,8 +1366,10 @@ void enc_ie_useruser(unsigned char **ntmode, msg_t *msg, int protocol, char *use p[2] = 0x80 + protocol; memcpy(p+3, user, user_len); } +#endif -void dec_ie_useruser(unsigned char *p, Q931_info_t *qi, int *protocol, char *user, int *user_len, int nt, struct misdn_bchannel *bc) +#if 0 +static void dec_ie_useruser(unsigned char *p, Q931_info_t *qi, int *protocol, char *user, int *user_len, int nt, struct misdn_bchannel *bc) { char debug[768]; int i; @@ -1382,7 +1402,5 @@ void dec_ie_useruser(unsigned char *p, Q931_info_t *qi, int *protocol, char *use if (MISDN_IE_DEBG) printf(" protocol=%d user-user%s\n", *protocol, debug); } - - - +#endif diff --git a/channels/misdn/isdn_lib.c b/channels/misdn/isdn_lib.c index ea38592bd..b0d2fbe9d 100644 --- a/channels/misdn/isdn_lib.c +++ b/channels/misdn/isdn_lib.c @@ -13,9 +13,11 @@ #include <syslog.h> -#include "isdn_lib_intern.h" #include <mISDNuser/isdn_debug.h> +#include "isdn_lib_intern.h" +#include "isdn_lib.h" + void misdn_join_conf(struct misdn_bchannel *bc, int conf_id); void misdn_split_conf(struct misdn_bchannel *bc, int conf_id); @@ -232,11 +234,6 @@ void manager_clean_bc(struct misdn_bchannel *bc ); void manager_bchannel_setup (struct misdn_bchannel *bc); void manager_bchannel_cleanup (struct misdn_bchannel *bc); -int isdn_msg_get_index(struct isdn_msg msgs[], msg_t *frm, int nt); -enum event_e isdn_msg_get_event(struct isdn_msg msgs[], msg_t *frm, int nt); -int isdn_msg_parse_event(struct isdn_msg msgs[], msg_t *frm, struct misdn_bchannel *bc, int nt); -char * isdn_get_info(struct isdn_msg msgs[], enum event_e event, int nt); -msg_t * isdn_msg_build_event(struct isdn_msg msgs[], struct misdn_bchannel *bc, enum event_e event, int nt); void ec_chunk( struct misdn_bchannel *bc, unsigned char *rxchunk, unsigned char *txchunk, int chunk_size); /* end */ int bchdev_echocancel_activate(struct misdn_bchannel* dev); @@ -275,7 +272,7 @@ static char *bearer2str(int cap) { static char flip_table[256]; -void init_flip_bits(void) +static void init_flip_bits(void) { int i,k; @@ -288,7 +285,7 @@ void init_flip_bits(void) } } -char * flip_buf_bits ( char * buf , int len) +static char * flip_buf_bits ( char * buf , int len) { int i; char * start = buf; @@ -303,7 +300,7 @@ char * flip_buf_bits ( char * buf , int len) -msg_t *create_l2msg(int prim, int dinfo, int size) /* NT only */ +static msg_t *create_l2msg(int prim, int dinfo, int size) /* NT only */ { int i = 0; msg_t *dmsg; @@ -364,7 +361,7 @@ msg_t *create_l3msg(int prim, int mt, int dinfo, int size, int ntmode) } -int send_msg (int midev, struct misdn_bchannel *bc, msg_t *dmsg) +static int send_msg (int midev, struct misdn_bchannel *bc, msg_t *dmsg) { iframe_t *frm; frm = (iframe_t *)dmsg->data; @@ -417,7 +414,7 @@ int misdn_inband_avail(struct misdn_bchannel *bc) } -void dump_chan_list(struct misdn_stack *stack) +static void dump_chan_list(struct misdn_stack *stack) { int i; @@ -460,7 +457,7 @@ static int find_free_chan_in_stack(struct misdn_stack *stack, struct misdn_bchan return 0; } -int empty_chan_in_stack(struct misdn_stack *stack, int channel) +static int empty_chan_in_stack(struct misdn_stack *stack, int channel) { if (channel<=0) { cb_log(0,stack?stack->port:0, "empty_chan_inst_stack: cannot empty channel %d\n",channel); @@ -521,7 +518,7 @@ void bc_state_change(struct misdn_bchannel *bc, enum bchannel_state state) } } -void bc_next_state_change(struct misdn_bchannel *bc, enum bchannel_state state) +static void bc_next_state_change(struct misdn_bchannel *bc, enum bchannel_state state) { cb_log(5,bc->port,"BC_NEXT_STATE_CHANGE: from:%s to:%s\n", bc_state2str(bc->next_bc_state), @@ -531,7 +528,7 @@ void bc_next_state_change(struct misdn_bchannel *bc, enum bchannel_state state) } -void empty_bc(struct misdn_bchannel *bc) +static void empty_bc(struct misdn_bchannel *bc) { bc->bframe_len=0; @@ -624,7 +621,7 @@ void empty_bc(struct misdn_bchannel *bc) } -int clean_up_bc(struct misdn_bchannel *bc) +static int clean_up_bc(struct misdn_bchannel *bc) { int ret=0; unsigned char buff[32]; @@ -667,7 +664,7 @@ int clean_up_bc(struct misdn_bchannel *bc) -void clear_l3(struct misdn_stack *stack) +static void clear_l3(struct misdn_stack *stack) { int i; @@ -682,7 +679,7 @@ void clear_l3(struct misdn_stack *stack) } } -int set_chan_in_stack(struct misdn_stack *stack, int channel) +static int set_chan_in_stack(struct misdn_stack *stack, int channel) { cb_log(4,stack->port,"set_chan_in_stack: %d\n",channel); @@ -695,21 +692,22 @@ int set_chan_in_stack(struct misdn_stack *stack, int channel) return 0; } -int chan_in_stack_free(struct misdn_stack *stack, int channel) +#if 0 +static int chan_in_stack_free(struct misdn_stack *stack, int channel) { if (stack->channels[channel-1]) return 0; return 1; } - +#endif static int newteid=0; #define MAXPROCS 0x100 -int misdn_lib_get_l1_down(struct misdn_stack *stack) +static int misdn_lib_get_l1_down(struct misdn_stack *stack) { /* Pull Up L1 */ iframe_t act; @@ -726,7 +724,7 @@ int misdn_lib_get_l1_down(struct misdn_stack *stack) } -int misdn_lib_get_l2_down(struct misdn_stack *stack) +static int misdn_lib_get_l2_down(struct misdn_stack *stack) { if (stack->ptp && (stack->nt) ) { @@ -752,7 +750,7 @@ int misdn_lib_get_l2_down(struct misdn_stack *stack) } -int misdn_lib_get_l1_up(struct misdn_stack *stack) +static int misdn_lib_get_l1_up(struct misdn_stack *stack) { /* Pull Up L1 */ iframe_t act; @@ -792,7 +790,8 @@ int misdn_lib_get_l2_up(struct misdn_stack *stack) return 0; } -int misdn_lib_get_l2_te_ptp_up(struct misdn_stack *stack) +#if 0 +static int misdn_lib_get_l2_te_ptp_up(struct misdn_stack *stack) { iframe_t act; @@ -804,9 +803,9 @@ int misdn_lib_get_l2_te_ptp_up(struct misdn_stack *stack) return mISDN_write(stack->midev, &act, mISDN_HEADER_LEN+act.len, TIMEOUT_1SEC); return 0; } +#endif - -int misdn_lib_get_short_status(struct misdn_stack *stack) +static int misdn_lib_get_short_status(struct misdn_stack *stack) { iframe_t act; @@ -1342,7 +1341,7 @@ void stack_destroy(struct misdn_stack* stack) } -struct misdn_stack * find_stack_by_addr(int addr) +static struct misdn_stack * find_stack_by_addr(int addr) { struct misdn_stack *stack; @@ -1357,7 +1356,7 @@ struct misdn_stack * find_stack_by_addr(int addr) } -struct misdn_stack * find_stack_by_port(int port) +static struct misdn_stack * find_stack_by_port(int port) { struct misdn_stack *stack; @@ -1369,7 +1368,7 @@ struct misdn_stack * find_stack_by_port(int port) return NULL; } -struct misdn_stack * find_stack_by_mgr(manager_t* mgr_nt) +static struct misdn_stack * find_stack_by_mgr(manager_t* mgr_nt) { struct misdn_stack *stack; @@ -1381,7 +1380,7 @@ struct misdn_stack * find_stack_by_mgr(manager_t* mgr_nt) return NULL; } -struct misdn_bchannel *find_bc_by_masked_l3id(struct misdn_stack *stack, unsigned long l3id, unsigned long mask) +static struct misdn_bchannel *find_bc_by_masked_l3id(struct misdn_stack *stack, unsigned long l3id, unsigned long mask) { int i; for (i=0; i<stack->b_num; i++) { @@ -1400,7 +1399,7 @@ struct misdn_bchannel *find_bc_by_l3id(struct misdn_stack *stack, unsigned long return stack_holder_find(stack,l3id); } -struct misdn_bchannel *find_bc_holded(struct misdn_stack *stack) +static struct misdn_bchannel *find_bc_holded(struct misdn_stack *stack) { int i; for (i=0; i<stack->b_num; i++) { @@ -1410,7 +1409,7 @@ struct misdn_bchannel *find_bc_holded(struct misdn_stack *stack) } -struct misdn_bchannel *find_bc_by_addr(unsigned long addr) +static struct misdn_bchannel *find_bc_by_addr(unsigned long addr) { struct misdn_stack* stack; int i; @@ -1434,7 +1433,7 @@ struct misdn_bchannel *find_bc_by_addr(unsigned long addr) } -struct misdn_bchannel *find_bc_by_channel(int port, int channel) +static struct misdn_bchannel *find_bc_by_channel(int port, int channel) { struct misdn_stack* stack=find_stack_by_port(port); int i; @@ -1454,7 +1453,7 @@ struct misdn_bchannel *find_bc_by_channel(int port, int channel) -int handle_event ( struct misdn_bchannel *bc, enum event_e event, iframe_t *frm) +static int handle_event ( struct misdn_bchannel *bc, enum event_e event, iframe_t *frm) { struct misdn_stack *stack=get_stack_by_bc(bc); @@ -1528,7 +1527,7 @@ int handle_event ( struct misdn_bchannel *bc, enum event_e event, iframe_t *frm) return 0; } -int handle_new_process(struct misdn_stack *stack, iframe_t *frm) +static int handle_new_process(struct misdn_stack *stack, iframe_t *frm) { struct misdn_bchannel* bc=misdn_lib_get_free_bc(stack->port, 0); @@ -1544,7 +1543,7 @@ int handle_new_process(struct misdn_stack *stack, iframe_t *frm) return 0; } -int handle_cr ( struct misdn_stack *stack, iframe_t *frm) +static int handle_cr ( struct misdn_stack *stack, iframe_t *frm) { if (!stack) return -1; @@ -2094,7 +2093,7 @@ handle_event_nt(void *dat, void *arg) } -int handle_timers(msg_t* msg) +static int handle_timers(msg_t* msg) { iframe_t *frm= (iframe_t*)msg->data; struct misdn_stack *stack; @@ -2235,7 +2234,7 @@ void misdn_tx_jitter(struct misdn_bchannel *bc, int len) } } -int handle_bchan(msg_t *msg) +static int handle_bchan(msg_t *msg) { iframe_t *frm= (iframe_t*)msg->data; @@ -2497,7 +2496,7 @@ int handle_bchan(msg_t *msg) -int handle_frm_nt(msg_t *msg) +static int handle_frm_nt(msg_t *msg) { iframe_t *frm= (iframe_t*)msg->data; struct misdn_stack *stack; @@ -2532,7 +2531,7 @@ int handle_frm_nt(msg_t *msg) } -int handle_frm(msg_t *msg) +static int handle_frm(msg_t *msg) { iframe_t *frm = (iframe_t*) msg->data; @@ -2630,7 +2629,7 @@ handle_frm_bc: } -int handle_l1(msg_t *msg) +static int handle_l1(msg_t *msg) { iframe_t *frm = (iframe_t*) msg->data; struct misdn_stack *stack = find_stack_by_addr(frm->addr); @@ -2700,7 +2699,7 @@ int handle_l1(msg_t *msg) return 0; } -int handle_l2(msg_t *msg) +static int handle_l2(msg_t *msg) { iframe_t *frm = (iframe_t*) msg->data; @@ -2747,7 +2746,7 @@ int handle_l2(msg_t *msg) return 0; } -int handle_mgmt(msg_t *msg) +static int handle_mgmt(msg_t *msg) { iframe_t *frm = (iframe_t*) msg->data; @@ -2824,7 +2823,7 @@ int handle_mgmt(msg_t *msg) } -msg_t *fetch_msg(int midev) +static msg_t *fetch_msg(int midev) { msg_t *msg=alloc_msg(MAX_MSG_SIZE); int r; @@ -3012,7 +3011,7 @@ struct misdn_bchannel *manager_find_bc_holded(struct misdn_bchannel* bc) -void prepare_bc(struct misdn_bchannel*bc, int channel) +static void prepare_bc(struct misdn_bchannel*bc, int channel) { bc->channel = channel; bc->channel_preselected = channel?1:0; @@ -3080,7 +3079,8 @@ struct misdn_bchannel* misdn_lib_get_free_bc(int port, int channel) } -char *fac2str (enum FacFunction func) { +static char *fac2str (enum FacFunction func) +{ struct arr_el { enum FacFunction p; char *s ; @@ -3329,7 +3329,7 @@ int misdn_lib_send_event(struct misdn_bchannel *bc, enum event_e event ) } -int handle_err(msg_t *msg) +static int handle_err(msg_t *msg) { iframe_t *frm = (iframe_t*) msg->data; @@ -3412,8 +3412,9 @@ int handle_err(msg_t *msg) return 0; } - -int queue_l2l3(msg_t *msg) { +#if 0 +static int queue_l2l3(msg_t *msg) +{ iframe_t *frm= (iframe_t*)msg->data; struct misdn_stack *stack; stack=find_stack_by_addr( frm->addr ); @@ -3427,6 +3428,7 @@ int queue_l2l3(msg_t *msg) { sem_post(&glob_mgr->new_msg); return 1; } +#endif int manager_isdn_handler(iframe_t *frm ,msg_t *msg) { @@ -3578,7 +3580,7 @@ int misdn_lib_port_restart(int port) sem_t handler_started; -void manager_event_handler(void *arg) +static void manager_event_handler(void *arg) { sem_post(&handler_started); while (1) { @@ -4261,7 +4263,7 @@ void misdn_lib_bridge( struct misdn_bchannel * bc1, struct misdn_bchannel *bc2) }; struct misdn_bchannel **bc; - for (bc=bc_list; *bc; *bc++) { + for (bc=bc_list; *bc; bc++) { (*bc)->conf_id=conf_id; cb_log(1, (*bc)->port, " --> bc_addr:%x\n",(*bc)->addr); @@ -4284,7 +4286,7 @@ void misdn_lib_split_bridge( struct misdn_bchannel * bc1, struct misdn_bchannel }; struct misdn_bchannel **bc; - for (bc=bc_list; *bc; *bc++) { + for (bc=bc_list; *bc; bc++) { if ( (*bc)->bc_state == BCHAN_BRIDGED){ misdn_split_conf( *bc, (*bc)->conf_id); } else { diff --git a/channels/misdn/isdn_lib.h b/channels/misdn/isdn_lib.h index 1d38bb4fa..d849a7ce8 100644 --- a/channels/misdn/isdn_lib.h +++ b/channels/misdn/isdn_lib.h @@ -458,5 +458,4 @@ char *bc_state2str(enum bchannel_state state); void bc_state_change(struct misdn_bchannel *bc, enum bchannel_state state); - #endif diff --git a/channels/misdn/isdn_lib_intern.h b/channels/misdn/isdn_lib_intern.h index 6dbc3afb7..86d95a9fe 100644 --- a/channels/misdn/isdn_lib_intern.h +++ b/channels/misdn/isdn_lib_intern.h @@ -11,7 +11,6 @@ #include "isdn_lib.h" - #if !defined MISDNUSER_VERSION_CODE || (MISDNUSER_VERSION_CODE < MISDNUSER_VERSION(1, 0, 3)) #error "You need a newer version of mISDNuser ..." #endif @@ -104,6 +103,13 @@ struct misdn_stack { struct misdn_stack* get_stack_by_bc(struct misdn_bchannel *bc); +int isdn_msg_get_index(struct isdn_msg msgs[], msg_t *frm, int nt); +enum event_e isdn_msg_get_event(struct isdn_msg msgs[], msg_t *frm, int nt); +int isdn_msg_parse_event(struct isdn_msg msgs[], msg_t *frm, struct misdn_bchannel *bc, int nt); +char * isdn_get_info(struct isdn_msg msgs[], enum event_e event, int nt); +msg_t * isdn_msg_build_event(struct isdn_msg msgs[], struct misdn_bchannel *bc, enum event_e event, int nt); +int isdn_msg_get_index_by_event(struct isdn_msg msgs[], enum event_e event, int nt); +char * isdn_msg_get_info(struct isdn_msg msgs[], msg_t *msg, int nt); #endif diff --git a/channels/misdn/isdn_msg_parser.c b/channels/misdn/isdn_msg_parser.c index a7fbf4e79..4179d8e60 100644 --- a/channels/misdn/isdn_msg_parser.c +++ b/channels/misdn/isdn_msg_parser.c @@ -20,7 +20,8 @@ #include "ie.c" -void set_channel(struct misdn_bchannel *bc, int channel) { +static void set_channel(struct misdn_bchannel *bc, int channel) +{ cb_log(3,bc->port,"set_channel: bc->channel:%d channel:%d\n", bc->channel, channel); @@ -47,7 +48,7 @@ void set_channel(struct misdn_bchannel *bc, int channel) { } } -void parse_proceeding (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_proceeding (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; CALL_PROCEEDING_t *proceeding=(CALL_PROCEEDING_t*)((unsigned long)msg->data+ HEADER_LEN); @@ -68,7 +69,7 @@ void parse_proceeding (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel printf("Parsing PROCEEDING Msg\n"); #endif } -msg_t *build_proceeding (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) +static msg_t *build_proceeding (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; CALL_PROCEEDING_t *proceeding; @@ -88,7 +89,7 @@ msg_t *build_proceeding (struct isdn_msg msgs[], struct misdn_bchannel *bc, int return msg; } -void parse_alerting (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_alerting (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; ALERTING_t *alerting=(ALERTING_t*)((unsigned long)(msg->data+HEADER_LEN)); @@ -102,7 +103,8 @@ void parse_alerting (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel * } -msg_t *build_alerting (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) + +static msg_t *build_alerting (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; ALERTING_t *alerting; @@ -121,7 +123,7 @@ msg_t *build_alerting (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt } -void parse_progress (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_progress (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; PROGRESS_t *progress=(PROGRESS_t*)((unsigned long)(msg->data+HEADER_LEN)); @@ -134,7 +136,7 @@ void parse_progress (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel * #endif } -msg_t *build_progress (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) +static msg_t *build_progress (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; PROGRESS_t *progress; @@ -148,7 +150,7 @@ msg_t *build_progress (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt return msg; } -void parse_setup (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_setup (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; SETUP_t *setup= (SETUP_t*)((unsigned long)msg->data+HEADER_LEN); @@ -256,7 +258,7 @@ void parse_setup (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, } #define ANY_CHANNEL 0xff /* IE attribut for 'any channel' */ -msg_t *build_setup (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) +static msg_t *build_setup (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; SETUP_t *setup; @@ -331,7 +333,7 @@ msg_t *build_setup (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) return msg; } -void parse_connect (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_connect (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; CONNECT_t *connect=(CONNECT_t*)((unsigned long)(msg->data+HEADER_LEN)); @@ -353,7 +355,8 @@ void parse_connect (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *b printf("Parsing CONNECT Msg\n"); #endif } -msg_t *build_connect (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) + +static msg_t *build_connect (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; CONNECT_t *connect; @@ -380,7 +383,7 @@ msg_t *build_connect (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) return msg; } -void parse_setup_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_setup_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; SETUP_ACKNOWLEDGE_t *setup_acknowledge=(SETUP_ACKNOWLEDGE_t*)((unsigned long)(msg->data+HEADER_LEN)); @@ -400,7 +403,8 @@ void parse_setup_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_b } -msg_t *build_setup_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) + +static msg_t *build_setup_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; SETUP_ACKNOWLEDGE_t *setup_acknowledge; @@ -419,7 +423,7 @@ msg_t *build_setup_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *b return msg; } -void parse_connect_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_connect_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { #if DEBUG printf("Parsing CONNECT_ACKNOWLEDGE Msg\n"); @@ -427,7 +431,8 @@ void parse_connect_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn } -msg_t *build_connect_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) + +static msg_t *build_connect_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; CONNECT_ACKNOWLEDGE_t *connect_acknowledge; @@ -443,7 +448,7 @@ msg_t *build_connect_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel return msg; } -void parse_user_information (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_user_information (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { #if DEBUG printf("Parsing USER_INFORMATION Msg\n"); @@ -451,7 +456,8 @@ void parse_user_information (struct isdn_msg msgs[], msg_t *msg, struct misdn_bc } -msg_t *build_user_information (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) + +static msg_t *build_user_information (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; USER_INFORMATION_t *user_information; @@ -465,7 +471,7 @@ msg_t *build_user_information (struct isdn_msg msgs[], struct misdn_bchannel *bc return msg; } -void parse_suspend_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_suspend_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { #if DEBUG printf("Parsing SUSPEND_REJECT Msg\n"); @@ -473,7 +479,8 @@ void parse_suspend_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bcha } -msg_t *build_suspend_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) + +static msg_t *build_suspend_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; SUSPEND_REJECT_t *suspend_reject; @@ -487,7 +494,7 @@ msg_t *build_suspend_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, return msg; } -void parse_resume_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_resume_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { #if DEBUG printf("Parsing RESUME_REJECT Msg\n"); @@ -495,7 +502,8 @@ void parse_resume_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchan } -msg_t *build_resume_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) + +static msg_t *build_resume_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; RESUME_REJECT_t *resume_reject; @@ -509,7 +517,7 @@ msg_t *build_resume_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, i return msg; } -void parse_hold (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_hold (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { #if DEBUG printf("Parsing HOLD Msg\n"); @@ -517,7 +525,8 @@ void parse_hold (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, } -msg_t *build_hold (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) + +static msg_t *build_hold (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; HOLD_t *hold; @@ -531,7 +540,7 @@ msg_t *build_hold (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) return msg; } -void parse_suspend (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_suspend (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { #if DEBUG printf("Parsing SUSPEND Msg\n"); @@ -539,7 +548,8 @@ void parse_suspend (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *b } -msg_t *build_suspend (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) + +static msg_t *build_suspend (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; SUSPEND_t *suspend; @@ -553,7 +563,7 @@ msg_t *build_suspend (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) return msg; } -void parse_resume (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_resume (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { #if DEBUG printf("Parsing RESUME Msg\n"); @@ -561,7 +571,8 @@ void parse_resume (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc } -msg_t *build_resume (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) + +static msg_t *build_resume (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; RESUME_t *resume; @@ -575,7 +586,7 @@ msg_t *build_resume (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) return msg; } -void parse_hold_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_hold_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { #if DEBUG printf("Parsing HOLD_ACKNOWLEDGE Msg\n"); @@ -583,7 +594,8 @@ void parse_hold_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bc } -msg_t *build_hold_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) + +static msg_t *build_hold_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; HOLD_ACKNOWLEDGE_t *hold_acknowledge; @@ -597,7 +609,7 @@ msg_t *build_hold_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc return msg; } -void parse_suspend_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_suspend_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { #if DEBUG printf("Parsing SUSPEND_ACKNOWLEDGE Msg\n"); @@ -605,7 +617,8 @@ void parse_suspend_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn } -msg_t *build_suspend_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) + +static msg_t *build_suspend_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; SUSPEND_ACKNOWLEDGE_t *suspend_acknowledge; @@ -619,7 +632,7 @@ msg_t *build_suspend_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel return msg; } -void parse_resume_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_resume_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { #if DEBUG printf("Parsing RESUME_ACKNOWLEDGE Msg\n"); @@ -627,7 +640,8 @@ void parse_resume_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_ } -msg_t *build_resume_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) + +static msg_t *build_resume_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; RESUME_ACKNOWLEDGE_t *resume_acknowledge; @@ -641,7 +655,7 @@ msg_t *build_resume_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel * return msg; } -void parse_hold_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_hold_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { #if DEBUG printf("Parsing HOLD_REJECT Msg\n"); @@ -649,7 +663,8 @@ void parse_hold_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchanne } -msg_t *build_hold_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) + +static msg_t *build_hold_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; HOLD_REJECT_t *hold_reject; @@ -663,7 +678,7 @@ msg_t *build_hold_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, int return msg; } -void parse_retrieve (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_retrieve (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { #if DEBUG printf("Parsing RETRIEVE Msg\n"); @@ -671,7 +686,8 @@ void parse_retrieve (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel * } -msg_t *build_retrieve (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) + +static msg_t *build_retrieve (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; RETRIEVE_t *retrieve; @@ -685,7 +701,7 @@ msg_t *build_retrieve (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt return msg; } -void parse_retrieve_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_retrieve_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { #if DEBUG printf("Parsing RETRIEVE_ACKNOWLEDGE Msg\n"); @@ -693,7 +709,8 @@ void parse_retrieve_acknowledge (struct isdn_msg msgs[], msg_t *msg, struct misd } -msg_t *build_retrieve_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) + +static msg_t *build_retrieve_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; RETRIEVE_ACKNOWLEDGE_t *retrieve_acknowledge; @@ -708,7 +725,7 @@ msg_t *build_retrieve_acknowledge (struct isdn_msg msgs[], struct misdn_bchannel return msg; } -void parse_retrieve_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_retrieve_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { #if DEBUG printf("Parsing RETRIEVE_REJECT Msg\n"); @@ -716,7 +733,8 @@ void parse_retrieve_reject (struct isdn_msg msgs[], msg_t *msg, struct misdn_bch } -msg_t *build_retrieve_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) + +static msg_t *build_retrieve_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; RETRIEVE_REJECT_t *retrieve_reject; @@ -730,7 +748,7 @@ msg_t *build_retrieve_reject (struct isdn_msg msgs[], struct misdn_bchannel *bc, return msg; } -void parse_disconnect (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_disconnect (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; DISCONNECT_t *disconnect=(DISCONNECT_t*)((unsigned long)(msg->data+HEADER_LEN)); @@ -745,7 +763,8 @@ void parse_disconnect (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel } -msg_t *build_disconnect (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) + +static msg_t *build_disconnect (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; DISCONNECT_t *disconnect; @@ -762,7 +781,7 @@ msg_t *build_disconnect (struct isdn_msg msgs[], struct misdn_bchannel *bc, int return msg; } -void parse_restart (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_restart (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; RESTART_t *restart=(RESTART_t*)((unsigned long)(msg->data+HEADER_LEN)); @@ -774,8 +793,9 @@ void parse_restart (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *b #endif { - int exclusive, channel; + int exclusive, channel = 0; dec_ie_channel_id(restart->CHANNEL_ID, (Q931_info_t *)restart, &exclusive, &bc->restart_channel, nt,bc); + /* XXX: this is broken... channel is not used */ if (channel==0xff) /* any channel */ channel=-1; cb_log(3, stack->port, "CC_RESTART Request on channel:%d on this port.\n"); @@ -783,7 +803,8 @@ void parse_restart (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *b } -msg_t *build_restart (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) + +static msg_t *build_restart (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; RESTART_t *restart; @@ -797,7 +818,7 @@ msg_t *build_restart (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) return msg; } -void parse_release (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_release (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; RELEASE_t *release=(RELEASE_t*)((unsigned long)(msg->data+HEADER_LEN)); @@ -810,7 +831,8 @@ void parse_release (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *b } -msg_t *build_release (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) + +static msg_t *build_release (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; RELEASE_t *release; @@ -827,7 +849,7 @@ msg_t *build_release (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) return msg; } -void parse_release_complete (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_release_complete (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; RELEASE_COMPLETE_t *release_complete=(RELEASE_COMPLETE_t*)((unsigned long)(msg->data+HEADER_LEN)); @@ -859,7 +881,7 @@ void parse_release_complete (struct isdn_msg msgs[], msg_t *msg, struct misdn_bc #endif } -msg_t *build_release_complete (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) +static msg_t *build_release_complete (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; RELEASE_COMPLETE_t *release_complete; @@ -875,7 +897,7 @@ msg_t *build_release_complete (struct isdn_msg msgs[], struct misdn_bchannel *bc return msg; } -void parse_facility (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_facility (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt ? mISDNUSER_HEAD_SIZE : mISDN_HEADER_LEN; FACILITY_t *facility = (FACILITY_t*)(msg->data+HEADER_LEN); @@ -902,7 +924,7 @@ void parse_facility (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel * } } -msg_t *build_facility (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) +static msg_t *build_facility (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int len, HEADER_LEN = nt ? mISDNUSER_HEAD_SIZE : mISDN_HEADER_LEN; @@ -938,14 +960,14 @@ msg_t *build_facility (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt return msg; } -void parse_notify (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_notify (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { #if DEBUG printf("Parsing NOTIFY Msg\n"); #endif } -msg_t *build_notify (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) +static msg_t *build_notify (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; NOTIFY_t *notify; @@ -959,14 +981,14 @@ msg_t *build_notify (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) return msg; } -void parse_status_enquiry (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_status_enquiry (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { #if DEBUG printf("Parsing STATUS_ENQUIRY Msg\n"); #endif } -msg_t *build_status_enquiry (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) +static msg_t *build_status_enquiry (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; STATUS_ENQUIRY_t *status_enquiry; @@ -980,7 +1002,7 @@ msg_t *build_status_enquiry (struct isdn_msg msgs[], struct misdn_bchannel *bc, return msg; } -void parse_information (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_information (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; INFORMATION_t *information=(INFORMATION_t*)((unsigned long)(msg->data+HEADER_LEN)); @@ -998,7 +1020,7 @@ void parse_information (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchanne #endif } -msg_t *build_information (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) +static msg_t *build_information (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; INFORMATION_t *information; @@ -1023,7 +1045,7 @@ msg_t *build_information (struct isdn_msg msgs[], struct misdn_bchannel *bc, int return msg; } -void parse_status (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_status (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; STATUS_t *status=(STATUS_t*)((unsigned long)(msg->data+HEADER_LEN)); @@ -1037,7 +1059,7 @@ void parse_status (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc #endif } -msg_t *build_status (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) +static msg_t *build_status (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; STATUS_t *status; @@ -1051,14 +1073,14 @@ msg_t *build_status (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) return msg; } -void parse_timeout (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) +static void parse_timeout (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc, int nt) { #if DEBUG printf("Parsing STATUS Msg\n"); #endif } -msg_t *build_timeout (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) +static msg_t *build_timeout (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt) { int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN; STATUS_t *status; @@ -1269,4 +1291,3 @@ msg_t * isdn_msg_build_event(struct isdn_msg msgs[], struct misdn_bchannel *bc, return msgs[i].msg_builder(msgs, bc, nt); } - diff --git a/codecs/Makefile b/codecs/Makefile index f476e8a2b..9726979e0 100644 --- a/codecs/Makefile +++ b/codecs/Makefile @@ -11,7 +11,7 @@ # the GNU General Public License # -ifneq ($(wildcard ../menuselect.makeopts),) +ifneq ($(wildcard $(ASTTOPDIR)/menuselect.makeopts),) include ../menuselect.makeopts include ../menuselect.makedeps endif @@ -19,22 +19,25 @@ endif C_MODS:=$(filter-out $(MENUSELECT_CODECS),$(patsubst %.c,%,$(wildcard codec_*.c))) CC_MODS:=$(filter-out $(MENUSELECT_CODECS),$(patsubst %.cc,%,$(wildcard codec_*.cc))) -SELECTED_MODS:=$(C_MODS) $(CC_MODS) +LOADABLE_MODS:=$(C_MODS) $(CC_MODS) + +ifneq ($(findstring codecs,$(MENUSELECT_EMBED)),) + EMBEDDED_MODS:=$(LOADABLE_MODS) + LOADABLE_MODS:= +endif LIBILBC:=ilbc/libilbc.a LIBLPC10:=lpc10/liblpc10.a all: _all -ifeq ($(GSM_LIB),internal) -GSM_INCLUDE:=-Igsm/inc -GSM_LIB:= +include $(ASTTOPDIR)/Makefile.moddir_rules -codec_gsm.so: gsm/lib/libgsm.a +ifneq ($(GSM_INTERNAL),) +GSM_INCLUDE:=-Igsm/inc +$(codec_gsm): gsm/lib/libgsm.a endif -include $(ASTTOPDIR)/Makefile.moddir_rules - clean:: $(MAKE) -C gsm clean $(MAKE) -C lpc10 clean @@ -42,14 +45,14 @@ clean:: gsm/lib/libgsm.a: @mkdir -p gsm/lib - @CFLAGS="$(CFLAGS) -I." $(MAKE) -C gsm lib/libgsm.a + @CFLAGS="$(OTHER_SUBDIR_CFLAGS) -I." $(MAKE) -C gsm lib/libgsm.a $(LIBLPC10): - @$(MAKE) -C lpc10 all + @CFLAGS="$(OTHER_SUBDIR_CFLAGS)" $(MAKE) -C lpc10 all -codec_lpc10.so: $(LIBLPC10) +$(codec_lpc10): $(LIBLPC10) $(LIBILBC): - @$(MAKE) -C ilbc all + @CFLAGS="$(OTHER_SUBDIR_CFLAGS)" $(MAKE) -C ilbc all -codec_ilbc.so: $(LIBILBC) +$(codec_ilbc): $(LIBILBC) diff --git a/codecs/codec_a_mu.c b/codecs/codec_a_mu.c index c67bdd472..b9c1c4938 100644 --- a/codecs/codec_a_mu.c +++ b/codecs/codec_a_mu.c @@ -137,38 +137,32 @@ static struct ast_translator ulawtoalaw = { /*! \brief standard module glue */ -static int unload_module(void *mod) +static int unload_module(void) { int res; + res = ast_unregister_translator(&ulawtoalaw); res |= ast_unregister_translator(&alawtoulaw); + return res; } -static int load_module(void *mod) +static int load_module(void) { int res; int x; + for (x=0;x<256;x++) { mu2a[x] = AST_LIN2A(AST_MULAW(x)); a2mu[x] = AST_LIN2MU(AST_ALAW(x)); } - res = ast_register_translator(&alawtoulaw, mod); + res = ast_register_translator(&alawtoulaw); if (!res) - res = ast_register_translator(&ulawtoalaw, mod); + res = ast_register_translator(&ulawtoalaw); else ast_unregister_translator(&alawtoulaw); - return res; -} -static const char *description(void) -{ - return "A-law and Mulaw direct Coder/Decoder"; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; + return res; } -STD_MOD(MOD_1, NULL, NULL, NULL); +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "A-law and Mulaw direct Coder/Decoder"); diff --git a/codecs/codec_adpcm.c b/codecs/codec_adpcm.c index 9ab358ff5..7469f056c 100644 --- a/codecs/codec_adpcm.c +++ b/codecs/codec_adpcm.c @@ -367,40 +367,38 @@ static void parse_config(void) } /*! \brief standard module glue */ -static int reload(void *mod) +static int reload(void) { parse_config(); return 0; } -static int unload_module(void *mod) +static int unload_module(void) { int res; + res = ast_unregister_translator(&lintoadpcm); res |= ast_unregister_translator(&adpcmtolin); + return res; } -static int load_module(void *mod) +static int load_module(void) { int res; + parse_config(); - res = ast_register_translator(&adpcmtolin, mod); + res = ast_register_translator(&adpcmtolin); if (!res) - res = ast_register_translator(&lintoadpcm, mod); + res = ast_register_translator(&lintoadpcm); else ast_unregister_translator(&adpcmtolin); - return res; -} -static const char *description(void) -{ - return "Adaptive Differential PCM Coder/Decoder"; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; + return res; } -STD_MOD(MOD_1, reload, NULL, NULL); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Adaptive Differential PCM Coder/Decoder", + .load = load_module, + .unload = unload_module, + .reload = reload, + ); diff --git a/codecs/codec_alaw.c b/codecs/codec_alaw.c index 6def3f723..de1061687 100644 --- a/codecs/codec_alaw.c +++ b/codecs/codec_alaw.c @@ -152,40 +152,38 @@ static void parse_config(void) /*! \brief standard module stuff */ -static int reload(void *mod) +static int reload(void) { parse_config(); return 0; } -static int unload_module(void *mod) +static int unload_module(void) { int res; + res = ast_unregister_translator(&lintoalaw); res |= ast_unregister_translator(&alawtolin); + return res; } -static int load_module(void *mod) +static int load_module(void) { int res; + parse_config(); - res = ast_register_translator(&alawtolin, mod); + res = ast_register_translator(&alawtolin); if (!res) - res = ast_register_translator(&lintoalaw, mod); + res = ast_register_translator(&lintoalaw); else ast_unregister_translator(&alawtolin); - return res; -} -static const char *description(void) -{ - return "A-law Coder/Decoder"; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; + return res; } -STD_MOD(MOD_1, reload, NULL, NULL); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "A-law Coder/Decoder", + .load = load_module, + .unload = unload_module, + .reload = reload, + ); diff --git a/codecs/codec_g726.c b/codecs/codec_g726.c index 29932ab8a..bfc49ad9c 100644 --- a/codecs/codec_g726.c +++ b/codecs/codec_g726.c @@ -912,14 +912,14 @@ static void parse_config(void) ast_config_destroy(cfg); } -static int reload(void *mod) +static int reload(void) { parse_config(); return 0; } -static int unload_module (void *mod) +static int unload_module(void) { int res = 0; @@ -935,35 +935,30 @@ static int unload_module (void *mod) return res; } -static int load_module (void *mod) +static int load_module(void) { int res = 0; + parse_config(); - res |= ast_register_translator(&g726tolin, mod); - res |= ast_register_translator(&lintog726, mod); + res |= ast_register_translator(&g726tolin); + res |= ast_register_translator(&lintog726); - res |= ast_register_translator(&g726aal2tolin, mod); - res |= ast_register_translator(&lintog726aal2, mod); + res |= ast_register_translator(&g726aal2tolin); + res |= ast_register_translator(&lintog726aal2); - res |= ast_register_translator(&g726aal2tog726, mod); - res |= ast_register_translator(&g726tog726aal2, mod); + res |= ast_register_translator(&g726aal2tog726); + res |= ast_register_translator(&g726tog726aal2); if (res) - unload_module(mod); + unload_module(); return res; } -static const char *description(void) -{ - return "ITU G.726-32kbps G726 Transcoder"; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD(MOD_1, reload, NULL, NULL); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "ITU G.726-32kbps G726 Transcoder", + .load = load_module, + .unload = unload_module, + .reload = reload, + ); diff --git a/codecs/codec_gsm.c b/codecs/codec_gsm.c index 659a3e89a..bc5d9dc4f 100644 --- a/codecs/codec_gsm.c +++ b/codecs/codec_gsm.c @@ -246,41 +246,39 @@ static void parse_config(void) } /*! \brief standard module glue */ -static int reload(void *mod) +static int reload(void) { parse_config(); return 0; } -static int unload_module(void *mod) +static int unload_module(void) { int res; + res = ast_unregister_translator(&lintogsm); if (!res) res = ast_unregister_translator(&gsmtolin); + return res; } -static int load_module(void *mod) +static int load_module(void) { int res; + parse_config(); - res = ast_register_translator(&gsmtolin, mod); + res = ast_register_translator(&gsmtolin); if (!res) - res=ast_register_translator(&lintogsm, mod); + res=ast_register_translator(&lintogsm); else ast_unregister_translator(&gsmtolin); - return res; -} -static const char *description(void) -{ - return "GSM/PCM16 (signed linear) Codec Translator"; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; + return res; } -STD_MOD(MOD_1, reload, NULL, NULL); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "GSM Coder/Decoder", + .load = load_module, + .unload = unload_module, + .reload = reload, + ); diff --git a/codecs/codec_ilbc.c b/codecs/codec_ilbc.c index 98b5a1470..98d410e38 100644 --- a/codecs/codec_ilbc.c +++ b/codecs/codec_ilbc.c @@ -58,8 +58,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #define ILBC_SAMPLES 240 /* 30ms at 8000 hz */ #define BUFFER_SAMPLES 8000 -static char *tdesc = "iLBC/PCM16 (signed linear) Codec Translator"; - struct ilbc_coder_pvt { iLBC_Enc_Inst_t enc; iLBC_Dec_Inst_t dec; @@ -215,33 +213,27 @@ static struct ast_translator lintoilbc = { .buf_size = (BUFFER_SAMPLES * ILBC_FRAME_LEN + ILBC_SAMPLES - 1) / ILBC_SAMPLES, }; -static int unload_module(void *mod) +static int unload_module(void) { int res; + res = ast_unregister_translator(&lintoilbc); res |= ast_unregister_translator(&ilbctolin); + return res; } -static int load_module(void *mod) +static int load_module(void) { int res; - res = ast_register_translator(&ilbctolin, mod); + + res = ast_register_translator(&ilbctolin); if (!res) - res=ast_register_translator(&lintoilbc, mod); + res=ast_register_translator(&lintoilbc); else ast_unregister_translator(&ilbctolin); - return res; -} -static const char *description(void) -{ - return tdesc; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; + return res; } -STD_MOD(MOD_1, NULL, NULL, NULL); +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "iLBC Coder/Decoder"); diff --git a/codecs/codec_lpc10.c b/codecs/codec_lpc10.c index 03b7351c0..7985a11d6 100644 --- a/codecs/codec_lpc10.c +++ b/codecs/codec_lpc10.c @@ -281,41 +281,40 @@ static void parse_config(void) ast_config_destroy(cfg); } -static int reload(void *mod) +static int reload(void) { parse_config(); + return 0; } -static int unload_module(void *mod) +static int unload_module(void) { int res; + res = ast_unregister_translator(&lintolpc10); res |= ast_unregister_translator(&lpc10tolin); + return res; } -static int load_module(void *mod) +static int load_module(void) { int res; + parse_config(); - res=ast_register_translator(&lpc10tolin, mod); + res=ast_register_translator(&lpc10tolin); if (!res) - res=ast_register_translator(&lintolpc10, mod); + res=ast_register_translator(&lintolpc10); else ast_unregister_translator(&lpc10tolin); - return res; -} -static const char *description(void) -{ - return "LPC10 2.4kbps (signed linear) Voice Coder"; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; + return res; } -STD_MOD(MOD_1, reload, NULL, NULL); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "LPC10 2.4kbps Coder/Decoder", + .load = load_module, + .unload = unload_module, + .reload = reload, + ); diff --git a/codecs/codec_speex.c b/codecs/codec_speex.c index fec92520d..06c23e4f0 100644 --- a/codecs/codec_speex.c +++ b/codecs/codec_speex.c @@ -479,49 +479,39 @@ static void parse_config(void) ast_config_destroy(cfg); } -static int reload(void *mod) +static int reload(void) { - /* - * XXX reloading while there are active sessions is - * somewhat silly because the old state presumably - * wouldn't work anymore... - * maybe we shuld do a standard hangup localusers ? - */ - ast_mutex_lock(&__mod_desc->lock); parse_config(); - ast_mutex_lock(&__mod_desc->lock); + return 0; } -static int unload_module(void *mod) +static int unload_module(void) { int res; + res = ast_unregister_translator(&lintospeex); res |= ast_unregister_translator(&speextolin); + return res; } -static int load_module(void *mod) +static int load_module(void) { int res; + parse_config(); - res=ast_register_translator(&speextolin, mod); + res=ast_register_translator(&speextolin); if (!res) - res=ast_register_translator(&lintospeex, mod); + res=ast_register_translator(&lintospeex); else ast_unregister_translator(&speextolin); - return res; -} -static const char *description(void) -{ - return "Speex/PCM16 (signed linear) Codec Translator"; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; + return res; } -STD_MOD(MOD_1, reload, NULL, NULL); - +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Speex Coder/Decoder", + .load = load_module, + .unload = unload_module, + .reload = reload, + ); diff --git a/codecs/codec_ulaw.c b/codecs/codec_ulaw.c index 7544cdf17..334f8d9ad 100644 --- a/codecs/codec_ulaw.c +++ b/codecs/codec_ulaw.c @@ -163,44 +163,39 @@ static void parse_config(void) ast_config_destroy(cfg); } -static int reload(void *mod) +static int reload(void) { parse_config(); + return 0; } -static int unload_module(void *mod) +static int unload_module(void) { int res; + res = ast_unregister_translator(&lintoulaw); res |= ast_unregister_translator(&ulawtolin); + return res; } -static int load_module(void *mod) +static int load_module(void) { int res; + parse_config(); - res = ast_register_translator(&ulawtolin, mod); + res = ast_register_translator(&ulawtolin); if (!res) - res = ast_register_translator(&lintoulaw, mod); + res = ast_register_translator(&lintoulaw); else ast_unregister_translator(&ulawtolin); - return res; -} - -/* - * Return a description of this module. - */ -static const char *description(void) -{ - return "Mu-law Coder/Decoder"; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; + return res; } -STD_MOD(MOD_1, reload, NULL, NULL); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "mu-Law Coder/Decoder", + .load = load_module, + .unload = unload_module, + .reload = reload, + ); diff --git a/codecs/codec_zap.c b/codecs/codec_zap.c index ee9b94a4a..696a1b899 100644 --- a/codecs/codec_zap.c +++ b/codecs/codec_zap.c @@ -222,7 +222,7 @@ static struct ast_frame *fakesrc_sample(void) return &f; } -static int register_translator(int dst, int src, void *mod) +static int register_translator(int dst, int src) { struct translator *zt; int res; @@ -242,7 +242,7 @@ static int register_translator(int dst, int src, void *mod) zt->t.useplc = global_useplc; zt->t.buf_size = BUFFER_SAMPLES * 2; zt->t.desc_size = sizeof(struct pvt); - if ((res = ast_register_translator(&zt->t, mod))) { + if ((res = ast_register_translator(&zt->t))) { free(zt); return -1; } @@ -310,7 +310,7 @@ static void parse_config(void) ast_config_destroy(cfg); } -static void build_translators(void *mod, struct format_map *map, unsigned int dstfmts, unsigned int srcfmts) +static void build_translators(struct format_map *map, unsigned int dstfmts, unsigned int srcfmts) { unsigned int src, dst; @@ -325,13 +325,13 @@ static void build_translators(void *mod, struct format_map *map, unsigned int ds if (global_format_map.map[dst][src]) continue; - if (!register_translator(dst, src, mod)) + if (!register_translator(dst, src)) map->map[dst][src] = 1; } } } -static int find_transcoders(void *mod) +static int find_transcoders(void) { struct zt_transcode_info info = { 0, }; struct format_map map = { { { 0 } } }; @@ -346,7 +346,7 @@ static int find_transcoders(void *mod) for (info.tcnum = 0; !(res = ioctl(fd, ZT_TRANSCODE_OP, &info)); info.tcnum++) { if (option_verbose > 1) ast_verbose(VERBOSE_PREFIX_2 "Found transcoder '%s'.\n", info.name); - build_translators(mod, &map, info.dstfmts, info.srcfmts); + build_translators(&map, info.dstfmts, info.srcfmts); } close(fd); @@ -363,12 +363,12 @@ static int find_transcoders(void *mod) return 0; } -static int reload(void *mod) +static int reload(void) { struct translator *cur; parse_config(); - find_transcoders(mod); + find_transcoders(); AST_LIST_LOCK(&translators); AST_LIST_TRAVERSE(&translators, cur, entry) @@ -378,29 +378,23 @@ static int reload(void *mod) return 0; } -static int unload_module(void *mod) +static int unload_module(void) { unregister_translators(); return 0; } -static int load_module(void *mod) +static int load_module(void) { parse_config(); - find_transcoders(mod); + find_transcoders(); return 0; } -static const char *description(void) -{ - return "Generic Zaptel Transcoder Codec Translator"; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD(MOD_1, reload, NULL, NULL); +AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Generic Zaptel Transcoder Codec Translator", + .load = load_module, + .unload = unload_module, + .reload = reload, + ); diff --git a/codecs/gsm/Makefile b/codecs/gsm/Makefile index 483875cb6..9437c9ff9 100644 --- a/codecs/gsm/Makefile +++ b/codecs/gsm/Makefile @@ -38,7 +38,7 @@ WAV49 = -DWAV49 ######### probably require gcc. ifeq (, $(findstring $(OSARCH) , Darwin SunOS )) -ifeq (, $(findstring $(PROC) , x86_64 amd64 ultrasparc sparc64 arm ppc ppc64 ia64 s390)) +ifeq (, $(findstring $(PROC) , x86_64 amd64 ultrasparc sparc64 arm ppc ppc64 ia64 s390 bfin )) ifeq (, $(findstring $(shell uname -m) , ppc ppc64 alpha armv4l s390 )) OPTIMIZE+=-march=$(PROC) endif @@ -210,7 +210,7 @@ GSM_SOURCES = $(SRC)/add.c \ # XXX should merge with GSM_OBJECTS ifeq (${OSARCH},Linux) ifeq (,$(findstring $(shell uname -m) , x86_64 amd64 ppc ppc64 alpha armv4l sparc64 parisc s390 )) -ifeq (,$(findstring ${PROC} , arm ia64 s390 )) +ifeq (,$(findstring ${PROC} , arm ia64 s390 bfin )) GSM_SOURCES+= $(SRC)/k6opt.s endif endif @@ -262,7 +262,7 @@ GSM_OBJECTS = $(SRC)/add.o \ ifeq (${OSARCH},Linux) ifeq (,$(findstring $(shell uname -m) , x86_64 amd64 ppc ppc64 alpha armv4l sparc64 parisc )) -ifeq (,$(findstring ${PROC} , arm ia64 )) +ifeq (,$(findstring ${PROC} , arm ia64 bfin )) GSM_OBJECTS+= $(SRC)/k6opt.o endif endif @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.ac Revision: 40335 . +# From configure.ac Revision: 40597 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.60. # @@ -565,7 +565,7 @@ PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="asterisk" -ac_unique_file="asterisk.c" +ac_unique_file="main/asterisk.c" # Factoring default headers for most tests. ac_includes_default="\ #include <stdio.h> @@ -647,25 +647,21 @@ host host_cpu host_vendor host_os -target -target_cpu -target_vendor -target_os -PBX_PLATFORM -PBX_CPU -PBX_VENDOR -PBX_OS +BUILD_PLATFORM +BUILD_CPU +BUILD_VENDOR +BUILD_OS +HOST_PLATFORM +HOST_CPU +HOST_VENDOR +HOST_OS UNAME PBX_OSREV -OSISWIN32 -PBX_OSTYPE CC CXX +LD RANLIB AR -NM -WINDRES -DLLWRAP CFLAGS LDFLAGS CPPFLAGS @@ -696,6 +692,9 @@ PBX_ALSA CURSES_LIB CURSES_INCLUDE PBX_CURSES +GNUTLS_LIB +GNUTLS_INCLUDE +PBX_GNUTLS GSM_LIB GSM_INCLUDE PBX_GSM @@ -705,9 +704,15 @@ PBX_IKSEMEL IMAP_TK_LIB IMAP_TK_INCLUDE PBX_IMAP_TK +ISDNNET_LIB +ISDNNET_INCLUDE +PBX_ISDNNET KDE_LIB KDE_INCLUDE PBX_KDE +MISDN_LIB +MISDN_INCLUDE +PBX_MISDN NBS_LIB NBS_INCLUDE PBX_NBS @@ -756,6 +761,9 @@ PBX_SPEEX SQLITE_LIB SQLITE_INCLUDE PBX_SQLITE +SUPPSERV_LIB +SUPPSERV_INCLUDE +PBX_SUPPSERV OPENSSL_LIB OPENSSL_INCLUDE PBX_OPENSSL @@ -787,6 +795,7 @@ ALLOCA EGREP LIBOBJS POW_LIB +GSM_INTERNAL KDEINIT KDEDIR NETSNMP_CONFIG @@ -1378,7 +1387,6 @@ _ACEOF System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] - --target=TARGET configure for building compilers for TARGET [HOST] _ACEOF fi @@ -1397,10 +1405,14 @@ Optional Packages: --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-asound=PATH use Advanced Linux Sound Architecture files in PATH --with-curses=PATH use curses files in PATH + --with-gnutls=PATH use GNU TLS support (used for iksemel only) files in + PATH --with-gsm=PATH use GSM files in PATH , or 'internal' --with-iksemel=PATH use Iksemel Jabber Library files in PATH --with-imap=PATH use UW IMAP Toolkit files in PATH + --with-isdnnet=PATH use ISDN4Linux Library files in PATH --with-kde=PATH use KDE files in PATH + --with-misdn=PATH use mISDN User Library files in PATH --with-nbs=PATH use Network Broadcast Sound files in PATH --with-ncurses=PATH use ncurses files in PATH --with-netsnmp=PATH use Net-SNMP files in PATH @@ -1417,6 +1429,7 @@ Optional Packages: --with-radius=PATH use Radius Client files in PATH --with-speex=PATH use Speex files in PATH --with-sqlite=PATH use SQLite files in PATH + --with-suppserv=PATH use mISDN Supplemental Services files in PATH --with-ssl=PATH use OpenSSL files in PATH --with-tds=PATH use FreeTDS files in PATH --with-termcap=PATH use Termcap files in PATH @@ -1979,49 +1992,6 @@ IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac -{ echo "$as_me:$LINENO: checking target system type" >&5 -echo $ECHO_N "checking target system type... $ECHO_C" >&6; } -if test "${ac_cv_target+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "x$target_alias" = x; then - ac_cv_target=$ac_cv_host -else - ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || - { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 -echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} - { (exit 1); exit 1; }; } -fi - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_target" >&5 -echo "${ECHO_T}$ac_cv_target" >&6; } -case $ac_cv_target in -*-*-*) ;; -*) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 -echo "$as_me: error: invalid value of canonical target" >&2;} - { (exit 1); exit 1; }; };; -esac -target=$ac_cv_target -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_target -shift -target_cpu=$1 -target_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -target_os=$* -IFS=$ac_save_IFS -case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac - - -# The aliases save the names the user supplied, while $host etc. -# will get canonicalized. -test -n "$target_alias" && - test "$program_prefix$program_suffix$program_transform_name" = \ - NONENONEs,x,x, && - program_prefix=${target_alias}- # check existence of the package @@ -2033,8 +2003,8 @@ ac_config_headers="$ac_config_headers include/asterisk/autoconfig.h" -case "${host}" in - *freebsd*) +case "${host_os}" in + freebsd) ac_default_prefix=/usr/local ;; *) @@ -2052,33 +2022,21 @@ if test ${localstatedir} = '${prefix}/var'; then localstatedir=/var fi -### ** Platform. +BUILD_PLATFORM=${build} +BUILD_CPU=${build_cpu} +BUILD_VENDOR=${build_vendor} +BUILD_OS=${build_os} -cat >>confdefs.h <<_ACEOF -#define PBX_PLATFORM "${host}" -_ACEOF -cat >>confdefs.h <<_ACEOF -#define PBX_CPU "${host_cpu}" -_ACEOF -cat >>confdefs.h <<_ACEOF -#define PBX_VENDOR "${host_vendor}" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PBX_OS "${host_os}" -_ACEOF +HOST_PLATFORM=${host} +HOST_CPU=${host_cpu} +HOST_VENDOR=${host_vendor} +HOST_OS=${host_os} -# export some useful defines -PBX_PLATFORM=${host} -PBX_CPU=${host_cpu} -PBX_VENDOR=${host_vendor} -PBX_OS=${host_os} @@ -2192,86 +2150,6 @@ if test ! x"${UNAME}" = xNo; then fi -# guest OS type -case "${host}" in - cygwin*|mingw*|windows*|winnt) - -cat >>confdefs.h <<\_ACEOF -#define Win32 1 -_ACEOF - - PBX_OSTYPE="CYGWIN" -# this is ugly - KPF - OSISWIN32=1 - - ;; - *linux*) - -cat >>confdefs.h <<\_ACEOF -#define Linux 1 -_ACEOF - - PBX_OSTYPE="Linux" - ;; - *netbsd*) - -cat >>confdefs.h <<\_ACEOF -#define NetBSD 1 -_ACEOF - - PBX_OSTYPE="NetBSD" - ;; - *freebsd*) - -cat >>confdefs.h <<\_ACEOF -#define FreeBSD 1 -_ACEOF - - PBX_OSTYPE="FreeBSD" - # XXX temporary hack to let FreeBSD use the default paths - # for local stuff. We need a better solution. - if test x"${CPPFLAGS}" = x; then - CPPFLAGS="-I/usr/local/include" - fi - if test x"${LDFLAGS}" = x; then - LDFLAGS="-L/usr/local/lib" - fi - ;; - *openbsd*) - -cat >>confdefs.h <<\_ACEOF -#define OpenBSD 1 -_ACEOF - - PBX_OSTYPE="OpenBSD" - ;; - *sun*) - -cat >>confdefs.h <<\_ACEOF -#define SunOS 1 -_ACEOF - - PBX_OSTYPE="SunOS" - ;; - *darwin*) - -cat >>confdefs.h <<\_ACEOF -#define Darwin 1 -_ACEOF - - PBX_OSTYPE="Darwin" - ;; - *) - -cat >>confdefs.h <<\_ACEOF -#define Unix 1 -_ACEOF - - PBX_OSTYPE="Unix" - ;; -esac - - # This needs to be before any macros that use the C compiler cat >>confdefs.h <<\_ACEOF @@ -2287,7 +2165,7 @@ _ACEOF # cross-compile checks -if test x"${build}" != x"${host}"; +if test "${cross_compiling}" = "yes"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. @@ -2482,15 +2360,15 @@ else fi if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 + # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args. +set dummy ${ac_tool_prefix}ld; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_RANLIB+set}" = set; then +if test "${ac_cv_prog_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. + if test -n "$LD"; then + ac_cv_prog_LD="$LD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -2499,7 +2377,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + ac_cv_prog_LD="${ac_tool_prefix}ld" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -2509,10 +2387,10 @@ IFS=$as_save_IFS fi fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - { echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6; } +LD=$ac_cv_prog_LD +if test -n "$LD"; then + { echo "$as_me:$LINENO: result: $LD" >&5 +echo "${ECHO_T}$LD" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } @@ -2520,17 +2398,17 @@ fi fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 +if test -z "$ac_cv_prog_LD"; then + ac_ct_LD=$LD + # Extract the first word of "ld", so it can be a program name with args. +set dummy ld; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then +if test "${ac_cv_prog_ac_ct_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. + if test -n "$ac_ct_LD"; then + ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -2539,7 +2417,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_RANLIB="ranlib" + ac_cv_prog_ac_ct_LD="ld" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -2549,17 +2427,17 @@ IFS=$as_save_IFS fi fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6; } +ac_ct_LD=$ac_cv_prog_ac_ct_LD +if test -n "$ac_ct_LD"; then + { echo "$as_me:$LINENO: result: $ac_ct_LD" >&5 +echo "${ECHO_T}$ac_ct_LD" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi - if test "x$ac_ct_RANLIB" = x; then - RANLIB=":" + if test "x$ac_ct_LD" = x; then + LD=":" else case $cross_compiling:$ac_tool_warned in yes:) @@ -2571,217 +2449,22 @@ whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac - RANLIB=$ac_ct_RANLIB + LD=$ac_ct_LD fi else - RANLIB="$ac_cv_prog_RANLIB" + LD="$ac_cv_prog_LD" fi if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. -set dummy ${ac_tool_prefix}ar; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_AR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AR="${ac_tool_prefix}ar" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - { echo "$as_me:$LINENO: result: $AR" >&5 -echo "${ECHO_T}$AR" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_AR"; then - ac_ct_AR=$AR - # Extract the first word of "ar", so it can be a program name with args. -set dummy ar; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_AR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_AR="ar" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_AR=$ac_cv_prog_ac_ct_AR -if test -n "$ac_ct_AR"; then - { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 -echo "${ECHO_T}$ac_ct_AR" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_AR" = x; then - AR=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - AR=$ac_ct_AR - fi -else - AR="$ac_cv_prog_AR" -fi - - - if test x"${PBX_OSTYPE}" = xWin32; - then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args. -set dummy ${ac_tool_prefix}nm; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_NM+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$NM"; then - ac_cv_prog_NM="$NM" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_NM="${ac_tool_prefix}nm" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -NM=$ac_cv_prog_NM -if test -n "$NM"; then - { echo "$as_me:$LINENO: result: $NM" >&5 -echo "${ECHO_T}$NM" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_NM"; then - ac_ct_NM=$NM - # Extract the first word of "nm", so it can be a program name with args. -set dummy nm; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_NM+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_NM"; then - ac_cv_prog_ac_ct_NM="$ac_ct_NM" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_NM="nm" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_NM=$ac_cv_prog_ac_ct_NM -if test -n "$ac_ct_NM"; then - { echo "$as_me:$LINENO: result: $ac_ct_NM" >&5 -echo "${ECHO_T}$ac_ct_NM" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_NM" = x; then - NM=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - NM=$ac_ct_NM - fi -else - NM="$ac_cv_prog_NM" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args. -set dummy ${ac_tool_prefix}windres; ac_word=$2 + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_WINDRES+set}" = set; then +if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$WINDRES"; then - ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test. + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -2790,7 +2473,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_WINDRES="${ac_tool_prefix}windres" + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -2800,10 +2483,10 @@ IFS=$as_save_IFS fi fi -WINDRES=$ac_cv_prog_WINDRES -if test -n "$WINDRES"; then - { echo "$as_me:$LINENO: result: $WINDRES" >&5 -echo "${ECHO_T}$WINDRES" >&6; } +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } @@ -2811,17 +2494,17 @@ fi fi -if test -z "$ac_cv_prog_WINDRES"; then - ac_ct_WINDRES=$WINDRES - # Extract the first word of "windres", so it can be a program name with args. -set dummy windres; ac_word=$2 +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_WINDRES+set}" = set; then +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$ac_ct_WINDRES"; then - ac_cv_prog_ac_ct_WINDRES="$ac_ct_WINDRES" # Let the user override the test. + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -2830,7 +2513,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_WINDRES="windres" + ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -2840,17 +2523,17 @@ IFS=$as_save_IFS fi fi -ac_ct_WINDRES=$ac_cv_prog_ac_ct_WINDRES -if test -n "$ac_ct_WINDRES"; then - { echo "$as_me:$LINENO: result: $ac_ct_WINDRES" >&5 -echo "${ECHO_T}$ac_ct_WINDRES" >&6; } +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi - if test "x$ac_ct_WINDRES" = x; then - WINDRES=":" + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) @@ -2862,22 +2545,22 @@ whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac - WINDRES=$ac_ct_WINDRES + RANLIB=$ac_ct_RANLIB fi else - WINDRES="$ac_cv_prog_WINDRES" + RANLIB="$ac_cv_prog_RANLIB" fi - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dllwrap", so it can be a program name with args. -set dummy ${ac_tool_prefix}dllwrap; ac_word=$2 + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_DLLWRAP+set}" = set; then +if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$DLLWRAP"; then - ac_cv_prog_DLLWRAP="$DLLWRAP" # Let the user override the test. + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -2886,7 +2569,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_DLLWRAP="${ac_tool_prefix}dllwrap" + ac_cv_prog_AR="${ac_tool_prefix}ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -2896,10 +2579,10 @@ IFS=$as_save_IFS fi fi -DLLWRAP=$ac_cv_prog_DLLWRAP -if test -n "$DLLWRAP"; then - { echo "$as_me:$LINENO: result: $DLLWRAP" >&5 -echo "${ECHO_T}$DLLWRAP" >&6; } +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } @@ -2907,17 +2590,17 @@ fi fi -if test -z "$ac_cv_prog_DLLWRAP"; then - ac_ct_DLLWRAP=$DLLWRAP - # Extract the first word of "dllwrap", so it can be a program name with args. -set dummy dllwrap; ac_word=$2 +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_DLLWRAP+set}" = set; then +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$ac_ct_DLLWRAP"; then - ac_cv_prog_ac_ct_DLLWRAP="$ac_ct_DLLWRAP" # Let the user override the test. + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -2926,7 +2609,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_DLLWRAP="dllwrap" + ac_cv_prog_ac_ct_AR="ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -2936,17 +2619,17 @@ IFS=$as_save_IFS fi fi -ac_ct_DLLWRAP=$ac_cv_prog_ac_ct_DLLWRAP -if test -n "$ac_ct_DLLWRAP"; then - { echo "$as_me:$LINENO: result: $ac_ct_DLLWRAP" >&5 -echo "${ECHO_T}$ac_ct_DLLWRAP" >&6; } +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 +echo "${ECHO_T}$ac_ct_AR" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi - if test "x$ac_ct_DLLWRAP" = x; then - DLLWRAP=":" + if test "x$ac_ct_AR" = x; then + AR=":" else case $cross_compiling:$ac_tool_warned in yes:) @@ -2958,14 +2641,12 @@ whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac - DLLWRAP=$ac_ct_DLLWRAP + AR=$ac_ct_AR fi else - DLLWRAP="$ac_cv_prog_DLLWRAP" + AR="$ac_cv_prog_AR" fi - fi - crossCompile="Yes" fi # Checks for programs. @@ -5620,6 +5301,33 @@ PBX_CURSES=0 +GNUTLS_DESCRIP="GNU TLS support (used for iksemel only)" +GNUTLS_OPTION="gnutls" + +# Check whether --with-gnutls was given. +if test "${with_gnutls+set}" = set; then + withval=$with_gnutls; +case ${withval} in + n|no) + USE_GNUTLS=no + ;; + y|ye|yes) + GNUTLS_MANDATORY="yes" + ;; + *) + GNUTLS_DIR="${withval}" + GNUTLS_MANDATORY="yes" + ;; +esac + +fi + +PBX_GNUTLS=0 + + + + + GSM_DESCRIP="GSM" GSM_OPTION="gsm" @@ -5701,6 +5409,33 @@ PBX_IMAP_TK=0 +ISDNNET_DESCRIP="ISDN4Linux Library" +ISDNNET_OPTION="isdnnet" + +# Check whether --with-isdnnet was given. +if test "${with_isdnnet+set}" = set; then + withval=$with_isdnnet; +case ${withval} in + n|no) + USE_ISDNNET=no + ;; + y|ye|yes) + ISDNNET_MANDATORY="yes" + ;; + *) + ISDNNET_DIR="${withval}" + ISDNNET_MANDATORY="yes" + ;; +esac + +fi + +PBX_ISDNNET=0 + + + + + KDE_DESCRIP="KDE" KDE_OPTION="kde" @@ -5728,6 +5463,33 @@ PBX_KDE=0 +MISDN_DESCRIP="mISDN User Library" +MISDN_OPTION="misdn" + +# Check whether --with-misdn was given. +if test "${with_misdn+set}" = set; then + withval=$with_misdn; +case ${withval} in + n|no) + USE_MISDN=no + ;; + y|ye|yes) + MISDN_MANDATORY="yes" + ;; + *) + MISDN_DIR="${withval}" + MISDN_MANDATORY="yes" + ;; +esac + +fi + +PBX_MISDN=0 + + + + + NBS_DESCRIP="Network Broadcast Sound" NBS_OPTION="nbs" @@ -6160,6 +5922,33 @@ PBX_SQLITE=0 +SUPPSERV_DESCRIP="mISDN Supplemental Services" +SUPPSERV_OPTION="suppserv" + +# Check whether --with-suppserv was given. +if test "${with_suppserv+set}" = set; then + withval=$with_suppserv; +case ${withval} in + n|no) + USE_SUPPSERV=no + ;; + y|ye|yes) + SUPPSERV_MANDATORY="yes" + ;; + *) + SUPPSERV_DIR="${withval}" + SUPPSERV_MANDATORY="yes" + ;; +esac + +fi + +PBX_SUPPSERV=0 + + + + + OPENSSL_DESCRIP="OpenSSL" OPENSSL_OPTION="ssl" @@ -10878,260 +10667,10 @@ echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6; } fi fi - -for ac_header in stdlib.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - -{ echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 -echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6; } -if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_func_malloc_0_nonnull=no -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if STDC_HEADERS || HAVE_STDLIB_H -# include <stdlib.h> -#else -char *malloc (); -#endif - -int -main () -{ -return ! malloc (0); - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_malloc_0_nonnull=yes -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_malloc_0_nonnull=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 -echo "${ECHO_T}$ac_cv_func_malloc_0_nonnull" >&6; } -if test $ac_cv_func_malloc_0_nonnull = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_MALLOC 1 -_ACEOF - -else - cat >>confdefs.h <<\_ACEOF -#define HAVE_MALLOC 0 -_ACEOF - - case " $LIBOBJS " in - *" malloc.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS malloc.$ac_objext" - ;; -esac - - -cat >>confdefs.h <<\_ACEOF -#define malloc rpl_malloc -_ACEOF - -fi - - - +# XXX: these are commented out until we determine whether it matters if our malloc() +# acts exactly like glibc's or not +# AC_FUNC_MALLOC +# AC_FUNC_REALLOC { echo "$as_me:$LINENO: checking for working memcmp" >&5 echo $ECHO_N "checking for working memcmp... $ECHO_C" >&6; } if test "${ac_cv_func_memcmp_working+set}" = set; then @@ -12180,260 +11719,6 @@ fi rm -f conftest.mmap -for ac_header in stdlib.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - -{ echo "$as_me:$LINENO: checking for GNU libc compatible realloc" >&5 -echo $ECHO_N "checking for GNU libc compatible realloc... $ECHO_C" >&6; } -if test "${ac_cv_func_realloc_0_nonnull+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_func_realloc_0_nonnull=no -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#if STDC_HEADERS || HAVE_STDLIB_H -# include <stdlib.h> -#else -char *realloc (); -#endif - -int -main () -{ -return ! realloc (0, 0); - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_realloc_0_nonnull=yes -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_func_realloc_0_nonnull=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_realloc_0_nonnull" >&5 -echo "${ECHO_T}$ac_cv_func_realloc_0_nonnull" >&6; } -if test $ac_cv_func_realloc_0_nonnull = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_REALLOC 1 -_ACEOF - -else - cat >>confdefs.h <<\_ACEOF -#define HAVE_REALLOC 0 -_ACEOF - - case " $LIBOBJS " in - *" realloc.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS realloc.$ac_objext" - ;; -esac - - -cat >>confdefs.h <<\_ACEOF -#define realloc rpl_realloc -_ACEOF - -fi - - - - for ac_header in sys/select.h sys/socket.h do @@ -14299,6 +13584,422 @@ fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext +{ echo "$as_me:$LINENO: checking checking for res_ninit" >&5 +echo $ECHO_N "checking checking for res_ninit... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <resolv.h> +int +main () +{ +int foo = res_ninit(NULL); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + +cat >>confdefs.h <<\_ACEOF +#define HAVE_RES_NINIT 1 +_ACEOF + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + +fi + +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + + +{ echo "$as_me:$LINENO: checking checking for compiler 'attribute pure' support" >&5 +echo $ECHO_N "checking checking for compiler 'attribute pure' support... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +static int __attribute__((pure)) test(void) {} +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + +cat >>confdefs.h <<_ACEOF +#define HAVE_ATTRIBUTE_pure 1 +_ACEOF + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + +{ echo "$as_me:$LINENO: checking checking for compiler 'attribute malloc' support" >&5 +echo $ECHO_N "checking checking for compiler 'attribute malloc' support... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +static int __attribute__((malloc)) test(void) {} +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + +cat >>confdefs.h <<_ACEOF +#define HAVE_ATTRIBUTE_malloc 1 +_ACEOF + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + +{ echo "$as_me:$LINENO: checking checking for compiler 'attribute const' support" >&5 +echo $ECHO_N "checking checking for compiler 'attribute const' support... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +static int __attribute__((const)) test(void) {} +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + +cat >>confdefs.h <<_ACEOF +#define HAVE_ATTRIBUTE_const 1 +_ACEOF + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + +{ echo "$as_me:$LINENO: checking checking for compiler 'attribute unused' support" >&5 +echo $ECHO_N "checking checking for compiler 'attribute unused' support... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +static int __attribute__((unused)) test(void) {} +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + +cat >>confdefs.h <<_ACEOF +#define HAVE_ATTRIBUTE_unused 1 +_ACEOF + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + +{ echo "$as_me:$LINENO: checking checking for compiler 'attribute always_inline' support" >&5 +echo $ECHO_N "checking checking for compiler 'attribute always_inline' support... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +static int __attribute__((always_inline)) test(void) {} +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + +cat >>confdefs.h <<_ACEOF +#define HAVE_ATTRIBUTE_always_inline 1 +_ACEOF + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + if test "${ac_cv_header_libkern_OSAtomic_h+set}" = set; then { echo "$as_me:$LINENO: checking for libkern/OSAtomic.h" >&5 echo $ECHO_N "checking for libkern/OSAtomic.h... $ECHO_C" >&6; } @@ -15882,6 +15583,7 @@ fi GSM_INTERNAL="yes" + GSM_SYSTEM="yes" if test "${USE_GSM}" != "no"; then if test "${GSM_DIR}" = "internal"; then @@ -15994,7 +15696,6 @@ fi fi fi if test "${GSM_INTERNAL}" = "yes"; then - GSM_LIB="internal" PBX_GSM=1 fi fi @@ -16459,6 +16160,471 @@ echo "$as_me: *** without explicitly specifying --with-${IKSEMEL_OPTION}" >&6;} fi +if test "${PBX_IKSEMEL}" = 1; then + +if test "${USE_GNUTLS}" != "no"; then + pbxlibdir="" + if test "x${GNUTLS_DIR}" != "x"; then + if test -d ${GNUTLS_DIR}/lib; then + pbxlibdir="-L${GNUTLS_DIR}/lib" + else + pbxlibdir="-L${GNUTLS_DIR}" + fi + fi + { echo "$as_me:$LINENO: checking for gnutls_bye in -lgnutls" >&5 +echo $ECHO_N "checking for gnutls_bye in -lgnutls... $ECHO_C" >&6; } +if test "${ac_cv_lib_gnutls_gnutls_bye+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgnutls ${pbxlibdir} $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gnutls_bye (); +int +main () +{ +return gnutls_bye (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_gnutls_gnutls_bye=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_gnutls_gnutls_bye=no +fi + +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_gnutls_gnutls_bye" >&5 +echo "${ECHO_T}$ac_cv_lib_gnutls_gnutls_bye" >&6; } +if test $ac_cv_lib_gnutls_gnutls_bye = yes; then + AST_GNUTLS_FOUND=yes +else + AST_GNUTLS_FOUND=no +fi + + + if test "${AST_GNUTLS_FOUND}" = "yes"; then + GNUTLS_LIB="-lgnutls " + GNUTLS_HEADER_FOUND="1" + if test "x${GNUTLS_DIR}" != "x"; then + GNUTLS_LIB="${pbxlibdir} ${GNUTLS_LIB}" + GNUTLS_INCLUDE="-I${GNUTLS_DIR}/include" + if test "x" != "x" ; then + as_ac_Header=`echo "ac_cv_header_${GNUTLS_DIR}/include/" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for ${GNUTLS_DIR}/include/" >&5 +echo $ECHO_N "checking for ${GNUTLS_DIR}/include/... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking ${GNUTLS_DIR}/include/ usability" >&5 +echo $ECHO_N "checking ${GNUTLS_DIR}/include/ usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <${GNUTLS_DIR}/include/> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking ${GNUTLS_DIR}/include/ presence" >&5 +echo $ECHO_N "checking ${GNUTLS_DIR}/include/ presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <${GNUTLS_DIR}/include/> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: ${GNUTLS_DIR}/include/: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: ${GNUTLS_DIR}/include/: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: ${GNUTLS_DIR}/include/: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: ${GNUTLS_DIR}/include/: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: ${GNUTLS_DIR}/include/: present but cannot be compiled" >&5 +echo "$as_me: WARNING: ${GNUTLS_DIR}/include/: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: ${GNUTLS_DIR}/include/: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: ${GNUTLS_DIR}/include/: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: ${GNUTLS_DIR}/include/: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: ${GNUTLS_DIR}/include/: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: ${GNUTLS_DIR}/include/: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: ${GNUTLS_DIR}/include/: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: ${GNUTLS_DIR}/include/: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: ${GNUTLS_DIR}/include/: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: ${GNUTLS_DIR}/include/: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: ${GNUTLS_DIR}/include/: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for ${GNUTLS_DIR}/include/" >&5 +echo $ECHO_N "checking for ${GNUTLS_DIR}/include/... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + GNUTLS_HEADER_FOUND=1 +else + GNUTLS_HEADER_FOUND=0 +fi + + + fi + else + if test "x" != "x" ; then + if test "${ac_cv_header_+set}" = set; then + { echo "$as_me:$LINENO: checking for " >&5 +echo $ECHO_N "checking for ... $ECHO_C" >&6; } +if test "${ac_cv_header_+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 +echo "${ECHO_T}$ac_cv_header_" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking usability" >&5 +echo $ECHO_N "checking usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking presence" >&5 +echo $ECHO_N "checking presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: : proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: : proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: : present but cannot be compiled" >&5 +echo "$as_me: WARNING: : present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: : check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: : check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: : see the Autoconf documentation" >&5 +echo "$as_me: WARNING: : see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: : section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: : section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: : proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: : proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: : in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: : in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for " >&5 +echo $ECHO_N "checking for ... $ECHO_C" >&6; } +if test "${ac_cv_header_+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 +echo "${ECHO_T}$ac_cv_header_" >&6; } + +fi +if test $ac_cv_header_ = yes; then + GNUTLS_HEADER_FOUND=1 +else + GNUTLS_HEADER_FOUND=0 +fi + + + fi + fi + if test "x${GNUTLS_HEADER_FOUND}" = "x0" ; then + if test ! -z "${GNUTLS_MANDATORY}" ; + then + { echo "$as_me:$LINENO: ***" >&5 +echo "$as_me: ***" >&6;} + { echo "$as_me:$LINENO: *** It appears that you do not have the gnutls development package installed." >&5 +echo "$as_me: *** It appears that you do not have the gnutls development package installed." >&6;} + { echo "$as_me:$LINENO: *** Please install it to include ${GNUTLS_DESCRIP} support" >&5 +echo "$as_me: *** Please install it to include ${GNUTLS_DESCRIP} support" >&or re-run configure;} + { echo "$as_me:$LINENO: *** without explicitly specifying --with-${GNUTLS_OPTION}" >&5 +echo "$as_me: *** without explicitly specifying --with-${GNUTLS_OPTION}" >&6;} + exit 1 + fi + GNUTLS_LIB="" + GNUTLS_INCLUDE="" + PBX_GNUTLS=0 + else + PBX_GNUTLS=1 + +cat >>confdefs.h <<_ACEOF +#define HAVE_GNUTLS 1 +_ACEOF + + fi + elif test ! -z "${GNUTLS_MANDATORY}"; + then + { echo "$as_me:$LINENO: ***" >&5 +echo "$as_me: ***" >&6;} + { echo "$as_me:$LINENO: *** The ${GNUTLS_DESCRIP} installation on this system appears to be broken." >&5 +echo "$as_me: *** The ${GNUTLS_DESCRIP} installation on this system appears to be broken." >&6;} + { echo "$as_me:$LINENO: *** Either correct the installation" >&5 +echo "$as_me: *** Either correct the installation" >&or run configure;} + { echo "$as_me:$LINENO: *** without explicitly specifying --with-${GNUTLS_OPTION}" >&5 +echo "$as_me: *** without explicitly specifying --with-${GNUTLS_OPTION}" >&6;} + exit 1 + fi +fi + + if test "${PBX_GNUTLS}" = 1; then + IKSEMEL_LIB="${IKSEMEL_LIB} -lgnutls -ltasn1 -lz -lgcrypt -lnsl -lgpg-error" + fi +fi + if test "${USE_IMAP_TK}" != "no"; then if test "${IMAP_TK_DIR}" = ""; then IMAP_TK_DIR=`pwd`"/../imap-2004g" @@ -16962,6 +17128,1387 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test "${USE_MISDN}" != "no"; then + pbxlibdir="" + if test "x${MISDN_DIR}" != "x"; then + if test -d ${MISDN_DIR}/lib; then + pbxlibdir="-L${MISDN_DIR}/lib" + else + pbxlibdir="-L${MISDN_DIR}" + fi + fi + { echo "$as_me:$LINENO: checking for mISDN_open in -lmISDN" >&5 +echo $ECHO_N "checking for mISDN_open in -lmISDN... $ECHO_C" >&6; } +if test "${ac_cv_lib_mISDN_mISDN_open+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lmISDN ${pbxlibdir} $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char mISDN_open (); +int +main () +{ +return mISDN_open (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_mISDN_mISDN_open=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_mISDN_mISDN_open=no +fi + +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_mISDN_mISDN_open" >&5 +echo "${ECHO_T}$ac_cv_lib_mISDN_mISDN_open" >&6; } +if test $ac_cv_lib_mISDN_mISDN_open = yes; then + AST_MISDN_FOUND=yes +else + AST_MISDN_FOUND=no +fi + + + if test "${AST_MISDN_FOUND}" = "yes"; then + MISDN_LIB="-lmISDN " + MISDN_HEADER_FOUND="1" + if test "x${MISDN_DIR}" != "x"; then + MISDN_LIB="${pbxlibdir} ${MISDN_LIB}" + MISDN_INCLUDE="-I${MISDN_DIR}/include" + if test "xmISDNuser/mISDNlib.h" != "x" ; then + as_ac_Header=`echo "ac_cv_header_${MISDN_DIR}/include/mISDNuser/mISDNlib.h" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for ${MISDN_DIR}/include/mISDNuser/mISDNlib.h" >&5 +echo $ECHO_N "checking for ${MISDN_DIR}/include/mISDNuser/mISDNlib.h... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking ${MISDN_DIR}/include/mISDNuser/mISDNlib.h usability" >&5 +echo $ECHO_N "checking ${MISDN_DIR}/include/mISDNuser/mISDNlib.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <${MISDN_DIR}/include/mISDNuser/mISDNlib.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking ${MISDN_DIR}/include/mISDNuser/mISDNlib.h presence" >&5 +echo $ECHO_N "checking ${MISDN_DIR}/include/mISDNuser/mISDNlib.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <${MISDN_DIR}/include/mISDNuser/mISDNlib.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for ${MISDN_DIR}/include/mISDNuser/mISDNlib.h" >&5 +echo $ECHO_N "checking for ${MISDN_DIR}/include/mISDNuser/mISDNlib.h... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + MISDN_HEADER_FOUND=1 +else + MISDN_HEADER_FOUND=0 +fi + + + fi + else + if test "xmISDNuser/mISDNlib.h" != "x" ; then + if test "${ac_cv_header_mISDNuser_mISDNlib_h+set}" = set; then + { echo "$as_me:$LINENO: checking for mISDNuser/mISDNlib.h" >&5 +echo $ECHO_N "checking for mISDNuser/mISDNlib.h... $ECHO_C" >&6; } +if test "${ac_cv_header_mISDNuser_mISDNlib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_mISDNuser_mISDNlib_h" >&5 +echo "${ECHO_T}$ac_cv_header_mISDNuser_mISDNlib_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking mISDNuser/mISDNlib.h usability" >&5 +echo $ECHO_N "checking mISDNuser/mISDNlib.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <mISDNuser/mISDNlib.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking mISDNuser/mISDNlib.h presence" >&5 +echo $ECHO_N "checking mISDNuser/mISDNlib.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <mISDNuser/mISDNlib.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: mISDNuser/mISDNlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: mISDNuser/mISDNlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: mISDNuser/mISDNlib.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: mISDNuser/mISDNlib.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: mISDNuser/mISDNlib.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: mISDNuser/mISDNlib.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: mISDNuser/mISDNlib.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: mISDNuser/mISDNlib.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: mISDNuser/mISDNlib.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: mISDNuser/mISDNlib.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: mISDNuser/mISDNlib.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: mISDNuser/mISDNlib.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: mISDNuser/mISDNlib.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: mISDNuser/mISDNlib.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: mISDNuser/mISDNlib.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: mISDNuser/mISDNlib.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for mISDNuser/mISDNlib.h" >&5 +echo $ECHO_N "checking for mISDNuser/mISDNlib.h... $ECHO_C" >&6; } +if test "${ac_cv_header_mISDNuser_mISDNlib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_mISDNuser_mISDNlib_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_mISDNuser_mISDNlib_h" >&5 +echo "${ECHO_T}$ac_cv_header_mISDNuser_mISDNlib_h" >&6; } + +fi +if test $ac_cv_header_mISDNuser_mISDNlib_h = yes; then + MISDN_HEADER_FOUND=1 +else + MISDN_HEADER_FOUND=0 +fi + + + fi + fi + if test "x${MISDN_HEADER_FOUND}" = "x0" ; then + if test ! -z "${MISDN_MANDATORY}" ; + then + { echo "$as_me:$LINENO: ***" >&5 +echo "$as_me: ***" >&6;} + { echo "$as_me:$LINENO: *** It appears that you do not have the mISDN development package installed." >&5 +echo "$as_me: *** It appears that you do not have the mISDN development package installed." >&6;} + { echo "$as_me:$LINENO: *** Please install it to include ${MISDN_DESCRIP} support" >&5 +echo "$as_me: *** Please install it to include ${MISDN_DESCRIP} support" >&or re-run configure;} + { echo "$as_me:$LINENO: *** without explicitly specifying --with-${MISDN_OPTION}" >&5 +echo "$as_me: *** without explicitly specifying --with-${MISDN_OPTION}" >&6;} + exit 1 + fi + MISDN_LIB="" + MISDN_INCLUDE="" + PBX_MISDN=0 + else + PBX_MISDN=1 + +cat >>confdefs.h <<_ACEOF +#define HAVE_MISDN 1 +_ACEOF + + fi + elif test ! -z "${MISDN_MANDATORY}"; + then + { echo "$as_me:$LINENO: ***" >&5 +echo "$as_me: ***" >&6;} + { echo "$as_me:$LINENO: *** The ${MISDN_DESCRIP} installation on this system appears to be broken." >&5 +echo "$as_me: *** The ${MISDN_DESCRIP} installation on this system appears to be broken." >&6;} + { echo "$as_me:$LINENO: *** Either correct the installation" >&5 +echo "$as_me: *** Either correct the installation" >&or run configure;} + { echo "$as_me:$LINENO: *** without explicitly specifying --with-${MISDN_OPTION}" >&5 +echo "$as_me: *** without explicitly specifying --with-${MISDN_OPTION}" >&6;} + exit 1 + fi +fi + + +if test "${PBX_MISDN}" = 1; then + +if test "${USE_ISDNNET}" != "no"; then + pbxlibdir="" + if test "x${ISDNNET_DIR}" != "x"; then + if test -d ${ISDNNET_DIR}/lib; then + pbxlibdir="-L${ISDNNET_DIR}/lib" + else + pbxlibdir="-L${ISDNNET_DIR}" + fi + fi + { echo "$as_me:$LINENO: checking for init_manager in -lisdnnet" >&5 +echo $ECHO_N "checking for init_manager in -lisdnnet... $ECHO_C" >&6; } +if test "${ac_cv_lib_isdnnet_init_manager+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lisdnnet ${pbxlibdir} -lmISDN -lpthread $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char init_manager (); +int +main () +{ +return init_manager (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_isdnnet_init_manager=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_isdnnet_init_manager=no +fi + +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_isdnnet_init_manager" >&5 +echo "${ECHO_T}$ac_cv_lib_isdnnet_init_manager" >&6; } +if test $ac_cv_lib_isdnnet_init_manager = yes; then + AST_ISDNNET_FOUND=yes +else + AST_ISDNNET_FOUND=no +fi + + + if test "${AST_ISDNNET_FOUND}" = "yes"; then + ISDNNET_LIB="-lisdnnet -lmISDN -lpthread" + ISDNNET_HEADER_FOUND="1" + if test "x${ISDNNET_DIR}" != "x"; then + ISDNNET_LIB="${pbxlibdir} ${ISDNNET_LIB}" + ISDNNET_INCLUDE="-I${ISDNNET_DIR}/include" + if test "xmISDNuser/isdn_net.h" != "x" ; then + as_ac_Header=`echo "ac_cv_header_${ISDNNET_DIR}/include/mISDNuser/isdn_net.h" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h" >&5 +echo $ECHO_N "checking for ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h usability" >&5 +echo $ECHO_N "checking ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <${ISDNNET_DIR}/include/mISDNuser/isdn_net.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h presence" >&5 +echo $ECHO_N "checking ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <${ISDNNET_DIR}/include/mISDNuser/isdn_net.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h" >&5 +echo $ECHO_N "checking for ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + ISDNNET_HEADER_FOUND=1 +else + ISDNNET_HEADER_FOUND=0 +fi + + + fi + else + if test "xmISDNuser/isdn_net.h" != "x" ; then + if test "${ac_cv_header_mISDNuser_isdn_net_h+set}" = set; then + { echo "$as_me:$LINENO: checking for mISDNuser/isdn_net.h" >&5 +echo $ECHO_N "checking for mISDNuser/isdn_net.h... $ECHO_C" >&6; } +if test "${ac_cv_header_mISDNuser_isdn_net_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_mISDNuser_isdn_net_h" >&5 +echo "${ECHO_T}$ac_cv_header_mISDNuser_isdn_net_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking mISDNuser/isdn_net.h usability" >&5 +echo $ECHO_N "checking mISDNuser/isdn_net.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <mISDNuser/isdn_net.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking mISDNuser/isdn_net.h presence" >&5 +echo $ECHO_N "checking mISDNuser/isdn_net.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <mISDNuser/isdn_net.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: mISDNuser/isdn_net.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: mISDNuser/isdn_net.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: mISDNuser/isdn_net.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: mISDNuser/isdn_net.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: mISDNuser/isdn_net.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: mISDNuser/isdn_net.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: mISDNuser/isdn_net.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: mISDNuser/isdn_net.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: mISDNuser/isdn_net.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: mISDNuser/isdn_net.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: mISDNuser/isdn_net.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: mISDNuser/isdn_net.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: mISDNuser/isdn_net.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: mISDNuser/isdn_net.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: mISDNuser/isdn_net.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: mISDNuser/isdn_net.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for mISDNuser/isdn_net.h" >&5 +echo $ECHO_N "checking for mISDNuser/isdn_net.h... $ECHO_C" >&6; } +if test "${ac_cv_header_mISDNuser_isdn_net_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_mISDNuser_isdn_net_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_mISDNuser_isdn_net_h" >&5 +echo "${ECHO_T}$ac_cv_header_mISDNuser_isdn_net_h" >&6; } + +fi +if test $ac_cv_header_mISDNuser_isdn_net_h = yes; then + ISDNNET_HEADER_FOUND=1 +else + ISDNNET_HEADER_FOUND=0 +fi + + + fi + fi + if test "x${ISDNNET_HEADER_FOUND}" = "x0" ; then + if test ! -z "${ISDNNET_MANDATORY}" ; + then + { echo "$as_me:$LINENO: ***" >&5 +echo "$as_me: ***" >&6;} + { echo "$as_me:$LINENO: *** It appears that you do not have the isdnnet development package installed." >&5 +echo "$as_me: *** It appears that you do not have the isdnnet development package installed." >&6;} + { echo "$as_me:$LINENO: *** Please install it to include ${ISDNNET_DESCRIP} support" >&5 +echo "$as_me: *** Please install it to include ${ISDNNET_DESCRIP} support" >&or re-run configure;} + { echo "$as_me:$LINENO: *** without explicitly specifying --with-${ISDNNET_OPTION}" >&5 +echo "$as_me: *** without explicitly specifying --with-${ISDNNET_OPTION}" >&6;} + exit 1 + fi + ISDNNET_LIB="" + ISDNNET_INCLUDE="" + PBX_ISDNNET=0 + else + PBX_ISDNNET=1 + +cat >>confdefs.h <<_ACEOF +#define HAVE_ISDNNET 1 +_ACEOF + + fi + elif test ! -z "${ISDNNET_MANDATORY}"; + then + { echo "$as_me:$LINENO: ***" >&5 +echo "$as_me: ***" >&6;} + { echo "$as_me:$LINENO: *** The ${ISDNNET_DESCRIP} installation on this system appears to be broken." >&5 +echo "$as_me: *** The ${ISDNNET_DESCRIP} installation on this system appears to be broken." >&6;} + { echo "$as_me:$LINENO: *** Either correct the installation" >&5 +echo "$as_me: *** Either correct the installation" >&or run configure;} + { echo "$as_me:$LINENO: *** without explicitly specifying --with-${ISDNNET_OPTION}" >&5 +echo "$as_me: *** without explicitly specifying --with-${ISDNNET_OPTION}" >&6;} + exit 1 + fi +fi + + +if test "${USE_SUPPSERV}" != "no"; then + pbxlibdir="" + if test "x${SUPPSERV_DIR}" != "x"; then + if test -d ${SUPPSERV_DIR}/lib; then + pbxlibdir="-L${SUPPSERV_DIR}/lib" + else + pbxlibdir="-L${SUPPSERV_DIR}" + fi + fi + { echo "$as_me:$LINENO: checking for encodeFac in -lsuppserv" >&5 +echo $ECHO_N "checking for encodeFac in -lsuppserv... $ECHO_C" >&6; } +if test "${ac_cv_lib_suppserv_encodeFac+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsuppserv ${pbxlibdir} $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char encodeFac (); +int +main () +{ +return encodeFac (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_suppserv_encodeFac=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_suppserv_encodeFac=no +fi + +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_suppserv_encodeFac" >&5 +echo "${ECHO_T}$ac_cv_lib_suppserv_encodeFac" >&6; } +if test $ac_cv_lib_suppserv_encodeFac = yes; then + AST_SUPPSERV_FOUND=yes +else + AST_SUPPSERV_FOUND=no +fi + + + if test "${AST_SUPPSERV_FOUND}" = "yes"; then + SUPPSERV_LIB="-lsuppserv " + SUPPSERV_HEADER_FOUND="1" + if test "x${SUPPSERV_DIR}" != "x"; then + SUPPSERV_LIB="${pbxlibdir} ${SUPPSERV_LIB}" + SUPPSERV_INCLUDE="-I${SUPPSERV_DIR}/include" + if test "xmISDNuser/suppserv.h" != "x" ; then + as_ac_Header=`echo "ac_cv_header_${SUPPSERV_DIR}/include/mISDNuser/suppserv.h" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h" >&5 +echo $ECHO_N "checking for ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h usability" >&5 +echo $ECHO_N "checking ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <${SUPPSERV_DIR}/include/mISDNuser/suppserv.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h presence" >&5 +echo $ECHO_N "checking ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <${SUPPSERV_DIR}/include/mISDNuser/suppserv.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h" >&5 +echo $ECHO_N "checking for ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + SUPPSERV_HEADER_FOUND=1 +else + SUPPSERV_HEADER_FOUND=0 +fi + + + fi + else + if test "xmISDNuser/suppserv.h" != "x" ; then + if test "${ac_cv_header_mISDNuser_suppserv_h+set}" = set; then + { echo "$as_me:$LINENO: checking for mISDNuser/suppserv.h" >&5 +echo $ECHO_N "checking for mISDNuser/suppserv.h... $ECHO_C" >&6; } +if test "${ac_cv_header_mISDNuser_suppserv_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_mISDNuser_suppserv_h" >&5 +echo "${ECHO_T}$ac_cv_header_mISDNuser_suppserv_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking mISDNuser/suppserv.h usability" >&5 +echo $ECHO_N "checking mISDNuser/suppserv.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <mISDNuser/suppserv.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking mISDNuser/suppserv.h presence" >&5 +echo $ECHO_N "checking mISDNuser/suppserv.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <mISDNuser/suppserv.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: mISDNuser/suppserv.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: mISDNuser/suppserv.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: mISDNuser/suppserv.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: mISDNuser/suppserv.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: mISDNuser/suppserv.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: mISDNuser/suppserv.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: mISDNuser/suppserv.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: mISDNuser/suppserv.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: mISDNuser/suppserv.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: mISDNuser/suppserv.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: mISDNuser/suppserv.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: mISDNuser/suppserv.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: mISDNuser/suppserv.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: mISDNuser/suppserv.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: mISDNuser/suppserv.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: mISDNuser/suppserv.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for mISDNuser/suppserv.h" >&5 +echo $ECHO_N "checking for mISDNuser/suppserv.h... $ECHO_C" >&6; } +if test "${ac_cv_header_mISDNuser_suppserv_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_mISDNuser_suppserv_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_mISDNuser_suppserv_h" >&5 +echo "${ECHO_T}$ac_cv_header_mISDNuser_suppserv_h" >&6; } + +fi +if test $ac_cv_header_mISDNuser_suppserv_h = yes; then + SUPPSERV_HEADER_FOUND=1 +else + SUPPSERV_HEADER_FOUND=0 +fi + + + fi + fi + if test "x${SUPPSERV_HEADER_FOUND}" = "x0" ; then + if test ! -z "${SUPPSERV_MANDATORY}" ; + then + { echo "$as_me:$LINENO: ***" >&5 +echo "$as_me: ***" >&6;} + { echo "$as_me:$LINENO: *** It appears that you do not have the suppserv development package installed." >&5 +echo "$as_me: *** It appears that you do not have the suppserv development package installed." >&6;} + { echo "$as_me:$LINENO: *** Please install it to include ${SUPPSERV_DESCRIP} support" >&5 +echo "$as_me: *** Please install it to include ${SUPPSERV_DESCRIP} support" >&or re-run configure;} + { echo "$as_me:$LINENO: *** without explicitly specifying --with-${SUPPSERV_OPTION}" >&5 +echo "$as_me: *** without explicitly specifying --with-${SUPPSERV_OPTION}" >&6;} + exit 1 + fi + SUPPSERV_LIB="" + SUPPSERV_INCLUDE="" + PBX_SUPPSERV=0 + else + PBX_SUPPSERV=1 + +cat >>confdefs.h <<_ACEOF +#define HAVE_SUPPSERV 1 +_ACEOF + + fi + elif test ! -z "${SUPPSERV_MANDATORY}"; + then + { echo "$as_me:$LINENO: ***" >&5 +echo "$as_me: ***" >&6;} + { echo "$as_me:$LINENO: *** The ${SUPPSERV_DESCRIP} installation on this system appears to be broken." >&5 +echo "$as_me: *** The ${SUPPSERV_DESCRIP} installation on this system appears to be broken." >&6;} + { echo "$as_me:$LINENO: *** Either correct the installation" >&5 +echo "$as_me: *** Either correct the installation" >&or run configure;} + { echo "$as_me:$LINENO: *** without explicitly specifying --with-${SUPPSERV_OPTION}" >&5 +echo "$as_me: *** without explicitly specifying --with-${SUPPSERV_OPTION}" >&6;} + exit 1 + fi +fi + +fi + + if test "${USE_NBS}" != "no"; then pbxlibdir="" if test "x${NBS_DIR}" != "x"; then @@ -18697,7 +20244,7 @@ if test "${ac_cv_lib_odbc_SQLConnect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lodbc ${pbxlibdir} $LIBS" +LIBS="-lodbc ${pbxlibdir} -lltdl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -18776,7 +20323,7 @@ fi if test "${AST_UNIXODBC_FOUND}" = "yes"; then - UNIXODBC_LIB="-lodbc " + UNIXODBC_LIB="-lodbc -lltdl" UNIXODBC_HEADER_FOUND="1" if test "x${UNIXODBC_DIR}" != "x"; then UNIXODBC_LIB="${pbxlibdir} ${UNIXODBC_LIB}" @@ -21162,7 +22709,7 @@ fi if test "${ac_cv_lib_pq_PQexec}" = "yes"; then - PGSQL_LIB="-L${PGSQL_libdir} -lpq -lz" + PGSQL_LIB="-L${PGSQL_libdir} -lpq -lz -lcrypt" PGSQL_INCLUDE="-I${PGSQL_includedir}" PBX_PGSQL=1 elif test ! -z "${PGSQL_MANDATORY}"; @@ -25750,7 +27297,7 @@ echo "$as_me: *** without explicitly specifying --with-${TINFO_OPTION}" >&6;} fi -if test "${PBX_OSTYPE}" != "Linux" ; then +if test "${host_os}" != "linux-gnu" ; then tonezone_extra="-lm" fi @@ -27822,7 +29369,7 @@ fi if test ! x"${CURL}" = xNo; then # check for version - if test $PBX_OSTYPE = "SunOS"; then + if test "${host_os}" = "SunOS"; then if [ 0x`curl-config --vernum` -ge 0x70907 ]; then CURLLIB=$(${CURL} --libs) PBX_CURL=1 @@ -28498,25 +30045,21 @@ host!$host$ac_delim host_cpu!$host_cpu$ac_delim host_vendor!$host_vendor$ac_delim host_os!$host_os$ac_delim -target!$target$ac_delim -target_cpu!$target_cpu$ac_delim -target_vendor!$target_vendor$ac_delim -target_os!$target_os$ac_delim -PBX_PLATFORM!$PBX_PLATFORM$ac_delim -PBX_CPU!$PBX_CPU$ac_delim -PBX_VENDOR!$PBX_VENDOR$ac_delim -PBX_OS!$PBX_OS$ac_delim +BUILD_PLATFORM!$BUILD_PLATFORM$ac_delim +BUILD_CPU!$BUILD_CPU$ac_delim +BUILD_VENDOR!$BUILD_VENDOR$ac_delim +BUILD_OS!$BUILD_OS$ac_delim +HOST_PLATFORM!$HOST_PLATFORM$ac_delim +HOST_CPU!$HOST_CPU$ac_delim +HOST_VENDOR!$HOST_VENDOR$ac_delim +HOST_OS!$HOST_OS$ac_delim UNAME!$UNAME$ac_delim PBX_OSREV!$PBX_OSREV$ac_delim -OSISWIN32!$OSISWIN32$ac_delim -PBX_OSTYPE!$PBX_OSTYPE$ac_delim CC!$CC$ac_delim CXX!$CXX$ac_delim +LD!$LD$ac_delim RANLIB!$RANLIB$ac_delim AR!$AR$ac_delim -NM!$NM$ac_delim -WINDRES!$WINDRES$ac_delim -DLLWRAP!$DLLWRAP$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim @@ -28547,9 +30090,13 @@ PBX_ALSA!$PBX_ALSA$ac_delim CURSES_LIB!$CURSES_LIB$ac_delim CURSES_INCLUDE!$CURSES_INCLUDE$ac_delim PBX_CURSES!$PBX_CURSES$ac_delim +GNUTLS_LIB!$GNUTLS_LIB$ac_delim +GNUTLS_INCLUDE!$GNUTLS_INCLUDE$ac_delim +PBX_GNUTLS!$PBX_GNUTLS$ac_delim GSM_LIB!$GSM_LIB$ac_delim GSM_INCLUDE!$GSM_INCLUDE$ac_delim PBX_GSM!$PBX_GSM$ac_delim +IKSEMEL_LIB!$IKSEMEL_LIB$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then @@ -28591,15 +30138,20 @@ _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF -IKSEMEL_LIB!$IKSEMEL_LIB$ac_delim IKSEMEL_INCLUDE!$IKSEMEL_INCLUDE$ac_delim PBX_IKSEMEL!$PBX_IKSEMEL$ac_delim IMAP_TK_LIB!$IMAP_TK_LIB$ac_delim IMAP_TK_INCLUDE!$IMAP_TK_INCLUDE$ac_delim PBX_IMAP_TK!$PBX_IMAP_TK$ac_delim +ISDNNET_LIB!$ISDNNET_LIB$ac_delim +ISDNNET_INCLUDE!$ISDNNET_INCLUDE$ac_delim +PBX_ISDNNET!$PBX_ISDNNET$ac_delim KDE_LIB!$KDE_LIB$ac_delim KDE_INCLUDE!$KDE_INCLUDE$ac_delim PBX_KDE!$PBX_KDE$ac_delim +MISDN_LIB!$MISDN_LIB$ac_delim +MISDN_INCLUDE!$MISDN_INCLUDE$ac_delim +PBX_MISDN!$PBX_MISDN$ac_delim NBS_LIB!$NBS_LIB$ac_delim NBS_INCLUDE!$NBS_INCLUDE$ac_delim PBX_NBS!$PBX_NBS$ac_delim @@ -28648,6 +30200,9 @@ PBX_SPEEX!$PBX_SPEEX$ac_delim SQLITE_LIB!$SQLITE_LIB$ac_delim SQLITE_INCLUDE!$SQLITE_INCLUDE$ac_delim PBX_SQLITE!$PBX_SQLITE$ac_delim +SUPPSERV_LIB!$SUPPSERV_LIB$ac_delim +SUPPSERV_INCLUDE!$SUPPSERV_INCLUDE$ac_delim +PBX_SUPPSERV!$PBX_SUPPSERV$ac_delim OPENSSL_LIB!$OPENSSL_LIB$ac_delim OPENSSL_INCLUDE!$OPENSSL_INCLUDE$ac_delim PBX_OPENSSL!$PBX_OPENSSL$ac_delim @@ -28679,15 +30234,7 @@ ALLOCA!$ALLOCA$ac_delim EGREP!$EGREP$ac_delim LIBOBJS!$LIBOBJS$ac_delim POW_LIB!$POW_LIB$ac_delim -KDEINIT!$KDEINIT$ac_delim -KDEDIR!$KDEDIR$ac_delim -NETSNMP_CONFIG!$NETSNMP_CONFIG$ac_delim -PG_CONFIG!$PG_CONFIG$ac_delim -QTMOC!$QTMOC$ac_delim -EDITLINE_LIB!$EDITLINE_LIB$ac_delim -PBX_H323!$PBX_H323$ac_delim -PBX_IXJUSER!$PBX_IXJUSER$ac_delim -GTKCONFIG!$GTKCONFIG$ac_delim +GSM_INTERNAL!$GSM_INTERNAL$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then @@ -28729,6 +30276,15 @@ _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF +KDEINIT!$KDEINIT$ac_delim +KDEDIR!$KDEDIR$ac_delim +NETSNMP_CONFIG!$NETSNMP_CONFIG$ac_delim +PG_CONFIG!$PG_CONFIG$ac_delim +QTMOC!$QTMOC$ac_delim +EDITLINE_LIB!$EDITLINE_LIB$ac_delim +PBX_H323!$PBX_H323$ac_delim +PBX_IXJUSER!$PBX_IXJUSER$ac_delim +GTKCONFIG!$GTKCONFIG$ac_delim PBX_GTK!$PBX_GTK$ac_delim GTK_INCLUDE!$GTK_INCLUDE$ac_delim GTK_LIB!$GTK_LIB$ac_delim @@ -28738,7 +30294,7 @@ CURLLIB!$CURLLIB$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 7; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 16; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 @@ -29196,17 +30752,13 @@ fi { echo "$as_me:$LINENO: Package configured for: " >&5 echo "$as_me: Package configured for: " >&6;} -{ echo "$as_me:$LINENO: OS type : $PBX_OSTYPE" >&5 -echo "$as_me: OS type : $PBX_OSTYPE" >&6;} +{ echo "$as_me:$LINENO: OS type : $host_os" >&5 +echo "$as_me: OS type : $host_os" >&6;} { echo "$as_me:$LINENO: Host CPU : $host_cpu" >&5 echo "$as_me: Host CPU : $host_cpu" >&6;} -if test "x${crossCompile}" = xYes; then - { echo "$as_me:$LINENO: " >&5 -echo "$as_me: " >&6;} +if test "${cross_compiling}" = "yes"; then { echo "$as_me:$LINENO: Cross Compilation = YES" >&5 echo "$as_me: Cross Compilation = YES" >&6;} - { echo "$as_me:$LINENO: Target = ${host}" >&5 -echo "$as_me: Target = ${host}" >&6;} fi if test ${GNU_MAKE_VERSION_MAJOR} -lt 3 || test ${GNU_MAKE_VERSION_MINOR} -lt 81 ; then diff --git a/configure.ac b/configure.ac index d4559cdc4..0a68a6ed8 100644 --- a/configure.ac +++ b/configure.ac @@ -11,10 +11,9 @@ AC_INIT(asterisk, PBX_VERSION, www.asterisk.org) # cross-compile macros AC_CANONICAL_BUILD AC_CANONICAL_HOST -AC_CANONICAL_TARGET # check existence of the package -AC_CONFIG_SRCDIR([asterisk.c]) +AC_CONFIG_SRCDIR([main/asterisk.c]) # specify output header file AC_CONFIG_HEADER(include/asterisk/autoconfig.h) @@ -22,8 +21,8 @@ AC_CONFIG_HEADER(include/asterisk/autoconfig.h) AC_COPYRIGHT("Asterisk") AC_REVISION($Revision$) -case "${host}" in - *freebsd*) +case "${host_os}" in + freebsd) ac_default_prefix=/usr/local ;; *) @@ -41,25 +40,25 @@ if test ${localstatedir} = '${prefix}/var'; then localstatedir=/var fi -### ** Platform. -AC_DEFINE_UNQUOTED(PBX_PLATFORM, "${host}", -[Define this to be the canonical name (cpu-vendor-os) of your system.]) -AC_DEFINE_UNQUOTED(PBX_CPU, "${host_cpu}", -[Define this to be the name of the CPU of your system.]) -AC_DEFINE_UNQUOTED(PBX_VENDOR, "${host_vendor}", -[Define this to be the name of the vendor of your system.]) -AC_DEFINE_UNQUOTED(PBX_OS, "${host_os}", -[Define this to be the name of the OS of your system.]) - -# export some useful defines -PBX_PLATFORM=${host} -PBX_CPU=${host_cpu} -PBX_VENDOR=${host_vendor} -PBX_OS=${host_os} -AC_SUBST(PBX_PLATFORM) -AC_SUBST(PBX_CPU) -AC_SUBST(PBX_VENDOR) -AC_SUBST(PBX_OS) +BUILD_PLATFORM=${build} +BUILD_CPU=${build_cpu} +BUILD_VENDOR=${build_vendor} +BUILD_OS=${build_os} + +AC_SUBST(BUILD_PLATFORM) +AC_SUBST(BUILD_CPU) +AC_SUBST(BUILD_VENDOR) +AC_SUBST(BUILD_OS) + +HOST_PLATFORM=${host} +HOST_CPU=${host_cpu} +HOST_VENDOR=${host_vendor} +HOST_OS=${host_os} + +AC_SUBST(HOST_PLATFORM) +AC_SUBST(HOST_CPU) +AC_SUBST(HOST_VENDOR) +AC_SUBST(HOST_OS) # check for uname AC_PATH_TOOL([UNAME], [uname], No) @@ -68,62 +67,6 @@ if test ! x"${UNAME}" = xNo; then fi AC_SUBST(PBX_OSREV) -# guest OS type -case "${host}" in - cygwin*|mingw*|windows*|winnt) - AC_DEFINE(Win32, 1, - [Define according to your operating system type.]) - PBX_OSTYPE="CYGWIN" -# this is ugly - KPF - OSISWIN32=1 - AC_SUBST(OSISWIN32) - ;; - *linux*) - AC_DEFINE(Linux, 1, - [Define according to your operating system type.]) - PBX_OSTYPE="Linux" - ;; - *netbsd*) - AC_DEFINE(NetBSD, 1, - [Define according to your operating system type.]) - PBX_OSTYPE="NetBSD" - ;; - *freebsd*) - AC_DEFINE(FreeBSD, 1, - [Define according to your operating system type.]) - PBX_OSTYPE="FreeBSD" - # XXX temporary hack to let FreeBSD use the default paths - # for local stuff. We need a better solution. - if test x"${CPPFLAGS}" = x; then - CPPFLAGS="-I/usr/local/include" - fi - if test x"${LDFLAGS}" = x; then - LDFLAGS="-L/usr/local/lib" - fi - ;; - *openbsd*) - AC_DEFINE(OpenBSD, 1, - [Define according to your operating system type.]) - PBX_OSTYPE="OpenBSD" - ;; - *sun*) - AC_DEFINE(SunOS, 1, - [Define according to your operating system type.]) - PBX_OSTYPE="SunOS" - ;; - *darwin*) - AC_DEFINE(Darwin, 1, - [Define according to your operating system type.]) - PBX_OSTYPE="Darwin" - ;; - *) - AC_DEFINE(Unix, 1, - [Define according to your operating system type.]) - PBX_OSTYPE="Unix" - ;; -esac -AC_SUBST(PBX_OSTYPE) - # This needs to be before any macros that use the C compiler AC_GNU_SOURCE @@ -145,20 +88,13 @@ AH_BOTTOM( ) # cross-compile checks -if test x"${build}" != x"${host}"; +if test "${cross_compiling}" = "yes"; then AC_CHECK_TOOL(CC, gcc, :) AC_CHECK_TOOL(CXX, g++, :) + AC_CHECK_TOOL(LD, ld, :) AC_CHECK_TOOL(RANLIB, ranlib, :) AC_CHECK_TOOL(AR, ar, :) - - if test x"${PBX_OSTYPE}" = xWin32; - then - AC_CHECK_TOOL(NM, nm, :) - AC_CHECK_TOOL(WINDRES, windres, :) - AC_CHECK_TOOL(DLLWRAP, dllwrap, :) - fi - crossCompile="Yes" fi # Checks for programs. @@ -198,10 +134,13 @@ AC_SUBST(AST_DEVMODE) AST_EXT_LIB_SETUP([ALSA], [Advanced Linux Sound Architecture], [asound]) AST_EXT_LIB_SETUP([CURSES], [curses], [curses]) +AST_EXT_LIB_SETUP([GNUTLS], [GNU TLS support (used for iksemel only)], [gnutls]) AST_EXT_LIB_SETUP([GSM], [GSM], [gsm], [, or 'internal']) AST_EXT_LIB_SETUP([IKSEMEL], [Iksemel Jabber Library], [iksemel]) AST_EXT_LIB_SETUP([IMAP_TK], [UW IMAP Toolkit], [imap]) +AST_EXT_LIB_SETUP([ISDNNET], [ISDN4Linux Library], [isdnnet]) AST_EXT_LIB_SETUP([KDE], [KDE], [kde]) +AST_EXT_LIB_SETUP([MISDN], [mISDN User Library], [misdn]) AST_EXT_LIB_SETUP([NBS], [Network Broadcast Sound], [nbs]) AST_EXT_LIB_SETUP([NCURSES], [ncurses], [ncurses]) AST_EXT_LIB_SETUP([NETSNMP], [Net-SNMP], [netsnmp]) @@ -218,6 +157,7 @@ AST_EXT_LIB_SETUP([QT], [Qt], [qt]) AST_EXT_LIB_SETUP([RADIUS], [Radius Client], [radius]) AST_EXT_LIB_SETUP([SPEEX], [Speex], [speex]) AST_EXT_LIB_SETUP([SQLITE], [SQLite], [sqlite]) +AST_EXT_LIB_SETUP([SUPPSERV], [mISDN Supplemental Services], [suppserv]) AST_EXT_LIB_SETUP([OPENSSL], [OpenSSL], [ssl]) AST_EXT_LIB_SETUP([FREETDS], [FreeTDS], [tds]) AST_EXT_LIB_SETUP([TERMCAP], [Termcap], [termcap]) @@ -261,11 +201,13 @@ AC_FUNC_ERROR_AT_LINE AC_FUNC_FORK AC_FUNC_FSEEKO AC_PROG_GCC_TRADITIONAL -AC_FUNC_MALLOC +# XXX: these are commented out until we determine whether it matters if our malloc() +# acts exactly like glibc's or not +# AC_FUNC_MALLOC +# AC_FUNC_REALLOC AC_FUNC_MEMCMP AC_FUNC_MKTIME AC_FUNC_MMAP -AC_FUNC_REALLOC AC_FUNC_SELECT_ARGTYPES AC_FUNC_SETVBUF_REVERSED AC_TYPE_SIGNAL @@ -286,6 +228,21 @@ AC_DEFINE([HAVE_GCC_ATOMICS], 1, [Define to 1 if your GCC C compiler provides at AC_MSG_RESULT(no) ) +AC_MSG_CHECKING(checking for res_ninit) +AC_LINK_IFELSE( + AC_LANG_PROGRAM([#include <resolv.h>], + [int foo = res_ninit(NULL);]), + AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_RES_NINIT], 1, [Define t |