[svn-commits] oej: branch oej/moremanager r65074 - in /team/oej/moremanager: ./ channels/ c...

svn-commits at lists.digium.com svn-commits at lists.digium.com
Fri May 18 06:24:23 MST 2007


Author: oej
Date: Fri May 18 08:24:23 2007
New Revision: 65074

URL: http://svn.digium.com/view/asterisk?view=rev&rev=65074
Log:
Another branch broken by oej...

Modified:
    team/oej/moremanager/   (props changed)
    team/oej/moremanager/channels/chan_sip.c
    team/oej/moremanager/channels/misdn/ie.c
    team/oej/moremanager/channels/misdn/isdn_msg_parser.c

Propchange: team/oej/moremanager/
------------------------------------------------------------------------------
    automerge = http://edvina.net/training/

Propchange: team/oej/moremanager/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Propchange: team/oej/moremanager/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri May 18 08:24:23 2007
@@ -1,1 +1,1 @@
-/branches/1.4:1-64994
+/branches/1.4:1-65073

Modified: team/oej/moremanager/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/moremanager/channels/chan_sip.c?view=diff&rev=65074&r1=65073&r2=65074
==============================================================================
--- team/oej/moremanager/channels/chan_sip.c (original)
+++ team/oej/moremanager/channels/chan_sip.c Fri May 18 08:24:23 2007
@@ -4741,6 +4741,35 @@
 	return 0;
 }
 
+/*! \brief Change hold state for a call */
+static void change_hold_state(struct sip_pvt *dialog, struct sip_request *req, int holdstate, int sendonly)
+{
+	if (global_notifyhold)
+		sip_peer_hold(dialog, holdstate);
+	if (global_callevents)
+		manager_event(EVENT_FLAG_CALL, "Hold",
+			      "Status: %s\r\n"
+			      "Channel: %s\r\n"
+			      "Uniqueid: %s\r\n",
+			      holdstate ? "On" : "Off",
+			      dialog->owner->name, 
+			      dialog->owner->uniqueid);
+	append_history(dialog, holdstate ? "Hold" : "Unhold", "%s", req->data);
+	if (!holdstate) { 	/* Put off remote hold */
+		ast_clear_flag(&dialog->flags[1], SIP_PAGE2_CALL_ONHOLD);	/* Clear both flags */
+		return;
+	}
+	/* No address for RTP, we're on hold */
+
+	if (sendonly == 1)	/* One directional hold (sendonly/recvonly) */
+		ast_set_flag(&dialog->flags[1], SIP_PAGE2_CALL_ONHOLD_ONEDIR);
+	else if (sendonly == 2)	/* Inactive stream */
+		ast_set_flag(&dialog->flags[1], SIP_PAGE2_CALL_ONHOLD_INACTIVE);
+	else
+		ast_set_flag(&dialog->flags[1], SIP_PAGE2_CALL_ONHOLD_ACTIVE);
+	return;
+}
+
 /*! \brief Process SIP SDP offer, select formats and activate RTP channels
 	If offer is rejected, we will not change any properties of the call
  	Return 0 on success, a negative value on errors.
@@ -5289,40 +5318,10 @@
 	}
 
 	/* Manager Hold and Unhold events must be generated, if necessary */
-	if (ast_test_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD) && sin.sin_addr.s_addr && (!sendonly || sendonly == -1)) {
-		append_history(p, "Unhold", "%s", req->data);
-		if (global_callevents)
-			manager_event(EVENT_FLAG_CALL, "Hold",
-				      "Status: Off\r\n"
-				      "Channel: %s\r\n"
-				      "Uniqueid: %s\r\n",
-				      p->owner->name, 
-				      p->owner->uniqueid);
-		if (global_notifyhold)
-			sip_peer_hold(p, 0);
-		ast_clear_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD);	/* Clear both flags */
-	} else if (!sin.sin_addr.s_addr || (sendonly && sendonly != -1)) {
-		/* No address for RTP, we're on hold */
-		append_history(p, "Hold", "%s", req->data);
-
-		if (global_callevents && !ast_test_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD)) {
-			manager_event(EVENT_FLAG_CALL, "Hold",
-				"Status: On\r\n"
-				"Channel: %s\r\n"
-				"Uniqueid: %s\r\n",
-				p->owner->name, 
-				p->owner->uniqueid);
-		}
-		if (sendonly == 1)	/* One directional hold (sendonly/recvonly) */
-			ast_set_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD_ONEDIR);
-		else if (sendonly == 2)	/* Inactive stream */
-			ast_set_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD_INACTIVE);
-		else
-			ast_set_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD_ACTIVE);
-		if (global_notifyhold)
-			sip_peer_hold(p, 1);
-	}
-	
+	if (ast_test_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD) && sin.sin_addr.s_addr && (!sendonly || sendonly == -1))
+		change_hold_state(p, req, FALSE, sendonly);
+	else if (!sin.sin_addr.s_addr || (sendonly && sendonly != -1))
+		change_hold_state(p, req, TRUE, sendonly);
 	return 0;
 }
 
