From a5dbceef559b67eb0d49acfaa0f7856a3d8b480a Mon Sep 17 00:00:00 2001 From: Stefan Sayer Date: Sat, 25 Nov 2006 23:25:16 +0000 Subject: [PATCH] adds sending REFER in dialog git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@140 8eb893ce-cfd4-0310-b710-fb5ebe64c474 --- core/AmSipDialog.cpp | 19 +++++++++++++++++++ core/AmSipDialog.h | 1 + 2 files changed, 20 insertions(+) diff --git a/core/AmSipDialog.cpp b/core/AmSipDialog.cpp index d7cbf6a6..39e4d743 100644 --- a/core/AmSipDialog.cpp +++ b/core/AmSipDialog.cpp @@ -398,6 +398,25 @@ int AmSipDialog::update(const string& hdrs) } } +int AmSipDialog::refer(const string& refer_to) +{ + switch(status){ + case Connected: + return sendRequest("REFER", "", "", "Refer-To: "+refer_to); + case Disconnecting: + case Pending: + DBG("refer(): we are not yet connected." + "(status=%i). do nothing!\n",status); + + return 0; + default: + DBG("refer(): we are not connected " + "(status=%i). do nothing!\n",status); + return 0; + } + +} + int AmSipDialog::cancel() { int cancel_cseq = -1; diff --git a/core/AmSipDialog.h b/core/AmSipDialog.h index 97939502..0f9882f8 100644 --- a/core/AmSipDialog.h +++ b/core/AmSipDialog.h @@ -141,6 +141,7 @@ public: int invite(const string& hdrs, const string& content_type, const string& body); + int refer(const string& refer_to); /** * @return true if a transaction could be found that * matches the CANCEL's one.