uac_replace_from(uri) truncating the header after a second use at same transaction

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

uac_replace_from(uri) truncating the header after a second use at same transaction

Ricardo Martins
Hi guys I think I found a bug on uac_replace_from(uri) function.

When I use it a second time at the same transaction (into the failure
route) in order to send the call with a proper "From" to a backup
provider, the function is not replacing the "From" information as
expected but it is adding a second uri string just after the first. Like
that:

Original from:
From: "grupo1" <sip:grupo1@homedomain>;tag=qtfgz.

After the first use of uac_replace_from(uri) function:
From: "grupo1" <sip:username1@domainproviderone>;tag=qtfgz.

Truncating after the second use:
From: "grupo1"
<sip:username1@domainprovideronesip:username2@domainprovidertwo>;tag=qtfgz.


Do anybody used this function as that?

Regards, Ricardo.

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

Re: uac_replace_from(uri) truncating the header after a second use at same transaction

Thomas Gelf
Hi Ricardo,

this does not work, uac_replace_from is known to misbehave if called
twice in a transaction. You could try to add another branch, but please
don't take my words too serious - I need some more coffee today ;-)

Best regards,
Thomas Gelf


Ricardo Martins schrieb:

> Hi guys I think I found a bug on uac_replace_from(uri) function.
>
> When I use it a second time at the same transaction (into the failure
> route) in order to send the call with a proper "From" to a backup
> provider, the function is not replacing the "From" information as
> expected but it is adding a second uri string just after the first. Like
> that:
>
> Original from:
> From: "grupo1" <sip:grupo1@homedomain>;tag=qtfgz.
>
> After the first use of uac_replace_from(uri) function:
> From: "grupo1" <sip:username1@domainproviderone>;tag=qtfgz.
>
> Truncating after the second use:
> From: "grupo1"
> <sip:username1@domainprovideronesip:username2@domainprovidertwo>;tag=qtfgz.
>
>
> Do anybody used this function as that?
>
> Regards, Ricardo.


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

Re: uac_replace_from(uri) truncating the header after a second use at same transaction

Bogdan-Andrei Iancu
Hi Thomas,

well, you are right - if you want to use different FROM hdr in different
branches, use the uac_replace_from() only in branch_route. Do not use it
in REQUEST Route!

Regards,
Bogdan

Thomas Gelf wrote:

> Hi Ricardo,
>
> this does not work, uac_replace_from is known to misbehave if called
> twice in a transaction. You could try to add another branch, but please
> don't take my words too serious - I need some more coffee today ;-)
>
> Best regards,
> Thomas Gelf
>
>
> Ricardo Martins schrieb:
>  
>> Hi guys I think I found a bug on uac_replace_from(uri) function.
>>
>> When I use it a second time at the same transaction (into the failure
>> route) in order to send the call with a proper "From" to a backup
>> provider, the function is not replacing the "From" information as
>> expected but it is adding a second uri string just after the first. Like
>> that:
>>
>> Original from:
>> From: "grupo1" <sip:grupo1@homedomain>;tag=qtfgz.
>>
>> After the first use of uac_replace_from(uri) function:
>> From: "grupo1" <sip:username1@domainproviderone>;tag=qtfgz.
>>
>> Truncating after the second use:
>> From: "grupo1"
>> <sip:username1@domainprovideronesip:username2@domainprovidertwo>;tag=qtfgz.
>>
>>
>> Do anybody used this function as that?
>>
>> Regards, Ricardo.
>>    
>
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>  


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

Re: uac_replace_from(uri) truncating the header after a second use at same transaction

Ricardo Martins
That's right men! I used uac_replace_from() function inside a brach_route, calling an avp_db_query function to get from db the proper from parameters for each provider, based on domain uri, and everything is working like a charming sip robot!

Thanks for that again, Bogdan. And Thomas, maybe you should re-think about drinking coffee, because you don't need it! ahahahah, just kidding, I love coffee too.

Well, by the way, I still have that issue of uac_auth(ing) two users from the same realm, but that's on another thread...

Regards to all.

Ricardo.



Bogdan-Andrei Iancu escreveu:
Hi Thomas,

well, you are right - if you want to use different FROM hdr in different 
branches, use the uac_replace_from() only in branch_route. Do not use it 
in REQUEST Route!

Regards,
Bogdan

Thomas Gelf wrote:
  
Hi Ricardo,

this does not work, uac_replace_from is known to misbehave if called
twice in a transaction. You could try to add another branch, but please
don't take my words too serious - I need some more coffee today ;-)

Best regards,
Thomas Gelf


Ricardo Martins schrieb:
  
    
Hi guys I think I found a bug on uac_replace_from(uri) function.

When I use it a second time at the same transaction (into the failure 
route) in order to send the call with a proper "From" to a backup 
provider, the function is not replacing the "From" information as 
expected but it is adding a second uri string just after the first. Like 
that:

Original from:
From: "grupo1" <a class="moz-txt-link-rfc2396E" href="sip:grupo1@homedomain"><sip:grupo1@homedomain>;tag=qtfgz.

After the first use of uac_replace_from(uri) function:
From: "grupo1" <a class="moz-txt-link-rfc2396E" href="sip:username1@domainproviderone"><sip:username1@domainproviderone>;tag=qtfgz.

Truncating after the second use:
From: "grupo1" 
<a class="moz-txt-link-rfc2396E" href="sip:username1@domainprovideronesip:username2@domainprovidertwo"><sip:username1@domainprovideronesip:username2@domainprovidertwo>;tag=qtfgz.


Do anybody used this function as that?

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

  
    


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

  


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