2 # Copyright (C) 2008-2010 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://downloads.digium.com/pub/asterisk/releases/
16 PKG_MD5SUM:=1e184a4d9301e2e4b9de3bc98b507d4f
18 include $(INCLUDE_DIR)/package.mk
20 define Package/asterisk16/Default
21 SUBMENU:=asterisk16 (Complete Open Source PBX), v1.6.x
24 URL:=http://www.asterisk.org/
25 MAINTAINER:=Hans Zandbelt <hans.zandbelt@gmail.com>
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.
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
42 define Package/asterisk16/description
43 $(call Package/asterisk16/Default/description)
46 define Package/asterisk16-sounds
47 $(call Package/asterisk16/Default)
52 define Package/asterisk16-sounds/description
53 $(call Package/asterisk16/Default/description)
54 This package contains sound files for Asterisk.
58 define Package/asterisk16-voicemail
59 $(call Package/asterisk16/Default)
60 TITLE:=Voicemail support
64 define Package/asterisk16-voicemail/description
65 $(call Package/asterisk16/Default/description)
66 This package contains voicemail related modules for Asterisk.
69 define Package/asterisk16-app-meetme
70 $(call Package/asterisk16/Default)
71 TITLE:=conferencing support
72 DEPENDS:= +asterisk16 +dahdi-tools-libtonezone +kmod-dahdi-linux
75 define Package/asterisk16-app-meetme/description
76 $(call Package/asterisk16/Default/description)
77 This package provides the MeetMe application driver Conferencing support to
81 define Package/asterisk16-chan-iax2
82 $(call Package/asterisk16/Default)
87 define Package/asterisk16-chan-iax2/description
88 $(call Package/asterisk16/Default/description)
89 This package provides IAX support to
93 define Package/asterisk16-cdr
94 $(call Package/asterisk16/Default)
99 define Package/asterisk16-cdr/description
100 $(call Package/asterisk16/Default/description)
101 This package provides Call Detail Record support to
105 define Package/asterisk16-res-musiconhold
106 $(call Package/asterisk16/Default)
108 DEPENDS:= +asterisk16
111 define Package/asterisk16-res-musiconhold/description
112 $(call Package/asterisk16/Default/description)
113 This package provides Music On Hold support to
117 define Package/asterisk16-chan-gtalk
118 $(call Package/asterisk16/Default)
120 DEPENDS:= +asterisk16 +libiksemel
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
129 define Package/asterisk16-curl
130 $(call Package/asterisk16/Default)
132 DEPENDS:= +asterisk16 +libcurl
135 define Package/asterisk16-curl/description
136 $(call Package/asterisk16/Default/description)
137 This package provides CURL
141 ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk16-app-meetme),)
143 --with-dahdi="$(STAGING_DIR)/usr"
149 ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk16-chan-gtalk),)
151 --with-gnutls="$(STAGING_DIR)/usr" \
152 --with-iksemel="$(STAGING_DIR)/usr"
154 ac_cv_lib_iksemel_iks_start_sasl=yes \
155 ac_cv_lib_gnutls_gnutls_bye=yes
162 ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk16-curl),)
164 --with-curl="$(STAGING_DIR)/usr"
172 --with-gsm=internal \
179 --with-ncurses="$(STAGING_DIR)/usr" \
185 --with-popt="$(STAGING_DIR)/usr" \
197 --with-z="$(STAGING_DIR)/usr" \
200 EXTRA_CFLAGS+= $(TARGET_CPPFLAGS)
201 EXTRA_LDFLAGS+= $(TARGET_LDFLAGS)
203 define Build/Configure
204 -rm $(PKG_BUILD_DIR)/menuselect.makeopts
205 $(call Build/Configure/Default,,$(SITE_VARS))
209 $(MAKE) -C "$(PKG_BUILD_DIR)" \
210 include/asterisk/version.h \
211 include/asterisk/buildopts.h defaults.h \
213 ASTCFLAGS="$(EXTRA_CFLAGS) -DLOW_MEMORY" \
214 ASTLDFLAGS="$(EXTRA_LDFLAGS)" \
215 $(MAKE) -C "$(PKG_BUILD_DIR)" \
216 ASTVARLIBDIR="/usr/lib/asterisk" \
220 DESTDIR="$(PKG_INSTALL_DIR)" \
222 $(SED) 's|/var/lib/asterisk|/usr/lib/asterisk|g' $(PKG_INSTALL_DIR)/etc/asterisk/musiconhold.conf
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/
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
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/ ; \
253 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
254 for f in app_dial app_echo app_playback app_macro \
256 codec_ulaw codec_gsm \
257 format_gsm format_pcm format_wav format_wav_gsm \
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/ ; \
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
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-*
278 define Package/asterisk16-voicemail/conffiles
279 /etc/asterisk/voicemail.conf
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/
292 define Package/asterisk16-app-meetme/conffiles
293 /etc/asterisk/meetme.conf
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/
306 define Package/asterisk16-chan-iax2/conffiles
307 /etc/asterisk/iax.conf
308 /etc/asterisk/iaxprov.conf
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
320 define Package/asterisk16-res-musiconhold/conffiles
321 /etc/asterisk/musiconhold.conf
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/
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/
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/
346 define Package/asterisk16-chan-gtalk/conffiles
347 /etc/asterisk/gtalk.conf
348 /etc/asterisk/jabber.conf
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/
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/
366 define BuildAsterisk16ModuleTemplate
368 define Package/asterisk16-$(subst _,-,$(1))
369 $$(call Package/asterisk16/Default)
371 DEPENDS:= +asterisk16
374 define Package/asterisk16-$(subst _,-,$(1))/description
375 $$(call Package/asterisk16/Default/description)
376 This package provides support $(3) in Asterisk.
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/
384 $$(eval $$(call BuildPackage,asterisk16-$(subst _,-,$(1))))
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))