piece of code:
........
failure_route[2] {
if (!t_is_canceled()) {
revert_uri();
sql_query("main", "select username from subscriber where alias='$tU' and alias_seq='2'", "alias_name");
sql_query("main", "select domain from subscriber where alias='$tU' and alias_seq='2'", "alias_domain");
subst_uri('/^sip:.*@.*$/sip:$dbr(alias_name=>[0,0])@$dbr(alias_domain=>[0,0])/');
subst('/^To:.*<sip:.*>/To: <sip:$dbr(alias_name=>[0,0])@$dbr(alias_domain=>[0,0])>\r/'); #<-----THIS ONE DOESN'T WORK PROPERLY
sql_result_free("alias_name");
sql_result_free("alias_domain");
setflag(10);
if (!lookup("location")) {
switch ($retcode) {
case -1:
case -3:
t_reply("404", "Not Found");
exit;
case -2:
exit;
}
}
append_branch();
route(5);
}
}
route[5] {
if (!t_relay()) {
sl_reply_error();
}
exit;
}
And with ngrep i can see:
#
Record-Route: <sip:10.10.10.10;lr=on;ftag=D1D33F74-16CA;nat=yes>.
Via: SIP/2.0/UDP 10.10.10.10;branch=z9hG4bKc1ce.a89602e5.1.
Via: SIP/2.0/UDP 10.20.5.10:5060;rport=57078;branch=z9hG4bK6F2A7E0.
Date: Tue, 08 Jun 2010 06:39:41 GMT.
Supported: 100rel,timer,resource-priority,replaces.
Min-SE: 1800.
Cisco-Guid: 1942740043-1912541663-2892365836-2242214896.
User-Agent: Cisco-SIPGateway/IOS-12.x.
Accept-Language: ru.
Allow: INVITE, OPTIONS, BYE, CANCEL, ACK, PRACK, UPDATE, REFER, SUBSCRIBE, NOTIFY, INFO, REGISTER.
CSeq: 101 INVITE.
Max-Forwards: 69.
Timestamp: 1275979181.
Expires: 180.
Allow-Events: telephone-event.
Content-Type: application/sdp.
Content-Disposition: session;handling=required.
Content-Length: 401.
...............
I'm a newbie, so, please, show me where is my mistake.
Sincerely yours,
Kosilov Fedor.