[Serusers] SER Support for SIP Diversion header

Stefan Sayer stefan.sayer at iptego.com
Thu Apr 23 19:39:09 CEST 2009



o Stefan Sayer [04/23/09 19:35]:
> If you are only using mode=box (only voicebox, no mail) though, it may 
> be simpler to get the user in SEMS like with this patch to voicemail app:
... sorry, some corrections to make it actually compile:
Index: AnswerMachine.cpp
===================================================================
--- AnswerMachine.cpp   (revision 1354)
+++ AnswerMachine.cpp   (working copy)
@@ -33,7 +33,8 @@
  #include "AmUtils.h"
  #include "AmPlugIn.h"
  #include "AmPlaylist.h"
-
+#include "AmUriParser.h"
+
  #include "../msg_storage/MsgStorageAPI.h"
  #include "sems.h"
  #include "log.h"
@@ -531,7 +532,15 @@
      throw AmSession::Exception(500, "voicemail: no email address");
    }

-  user = get_header_keyvalue(iptel_app_param,"usr", "User");
+  //  user = get_header_keyvalue(iptel_app_param,"usr", "User");
+  AmUriParser div_parser;
+  size_t end;
+  if (!div_parser.parse_contact(getHeader(req.hdrs, "Diversion"), 0, 
end)) {
+    ERROR("could not parse Diversion header");
+    throw AmSession::Exception(500, "voicemail: no user found");
+  }
+  user = div_parser.uri_user;
+
    if (!user.length())
      user = req.user;

Stefan

-- 
Stefan Sayer
VoIP Services

stefan.sayer at iptego.com
www.iptego.com

IPTEGO GmbH
Wittenbergplatz 1
10789 Berlin
Germany

Amtsgericht Charlottenburg, HRB 101010
Geschaeftsfuehrer: Alexander Hoffmann



More information about the sr-users mailing list