[Serusers] Rewriting URI in the Contact field
Jiri Kuthan
jiri at iptel.org
Tue Jan 14 12:24:48 CET 2003
At 01:46 PM 1/13/2003, Maxim Sobolev wrote:
>> You can do this using TM and it's callbacks. TM is transaction module and
>> you can register callbacks with the module. Among others, there is a callback
>> that will be called upon reception of the final response (200 OK in your
>> case). In the callback, you can modify the response and rewrite the contact.
>
>I see, but IMO this would be not a generic solution, as I'll have to adjust
>the code for my particular needs. What I am looking for is some way to
>allow it to be modified by properly constructing config file. Perhaps something
>like t_on_negative() could be added, i.e. t_on_positive(): the specified
>routing block will be called when the transaction is completed with positive
>result but before sending final reply. What do you think?
I'm not sure what you mean by adjusting to your particular needs. If that means
that you want to process only "some" replies belonging to some particular
transactions, you may want to do the following things:
- use TM, as you need to correlate replies with requests
- use setflag during request processing to label transactions which
shell get a specific handling
- register a callback, from which you apply the special handling to
replies belonging to requests, that were previously marked
That's how accounting module works, for example. Interesting transactions are
labeled, and if a reply arrives, it is processed by the accounting logic only
if the label was set.
-Jiri
More information about the sr-users
mailing list