[packages] asterisk-1.6.x update to 1.6.2.13 and add pbx_spool
[openwrt/svn-archive/archive.git] / net / asterisk-1.6.x / Makefile
1 #
2 # Copyright (C) 2008-2010 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=asterisk
11 PKG_VERSION:=1.6.2.13
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://downloads.digium.com/pub/asterisk/releases/
16 PKG_MD5SUM:=1e184a4d9301e2e4b9de3bc98b507d4f
17
18 include $(INCLUDE_DIR)/package.mk
19
20 define Package/asterisk16/Default
21 SUBMENU:=asterisk16 (Complete Open Source PBX), v1.6.x
22 SECTION:=net
23 CATEGORY:=Network
24 URL:=http://www.asterisk.org/
25 MAINTAINER:=Hans Zandbelt <hans.zandbelt@gmail.com>
26 endef
27
28 define Package/asterisk16/Default/description
29 Asterisk is a complete PBX in software. It provides all of the features
30 you would expect from a PBX and more. Asterisk does voice over IP in three
31 protocols, and can interoperate with almost all standards-based telephony
32 equipment using relatively inexpensive hardware.
33 endef
34
35
36 define Package/asterisk16
37 $(call Package/asterisk16/Default)
38 TITLE:=Complete open source PBX
39 DEPENDS:= +libopenssl +libncurses +libpopt +libpthread +zlib @!TARGET_avr32 @!PACKAGE_asterisk14
40 endef
41
42 define Package/asterisk16/description
43 $(call Package/asterisk16/Default/description)
44 endef
45
46 define Package/asterisk16-sounds
47 $(call Package/asterisk16/Default)
48 TITLE:=Sound files
49 DEPENDS:= +asterisk16
50 endef
51
52 define Package/asterisk16-sounds/description
53 $(call Package/asterisk16/Default/description)
54 This package contains sound files for Asterisk.
55 endef
56
57
58 define Package/asterisk16-voicemail
59 $(call Package/asterisk16/Default)
60 TITLE:=Voicemail support
61 DEPENDS:= +asterisk16
62 endef
63
64 define Package/asterisk16-voicemail/description
65 $(call Package/asterisk16/Default/description)
66 This package contains voicemail related modules for Asterisk.
67 endef
68
69 define Package/asterisk16-app-meetme
70 $(call Package/asterisk16/Default)
71 TITLE:=conferencing support
72 DEPENDS:= +asterisk16 +dahdi-tools-libtonezone +kmod-dahdi-linux
73 endef
74
75 define Package/asterisk16-app-meetme/description
76 $(call Package/asterisk16/Default/description)
77 This package provides the MeetMe application driver Conferencing support to
78 Asterisk.
79 endef
80
81 define Package/asterisk16-chan-iax2
82 $(call Package/asterisk16/Default)
83 TITLE:=IAX support
84 DEPENDS:= +asterisk16
85 endef
86
87 define Package/asterisk16-chan-iax2/description
88 $(call Package/asterisk16/Default/description)
89 This package provides IAX support to
90 Asterisk.
91 endef
92
93 define Package/asterisk16-cdr
94 $(call Package/asterisk16/Default)
95 TITLE:=CDR support
96 DEPENDS:= +asterisk16
97 endef
98
99 define Package/asterisk16-cdr/description
100 $(call Package/asterisk16/Default/description)
101 This package provides Call Detail Record support to
102 Asterisk.
103 endef
104
105 define Package/asterisk16-res-musiconhold
106 $(call Package/asterisk16/Default)
107 TITLE:=MOH support
108 DEPENDS:= +asterisk16
109 endef
110
111 define Package/asterisk16-res-musiconhold/description
112 $(call Package/asterisk16/Default/description)
113 This package provides Music On Hold support to
114 Asterisk.
115 endef
116
117 define Package/asterisk16-chan-gtalk
118 $(call Package/asterisk16/Default)
119 TITLE:=GTalk support
120 DEPENDS:= +asterisk16 +libiksemel
121 endef
122
123 define Package/asterisk16-chan-gtalk/description
124 $(call Package/asterisk16/Default/description)
125 This package provides the channel chan_gtalk and res_jabber for GTalk
126 support to Asterisk.
127 endef
128
129 define Package/asterisk16-curl
130 $(call Package/asterisk16/Default)
131 TITLE:=CURL support
132 DEPENDS:= +asterisk16 +libcurl
133 endef
134
135 define Package/asterisk16-curl/description
136 $(call Package/asterisk16/Default/description)
137 This package provides CURL
138 support to Asterisk.
139 endef
140
141 ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk16-app-meetme),)
142 CONFIGURE_ARGS+= \
143 --with-dahdi="$(STAGING_DIR)/usr"
144 else
145 CONFIGURE_ARGS+= \
146 --without-dahdi
147 endif
148
149 ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk16-chan-gtalk),)
150 CONFIGURE_ARGS+= \
151 --with-gnutls="$(STAGING_DIR)/usr" \
152 --with-iksemel="$(STAGING_DIR)/usr"
153 SITE_VARS+= \
154 ac_cv_lib_iksemel_iks_start_sasl=yes \
155 ac_cv_lib_gnutls_gnutls_bye=yes
156 else
157 CONFIGURE_ARGS+= \
158 --without-gnutls \
159 --without-iksemel
160 endif
161
162 ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk16-curl),)
163 CONFIGURE_ARGS+= \
164 --with-curl="$(STAGING_DIR)/usr"
165 else
166 CONFIGURE_ARGS+= \
167 --without-curl
168 endif
169
170 CONFIGURE_ARGS+= \
171 --without-curses \
172 --with-gsm=internal \
173 --without-gtk \
174 --without-gtk2 \
175 --without-isdnnet \
176 --without-kde \
177 --without-misdn \
178 --without-nbs \
179 --with-ncurses="$(STAGING_DIR)/usr" \
180 --without-netsnmp \
181 --without-newt \
182 --without-odbc \
183 --without-ogg \
184 --without-osptk \
185 --with-popt="$(STAGING_DIR)/usr" \
186 --without-pri \
187 --without-qt \
188 --without-radius \
189 --without-sdl \
190 --without-spandsp \
191 --without-suppserv \
192 --without-tds \
193 --without-termcap \
194 --without-tinfo \
195 --without-vorbis \
196 --without-vpb \
197 --with-z="$(STAGING_DIR)/usr" \
198 --disable-xmldoc
199
200 EXTRA_CFLAGS+= $(TARGET_CPPFLAGS)
201 EXTRA_LDFLAGS+= $(TARGET_LDFLAGS)
202
203 define Build/Configure
204 -rm $(PKG_BUILD_DIR)/menuselect.makeopts
205 $(call Build/Configure/Default,,$(SITE_VARS))
206 endef
207
208 define Build/Compile
209 $(MAKE) -C "$(PKG_BUILD_DIR)" \
210 include/asterisk/version.h \
211 include/asterisk/buildopts.h defaults.h \
212 makeopts.embed_rules
213 ASTCFLAGS="$(EXTRA_CFLAGS) -DLOW_MEMORY" \
214 ASTLDFLAGS="$(EXTRA_LDFLAGS)" \
215 $(MAKE) -C "$(PKG_BUILD_DIR)" \
216 ASTVARLIBDIR="/usr/lib/asterisk" \
217 NOISY_BUILD="1" \
218 DEBUG="" \
219 OPTIMIZE="" \
220 DESTDIR="$(PKG_INSTALL_DIR)" \
221 all install samples
222 $(SED) 's|/var/lib/asterisk|/usr/lib/asterisk|g' $(PKG_INSTALL_DIR)/etc/asterisk/musiconhold.conf
223 endef
224
225 #define Build/InstallDev
226 # $(INSTALL_DIR) $(1)/usr/include/asterisk/
227 # $(CP) $(PKG_INSTALL_DIR)/usr/include/asterisk/*.h $(1)/usr/include/asterisk/
228 # $(CP) $(PKG_INSTALL_DIR)/usr/include/asterisk.h $(1)/usr/include/
229 #endef
230
231 define Package/asterisk16/conffiles
232 /etc/asterisk/asterisk.conf
233 /etc/asterisk/modules.conf
234 /etc/asterisk/extensions.conf
235 /etc/asterisk/sip.conf
236 /etc/asterisk/sip_notify.conf
237 /etc/asterisk/features.conf
238 /etc/asterisk/indications.conf
239 /etc/asterisk/logger.conf
240 /etc/asterisk/manager.conf
241 /etc/asterisk/rtp.conf
242 /etc/default/asterisk
243 /etc/init.d/asterisk
244 endef
245
246 define Package/asterisk16/install
247 $(INSTALL_DIR) $(1)/etc/asterisk
248 for f in asterisk extensions features \
249 indications logger manager modules \
250 sip sip_notify rtp; do \
251 $(CP) $(PKG_INSTALL_DIR)/etc/asterisk/$$$$f.conf $(1)/etc/asterisk/ ; \
252 done
253 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
254 for f in app_dial app_echo app_playback app_macro \
255 chan_sip \
256 codec_ulaw codec_gsm \
257 format_gsm format_pcm format_wav format_wav_gsm \
258 pbx_config \
259 func_strings func_timeout func_callerid func_logic; do \
260 $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/$$$$f.so $(1)/usr/lib/asterisk/modules/ ; \
261 done
262 $(INSTALL_DIR) $(1)/usr/sbin
263 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/asterisk $(1)/usr/sbin/
264 $(INSTALL_DIR) $(1)/etc/default
265 $(INSTALL_DATA) ./files/asterisk.default $(1)/etc/default/asterisk
266 $(INSTALL_DIR) $(1)/etc/init.d
267 $(INSTALL_BIN) ./files/asterisk.init $(1)/etc/init.d/asterisk
268 endef
269
270 define Package/asterisk16-sounds/install
271 $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
272 $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/* $(1)/usr/lib/asterisk/sounds/
273 rm -f $(1)/usr/lib/asterisk/sounds/vm-*
274 rm -f $(1)/usr/lib/asterisk/sounds/conf-*
275 endef
276
277
278 define Package/asterisk16-voicemail/conffiles
279 /etc/asterisk/voicemail.conf
280 endef
281
282 define Package/asterisk16-voicemail/install
283 $(INSTALL_DIR) $(1)/etc/asterisk
284 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/voicemail.conf $(1)/etc/asterisk/
285 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
286 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/*voicemail.so $(1)/usr/lib/asterisk/modules/
287 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_adsi.so $(1)/usr/lib/asterisk/modules/
288 $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
289 $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/vm-*.gsm $(1)/usr/lib/asterisk/sounds/
290 endef
291
292 define Package/asterisk16-app-meetme/conffiles
293 /etc/asterisk/meetme.conf
294 endef
295
296 define Package/asterisk16-app-meetme/install
297 $(INSTALL_DIR) $(1)/etc/asterisk
298 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/meetme.conf $(1)/etc/asterisk/
299 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
300 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/app_meetme.so $(1)/usr/lib/asterisk/modules/
301 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_dahdi.so $(1)/usr/lib/asterisk/modules/
302 $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
303 $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/conf-*.gsm $(1)/usr/lib/asterisk/sounds/
304 endef
305
306 define Package/asterisk16-chan-iax2/conffiles
307 /etc/asterisk/iax.conf
308 /etc/asterisk/iaxprov.conf
309 endef
310
311 define Package/asterisk16-cdr/conffiles
312 /etc/asterisk/cdr.conf
313 /etc/asterisk/cdr_custom.conf
314 /etc/asterisk/cdr_manager.conf
315 /etc/asterisk/cdr_odbc.conf
316 /etc/asterisk/cdr_pgsql.conf
317 /etc/asterisk/cdr_tds.conf
318 endef
319
320 define Package/asterisk16-res-musiconhold/conffiles
321 /etc/asterisk/musiconhold.conf
322 endef
323
324 define Package/asterisk16-chan-iax2/install
325 $(INSTALL_DIR) $(1)/etc/asterisk
326 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/iax.conf $(1)/etc/asterisk/
327 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/iaxprov.conf $(1)/etc/asterisk/
328 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
329 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_iax2.so $(1)/usr/lib/asterisk/modules/
330 endef
331
332 define Package/asterisk16-cdr/install
333 $(INSTALL_DIR) $(1)/etc/asterisk
334 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/cdr*.conf $(1)/etc/asterisk/
335 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
336 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/*cdr*.so $(1)/usr/lib/asterisk/modules/
337 endef
338
339 define Package/asterisk16-res-musiconhold/install
340 $(INSTALL_DIR) $(1)/etc/asterisk
341 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/musiconhold.conf $(1)/etc/asterisk/
342 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
343 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_musiconhold.so $(1)/usr/lib/asterisk/modules/
344 endef
345
346 define Package/asterisk16-chan-gtalk/conffiles
347 /etc/asterisk/gtalk.conf
348 /etc/asterisk/jabber.conf
349 endef
350
351 define Package/asterisk16-chan-gtalk/install
352 $(INSTALL_DIR) $(1)/etc/asterisk
353 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/gtalk.conf $(1)/etc/asterisk/
354 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/jabber.conf $(1)/etc/asterisk/
355 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
356 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_gtalk.so $(1)/usr/lib/asterisk/modules/
357 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_jabber.so $(1)/usr/lib/asterisk/modules/
358 endef
359
360 define Package/asterisk16-curl/install
361 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
362 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/func_curl.so $(1)/usr/lib/asterisk/modules/
363 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_curl.so $(1)/usr/lib/asterisk/modules/
364 endef
365
366 define BuildAsterisk16ModuleTemplate
367
368 define Package/asterisk16-$(subst _,-,$(1))
369 $$(call Package/asterisk16/Default)
370 TITLE:=$(2) support
371 DEPENDS:= +asterisk16
372 endef
373
374 define Package/asterisk16-$(subst _,-,$(1))/description
375 $$(call Package/asterisk16/Default/description)
376 This package provides support $(3) in Asterisk.
377 endef
378
379 define Package/asterisk16-$(subst _,-,$(1))/install
380 $(INSTALL_DIR) $$(1)/usr/lib/asterisk/modules
381 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/$(1).so $$(1)/usr/lib/asterisk/modules/
382 endef
383
384 $$(eval $$(call BuildPackage,asterisk16-$(subst _,-,$(1))))
385 endef
386
387 $(eval $(call BuildPackage,asterisk16))
388 $(eval $(call BuildPackage,asterisk16-voicemail))
389 $(eval $(call BuildPackage,asterisk16-sounds))
390 #$(eval $(call BuildPackage,asterisk16-app-meetme))
391 $(eval $(call BuildPackage,asterisk16-chan-iax2))
392 $(eval $(call BuildPackage,asterisk16-cdr))
393 $(eval $(call BuildPackage,asterisk16-res-musiconhold))
394 $(eval $(call BuildPackage,asterisk16-chan-gtalk))
395 $(eval $(call BuildPackage,asterisk16-curl))
396 $(eval $(call BuildAsterisk16ModuleTemplate,app_authenticate,Authenticate,support for executing arbitrary authenticate commands))
397 $(eval $(call BuildAsterisk16ModuleTemplate,app_chanisavail,Channel availability check,support for checking if a channel is available))
398 $(eval $(call BuildAsterisk16ModuleTemplate,app_chanspy,Channel listen in,support for listening in on any channel))
399 $(eval $(call BuildAsterisk16ModuleTemplate,app_directed_pickup,Directed call pickup,support for directed call pickup))
400 $(eval $(call BuildAsterisk16ModuleTemplate,app_exec,Exec application,support for application execution))
401 $(eval $(call BuildAsterisk16ModuleTemplate,app_minivm,Minimal voicemail system,a voicemail system in small building blocks working together based on the Comedian Mail voicemail system))
402 $(eval $(call BuildAsterisk16ModuleTemplate,app_readexten,Extension to variable,a trivial application to read an extension into a variable))
403 $(eval $(call BuildAsterisk16ModuleTemplate,app_read,Variable read,a trivial application to read a variable))
404 $(eval $(call BuildAsterisk16ModuleTemplate,app_sayunixtime,Say Unix time,an application to say Unix time))
405 $(eval $(call BuildAsterisk16ModuleTemplate,app_sms,SMS,SMS support (ETSI ES 201 912 protocol 1)))
406 $(eval $(call BuildAsterisk16ModuleTemplate,app_stack,Stack applications, stack applications Gosub Return etc.))
407 $(eval $(call BuildAsterisk16ModuleTemplate,app_system,System exec,support for executing system commands))
408 $(eval $(call BuildAsterisk16ModuleTemplate,app_talkdetect,File playback with audio detect,for file playback with audio detect))
409 $(eval $(call BuildAsterisk16ModuleTemplate,app_waituntil,Sleep,support sleeping until the given epoch))
410 $(eval $(call BuildAsterisk16ModuleTemplate,app_while,While loop,a while loop implementation))
411 $(eval $(call BuildAsterisk16ModuleTemplate,chan_agent,Agents proxy channel, an implementation of agents proxy channel))
412 $(eval $(call BuildAsterisk16ModuleTemplate,chan_local,Local proxy channel, an implementation of local proxy channel))
413 $(eval $(call BuildAsterisk16ModuleTemplate,codec_ulaw,Signed linear to ulaw translation,translation between signed linear and ulaw codecs))
414 $(eval $(call BuildAsterisk16ModuleTemplate,codec_a_mu,Alaw to ulaw translation,translation between alaw and ulaw codecs))
415 $(eval $(call BuildAsterisk16ModuleTemplate,codec_g726,Signed linear to G.726 translation,translation between signed linear and ITU G.726-32kbps codecs))
416 $(eval $(call BuildAsterisk16ModuleTemplate,format_g726,G.726,support for headerless G.726 16/24/32/40kbps data format))
417 $(eval $(call BuildAsterisk16ModuleTemplate,format_g729,G.729,support for raw headerless G729 data))
418 $(eval $(call BuildAsterisk16ModuleTemplate,format_sln,Raw slinear format,support for raw slinear format))
419 $(eval $(call BuildAsterisk16ModuleTemplate,format_sln16,Raw slinear 16 format,support for Raw slinear 16 format))
420 $(eval $(call BuildAsterisk16ModuleTemplate,func_db,Database interaction,functions for interaction with the database))
421 $(eval $(call BuildAsterisk16ModuleTemplate,func_devstate,Blinky lights control,functions for manually controlled blinky lights))
422 $(eval $(call BuildAsterisk16ModuleTemplate,func_vmcount,vmcount dialplan,a vmcount dialplan function))
423 $(eval $(call BuildAsterisk16ModuleTemplate,func_extstate,Hinted extension state,retrieving the state of a hinted extension for dialplan control))
424 $(eval $(call BuildAsterisk16ModuleTemplate,func_global,Global variable,global variable dialplan functions))
425 $(eval $(call BuildAsterisk16ModuleTemplate,func_shell,Shell,support for shell execution))
426 $(eval $(call BuildAsterisk16ModuleTemplate,pbx_ael,Asterisk Extension Logic,support for symbolic Asterisk Extension Logic))
427 $(eval $(call BuildAsterisk16ModuleTemplate,res_ael_share,Shareable AEL code,support for shareable AEL code mainly between internal and external modules))
428 $(eval $(call BuildAsterisk16ModuleTemplate,pbx_spool,Call Spool,outgoing call spool support))
429 $(eval $(call BuildAsterisk16ModuleTemplate,res_agi,Asterisk Gateway Interface,support for the Asterisk Gateway Interface extension))
430