Browse code

dlg.bye() action

git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1406 8eb893ce-cfd4-0310-b710-fb5ebe64c474

Stefan Sayer authored on 22/05/2009 17:46:09
Showing 3 changed files
... ...
@@ -31,6 +31,7 @@
31 31
 #include "DSMSession.h"
32 32
 #include "AmSession.h"
33 33
 #include <string.h>
34
+#include "AmSipHeaders.h"
34 35
 
35 36
 SC_EXPORT(DLGModule);
36 37
 
... ...
@@ -66,6 +67,7 @@ DSMAction* DLGModule::getAction(const string& from_str) {
66 67
 
67 68
   DEF_CMD("dlg.reply", DLGReplyAction);
68 69
   DEF_CMD("dlg.acceptInvite", DLGAcceptInviteAction);
70
+  DEF_CMD("dlg.bye", DLGByeAction);
69 71
 
70 72
   return NULL;
71 73
 }
... ...
@@ -162,3 +164,13 @@ bool DLGAcceptInviteAction::execute(AmSession* sess,
162 164
 
163 165
   return false;
164 166
 }
167
+
168
+EXEC_ACTION_START(DLGByeAction) {
169
+  string hdrs = resolveVars(arg, sess, sc_sess, event_params);
170
+
171
+  if (sess->dlg.bye(hdrs)) {
172
+    sc_sess->SET_ERRNO(DSM_ERRNO_UNKNOWN_ARG);
173
+  } else {
174
+    sc_sess->SET_ERRNO(DSM_ERRNO_OK);
175
+  }
176
+} EXEC_ACTION_END;
... ...
@@ -43,4 +43,5 @@ class DLGModule
43 43
 
44 44
 DEF_ACTION_2P(DLGReplyAction);
45 45
 DEF_ACTION_2P(DLGAcceptInviteAction);
46
+DEF_ACTION_1P(DLGByeAction);
46 47
 #endif
... ...
@@ -11,3 +11,6 @@ dlg.acceptInvite([code, reason]);
11 11
  accept audio stream from last_req (INVITE), and reply with 200 OK (default)
12 12
  or code, reason
13 13
  
14
+dlg.bye([headers])
15
+ send BYE. useful for example for continuing processing after call has ended.
16
+