File: exec_s3.cfg

package info (click to toggle)
openser 1.1.0-9etch1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 9,828 kB
  • ctags: 11,809
  • sloc: ansic: 120,528; sh: 5,249; yacc: 1,716; makefile: 1,261; php: 656; perl: 205; sql: 190
file content (27 lines) | stat: -rw-r--r-- 772 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#
# $Id: exec_s3.cfg,v 1.1.1.1 2005/06/13 16:47:30 bogdan_iancu Exp $
#
# email notification to email address from mysql database
#

# ------------------ module loading ----------------------------------

loadmodule "modules/exec/exec.so"
loadmodule "modules/sl/sl.so"

# send email if a request arrives
route[0] {
     if (!exec_msg('
	QUERY="select email_address from subscriber 
		where user=\"$SIP_OUSER\"";
	EMAIL=`mysql  -Bsuser -pheslo -e "$QUERY" ser`;
	if [ -z "$EMAIL" ] ; then exit 1; fi ;
	echo "SIP request received from $SIP_HF_FROM for $SIP_OUSER" |
	mail -s "request for you" $EMAIL ')) {
		# exec returned error ... user does not exist
		sl_send_reply("404", "User does not exist");
	} else {
		sl_send_reply("600", "No messages for this user");
	};
		
}