Module: sems Branch: master Commit: 68e17db9d706576c7c16259843e1a43b2e05d7cf URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=68e17db9d706576c7c16259843e1a43b2e05d7cf
Author: Stefan Sayer <[email protected]> Committer: Stefan Sayer <[email protected]> Date: Tue Aug 7 15:35:25 2012 +0200 user_timer: enable setting of timer by struct timeval through DI Patch by Robert Szokovacs --- core/plug-in/session_timer/UserTimer.cpp | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/core/plug-in/session_timer/UserTimer.cpp b/core/plug-in/session_timer/UserTimer.cpp index 46162d1..295a6af 100644 --- a/core/plug-in/session_timer/UserTimer.cpp +++ b/core/plug-in/session_timer/UserTimer.cpp @@ -228,6 +228,17 @@ void UserTimer::invoke(const string& method, const AmArg& args, AmArg& ret) setTimer(args.get(0).asInt(), args.get(1).asDouble(), args.get(2).asCStr()); + } else if (isArgBlob(args.get(1))) { + ArgBlob* blob = args.get(1).asBlob(); + if(blob->len != sizeof(struct timeval)) { + ERROR("unsupported data in blob in '%s', expected struct timeval\n", + AmArg::print(args).c_str()); + } + else { + setTimer(args.get(0).asInt(), + (struct timeval*)blob->data, + args.get(2).asCStr()); + } } else { ERROR("unsupported timeout type in '%s'\n", AmArg::print(args).c_str()); } _______________________________________________ Semsdev mailing list [email protected] http://lists.iptel.org/mailman/listinfo/semsdev
