[svn-commits] branch oej/sipregister r15424 - in /team/oej/sipregister: ./ channels/chan_sip.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Mon Mar 27 17:09:13 MST 2006


Author: oej
Date: Mon Mar 27 18:09:12 2006
New Revision: 15424

URL: http://svn.digium.com/view/asterisk?rev=15424&view=rev
Log:
resolve and move forward

Modified:
    team/oej/sipregister/   (props changed)
    team/oej/sipregister/channels/chan_sip.c

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

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

Propchange: team/oej/sipregister/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Mar 27 18:09:12 2006
@@ -1,1 +1,1 @@
-/trunk:1-15354
+/trunk:1-15417

Modified: team/oej/sipregister/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/sipregister/channels/chan_sip.c?rev=15424&r1=15423&r2=15424&view=diff
==============================================================================
--- team/oej/sipregister/channels/chan_sip.c (original)
+++ team/oej/sipregister/channels/chan_sip.c Mon Mar 27 18:09:12 2006
@@ -5621,6 +5621,8 @@
 		ast_string_field_set(r, callid, p->callid);
 		if (r->portno)
 			p->sa.sin_port = htons(r->portno);
+		else 	/* Set registry port to the port set from the peer definition/srv or default */
+			r->portno = p->sa.sin_port;
 		ast_set_flag(&p->flags[0], SIP_OUTGOING);	/* Registration is outgoing call */
 		r->call=p;			/* Save pointer to SIP packet */
 		p->registry = ASTOBJ_REF(r);	/* Add pointer to registry in packet */
@@ -6754,6 +6756,7 @@
 	char tmpf[256], *from;
 	struct sip_request *req;
 	int localdomain = TRUE;
+	char *colon;
 	
 	req = oreq;
 	if (!req)
@@ -6785,20 +6788,27 @@
 		ast_uri_decode(from);
 	}
 
+	/* Skip any options */
+	if ((a = strchr(uri, ';'))) {
+		*a = '\0';
+	}
+
 	/* Get the target domain */
 	if ((a = strchr(uri, '@'))) {
-		char *colon;
 		*a = '\0';
 		a++;
 		colon = strchr(a, ':'); /* Remove :port */
 		if (colon)
 			*colon = '\0';
-		ast_string_field_set(p, domain, a);
-	}
-	/* Skip any options */
-	if ((a = strchr(uri, ';'))) {
-		*a = '\0';
-	}
+	} else {	/* No username part */
+		a = uri;
+		uri = "s";	/* Set extension to "s" */
+	}
+	colon = strchr(a, ':'); /* Remove :port */
+	if (colon)
+		*colon = '\0';
+
+	ast_string_field_set(p, domain, a);
 
 	if (!AST_LIST_EMPTY(&domain_list)) {
 		char domain_context[AST_MAX_EXTENSION];
@@ -11745,6 +11755,7 @@
 static int sip_poke_peer(struct sip_peer *peer)
 {
 	struct sip_pvt *p;
+
 	if (!peer->maxms || !peer->addr.sin_addr.s_addr) {
 		/* IF we have no IP, or this isn't to be monitored, return
 		  imeediately after clearing things out */
@@ -11765,8 +11776,10 @@
 	
 	memcpy(&p->sa, &peer->addr, sizeof(p->sa));
 	memcpy(&p->recv, &peer->addr, sizeof(p->sa));
-
-	/* Send options to peer's fullcontact */
+	ast_copy_flags(&peer->flags[0], &global_flags[0], SIP_FLAGS_TO_COPY);
+	ast_copy_flags(&peer->flags[1], &global_flags[1], SIP_PAGE2_FLAGS_TO_COPY);
+
+	/* Send OPTIONs to peer's fullcontact */
 	if (!ast_strlen_zero(peer->fullcontact))
 		ast_string_field_set(p, fullcontact, peer->fullcontact);
 



More information about the svn-commits mailing list