[Freeswitch-svn] [commit] r11544 - freeswitch/trunk/scripts/contrib/intralanman/C/tel_handler

FreeSWITCH SVN intralanman at freeswitch.org
Wed Jan 28 13:55:49 PST 2009


Author: intralanman
Date: Wed Jan 28 15:55:49 2009
New Revision: 11544

Log:
adding tel handler to use with firefox and [hopefully] thunderbird

Added:
   freeswitch/trunk/scripts/contrib/intralanman/C/tel_handler/
   freeswitch/trunk/scripts/contrib/intralanman/C/tel_handler/Makefile
   freeswitch/trunk/scripts/contrib/intralanman/C/tel_handler/tel_handler.c

Added: freeswitch/trunk/scripts/contrib/intralanman/C/tel_handler/Makefile
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/intralanman/C/tel_handler/Makefile	Wed Jan 28 15:55:49 2009
@@ -0,0 +1,25 @@
+INCS=-I../../../../../libs/esl/src/include
+LIBEDIT_DIR=../../libs/libedit
+DEBUG=-g -ggdb
+PICKY=-O2 -ffast-math -Wall -Werror -Wunused-variable -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
+CFLAGS=$(INCS) -DHAVE_EDITLINE $(DEBUG) -I$(LIBEDIT_DIR)/src/ $(PICKY)
+MYLIB=libesl.a
+LIBS=-lncurses -lpthread -lesl
+LDFLAGS=-L../../../../../libs/esl/
+OBJS=src/esl.o src/esl_event.o src/esl_threadmutex.o src/esl_config.o
+SRC=src/esl.c src/esl_event.c src/esl_threadmutex.c src/esl_config.c
+HEADERS=src/include/esl_config.h src/include/esl_event.h src/include/esl.h src/include/esl_threadmutex.h
+
+all: tel_handler
+
+tel_handler: tel_handler.c
+	$(CC) $(CC_CFLAGS) $(CFLAGS) tel_handler.c -o tel_handler $(LDFLAGS) $(LIBS)
+
+%.o: %.c
+	$(CC) $(CC_CFLAGS) $(CFLAGS) -c $< -o $@
+
+clean:
+	rm -f *.o tel_handler *~ 
+
+install: all
+	cp tel_handler /usr/bin/tel_handler

Added: freeswitch/trunk/scripts/contrib/intralanman/C/tel_handler/tel_handler.c
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/intralanman/C/tel_handler/tel_handler.c	Wed Jan 28 15:55:49 2009
@@ -0,0 +1,19 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <esl.h>
+
+int main(int argc, char *argv[])
+{
+	esl_handle_t handle = {{0}};
+	if(argc == 2) {
+		char buf[1024];
+		esl_connect(&handle, "localhost", 8021, "ClueCon");
+		snprintf(buf, sizeof(buf), "api pa call %s", argv[1]);
+		esl_send_recv(&handle, buf);
+		esl_disconnect(&handle);
+		return 0;
+	} else {
+		printf("Not enough args!!");
+		return 1;
+	}
+}



More information about the Freeswitch-svn mailing list