examples/exec_s3.cfg
5eb5c40d
 #
 # $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 
eca3bd17
 		where user=\"$SIP_OUSER\"";
5eb5c40d
 	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");
 	};
 		
 }