SUSPECT: Rewrite From Header In CANCEL forwarded packet

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

SUSPECT: Rewrite From Header In CANCEL forwarded packet

Marc Leurent
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:
\[hidden email]\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 - [hidden email]
----------------------------------------------------------------
VTX, votre partenaire telecom proche de vous !
================================================================

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: SUSPECT: Rewrite From Header In CANCEL forwarded packet

Bogdan-Andrei Iancu
Hi Marc,

use uac_replace_from() from UAC module to get changes persistent across
the transaction:
    http://www.opensips.org/html/docs/modules/1.4.x/uac.html#id227417

Note the CANCEL is locally regenerated (even if received) - it is
propagating hopbyhop.

Regards,
Bogdan

Marc Leurent wrote:

> 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:
> \[hidden email]\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
>
>  


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

SUSPECT: Re: SUSPECT: SUSPECT: Rewrite From Header In CANCEL forwarded packet

Marc Leurent
In reply to this post by Marc Leurent

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@212.147.47.210>;tag=as305154bf

DBG:core:subst_run: running. r=0

DBG:core:subst_run: matched (67, 66): [From: "0227875100" <sip:0227875100@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@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@212.147.47.210>;tag=as305154bf^M >, TO=<To: <sip:0225667886@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:

> \[hidden email]\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 - [hidden email]

----------------------------------------------------------------

VTX, votre partenaire telecom proche de vous !

================================================================


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

debug.txt (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

SUSPECT: Re: SUSPECT: SUSPECT: Re: SUSPECT: SUSPECT: Rewrite From Header In CANCEL forwarded packet

Marc Leurent
Hello Evrybody, I have finnaly found how to do it,
I have enable the uac module again to play with From header!

It's easier and works great!


Le Friday 13 March 2009 13.31:14 Marc Leurent, vous avez écrit :

> 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@212.147.47.210>;tag=as305154bf
> DBG:core:subst_run: running. r=0
> DBG:core:subst_run: matched (67, 66): [From: "0227875100" <sip:0227875100@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@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@212.147.47.210>;tag=as305154bf^M >, TO=<To: <sip:0225667886@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:
> > \[hidden email]\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 - [hidden email]
----------------------------------------------------------------
VTX, votre partenaire telecom proche de vous !
================================================================

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

SUSPECT: Re: SUSPECT: Re: SUSPECT: Rewrite From Header In CANCEL forwarded packet

Marc Leurent
In reply to this post by Bogdan-Andrei Iancu
Thanks Bogdan, I haven't seen your email before, it has been tagged as spam by our exchange!
Have a nice day

Le Friday 13 March 2009 12.19:33 Bogdan-Andrei Iancu, vous avez écrit :

> Hi Marc,
>
> use uac_replace_from() from UAC module to get changes persistent across
> the transaction:
>     http://www.opensips.org/html/docs/modules/1.4.x/uac.html#id227417
>
> Note the CANCEL is locally regenerated (even if received) - it is
> propagating hopbyhop.
>
> Regards,
> Bogdan
>
> Marc Leurent wrote:
> > 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:
> > \[hidden email]\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 - [hidden email]
----------------------------------------------------------------
VTX, votre partenaire telecom proche de vous !
================================================================

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users