[OpenSIPS-Users] SUSPECT: Re: SUSPECT: SUSPECT: Rewrite From Header In CANCEL forwarded packet

Marc Leurent marc.leurent at vtx-telecom.ch
Fri Mar 13 13:31:14 CET 2009


I think I understand a little bit more my problem.
"From" Header is corrected in Request Route, but it is another request that will be sent to the UA. The transaction isn't forwarded and From Header is regenerated from transaction memory!

The debug section in request route:

DBG:core:get_hdr_field: content_length=0
DBG:core:get_hdr_field: found end of header
Rewriting From Domain in CANCEL "0227875100" <sip:0227875100 at 212.147.47.210>;tag=as305154bf
DBG:core:subst_run: running. r=0
DBG:core:subst_run: matched (67, 66): [From: "0227875100" <sip:0227875100 at 212.147.47.210>;tag=as305154bf^M]
DBG:core:subst_run: running. r=1
DBG:textops:subst_f: textops: replacing at offset 128 [From: "0227875100" <sip:0227875100 at 212.147.47.210>;tag=as305154bf^M] with [From: "0227875100" <sip:0227875100@
voip-dev.vtx.ch>;tag=as305154bf^M]
DBG:textops:subst_f: lst was 0x77e380


But after, it seems to be another request that is generated wich is built locally:

DBG:tm:matching_3261: RFC3261 transaction matched, tid=5a03baaa
DBG:tm:t_lookupOriginalT: canceled transaction found (0x2b67b0bf6058)!
DBG:tm:t_lookupOriginalT: REF_UNSAFE: after is 1
DBG:tm:t_lookupOriginalT: t_lookupOriginalT completed
DBG:tm:t_newtran: transaction on entrance=0xffffffffffffffff
DBG:core:parse_headers: flags=ffffffffffffffff
DBG:core:parse_headers: flags=78
DBG:tm:t_lookup_request: start searching: hash=47230, isACK=0
DBG:tm:matching_3261: RFC3261 transaction matching failed
DBG:tm:t_lookup_request: no transaction found
DBG:tm:run_reqin_callbacks: trans=0x2b67b0bfdd50, callback type 1, id 1 entered
DBG:tm:run_reqin_callbacks: trans=0x2b67b0bfdd50, callback type 1, id 0 entered
DBG:core:parse_headers: flags=ffffffffffffffff
DBG:core:check_via_address: params 212.147.47.82, 212.147.47.210, 0
DBG:core:_shm_resize: resize(0) called
DBG:tm:cleanup_uac_timers: RETR/FR timers reset
DBG:tm:insert_timer_unsafe: [2]: 0x2b67b0bfddd0 (71)
DBG:tm:_reply_light: reply sent out. buf=0x77e8a0: SIP/2.0 2..., shmem=0x2b67b0bd5460: SIP/2.0 2
DBG:tm:_reply_light: finished
DBG:tm:build_local: using FROM=<From: "0227875100" <sip:0227875100 at 212.147.47.210>;tag=as305154bf^M >, TO=<To: <sip:0225667886 at 213.162.3.158:5060;user=phone>^M >, CSEQ_N=<CSeq: 102>
DBG:tm:cancel_branch: sending cancel...

Have you got any idea how to modify the generated packet? Or how to change the "From" Header generated locally

Thanks



Le Friday 13 March 2009 10.57:03 Marc Leurent, vous avez écrit :
> Good Morning,
> I'am using a loadbalanced platform with dispatcher module. When a packet is
> sent from a Gateway to a peer, I rewrite the From Header which contains the
> IP of the gateway in order to put the proxy domain because some Hardphones
> like
> Thomson ST2030 will keep the domain in call history to be able to call back
> a person. If the UA use the direct IP of the gateway, the call will failed,
> it has to go through the proxy! So I would like to rewrite From header
> coming from gateways
>
> It's working for INVITE, OPTIONS,... in main route, but CANCEL packets are
> not rewritten and UA sent back a message saying transaction does not exists
> because From header is different from INVITE!
>
> I have put this in main route:
>
> if (ds_is_from_list()) {        # Returns true if the current request comes
> from a host from the dispatcher-list
>          xlog("L_INFO", "Rewriting From Domain in $rm $(hdr(From))");
>        #subst('/^From:(.*)@xxx.xxx.xxx.[0-9]+(.*)$/From:
> \1 at xxx-dev.xxx.xx\2/ig');
> }
>
> Have you got any idea how to rewrite CANCEL packet?
> I have tried to put the same thing in failure route but it does not work.
>
> Thanks
>
> Best Regards



-- 
-- --
Marc LEURENT
Ingénieur VoIP

