Hi,
first I think the if branches should be swapped - if the from URI has an
username, then you should change it.
about how to use uac module for from changing:
1) set to Auto the restore mode
modparam("uac","from_restore_mode","auto")
2) call uac_replace_from() only for initial request (without TO tag)
regards,
bogdan
unplug wrote:
I am modifying features-callfwd.5.0.cfg from the
getting start script.
I have inserted the following code after if (msg:len>max_len) {}. It
is used to detect the @ in the from header to find any anonymous call
and replace that header to anonymous@calling_source. I have no idea
it is the right way to do as there is an error shown in the log. Any
comment.
if
(method=="INVITE"||method=="ACK"||method=="CANCEL"||method=="BYE")
{
if (from_uri=~".*@.*") {
xlog("L_INFO","SIP have @\n");
} else {
xlog("L_INFO","SIP no @\n");
uac_replace_from("anonymous","anonymous@$si");
};
};
In the log, below error shown.
Dec 29 17:05:47 owthkems01 /usr/local/sbin/openser[3420]:
ERROR:uac:replace_from: decline FROM replacing in sequential request
(has TO tag)
interface: any
filter: (ip) and ( port 5060 )
#
U 200.190.40.242:51895 -> 200.190.40.226:5060
INVITE sip:36418473@200.190.40.226:5060 SIP/2.0.
Via: SIP/2.0/UDP 200.190.40.242:5060.
From: <sip:200.190.40.242>;tag=1E51512C-12BC.
To: <sip:36418473@200.190.40.226>.
Date: Thu, 29 Dec 2005 09:29:11 GMT.
Call-ID: 678AB9AD-778411DA-8334950A-6B2B773F(a)200.190.40.242.
Supported: timer,100rel.
Min-SE: 1800.
Cisco-Guid: 1737064797-2005144026-2201064714-1798010687.
User-Agent: Cisco-SIPGateway/IOS-12.x.
Allow: INVITE, OPTIONS, BYE, CANCEL, ACK, PRACK, COMET, REFER,
SUBSCRIBE, NOTIFY, INFO.
CSeq: 101 INVITE.
Max-Forwards: 15.
Remote-Party-ID: <sip:200.190.40.242>;party=calling;screen=no;privacy=off.
Timestamp: 1135848551.
Contact: <sip:200.190.40.242:5060>.
Expires: 180.
Allow-Events: telephone-event.
Content-Type: application/sdp.
Content-Length: 305.
.
v=0.
o=CiscoSystemsSIP-GW-UserAgent 4299 5269 IN IP4 200.190.40.242.
s=SIP Call.
c=IN IP4 200.190.40.242.
t=0 0.
m=audio 18612 RTP/AVP 3 18 4 2 15.
a=rtpmap:3 GSM/8000.
a=rtpmap:18 G729/8000.
a=fmtp:18 annexb=yes.
a=rtpmap:4 G723/8000.
a=fmtp:4 annexa=yes.
a=rtpmap:2 G726-32/8000.
a=rtpmap:15 G728/8000.
#
U 200.190.40.226:5060 -> 200.190.40.242:51895
SIP/2.0 100 trying -- your call is important to us.
Via: SIP/2.0/UDP 200.190.40.242:5060;rport=51895.
From: <sip:200.190.40.242>;tag=1E51512C-12BC.
To: <sip:36418473@200.190.40.226>.
Call-ID: 678AB9AD-778411DA-8334950A-6B2B773F(a)200.190.40.242.
CSeq: 101 INVITE.
Server: OpenSer (1.0.0 (i386/linux)).
Content-Length: 0.
Warning: 392 200.190.40.226:5060 "Noisy feedback tells: pid=3737
req_src_ip=200.190.40.242 req_src_port=51895
in_uri=sip:36418473@200.190.40.226:5060
out_uri=sip:882754853589@10.0.0.52:5060 via_cnt==1".
.
#
U 200.190.40.226:5060 -> 200.180.40.31:5060
INVITE sip:882754853589@10.0.0.52:5060 SIP/2.0.
Record-Route: <sip:36418473@200.190.40.226:5060;nat=yes;ftag=1E51512C-12BC;lr=on>.
Via: SIP/2.0/UDP 200.190.40.226;branch=z9hG4bK6174.d8d20e25.0.
Via: SIP/2.0/UDP 200.190.40.242:5060;rport=51895.
From: <sip:anonymous@200.190.40.242>;tag=1E51512C-12BC.
To: <sip:36418473@200.190.40.226>.
Date: Thu, 29 Dec 2005 09:29:11 GMT.
Call-ID: 678AB9AD-778411DA-8334950A-6B2B773F(a)200.190.40.242.
Supported: timer,100rel.
Min-SE: 1800.
Cisco-Guid: 1737064797-2005144026-2201064714-1798010687.
User-Agent: Cisco-SIPGateway/IOS-12.x.
Allow: INVITE, OPTIONS, BYE, CANCEL, ACK, PRACK, COMET, REFER,
SUBSCRIBE, NOTIFY, INFO.
CSeq: 101 INVITE.
Max-Forwards: 14.
Remote-Party-ID: <sip:200.190.40.242>;party=calling;screen=no;privacy=off.
Timestamp: 1135848551.
Contact: <sip:200.190.40.242:51895>.
Expires: 180.
Allow-Events: telephone-event.
Content-Type: application/sdp.
Content-Length: 304.
.
v=0.
o=CiscoSystemsSIP-GW-UserAgent 4299 5269 IN IP4 200.190.40.242.
s=SIP Call.
c=IN IP4 200.190.40.226.
t=0 0.
m=audio 4290 RTP/AVP 3 18 4 2 15.
a=rtpmap:3 GSM/8000.
a=rtpmap:18 G729/8000.
a=fmtp:18 annexb=yes.
a=rtpmap:4 G723/8000.
a=fmtp:4 annexa=yes.
a=rtpmap:2 G726-32/8000.
a=rtpmap:15 G728/8000.
#
U 200.180.40.31:5060 -> 200.190.40.226:5060
SIP/2.0 180 Ringing.
Via: SIP/2.0/UDP 200.190.40.226;branch=z9hG4bK6174.d8d20e25.0.
Via: SIP/2.0/UDP 200.190.40.242:5060;rport=51895.
Record-Route: <sip:36418473@200.190.40.226:5060;nat=yes;ftag=1E51512C-12BC;lr=on>.
Call-ID: 678AB9AD-778411DA-8334950A-6B2B773F(a)200.190.40.242.
CSeq: 101 INVITE.
From: <sip:anonymous@200.190.40.242>;tag=1E51512C-12BC.
To: <sip:36418473@200.190.40.226>;tag=NYfee18oJjrLPTZ7.
RSeq: 4347.
Require: 100rel.
Contact: <sip:882754853589@10.0.0.52:5060>.
Content-Length: 0.
.
#
U 200.190.40.226:5060 -> 200.190.40.242:51895
SIP/2.0 180 Ringing.
Via: SIP/2.0/UDP 200.190.40.242:5060;rport=51895.
Record-Route: <sip:36418473@200.190.40.226:5060;nat=yes;ftag=1E51512C-12BC;lr=on>.
Call-ID: 678AB9AD-778411DA-8334950A-6B2B773F(a)200.190.40.242.
CSeq: 101 INVITE.
From: <sip:200.190.40.242>;tag=1E51512C-12BC.
To: <sip:36418473@200.190.40.226>;tag=NYfee18oJjrLPTZ7.
RSeq: 4347.
Require: 100rel.
Contact: <sip:882754853589@200.180.40.31:5060>.
Content-Length: 0.
.
#
U 200.190.40.242:51216 -> 200.190.40.226:5060
PRACK sip:36418473@200.190.40.226:5060;nat=yes;ftag=1E51512C-12BC;lr=on SIP/2.0.
Via: SIP/2.0/UDP 200.190.40.242:5060.
From: <sip:200.190.40.242>;tag=1E51512C-12BC.
To: <sip:36418473@200.190.40.226>;tag=NYfee18oJjrLPTZ7.
Date: Thu, 29 Dec 2005 09:29:11 GMT.
Call-ID: 678AB9AD-778411DA-8334950A-6B2B773F(a)200.190.40.242.
CSeq: 102 PRACK.
RAck: 4347 101 INVITE.
Route: <sip:882754853589@200.180.40.31:5060>.
Content-Length: 0.
.
#
U 200.190.40.226:5060 -> 200.180.40.31:5060
PRACK sip:882754853589@200.180.40.31:5060 SIP/2.0.
Max-Forwards: 10.
Record-Route: <sip:200.190.40.226;ftag=1E51512C-12BC;lr=on>.
Via: SIP/2.0/UDP 200.190.40.226;branch=z9hG4bK3174.de38e215.0.
Via: SIP/2.0/UDP 200.190.40.242:5060.
From: <sip:200.190.40.242>;tag=1E51512C-12BC.
To: <sip:36418473@200.190.40.226>;tag=NYfee18oJjrLPTZ7.
Date: Thu, 29 Dec 2005 09:29:11 GMT.
Call-ID: 678AB9AD-778411DA-8334950A-6B2B773F(a)200.190.40.242.
CSeq: 102 PRACK.
RAck: 4347 101 INVITE.
Content-Length: 0.
.
#
U 200.180.40.31:5060 -> 200.190.40.226:5060
SIP/2.0 200 OK.
Via: SIP/2.0/UDP 200.190.40.226;branch=z9hG4bK3174.de38e215.0.
Via: SIP/2.0/UDP 200.190.40.242:5060.
Record-Route: <sip:200.190.40.226;ftag=1E51512C-12BC;lr=on>.
Call-ID: 678AB9AD-778411DA-8334950A-6B2B773F(a)200.190.40.242.
CSeq: 102 PRACK.
From: <sip:200.190.40.242>;tag=1E51512C-12BC.
To: <sip:36418473@200.190.40.226>;tag=NYfee18oJjrLPTZ7.
Contact: <sip:882754853589@10.0.0.52:5060>.
Content-Length: 0.
.
#
U 200.190.40.226:5060 -> 200.190.40.242:5060
SIP/2.0 200 OK.
Via: SIP/2.0/UDP 200.190.40.242:5060.
Record-Route: <sip:200.190.40.226;ftag=1E51512C-12BC;lr=on>.
Call-ID: 678AB9AD-778411DA-8334950A-6B2B773F(a)200.190.40.242.
CSeq: 102 PRACK.
From: <sip:200.190.40.242>;tag=1E51512C-12BC.
To: <sip:36418473@200.190.40.226>;tag=NYfee18oJjrLPTZ7.
Contact: <sip:882754853589@200.180.40.31:5060>.
Content-Length: 0.
.
#
U 200.190.40.242:51895 -> 200.190.40.226:5060
CANCEL sip:36418473@200.190.40.226:5060 SIP/2.0.
Via: SIP/2.0/UDP 200.190.40.242:5060.
From: <sip:200.190.40.242>;tag=1E51512C-12BC.
To: <sip:36418473@200.190.40.226>.
Date: Thu, 29 Dec 2005 09:29:11 GMT.
Call-ID: 678AB9AD-778411DA-8334950A-6B2B773F(a)200.190.40.242.
CSeq: 101 CANCEL.
Max-Forwards: 15.
Timestamp: 1135848554.
Content-Length: 0.
.
#
U 200.190.40.226:5060 -> 200.180.40.31:5060
CANCEL sip:882754853589@10.0.0.52:5060 SIP/2.0.
Record-Route:
<sip:200.190.40.226;ftag=1E51512C-12BC;vsf=AAAAAFNeXEBIVFxbR3YcAgccMTkzLjQ2LjI0Mg--;lr=on>.
Via: SIP/2.0/UDP 200.190.40.226;branch=z9hG4bK6174.d8d20e25.0.
Via: SIP/2.0/UDP 200.190.40.242:5060.
From: <sip:anonymous@200.190.40.242>;tag=1E51512C-12BC.
To: <sip:36418473@200.190.40.226>.
Date: Thu, 29 Dec 2005 09:29:11 GMT.
Call-ID: 678AB9AD-778411DA-8334950A-6B2B773F(a)200.190.40.242.
CSeq: 101 CANCEL.
Max-Forwards: 14.
Timestamp: 1135848554.
Content-Length: 0.
.
#
U 200.190.40.226:5060 -> 200.190.40.242:5060
SIP/2.0 200 canceling.
Via: SIP/2.0/UDP 200.190.40.242:5060.
From: <sip:200.190.40.242>;tag=1E51512C-12BC.
To: <sip:36418473@200.190.40.226>;tag=bcb64021c7f9a2e2b52d4731493a0b90-332b.
Call-ID: 678AB9AD-778411DA-8334950A-6B2B773F(a)200.190.40.242.
CSeq: 101 CANCEL.
Server: OpenSer (1.0.0 (i386/linux)).
Content-Length: 0.
Warning: 392 200.190.40.226:5060 "Noisy feedback tells: pid=3737
req_src_ip=200.190.40.242 req_src_port=51895
in_uri=sip:36418473@200.190.40.226:5060
out_uri=sip:36418473@200.190.40.226:5060 via_cnt==1".
.
#
U 200.180.40.31:5060 -> 200.190.40.226:5060
SIP/2.0 200 OK.
Via: SIP/2.0/UDP 200.190.40.226;branch=z9hG4bK6174.d8d20e25.0.
Via: SIP/2.0/UDP 200.190.40.242:5060.
Record-Route:
<sip:200.190.40.226;ftag=1E51512C-12BC;vsf=AAAAAFNeXEBIVFxbR3YcAgccMTkzLjQ2LjI0Mg--;lr=on>.
Call-ID: 678AB9AD-778411DA-8334950A-6B2B773F(a)200.190.40.242.
CSeq: 101 CANCEL.
From: <sip:anonymous@200.190.40.242>;tag=1E51512C-12BC.
To: <sip:36418473@200.190.40.226>;tag=NYfee18oJjrLPTZ7.
Contact: <sip:882754853589@10.0.0.52:5060>.
Content-Length: 0.
.
#
U 200.180.40.31:5060 -> 200.190.40.226:5060
SIP/2.0 487 Request Terminated.
Via: SIP/2.0/UDP 200.190.40.226;branch=z9hG4bK6174.d8d20e25.0.
Via: SIP/2.0/UDP 200.190.40.242:5060;rport=51895.
Record-Route: <sip:36418473@200.190.40.226:5060;nat=yes;ftag=1E51512C-12BC;lr=on>.
Call-ID: 678AB9AD-778411DA-8334950A-6B2B773F(a)200.190.40.242.
CSeq: 101 INVITE.
From: <sip:anonymous@200.190.40.242>;tag=1E51512C-12BC.
To: <sip:36418473@200.190.40.226>;tag=NYfee18oJjrLPTZ7.
Contact: <sip:882754853589@10.0.0.52:5060>.
Content-Length: 0.
.
#
U 200.190.40.226:5060 -> 200.180.40.31:5060
ACK sip:882754853589@10.0.0.52:5060 SIP/2.0.
Via: SIP/2.0/UDP 200.190.40.226;branch=z9hG4bK6174.d8d20e25.0.
From: <sip:anonymous@200.190.40.242>;tag=1E51512C-12BC.
Call-ID: 678AB9AD-778411DA-8334950A-6B2B773F(a)200.190.40.242.
To: <sip:36418473@200.190.40.226>;tag=NYfee18oJjrLPTZ7.
CSeq: 101 ACK.
User-Agent: OpenSer (1.0.0 (i386/linux)).
Content-Length: 0.
.
#
U 200.190.40.226:5060 -> 200.190.40.242:51895
SIP/2.0 487 Request Terminated.
Via: SIP/2.0/UDP 200.190.40.242:5060;rport=51895.
Record-Route: <sip:36418473@200.190.40.226:5060;nat=yes;ftag=1E51512C-12BC;lr=on>.
Call-ID: 678AB9AD-778411DA-8334950A-6B2B773F(a)200.190.40.242.
CSeq: 101 INVITE.
From: <sip:200.190.40.242>;tag=1E51512C-12BC.
To: <sip:36418473@200.190.40.226>;tag=NYfee18oJjrLPTZ7.
Contact: <sip:882754853589@200.180.40.31:5060>.
Content-Length: 0.
.
#
U 200.190.40.242:51895 -> 200.190.40.226:5060
ACK sip:36418473@200.190.40.226:5060 SIP/2.0.
Via: SIP/2.0/UDP 200.190.40.242:5060.
From: <sip:200.190.40.242>;tag=1E51512C-12BC.
To: <sip:36418473@200.190.40.226>;tag=NYfee18oJjrLPTZ7.
Date: Thu, 29 Dec 2005 09:29:11 GMT.
Call-ID: 678AB9AD-778411DA-8334950A-6B2B773F(a)200.190.40.242.
Route: <sip:882754853589@200.180.40.31:5060>.
Max-Forwards: 15.
Content-Length: 0.
CSeq: 101 ACK.
.
exit
17 received, 0 dropped
_______________________________________________
Users mailing list
Users(a)openser.org
http://openser.org/cgi-bin/mailman/listinfo/users