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:=asterisk-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://downloads.digium.com/pub/asterisk/releases/
16 PKG_MD5SUM:=e394b63dd71c07497620dc12883e0b80
18 PKG_BUILD_DIR=$(BUILD_DIR)/asterisk-$(PKG_VERSION)
20 include $(INCLUDE_DIR)/package.mk
22 define Package/asterisk18/Default
23 SUBMENU:=asterisk18 (Complete Open Source PBX), v1.8.x
26 URL:=http://www.asterisk.org/
27 MAINTAINER:=Hans Zandbelt <hans.zandbelt@gmail.com>
30 define Package/asterisk18/Default/description
31 Asterisk is a complete PBX in software. It provides all of the features
32 you would expect from a PBX and more. Asterisk does voice over IP in three
33 protocols, and can interoperate with almost all standards-based telephony
34 equipment using relatively inexpensive hardware.
38 define Package/asterisk18
39 $(call Package/asterisk18/Default)
40 TITLE:=Complete open source PBX
41 DEPENDS:= +libopenssl +libncurses +libpopt +libpthread +zlib @!TARGET_avr32
44 define Package/asterisk18/description
45 $(call Package/asterisk18/Default/description)
48 define Package/asterisk18-sounds
49 $(call Package/asterisk18/Default)
54 define Package/asterisk18-sounds/description
55 $(call Package/asterisk18/Default/description)
56 This package contains sound files for Asterisk.
60 define Package/asterisk18-voicemail
61 $(call Package/asterisk18/Default)
62 TITLE:=Voicemail support
66 define Package/asterisk18-voicemail/description
67 $(call Package/asterisk18/Default/description)
68 This package contains voicemail related modules for Asterisk.
71 define Package/asterisk18-app-meetme
72 $(call Package/asterisk18/Default)
73 TITLE:=conferencing support
74 DEPENDS:= +asterisk18 +dahdi-tools-libtonezone +kmod-dahdi-linux
77 define Package/asterisk18-app-meetme/description
78 $(call Package/asterisk18/Default/description)
79 This package provides the MeetMe application driver Conferencing support to
83 define Package/asterisk18-chan-iax2
84 $(call Package/asterisk18/Default)
89 define Package/asterisk18-chan-iax2/description
90 $(call Package/asterisk18/Default/description)
91 This package provides IAX support to
95 define Package/asterisk18-cdr
96 $(call Package/asterisk18/Default)
101 define Package/asterisk18-cdr/description
102 $(call Package/asterisk18/Default/description)
103 This package provides Call Detail Record support to
107 define Package/asterisk18-res-musiconhold
108 $(call Package/asterisk18/Default)
110 DEPENDS:= +asterisk18
113 define Package/asterisk18-res-musiconhold/description
114 $(call Package/asterisk18/Default/description)
115 This package provides Music On Hold support to
119 define Package/asterisk18-chan-gtalk
120 $(call Package/asterisk18/Default)
122 DEPENDS:= +asterisk18 +libiksemel
125 define Package/asterisk18-chan-gtalk/description
126 $(call Package/asterisk18/Default/description)
127 This package provides the channel chan_gtalk and res_jabber for GTalk
131 define Package/asterisk18-chan-mobile
132 $(call Package/asterisk18/Default)
133 TITLE:=Mobile channel support
134 DEPENDS:= +asterisk18 +bluez-libs
137 define Package/asterisk18-chan-mobile/description
138 $(call Package/asterisk18/Default/description)
139 This package provides the channel chan_mobile support to Asterisk.
142 define Package/asterisk18-chan-mgcp
143 $(call Package/asterisk18/Default)
144 TITLE:=MGCP channel support
145 DEPENDS:= +asterisk18
148 define Package/asterisk18-chan-mgcp/description
149 $(call Package/asterisk18/Default/description)
150 This package provides the channel chan_mgcp support to Asterisk.
153 define Package/asterisk18-curl
154 $(call Package/asterisk18/Default)
156 DEPENDS:= +asterisk18 +libcurl
159 define Package/asterisk18-curl/description
160 $(call Package/asterisk18/Default/description)
161 This package provides CURL
165 ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk18-app-meetme),)
167 --with-dahdi="$(STAGING_DIR)/usr"
173 ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk18-chan-gtalk),)
175 --with-gnutls="$(STAGING_DIR)/usr" \
176 --with-iksemel="$(STAGING_DIR)/usr"
178 ac_cv_lib_iksemel_iks_start_sasl=yes \
179 ac_cv_lib_gnutls_gnutls_bye=yes
186 ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk18-curl),)
188 --with-curl="$(STAGING_DIR)/usr"
196 --with-gsm=internal \
203 --with-ncurses="$(STAGING_DIR)/usr" \
209 --with-popt="$(STAGING_DIR)/usr" \
221 --with-z="$(STAGING_DIR)/usr" \
224 EXTRA_CFLAGS+= $(TARGET_CPPFLAGS)
225 EXTRA_LDFLAGS+= $(TARGET_LDFLAGS)
227 define Build/Configure
228 -rm $(PKG_BUILD_DIR)/menuselect.makeopts
229 $(call Build/Configure/Default,,$(SITE_VARS))
233 $(MAKE) -C "$(PKG_BUILD_DIR)" \
234 include/asterisk/version.h \
235 include/asterisk/buildopts.h defaults.h \
237 ASTCFLAGS="$(EXTRA_CFLAGS) -DLOW_MEMORY" \
238 ASTLDFLAGS="$(EXTRA_LDFLAGS)" \
239 $(MAKE) -C "$(PKG_BUILD_DIR)" \
240 ASTVARLIBDIR="/usr/lib/asterisk" \
244 DESTDIR="$(PKG_INSTALL_DIR)" \
246 $(SED) 's|/var/lib/asterisk|/usr/lib/asterisk|g' $(PKG_INSTALL_DIR)/etc/asterisk/musiconhold.conf
249 define Build/InstallDev
250 $(INSTALL_DIR) $(1)/usr/include/asterisk-1.8/include/asterisk/
251 $(CP) $(PKG_INSTALL_DIR)/usr/include/asterisk/*.h $(1)/usr/include/asterisk-1.8/include/asterisk/
252 $(CP) $(PKG_INSTALL_DIR)/usr/include/asterisk.h $(1)/usr/include/asterisk-1.8/include/
255 define Package/asterisk18/conffiles
256 /etc/asterisk/asterisk.conf
257 /etc/asterisk/modules.conf
258 /etc/asterisk/extensions.conf
259 /etc/asterisk/sip.conf
260 /etc/asterisk/sip_notify.conf
261 /etc/asterisk/features.conf
262 /etc/asterisk/indications.conf
263 /etc/asterisk/logger.conf
264 /etc/asterisk/manager.conf
265 /etc/asterisk/rtp.conf
266 /etc/default/asterisk
270 define Package/asterisk18/install
271 $(INSTALL_DIR) $(1)/etc/asterisk
272 for f in asterisk extensions features \
273 indications logger manager modules \
274 sip sip_notify rtp; do \
275 $(CP) $(PKG_INSTALL_DIR)/etc/asterisk/$$$$f.conf $(1)/etc/asterisk/ ; \
277 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
278 for f in app_dial app_echo app_playback app_macro \
279 chan_sip res_rtp_asterisk res_rtp_multicast \
280 codec_ulaw codec_gsm \
281 format_gsm format_pcm format_wav format_wav_gsm \
283 func_strings func_timeout func_callerid func_logic; do \
284 $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/$$$$f.so $(1)/usr/lib/asterisk/modules/ ; \
286 $(INSTALL_DIR) $(1)/usr/sbin
287 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/asterisk $(1)/usr/sbin/
288 $(INSTALL_DIR) $(1)/etc/default
289 $(INSTALL_DATA) ./files/asterisk.default $(1)/etc/default/asterisk
290 $(INSTALL_DIR) $(1)/etc/init.d
291 $(INSTALL_BIN) ./files/asterisk.init $(1)/etc/init.d/asterisk
294 define Package/asterisk18-sounds/install
295 $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
296 $(CP) $(PKG_INSTALL_DIR)/var/lib/asterisk/sounds/en/* $(1)/usr/lib/asterisk/sounds/
297 rm -f $(1)/usr/lib/asterisk/sounds/vm-*
298 rm -f $(1)/usr/lib/asterisk/sounds/conf-*
302 define Package/asterisk18-voicemail/conffiles
303 /etc/asterisk/voicemail.conf
306 define Package/asterisk18-voicemail/install
307 $(INSTALL_DIR) $(1)/etc/asterisk
308 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/voicemail.conf $(1)/etc/asterisk/
309 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
310 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/*voicemail.so $(1)/usr/lib/asterisk/modules/
311 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_adsi.so $(1)/usr/lib/asterisk/modules/
312 $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
313 $(CP) $(PKG_INSTALL_DIR)/var/lib/asterisk/sounds/en/vm-*.gsm $(1)/usr/lib/asterisk/sounds/
316 define Package/asterisk18-app-meetme/conffiles
317 /etc/asterisk/meetme.conf
320 define Package/asterisk18-app-meetme/install
321 $(INSTALL_DIR) $(1)/etc/asterisk
322 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/meetme.conf $(1)/etc/asterisk/
323 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
324 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/app_meetme.so $(1)/usr/lib/asterisk/modules/
325 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_dahdi.so $(1)/usr/lib/asterisk/modules/
326 $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
327 $(CP) $(PKG_INSTALL_DIR)/var/lib/asterisk/sounds/en/conf-*.gsm $(1)/usr/lib/asterisk/sounds/
330 define Package/asterisk18-chan-iax2/conffiles
331 /etc/asterisk/iax.conf
332 /etc/asterisk/iaxprov.conf
335 define Package/asterisk18-cdr/conffiles
336 /etc/asterisk/cdr.conf
337 /etc/asterisk/cdr_custom.conf
338 /etc/asterisk/cdr_manager.conf
339 /etc/asterisk/cdr_odbc.conf
340 /etc/asterisk/cdr_pgsql.conf
341 /etc/asterisk/cdr_tds.conf
344 define Package/asterisk18-res-musiconhold/conffiles
345 /etc/asterisk/musiconhold.conf
348 define Package/asterisk18-chan-iax2/install
349 $(INSTALL_DIR) $(1)/etc/asterisk
350 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/iax.conf $(1)/etc/asterisk/
351 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/iaxprov.conf $(1)/etc/asterisk/
352 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
353 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_iax2.so $(1)/usr/lib/asterisk/modules/
356 define Package/asterisk18-cdr/install
357 $(INSTALL_DIR) $(1)/etc/asterisk
358 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/cdr*.conf $(1)/etc/asterisk/
359 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
360 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/*cdr*.so $(1)/usr/lib/asterisk/modules/
363 define Package/asterisk18-res-musiconhold/install
364 $(INSTALL_DIR) $(1)/etc/asterisk
365 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/musiconhold.conf $(1)/etc/asterisk/
366 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
367 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_musiconhold.so $(1)/usr/lib/asterisk/modules/
370 define Package/asterisk18-chan-gtalk/conffiles
371 /etc/asterisk/gtalk.conf
372 /etc/asterisk/jabber.conf
375 define Package/asterisk18-chan-gtalk/install
376 $(INSTALL_DIR) $(1)/etc/asterisk
377 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/gtalk.conf $(1)/etc/asterisk/
378 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/jabber.conf $(1)/etc/asterisk/
379 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
380 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_gtalk.so $(1)/usr/lib/asterisk/modules/
381 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_jabber.so $(1)/usr/lib/asterisk/modules/
384 define Package/asterisk18-chan-mobile/conffiles
385 /etc/asterisk/chan_mobile.conf
388 define Package/asterisk18-chan-mobile/install
389 $(INSTALL_DIR) $(1)/etc/asterisk
390 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/chan_mobile.conf $(1)/etc/asterisk/
391 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
392 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_mobile.so $(1)/usr/lib/asterisk/modules/
395 define Package/asterisk18-chan-mgcp/conffiles
396 /etc/asterisk/mgcp.conf
399 define Package/asterisk18-chan-mgcp/install
400 $(INSTALL_DIR) $(1)/etc/asterisk
401 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/mgcp.conf $(1)/etc/asterisk/
402 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
403 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_mgcp.so $(1)/usr/lib/asterisk/modules/
406 define Package/asterisk18-curl/install
407 $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
408 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/func_curl.so $(1)/usr/lib/asterisk/modules/
409 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_curl.so $(1)/usr/lib/asterisk/modules/
412 define Buildasterisk18ModuleTemplate
414 define Package/asterisk18-$(subst _,-,$(1))
415 $$(call Package/asterisk18/Default)
417 DEPENDS:= +asterisk18
420 define Package/asterisk18-$(subst _,-,$(1))/description
421 $$(call Package/asterisk18/Default/description)
422 This package provides support $(3) in Asterisk.
425 define Package/asterisk18-$(subst _,-,$(1))/install
426 $(INSTALL_DIR) $$(1)/usr/lib/asterisk/modules
427 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/$(1).so $$(1)/usr/lib/asterisk/modules/
430 $$(eval $$(call BuildPackage,asterisk18-$(subst _,-,$(1))))
433 $(eval $(call BuildPackage,asterisk18))
434 $(eval $(call BuildPackage,asterisk18-voicemail))
435 $(eval $(call BuildPackage,asterisk18-sounds))
436 #$(eval $(call BuildPackage,asterisk18-app-meetme))
437 $(eval $(call BuildPackage,asterisk18-chan-iax2))
438 $(eval $(call BuildPackage,asterisk18-cdr))
439 $(eval $(call BuildPackage,asterisk18-res-musiconhold))
440 $(eval $(call BuildPackage,asterisk18-chan-gtalk))
441 $(eval $(call BuildPackage,asterisk18-chan-mobile))
442 $(eval $(call BuildPackage,asterisk18-chan-mgcp))
443 $(eval $(call BuildPackage,asterisk18-curl))
444 $(eval $(call Buildasterisk18ModuleTemplate,app_authenticate,Authenticate,support for executing arbitrary authenticate commands))
445 $(eval $(call Buildasterisk18ModuleTemplate,app_chanisavail,Channel availability check,support for checking if a channel is available))
446 $(eval $(call Buildasterisk18ModuleTemplate,app_chanspy,Channel listen in,support for listening in on any channel))
447 $(eval $(call Buildasterisk18ModuleTemplate,app_directed_pickup,Directed call pickup,support for directed call pickup))
448 $(eval $(call Buildasterisk18ModuleTemplate,app_exec,Exec application,support for application execution))
449 $(eval $(call Buildasterisk18ModuleTemplate,app_minivm,Minimal voicemail system,a voicemail system in small building blocks working together based on the Comedian Mail voicemail system))
450 $(eval $(call Buildasterisk18ModuleTemplate,app_readexten,Extension to variable,a trivial application to read an extension into a variable))
451 $(eval $(call Buildasterisk18ModuleTemplate,app_read,Variable read,a trivial application to read a variable))
452 $(eval $(call Buildasterisk18ModuleTemplate,app_sayunixtime,Say Unix time,an application to say Unix time))
453 $(eval $(call Buildasterisk18ModuleTemplate,app_sms,SMS,SMS support (ETSI ES 201 912 protocol 1)))
454 $(eval $(call Buildasterisk18ModuleTemplate,app_stack,Stack applications, stack applications Gosub Return etc.))
455 $(eval $(call Buildasterisk18ModuleTemplate,app_system,System exec,support for executing system commands))
456 $(eval $(call Buildasterisk18ModuleTemplate,app_talkdetect,File playback with audio detect,for file playback with audio detect))
457 $(eval $(call Buildasterisk18ModuleTemplate,app_waituntil,Sleep,support sleeping until the given epoch))
458 $(eval $(call Buildasterisk18ModuleTemplate,app_while,While loop,a while loop implementation))
459 $(eval $(call Buildasterisk18ModuleTemplate,chan_agent,Agents proxy channel, an implementation of agents proxy channel))
460 $(eval $(call Buildasterisk18ModuleTemplate,chan_local,Local proxy channel, an implementation of local proxy channel))
461 $(eval $(call Buildasterisk18ModuleTemplate,codec_alaw,Signed linear to alaw translation,translation between signed linear and alaw codecs))
462 $(eval $(call Buildasterisk18ModuleTemplate,codec_ulaw,Signed linear to ulaw translation,translation between signed linear and ulaw codecs))
463 $(eval $(call Buildasterisk18ModuleTemplate,codec_a_mu,Alaw to ulaw translation,translation between alaw and ulaw codecs))
464 $(eval $(call Buildasterisk18ModuleTemplate,codec_g722,G.722,a high bit rate 48/56/64Kbps ITU standard codec))
465 $(eval $(call Buildasterisk18ModuleTemplate,codec_g726,Signed linear to G.726 translation,translation between signed linear and ITU G.726-32kbps codecs))
466 $(eval $(call Buildasterisk18ModuleTemplate,format_g726,G.726,support for headerless G.726 16/24/32/40kbps data format))
467 $(eval $(call Buildasterisk18ModuleTemplate,format_g729,G.729,support for raw headerless G729 data))
468 $(eval $(call Buildasterisk18ModuleTemplate,format_sln,Raw slinear format,support for raw slinear format))
469 $(eval $(call Buildasterisk18ModuleTemplate,format_sln16,Raw slinear 16 format,support for Raw slinear 16 format))
470 $(eval $(call Buildasterisk18ModuleTemplate,func_db,Database interaction,functions for interaction with the database))
471 $(eval $(call Buildasterisk18ModuleTemplate,func_devstate,Blinky lights control,functions for manually controlled blinky lights))
472 $(eval $(call Buildasterisk18ModuleTemplate,func_vmcount,vmcount dialplan,a vmcount dialplan function))
473 $(eval $(call Buildasterisk18ModuleTemplate,func_extstate,Hinted extension state,retrieving the state of a hinted extension for dialplan control))
474 $(eval $(call Buildasterisk18ModuleTemplate,func_global,Global variable,global variable dialplan functions))
475 $(eval $(call Buildasterisk18ModuleTemplate,func_shell,Shell,support for shell execution))
476 $(eval $(call Buildasterisk18ModuleTemplate,pbx_ael,Asterisk Extension Logic,support for symbolic Asterisk Extension Logic))
477 $(eval $(call Buildasterisk18ModuleTemplate,res_ael_share,Shareable AEL code,support for shareable AEL code mainly between internal and external modules))
478 $(eval $(call Buildasterisk18ModuleTemplate,pbx_spool,Call Spool,outgoing call spool support))
479 $(eval $(call Buildasterisk18ModuleTemplate,res_agi,Asterisk Gateway Interface,support for the Asterisk Gateway Interface extension))
480 $(eval $(call Buildasterisk18ModuleTemplate,app_alarmreceiver,Alarm receiver,Central Station Alarm receiver for Ademco Contact ID))
481 $(eval $(call Buildasterisk18ModuleTemplate,app_setcallerid,Set callerid,support for setting callerid))
482 $(eval $(call Buildasterisk18ModuleTemplate,app_verbose,Verbose logging,Verbose logging application))
483 $(eval $(call Buildasterisk18ModuleTemplate,func_channel,Channel info,Channel info dialplan function))
484 $(eval $(call Buildasterisk18ModuleTemplate,func_blacklist,Blacklist on callerid,looking up the callerid number, and see if it is blacklisted))
485 $(eval $(call Buildasterisk18ModuleTemplate,app_originate,Originate a call,originating an outbound call and connecting it to a specified extension or application))