From: <abe...@us...> - 2012-02-07 21:43:20
|
Revision: 5445 http://astlinux.svn.sourceforge.net/astlinux/?rev=5445&view=rev Author: abelbeck Date: 2012-02-07 21:43:13 +0000 (Tue, 07 Feb 2012) Log Message: ----------- revert app_notify 2.1 version bump, chief tester Michael reports it doesn't work Modified Paths: -------------- branches/1.0/docs/ChangeLog.txt branches/1.0/package/asterisk/asterisk.mk branches/1.0/package/asterisk-app_notify/asterisk-app_notify.mk Removed Paths: ------------- branches/1.0/package/asterisk/app_notify-2-1.c Modified: branches/1.0/docs/ChangeLog.txt =================================================================== --- branches/1.0/docs/ChangeLog.txt 2012-02-07 20:00:57 UTC (rev 5444) +++ branches/1.0/docs/ChangeLog.txt 2012-02-07 21:43:13 UTC (rev 5445) @@ -100,8 +100,6 @@ -- rhino, version bump to 0.99.5b1, DAHDI 2.5.x support --- app_notify, version bump to 2.1 for Asterisk 1.8, app_notify v2.0rc1 is used for Asterisk 1.4 - ** Web Interface -- Prefs tab and System tab, if the "Repository URL:" has not been defined (ex. initial Deleted: branches/1.0/package/asterisk/app_notify-2-1.c =================================================================== --- branches/1.0/package/asterisk/app_notify-2-1.c 2012-02-07 20:00:57 UTC (rev 5444) +++ branches/1.0/package/asterisk/app_notify-2-1.c 2012-02-07 21:43:13 UTC (rev 5445) @@ -1,158 +0,0 @@ -/* - * Asterisk -- An open source telephony toolkit. - * - */ - -/*! \file - * - * \brief Network Notification Application Module for Asterisk - * - * \author Sven Slezak <su...@me...> - * - * \ingroup applications - */ - -/*** MODULEINFO - <support_level>core</support_level> - ***/ - -#include "asterisk.h" - -ASTERISK_FILE_VERSION(__FILE__, "$Revision: $") - -#include "asterisk/channel.h" -#include "asterisk/module.h" -#include "asterisk/app.h" - - - -#include <sys/socket.h> -#include <netinet/in.h> -#include <arpa/inet.h> -#include <netdb.h> -#include <sys/time.h> /* select() */ - -#define DEFAULT_PORT 40000 - -static char *app = "Notify"; - -int notify(const char *text, const char *host, int port); - -/*** DOCUMENTATION - <application name="Notify" language="en_US"> - <synopsis> - Network Notification Application Module for Asterisk - </synopsis> - <syntax> - <parameter name="text" required="true"> - <para>The message to send.</para> - </parameter> - <parameter name="host_port" required="true"> - <para>The Host to send the message to.</para> - </parameter> - </syntax> - <description> - <para>This application sends network notifications from Asterisk to a given host.</para> - </description> - </application> - ***/ - -static const char notify_app[] = "Notify"; - - -int notify(const char *text, const char *host, int port) -{ - int sock; - int broadcast = 1; - struct sockaddr_in servAddr; - struct hostent *hp; - struct ast_hostent ahp; - - if(option_verbose > 2) - ast_verbose (VERBOSE_PREFIX_3 "Notify: sending '%s' to %s:%d \n", text, host, port); - - if ((sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) { - ast_log(LOG_ERROR, "cannot open socket\n"); - return -1; - } - - if(setsockopt(sock, SOL_SOCKET, SO_BROADCAST, &broadcast, sizeof(broadcast)) < 0) { - ast_log(LOG_ERROR, "setsockopt error.\n"); - } - - memset(&servAddr, 0, sizeof(struct sockaddr_in)); - servAddr.sin_family = AF_INET; - servAddr.sin_port = htons(port); - - if((servAddr.sin_addr.s_addr = inet_addr(host)) == -1) { - hp = ast_gethostbyname(host, &ahp); - if(hp == (struct hostent *)0) { - ast_log(LOG_ERROR, "unknown host: %s\n", host); - return -1; - } - memcpy(&servAddr.sin_addr, hp->h_addr_list[0], hp->h_length); - } - - if (sendto(sock, text, strlen(text)+1, 0, (struct sockaddr *)&servAddr, sizeof(servAddr)) < 0) { - ast_log(LOG_ERROR, "cannot send text\n"); - close(sock); - return -1; - } - - close(sock); - return 0; -} - - -static int notify_exec(struct ast_channel *chan, const char *data) -{ - AST_DECLARE_APP_ARGS(args, - AST_APP_ARG(text); - AST_APP_ARG(host_port); - ); - char *parse, *tmp; - char *host; - int port = DEFAULT_PORT; - - if (ast_strlen_zero(data)) { - ast_log(LOG_WARNING, "%s requires an argument (text,host[:port])\n", app); - return -1; - } - - parse = ast_strdupa(data); - AST_STANDARD_APP_ARGS(args, parse); - - if (!ast_strlen_zero(args.text)) { - ast_log(LOG_NOTICE, "message is : %s\n", args.text); - } - - if (!ast_strlen_zero(args.host_port)) { - host = args.host_port; - ast_log(LOG_NOTICE, "host_port is : %s\n", args.host_port); - if(strchr(args.host_port, ':')) { - tmp = strsep(&args.host_port, ":"); - port = atoi(strsep(&args.host_port, "\0")); - host = tmp; - } - - ast_log(LOG_NOTICE, "send: '%s' to %s:%d\n", args.text, host, port); - - notify(args.text, host, port); - } - - return 0; -} - -static int unload_module(void) -{ - return ast_unregister_application(notify_app); -} - -static int load_module(void) -{ - if (ast_register_application_xml(notify_app, notify_exec)) - return AST_MODULE_LOAD_FAILURE; - return AST_MODULE_LOAD_SUCCESS; -} - -AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Network Notifications for Asterisk"); Modified: branches/1.0/package/asterisk/asterisk.mk =================================================================== --- branches/1.0/package/asterisk/asterisk.mk 2012-02-07 20:00:57 UTC (rev 5444) +++ branches/1.0/package/asterisk/asterisk.mk 2012-02-07 21:43:13 UTC (rev 5445) @@ -158,15 +158,6 @@ endif endif -ifeq ($(strip $(BR2_PACKAGE_ASTERISK_APP_NOTIFY)),y) - ifneq ($(ASTERISK_VERSION_TUPLE),1.4) - ifneq ($(ASTERISK_VERSION_TUPLE),1.6) - # Source: http://www.mezzo.net/asterisk/app_notify.html - cp -p package/asterisk/app_notify-2-1.c $(ASTERISK_DIR)/apps/app_notify.c - endif - endif -endif - ifeq ($(strip $(BR2_PACKAGE_ASTERISK_ILBC)),y) zcat package/asterisk/ilbc-codec.tar.gz | tar -C $(ASTERISK_DIR) $(TAR_OPTIONS) - toolchain/patch-kernel.sh $(ASTERISK_DIR) package/asterisk/ ilbc-codec-\*.patch Modified: branches/1.0/package/asterisk-app_notify/asterisk-app_notify.mk =================================================================== --- branches/1.0/package/asterisk-app_notify/asterisk-app_notify.mk 2012-02-07 20:00:57 UTC (rev 5444) +++ branches/1.0/package/asterisk-app_notify/asterisk-app_notify.mk 2012-02-07 21:43:13 UTC (rev 5445) @@ -55,12 +55,6 @@ # ############################################################# ifeq ($(strip $(BR2_PACKAGE_ASTERISK_APP_NOTIFY)),y) - ifeq ($(BR2_PACKAGE_ASTERISK_v1_4),y) TARGETS+=asterisk-app_notify - else - ifeq ($(BR2_PACKAGE_ASTERISK_v1_6),y) -TARGETS+=asterisk-app_notify - endif - endif endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |