Browse code

DSM:mod_dlg: added setting errno if dlg.acceptInvite fails

Stefan Sayer authored on 17/04/2012 13:41:56
Showing 3 changed files
... ...
@@ -180,6 +180,9 @@ EXEC_ACTION_START(DLGAcceptInviteAction) {
180 180
     ERROR("%i %s\n",e.code,e.reason.c_str());
181 181
     sess->setStopped();
182 182
     sess->dlg.reply(*sc_sess->last_req.get(),e.code,e.reason);
183
+
184
+    sc_sess->SET_ERRNO(DSM_ERRNO_DLG);
185
+    sc_sess->SET_STRERROR("Error accepting call: "+ int2str(e.code) + " "+ e.reason);
183 186
   }
184 187
 } EXEC_ACTION_END;
185 188
 
... ...
@@ -30,6 +30,8 @@
30 30
 
31 31
 #define MOD_CLS_NAME DLGModule 
32 32
 
33
+#define DSM_ERRNO_DLG "dlg"
34
+
33 35
 DECLARE_MODULE_BEGIN(MOD_CLS_NAME);
34 36
 bool onInvite(const AmSipRequest& req, DSMSession* sess);
35 37
 DECLARE_MODULE_END;
... ...
@@ -35,7 +35,7 @@ dlg.acceptInvite([code, reason]);
35 35
  * sets $errno (arg,general)
36 36
  
37 37
  accept audio stream from last_req (INVITE), and reply with 200 OK (default)
38
- or code, reason
38
+ or code, reason. sets "dlg" type errno if negotiation fails.
39 39
  
40 40
 dlg.bye([headers])
41 41
  send BYE. useful for example for continuing processing after call has ended.