[svn-commits] branch oej/strictrouting r36778 - in
/team/oej/strictrouting: ./ channels/
svn-commits at lists.digium.com
svn-commits at lists.digium.com
Sun Jul 2 23:55:54 MST 2006
Author: oej
Date: Mon Jul 3 01:55:53 2006
New Revision: 36778
URL: http://svn.digium.com/view/asterisk?rev=36778&view=rev
Log:
Reset automerge
Modified:
team/oej/strictrouting/ (props changed)
team/oej/strictrouting/channels/chan_sip.c
Propchange: team/oej/strictrouting/
------------------------------------------------------------------------------
automerge = http://edvina.net/training/
Propchange: team/oej/strictrouting/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Jul 3 01:55:53 2006
@@ -1,1 +1,1 @@
-/trunk:1-36636
+/trunk:1-36696
Modified: team/oej/strictrouting/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/strictrouting/channels/chan_sip.c?rev=36778&r1=36777&r2=36778&view=diff
==============================================================================
--- team/oej/strictrouting/channels/chan_sip.c (original)
+++ team/oej/strictrouting/channels/chan_sip.c Mon Jul 3 01:55:53 2006
@@ -5153,7 +5153,7 @@
/*! \brief Add route header into request per learned route */
static void add_route(struct sip_request *req, struct sip_route *route)
{
- char r[256], *p;
+ char r[BUFSIZ], *p;
int n, rem = sizeof(r);
if (!route)
@@ -5317,7 +5317,7 @@
return 0;
}
-/*! \brief Initialize a SIP request packet within an existing dialog */
+/*! \brief Initialize a SIP request message (not the initial one in a dialog) */
static int reqprep(struct sip_request *req, struct sip_pvt *p, int sipmethod, int seqno, int newbranch)
{
struct sip_request *orig = &p->initreq;
@@ -5351,20 +5351,20 @@
is_strict = TRUE;
}
- if (sipmethod == SIP_CANCEL) { /* Cancel goes to the INVITEs URI */
+ if (sipmethod == SIP_CANCEL)
c = p->initreq.rlPart2; /* Use original URI */
- } else if (sipmethod == SIP_ACK) { /* SIP_ACK has two routing scenarios */
+ else if (sipmethod == SIP_ACK) {
/* Use URI from Contact: in 200 OK (if INVITE)
(we only have the contacturi on INVITEs) */
if (!ast_strlen_zero(p->okcontacturi))
c = is_strict ? p->route->hop : p->okcontacturi;
else
c = p->initreq.rlPart2;
- } else if (!ast_strlen_zero(p->okcontacturi)) {
+ } else if (!ast_strlen_zero(p->okcontacturi))
c = is_strict ? p->route->hop : p->okcontacturi; /* Use for BYE or REINVITE */
- } else if (!ast_strlen_zero(p->uri)) {
+ else if (!ast_strlen_zero(p->uri))
c = p->uri;
- } else {
+ else {
char *n;
/* We have no URI, use To: or From: header as URI (depending on direction) */
ast_copy_string(stripped, get_header(orig, (ast_test_flag(&p->flags[0], SIP_OUTGOING)) ? "To" : "From"),
@@ -7576,7 +7576,8 @@
if ((thishop = ast_malloc(sizeof(*thishop) + len))) {
/* ast_calloc is not needed because all fields are initialized in this block */
ast_copy_string(thishop->hop, rr, len);
- ast_log(LOG_DEBUG, "build_route: Record-Route hop: <%s>\n", thishop->hop);
+ if (option_debug > 1)
+ ast_log(LOG_DEBUG, "build_route: Record-Route hop: <%s>\n", thishop->hop);
/* Link in */
if (backwards) {
/* Link in at head so they end up in reverse order */
@@ -7605,9 +7606,8 @@
/* Can be multiple Contact headers, comma separated values - we just take the first */
contact = get_header(req, "Contact");
if (!ast_strlen_zero(contact)) {
- if (option_debug)
+ if (option_debug > 1)
ast_log(LOG_DEBUG, "build_route: Contact hop: %s\n", contact);
-
/* Look for <: delimited address */
c = get_in_brackets(contact);
@@ -12950,7 +12950,8 @@
break;
case AST_STATE_UP:
if (option_debug > 1)
- ast_log(LOG_DEBUG, "%s: New call is UP.... \n", c->name);
+ ast_log(LOG_DEBUG, "%s: This call is UP.... \n", c->name);
+
if (p->t38.state == T38_PEER_REINVITE) {
struct ast_channel *bridgepeer = NULL;
struct sip_pvt *bridgepvt = NULL;
@@ -12997,6 +12998,8 @@
ast_log(LOG_DEBUG,"T38 state changed to %d on channel %s\n", p->t38.state, p->owner ? p->owner->name : "<none>");
}
} else if (p->t38.state == T38_DISABLED) { /* Channel doesn't have T38 offered or enabled */
+ int sendok = TRUE;
+
/* If we are bridged to a channel that has T38 enabled than this is a case of RTP re-invite after T38 session */
/* so handle it here (re-invite other party to RTP) */
struct ast_channel *bridgepeer = NULL;
@@ -13004,6 +13007,7 @@
if ((bridgepeer = ast_bridged_channel(p->owner))) {
if (!strcasecmp(bridgepeer->tech->type, sip_tech.type)) {
bridgepvt = (struct sip_pvt*)bridgepeer->tech_pvt;
+ /* Does the bridged peer have T38 ? */
if (bridgepvt->t38.state == T38_ENABLED) {
ast_log(LOG_WARNING, "RTP re-invite after T38 session not handled yet !\n");
/* Insted of this we should somehow re-invite the other side of the bridge to RTP */
@@ -13012,13 +13016,14 @@
else
transmit_response_reliable(p, "488 Not Acceptable Here (unsupported)", req);
ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
- } else {
- /* No bridged peer with T38 enabled*/
- transmit_response_with_sdp(p, "200 OK", req, XMIT_CRITICAL);
- }
+ sendok = FALSE;
+ }
+ /* No bridged peer with T38 enabled*/
}
- } else /* No bridged peer */
+ }
+ if (sendok)
transmit_response_with_sdp(p, "200 OK", req, XMIT_CRITICAL);
+
}
break;
default:
More information about the svn-commits
mailing list