[Users] NAT+uac_replace_from

Bogdan-Andrei Iancu bogdan at voice-system.ro
Mon Jan 9 18:25:06 CET 2006


Hi,

when changing the FROM header in the initial request, you need to 
accordingly change it in all sequential requests. To do so, the easiest 
way is to switch to the auto mode (as Daniel suggested):
        modparam("uac","from_restore_mode","auto")
and change the from only in initial INVITEs.

regards,
Bogdan


unplug wrote:

>Thanks for your reply.  According to your reply, I add the following
>code for the PRACK.
>if (method=="PRACK") {
>           if (avp_db_load("$from/uri","s:alias")) {
>                 xlog("L_INFO","sip408: have alias - [$avp(s:alias)]\n");
>                 uac_replace_from("anonymous","sip:$avp(s:alias)@$si");
>           } else {
>                 xlog("L_INFO","sip411: no alias\n");
>           };
>}
>
>The result is the same as before.  It seems there is a conflict in the
>from header and it causes the 481 error.  To be more precise, below is
>the protocol flow.
>
>		UA1				server1			server2
>fromtag:taga	-----from username:9000 INVITE----->				
>fromtag:taga	<----from username:9000 100 trying---
>			after uac_replace_from("1234","sip:1234@$si")
>fromtag:taga 					------from username:1234 INVITE ---->
>(callee rings but caller drops)
>fromtag:taga					<-----from username:1234 100 trying----
>(callee still rings until answers the call)
>fromtag:taga					<----from username:1234 session progress 183---
>fromtag:taga	<-----from username:9000 session prgress 183----
>fromtag:taga	-----from username:9000 PRACK----------->
>fromtag:taga					----------from username:9000 PRACK--->
>fromtag:taga					<----from username:9000 481 call leg -----
>fromtag:taga	<----from username:9000 481 call leg -----
>
>
>On 1/5/06, Daniel-Constantin Mierla <daniel at voice-system.ro> wrote:
>  
>
>>Hello,
>>
>>"SIP/2.0 481 Call Leg/Transaction Does Not Exist" is for PRACK, because you do not change the From header for it. You have to do the same translation for all requests within the dialog. See the documentation of uac module: .
>>
>>http://openser.org/docs/modules/1.1.x/uac.html
>>
>>Cheers,
>>Daniel
>>
>>
>>On 01/04/06 12:21, unplug wrote:
>>    
>>
>>>Actually, I am replacing the username of the uri with the alias that
>>>stored in the database.  In my configuration file, it is using
>>>mediaproxy for NAT function (features-callfwd.5.0.cfg from getting
>>>started). I also add the following codes in the very first of the
>>>route routine for alias replacing purpose.
>>>
>>>route {
>>>...
>>>        if (!has_totag() && method=="INVITE") {
>>>          if (avp_db_load("$from/uri","s:alias")) {
>>>                xlog("L_INFO","sip408: have alias - [$avp(s:alias)]\n");
>>>                uac_replace_from("anonymous","sip:$avp(s:alias)@$si");
>>>          } else {
>>>                xlog("L_INFO","sip411: no alias\n");
>>>          };
>>>        };
>>>...
>>>}
>>>
>>>When I make a call from a phone to the PSTN phone, the caller drops
>>>the ring when the callee rings.  Callee hangs up and callee rings
>>>again few seconds after.  You can find an error message "SIP/2.0 481
>>>Call Leg/Transaction Does Not Exist" in line 180.  I wonder if there
>>>is any thing wrong with the above code or my concept is wrong.  Please
>>>help.  Below is the sip message.
>>>[...]
>>>
>>>      
>>>
>
>_______________________________________________
>Users mailing list
>Users at openser.org
>http://openser.org/cgi-bin/mailman/listinfo/users
>
>  
>





More information about the sr-users mailing list