[prev in list] [next in list] [prev in thread] [next in thread]
List: sr-dev
Subject: Re: [Serdev] voicemal in new release
From: Stefan Sayer <sayer () fokus ! fraunhofer ! de>
Date: 2004-11-21 15:06:09
Message-ID: 41A0AEE1.1090101 () fokus ! fraunhofer ! de
[Download RAW message or body]
Hello,
to use the email address in sems voicemail plug-in, apply the attached
patch to AnswerMachine.cpp. It checks for P-Email-Address header, so
change the configuration to something like:
modparam( "tm", "tw_append",
"ex1:src_ip=avp[$IP];hdr[User-Agent];hdr[my-hdr];P-Email-Address=avp[$email]")
One question: if an UAC request is sent from sems, are Headers like
P-xxyy filtered by ser or are they sent?
Stefan
--
Fraunhofer Institut FOKUS Email:stefan.sayer@fokus.fraunhofer.de
Kaiserin-Augusta-Allee 31 Phone: +49 30 3463 7137
D-10589 Berlin, Germany
http://www.fokus.fraunhofer.de/research/cc/mobis
["mail_from_header_cvs.patch" (text/plain)]
? AnswerMachine.d
? mail_from_header_cvs.patch
Index: AnswerMachine.cpp
===================================================================
RCS file: /cvsroot/sems/answer_machine/plug-in/voicemail/AnswerMachine.cpp,v
retrieving revision 1.19
diff -c -r1.19 AnswerMachine.cpp
*** AnswerMachine.cpp 21 Sep 2004 14:50:50 -0000 1.19
--- AnswerMachine.cpp 15 Nov 2004 13:44:51 -0000
***************
*** 211,232 ****
if(announce_file.empty())
throw AmSession::Exception(500,"voicemail: no greeting file found");
! SerDBQuery email_query("subscriber");
! email_query.addKey("email_address");
! email_query.addWhereClause("username = \"" + cmd.user + "\"");
! int query_res = email_query.execute();
! if(query_res < 0)
! throw AmSession::Exception(500,"voicemail: error while"
! " fetching user's email address");
! if(query_res == 0)
! throw AmSession::Exception(404,"voicemail: no email address for user <"
! + cmd.user + ">");
! cmd.email = email_query.getVal(0,0);
- DBG("email address for user '%s': <%s>\n",
- cmd.user.c_str(),cmd.email.c_str());
map<string,EmailTemplate>::iterator tmpl_it;
tmpl_it = email_tmpl.find(cmd.domain);
--- 211,239 ----
if(announce_file.empty())
throw AmSession::Exception(500,"voicemail: no greeting file found");
! cmd.email = cmd.getHeader("P-Email-Address");
! if (cmd.email.empty()) {
! SerDBQuery email_query("subscriber");
! email_query.addKey("email_address");
! email_query.addWhereClause("username = \"" + cmd.user + "\"");
! int query_res = email_query.execute();
! if(query_res < 0)
! throw AmSession::Exception(500,"voicemail: error while"
! " fetching user's email address");
! if(query_res == 0)
! throw AmSession::Exception(404,"voicemail: no email address for user <"
! + cmd.user + ">");
! cmd.email = email_query.getVal(0,0);
! DBG("email address for user '%s': <%s>\n",
! cmd.user.c_str(),cmd.email.c_str());
!
! } else {
! DBG("email address for user '%s': <%s> (from P-Email-Address)\n",
! cmd.user.c_str(),cmd.email.c_str());
! }
map<string,EmailTemplate>::iterator tmpl_it;
tmpl_it = email_tmpl.find(cmd.domain);
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic