File: exec_s3.cfg

package info (click to toggle)
kamailio 6.0.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 70,432 kB
  • sloc: ansic: 859,295; xml: 203,409; makefile: 9,687; sh: 9,043; sql: 8,571; yacc: 4,121; python: 3,086; perl: 2,955; java: 449; cpp: 289; javascript: 270; php: 258; ruby: 248; awk: 27
file content (27 lines) | stat: -rw-r--r-- 711 bytes parent folder | download | duplicates (10)
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$
#
# 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");
	};
		
}