[asterisk-scf-commits] asterisk-scf/integration/sip.git branch "master" updated.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Mon Sep 27 14:34:21 CDT 2010
branch "master" has been updated
via 6c055089caec742815e4d33923f1157b9386b929 (commit)
via 4337d0d1c99c6b812163708adb80400b7c37328f (commit)
from 3544960e1f73dd11af6160c1d838970c7f3f3edf (commit)
Summary of changes:
src/PJSipSessionModule.cpp | 8 ++++++++
src/SipSession.cpp | 3 ++-
2 files changed, 10 insertions(+), 1 deletions(-)
- Log -----------------------------------------------------------------
commit 6c055089caec742815e4d33923f1157b9386b929
Author: Mark Michelson <mmichelson at digium.com>
Date: Mon Sep 27 14:34:27 2010 -0500
Remove nonsensical check used for populating outbound R-URIs in INVITEs.
diff --git a/src/SipSession.cpp b/src/SipSession.cpp
index 2d2bf51..117f94e 100644
--- a/src/SipSession.cpp
+++ b/src/SipSession.cpp
@@ -320,12 +320,13 @@ void SipSession::start(const Ice::Current&)
local_uri = pj_str(local);
char remote[64];
- bool userDefined = config.transportConfig.user.size() != 0;
+ bool userDefined = mImplPriv->mDestination.size() != 0;
pj_ansi_sprintf(remote, "sip:%s%s%s",
userDefined ? mImplPriv->mDestination.c_str() : "",
userDefined ? "@" : "",
config.transportConfig.address.c_str());
remote_uri = pj_str(remote);
+ std::cerr << "[DEBUG] Sending new SIP INVITE to " << remote << std::endl;
// Create a UAC dialog for the outgoing call
if ((pjsip_dlg_create_uac(pjsip_ua_instance(), &local_uri, &local_uri, &remote_uri, &remote_uri, &dialog)) != PJ_SUCCESS)
commit 4337d0d1c99c6b812163708adb80400b7c37328f
Author: Mark Michelson <mmichelson at digium.com>
Date: Mon Sep 27 14:32:49 2010 -0500
Actually send failure responses, and add some debugging output.
diff --git a/src/PJSipSessionModule.cpp b/src/PJSipSessionModule.cpp
index 0ecb4db..99e0cbe 100644
--- a/src/PJSipSessionModule.cpp
+++ b/src/PJSipSessionModule.cpp
@@ -433,17 +433,22 @@ static void handle_new_invite(pjsip_rx_data *rdata)
{
pjsip_sip_uri *sipFrom = (pjsip_sip_uri *)from;
callerName = std::string(pj_strbuf(&sipFrom->user), pj_strlen(&sipFrom->user));
+ std::cerr << "[DEBUG] Got caller name " << callerName << std::endl;
}
SipEndpointPtr caller = factory->findByName(callerName);
if (caller == 0)
{
+ std::cerr << "[WARNING] Unknown calling endpoint " << callerName << std::endl;
pjsip_inv_end_session(inv_session, 404, NULL, &tdata);
+ pjsip_inv_send_msg(inv_session, tdata);
return;
}
SipEndpointConfig &config = caller->getConfig();
if (config.sessionConfig.callDirection != BOTH && config.sessionConfig.callDirection != INBOUND)
{
+ std::cerr << "[WARNING] Caller " << callerName << " does not have permission to make inbound calls." << std::endl;
pjsip_inv_end_session(inv_session, 403, NULL, &tdata);
+ pjsip_inv_send_msg(inv_session, tdata);
return;
}
@@ -456,6 +461,7 @@ static void handle_new_invite(pjsip_rx_data *rdata)
//For now, we only know about destination "100" so we'll
//grab that from the URI to pass to the locator.
destination = std::string(pj_strbuf(&sipRuri->user), pj_strlen(&sipRuri->user));
+ std::cerr << "[DEBUG] Call is destined for " << destination << std::endl;
}
SipSessionPtr session = caller->createSession(destination);
@@ -477,12 +483,14 @@ static void handle_new_invite(pjsip_rx_data *rdata)
{
// Destination not found is special since we can actually map it to a good response code, 404
pjsip_inv_end_session(inv_session, 404, NULL, &tdata);
+ pjsip_inv_send_msg(inv_session, tdata);
return;
}
catch (...)
{
// Everything else doesn't really map so they just become internal server errors
pjsip_inv_end_session(inv_session, 500, NULL, &tdata);
+ pjsip_inv_send_msg(inv_session, tdata);
return;
}
// All the actual call routing is taken care of, so let's tell the state replicator
-----------------------------------------------------------------------
--
asterisk-scf/integration/sip.git
More information about the asterisk-scf-commits
mailing list