DECKPOINT SA
Une société du groupe VTX Telecom
================================================================
Rue Eugène-Marziano 15 - 1227 Les Acacias
http://www.vtx.ch - marc.leurent at vtx-telecom.ch
----------------------------------------------------------------
VTX, votre partenaire telecom proche de vous !
================================================================
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20090313/5765bb8c/attachment-0001.htm 
-------------- next part --------------
DBG:core:parse_msg: SIP Request: 
DBG:core:parse_msg:  method:  <CANCEL> 
DBG:core:parse_msg:  uri:     <sip:0225667886 at 213.162.3.158:5060;user=phone> 
DBG:core:parse_msg:  version: <SIP/2.0> 
DBG:core:parse_headers: flags=2 
DBG:core:parse_via_param: found param type 232, <branch> = <z9hG4bK5a03baaa>; state=6 
DBG:core:parse_via_param: found param type 235, <rport> = <n/a>; state=17 
DBG:core:parse_via: end of header reached, state=5 
DBG:core:parse_headers: via found, flags=2 
DBG:core:parse_headers: this is the first via 
DBG:core:receive_msg: After parse_msg... 
DBG:core:receive_msg: preparing to run routing scripts... 
DBG:core:parse_headers: flags=100 
DBG:core:parse_to: end of header reached, state=10 
DBG:core:parse_to: display={}, ruri={sip:0225667886 at 213.162.3.158:5060;user=phone} 
DBG:core:get_hdr_field: <To> [48]; uri=[sip:0225667886 at 213.162.3.158:5060;user=phone]  
DBG:core:get_hdr_field: to body [<sip:0225667886 at 213.162.3.158:5060;user=phone>
 ] 
DBG:core:get_hdr_field: cseq <CSeq>: <102> <CANCEL> 
DBG:maxfwd:is_maxfwd_present: value = 70  
DBG:core:parse_headers: flags=ffffffffffffffff 
DBG:core:get_hdr_field: content_length=0 
DBG:core:get_hdr_field: found end of header 
Rewriting From Domain in CANCEL "0227875100" <sip:0227875100 at 212.147.47.210>;tag=as305154bf
DBG:core:subst_run: running. r=0 
DBG:core:subst_run: matched (67, 66): [From: "0227875100" <sip:0227875100 at 212.147.47.210>;tag=as305154bf
] 
DBG:core:subst_run: running. r=1 
DBG:textops:subst_f: textops: replacing at offset 128 [From: "0227875100" <sip:0227875100 at 212.147.47.210>;tag=as305154bf
] with [From: "0227875100" <sip:0227875100 at voip-dev.vtx.ch>;tag=as305154bf
] 
DBG:textops:subst_f: lst was 0x77e380 
STARTING TEST NAT
 
DBG:core:check_via_address: params 212.147.47.82, 212.147.47.210, 0 
DBG:core:parse_headers: flags=80 
DBG:core:pv_get_contact: no contact header! 
NAT Detected - Fixing Contact <null>
 
DBG:core:parse_headers: flags=80 
DBG:uri:has_totag: no totag 
DBG:core:parse_headers: flags=78 
DBG:tm:t_lookupOriginalT: searching on hash entry 47230 
DBG:tm:matching_3261: RFC3261 transaction matched, tid=5a03baaa 
DBG:tm:t_lookupOriginalT: canceled transaction found (0x2b67b0bf6058)!  
DBG:tm:t_lookupOriginalT: REF_UNSAFE: after is 1 
DBG:tm:t_lookupOriginalT: t_lookupOriginalT completed 
DBG:tm:t_newtran: transaction on entrance=0xffffffffffffffff 
DBG:core:parse_headers: flags=ffffffffffffffff 
DBG:core:parse_headers: flags=78 
DBG:tm:t_lookup_request: start searching: hash=47230, isACK=0 
DBG:tm:matching_3261: RFC3261 transaction matching failed 
DBG:tm:t_lookup_request: no transaction found 
DBG:tm:run_reqin_callbacks: trans=0x2b67b0bfdd50, callback type 1, id 1 entered 
DBG:tm:run_reqin_callbacks: trans=0x2b67b0bfdd50, callback type 1, id 0 entered 
DBG:core:parse_headers: flags=ffffffffffffffff 
DBG:core:check_via_address: params 212.147.47.82, 212.147.47.210, 0 
DBG:core:_shm_resize: resize(0) called 
DBG:tm:cleanup_uac_timers: RETR/FR timers reset 
DBG:tm:insert_timer_unsafe: [2]: 0x2b67b0bfddd0 (71) 
DBG:tm:_reply_light: reply sent out. buf=0x77e8a0: SIP/2.0 2..., shmem=0x2b67b0bd5460: SIP/2.0 2 
DBG:tm:_reply_light: finished 
DBG:tm:build_local: using FROM=<From: "0227875100" <sip:0227875100 at 212.147.47.210>;tag=as305154bf
 >, TO=<To: <sip:0225667886 at 213.162.3.158:5060;user=phone>
 >, CSEQ_N=<CSeq: 102> 
DBG:tm:cancel_branch: sending cancel... 
DBG:tm:set_timer: relative timeout is 500000 
DBG:tm:insert_timer_unsafe: [4]: 0x2b67b0bf6340 (67400000) 
DBG:tm:set_timer: relative timeout is 30 
DBG:tm:insert_timer_unsafe: [0]: 0x2b67b0bf6370 (96) 
DBG:tm:t_relay_to: new transaction fwd'ed 
DBG:tm:t_unref_cell: UNREF_UNSAFE: after is 0 
DBG:tm:t_unref: UNREF_UNSAFE: after is 0 
DBG:core:destroy_avp_list: destroying list (nil) 
DBG:core:receive_msg: cleaning up 


More information about the Users mailing list