[svn-commits] oej: branch oej/register-call-dependency-1.8 r422352 - in /team/oej/register-...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Aug 29 03:30:24 CDT 2014


Author: oej
Date: Fri Aug 29 03:30:16 2014
New Revision: 422352

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=422352
Log:
Make sure the fromdomain is handled perfectly well.
Seems like there is an issue in the regparser with auth usernames containing a @, like oej at edvina.net

Modified:
    team/oej/register-call-dependency-1.8/channels/chan_sip.c
    team/oej/register-call-dependency-1.8/channels/sip/config_parser.c

Modified: team/oej/register-call-dependency-1.8/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/register-call-dependency-1.8/channels/chan_sip.c?view=diff&rev=422352&r1=422351&r2=422352
==============================================================================
--- team/oej/register-call-dependency-1.8/channels/chan_sip.c (original)
+++ team/oej/register-call-dependency-1.8/channels/chan_sip.c Fri Aug 29 03:30:16 2014
@@ -13881,11 +13881,12 @@
 		ast_debug(1, "Scheduled a registration timeout for %s id  #%d \n", r->hostname, r->timeout);
 	}
 
-	snprintf(from, sizeof(from), "<sip:%s@%s>;tag=%s", r->username, S_OR(r->regdomain, sip_sanitized_host(p->tohost)), p->tag);
+	/* If the peer has a fromdomain setting, it should be used. */
+	snprintf(from, sizeof(from), "<sip:%s@%s>;tag=%s", r->username, S_OR(p->fromdomain,S_OR(r->regdomain, sip_sanitized_host(p->tohost))), p->tag);
 	if (!ast_strlen_zero(p->theirtag)) {
-		snprintf(to, sizeof(to), "<sip:%s@%s>;tag=%s", r->username, S_OR(r->regdomain, sip_sanitized_host(p->tohost)), p->theirtag);
+		snprintf(to, sizeof(to), "<sip:%s@%s>;tag=%s", r->username, S_OR(p->fromdomain,S_OR(r->regdomain, sip_sanitized_host(p->tohost))), p->theirtag);
 	} else {
-		snprintf(to, sizeof(to), "<sip:%s@%s>", r->username, S_OR(r->regdomain, sip_sanitized_host(p->tohost)));
+		snprintf(to, sizeof(to), "<sip:%s@%s>", r->username, S_OR(p->fromdomain,S_OR(r->regdomain, sip_sanitized_host(p->tohost))));
 	}
 
 	/* Fromdomain is what we are registering to, regardless of actual

Modified: team/oej/register-call-dependency-1.8/channels/sip/config_parser.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/register-call-dependency-1.8/channels/sip/config_parser.c?view=diff&rev=422352&r1=422351&r2=422352
==============================================================================
--- team/oej/register-call-dependency-1.8/channels/sip/config_parser.c (original)
+++ team/oej/register-call-dependency-1.8/channels/sip/config_parser.c Fri Aug 29 03:30:16 2014
@@ -267,6 +267,7 @@
 	reg->callid_valid = FALSE;
 	reg->ocseq = INITIAL_CSEQ;
 	reg->refresh = reg->expiry = reg->configured_expiry = (host1.expiry ? atoi(ast_strip_quoted(host1.expiry, "\"", "\"")) : default_expiry);
+	ast_debug(2, "  ==> Register to domain %s : User %s Host %s Auth user %s Secret %s\n", reg->regdomain, reg->username, reg->hostname, reg->authuser, reg->secret);
 
 	return 0;
 }




More information about the svn-commits mailing list