@@ -13414,8 +13413,13 @@
 				}
 			} else {
 				p->jointcapability = p->capability;
-				if (option_debug)
+				if (option_debug > 2)
 					ast_log(LOG_DEBUG, "Hm....  No sdp for the moment\n");
+				/* Some devices signal they want to be put off hold by sending a re-invite
+				   *without* an SDP, which is supposed to mean "Go back to your state"
+				   and since they put os on remote hold, we go back to off hold */
+				if (ast_test_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD))
+					change_hold_state(p, req, FALSE, 0);
 			}
 			if (!ast_test_flag(&p->flags[0], SIP_NO_HISTORY)) /* This is a response, note what it was for */
 				append_history(p, "ReInv", "Re-invite received");

Modified: team/oej/moremanager/channels/misdn/ie.c
URL: http://svn.digium.com/view/asterisk/team/oej/moremanager/channels/misdn/ie.c?view=diff&rev=65074&r1=65073&r2=65074
==============================================================================
--- team/oej/moremanager/channels/misdn/ie.c (original)
+++ team/oej/moremanager/channels/misdn/ie.c Fri May 18 08:24:23 2007
@@ -953,7 +953,7 @@
 
 	if (MISDN_IE_DEBG) printf("    keypad='%s'\n", keypad);
 
-	l = strlen((char *)keypad);
+	l = strlen(keypad);
 	p = msg_put(msg, l+2);
 	if (nt)
 		*ntmode = p+1;
@@ -961,7 +961,7 @@
 		qi->QI_ELEMENT(keypad) = p - (unsigned char *)qi - sizeof(Q931_info_t);
 	p[0] = IE_KEYPAD;
 	p[1] = l;
-	strncpy((char *)p+2, (char *)keypad, strlen((char *)keypad));
+	strncpy((char *)p+2, keypad, strlen(keypad));
 }
 #endif
 

Modified: team/oej/moremanager/channels/misdn/isdn_msg_parser.c
URL: http://svn.digium.com/view/asterisk/team/oej/moremanager/channels/misdn/isdn_msg_parser.c?view=diff&rev=65074&r1=65073&r2=65074
==============================================================================
--- team/oej/moremanager/channels/misdn/isdn_msg_parser.c (original)
+++ team/oej/moremanager/channels/misdn/isdn_msg_parser.c Fri May 18 08:24:23 2007
@@ -340,15 +340,13 @@
 	}
 
 	if (bc->sending_complete) {
-		enc_ie_complete(&setup->BEARER,msg, bc->sending_complete, nt, bc);
-	}
-  
-	{
+		enc_ie_complete(&setup->COMPLETE,msg, bc->sending_complete, nt, bc);
+	}
+  
+	if (bc->uulen) {
 		int  protocol=4;
 		enc_ie_useruser(&setup->USER_USER, msg, protocol, bc->uu, bc->uulen, nt,bc);
-		if (bc->uulen) cb_log(1,bc->port,"ENCODING USERUESRINFO:%s\n",bc->uu);
-		else
-		cb_log(1,bc->port,"NO USERUESRINFO ENCODED\n");
+		cb_log(1,bc->port,"ENCODING USERUESRINFO:%s\n",bc->uu);
 	}
 
 #if DEBUG 



More information about the svn-commits mailing list