Module: sems
Branch: master
Commit: 02bf350639b358ebb2ba5551529992bc8909d43f
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=02bf350639b358ebb2ba5551529992bc8909d43f

Author: Stefan Sayer <[email protected]>
Committer: Stefan Sayer <[email protected]>
Date:   Tue Apr 17 15:41:56 2012 +0200

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

---

 apps/dsm/mods/mod_dlg/ModDlg.cpp |    3 +++
 apps/dsm/mods/mod_dlg/ModDlg.h   |    2 ++
 doc/dsm/mods/Readme.mod_dlg.txt  |    2 +-
 3 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/apps/dsm/mods/mod_dlg/ModDlg.cpp b/apps/dsm/mods/mod_dlg/ModDlg.cpp
index c90c11e..58f5e78 100644
--- a/apps/dsm/mods/mod_dlg/ModDlg.cpp
+++ b/apps/dsm/mods/mod_dlg/ModDlg.cpp
@@ -180,6 +180,9 @@ EXEC_ACTION_START(DLGAcceptInviteAction) {
     ERROR("%i %s\n",e.code,e.reason.c_str());
     sess->setStopped();
     sess->dlg.reply(*sc_sess->last_req.get(),e.code,e.reason);
+
+    sc_sess->SET_ERRNO(DSM_ERRNO_DLG);
+    sc_sess->SET_STRERROR("Error accepting call: "+ int2str(e.code) + " "+ 
e.reason);
   }
 } EXEC_ACTION_END;
 
diff --git a/apps/dsm/mods/mod_dlg/ModDlg.h b/apps/dsm/mods/mod_dlg/ModDlg.h
index 9a8a06c..9ea2209 100644
--- a/apps/dsm/mods/mod_dlg/ModDlg.h
+++ b/apps/dsm/mods/mod_dlg/ModDlg.h
@@ -30,6 +30,8 @@
 
 #define MOD_CLS_NAME DLGModule 
 
+#define DSM_ERRNO_DLG "dlg"
+
 DECLARE_MODULE_BEGIN(MOD_CLS_NAME);
 bool onInvite(const AmSipRequest& req, DSMSession* sess);
 DECLARE_MODULE_END;
diff --git a/doc/dsm/mods/Readme.mod_dlg.txt b/doc/dsm/mods/Readme.mod_dlg.txt
index f14f056..19c8fd2 100644
--- a/doc/dsm/mods/Readme.mod_dlg.txt
+++ b/doc/dsm/mods/Readme.mod_dlg.txt
@@ -35,7 +35,7 @@ dlg.acceptInvite([code, reason]);
  * sets $errno (arg,general)
  
  accept audio stream from last_req (INVITE), and reply with 200 OK (default)
- or code, reason
+ or code, reason. sets "dlg" type errno if negotiation fails.
  
 dlg.bye([headers])
  send BYE. useful for example for continuing processing after call has ended.

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to