Stefan,
<br />
<br />If I understand you correctly you are talking about the following scenario
<br />
<br />someone calls 55555 and when it comes into the OpenSIPS server the domain gets replaced with sip.mydomain or mydomain.net.  The true domain for 55555 is something like 55555@fivefives.com.  So if you want to send the call to Asterisk so that someone can leave 55555@fivefives.com a voicemail you need to be able to change the domain to @fivefives.com instead of sip.mydomain or whatever else the domain might be when it comes in.
<br />
<br />If that is the scenario you are talking about then you can do this (This is what I do).
<br />
<br />When I create subscribers I do the following
<br />opensipsctl alias_db add 55555@fivefives.com 55555@fivefives.com
<br />
<br />Then in the OpenSIPS config do the following
<br />alias_db_lookup(&quot;dbaliases&quot; , &quot;d&quot;);
<br />
<br />With the function above OpenSIPS will look in the dbaliases database table for a username &quot;55555&quot; and ignore the current domain attached to that user and if the username is found in the dbaliases table the current domain on the uri will get replaced with the one in the dbaliases table.
<br />
<br />Hope that is what you are wanting.
<br />
<br />
<br />On May 24, 2011 8:32am, Stefan Sayer &lt;stefan.sayer@googlemail.com&gt; wrote:
<br />&gt; Hello,
<br />&gt; 
<br />&gt; 
<br />&gt; 
<br />&gt; 
<br />&gt; 
<br />&gt; in a typical OpenSIPS 1.6.* home proxy type of setup (i.e. where you have opensips as registrar and home proxy) with aliases and multi-domain support, e.g. the one from the default opensips.cfg, is there a way to determine the &#39;canonical&#39; domain and user ID, which is properly the same for a user in all cases, e.g. when sending to voicemail?
<br />&gt; 
<br />&gt; 
<br />&gt; 
<br />&gt; 
<br />&gt; 
<br />&gt; I know there&#39;s e.g. $rd, but if my proxy listens on sip.mydomain.and mydomain.net, then that may be either of them, or it may be the IP address.
<br />&gt; 
<br />&gt; 
<br />&gt; 
<br />&gt; 
<br />&gt; 
<br />&gt; The only proper solution that comes to my mind is to set a user preference (which would be like the primary key as afterthought...well we know the history). But I guess that this is a recurring issue for many things (aaa etc), so there should be a better solution i suppose.
<br />&gt; 
<br />&gt; 
<br />&gt; 
<br />&gt; 
<br />&gt; 
<br />&gt; Thanks!
<br />&gt; 
<br />&gt; 
<br />&gt; Stefan
<br />&gt; 
<br />&gt; 
<br />&gt; 
<br />&gt; 
<br />&gt; 
<br />&gt; 
<br />&gt; 
<br />&gt; 
<br />&gt; _______________________________________________
<br />&gt; 
<br />&gt; 
<br />&gt; Users mailing list
<br />&gt; 
<br />&gt; 
<br />&gt; Users@lists.opensips.org
<br />&gt; 
<br />&gt; 
<br />&gt; http://lists.opensips.org/cgi-bin/mailman/listinfo/users
<br />&gt; 
<br />&gt; 
<br />&gt;