route[3] { log(1, "Entering route[3]..."); fix_nated_register(); save_noreply("location"); #save("location"); # snom 200: Contact: ;q=1.0 # \1 \2 \3 \4 \5 if ( subst('/^Contact:(.*)(.*)$/Contact:\1\5/ig') ) { log(1, "Contact in REGISTER rewritten - SNOM style\n"); } # \1 \2 \3 \4 if ( subst('/^Contact:(.*)(.*)$/Contact:\1\4/ig') ) { log(1, "Contact in REGISTER rewritten - SIPURA style\n"); } #Contact: ;methods="INVITE, MESSAGE, INFO, OPTIONS, BYE, CANCEL, ACK, REFER" # \1 \2 \3 if ( subst('/^Contact:(.*)(.*)$/Contact:\1\3/ig') ) { #Messenger style contact without username log(1, "Contact in REGISTER rewritten - RTC API style\n"); } t_on_reply("3"); t_relay(); log(1, "... leaving route[3]"); break; } onreply_route[3] { log(1, "Entering onreply_route[3]...\n"); # \1 \2 \3 \4 if ( subst('/^Contact:(.*)(.*)$/Contact:\1\4/ig') ) { #Messenger style contact without username log(1, "Contact in REGISTER response rewritten - RTC API style\n"); } # \1 \2 \3 \4 \5 \6 if ( subst('/^Contact:(.*)(.*)$/Contact:\1\6/ig') ) { log(1, "Contact in REGISTER respone rewritten - SNOM style\n"); }; # \1 \2 \3 \4 \5 if ( subst('/^Contact:(.*)(.*)$/Contact:\1\5/ig') ) { log(1, "Contact in REGISTER respone rewritten - SIPURA style\n"); }; log(1, "leaving onreply_route(3)\n"); }