[sr-dev] git:master: tm: support for changing the reply status in the script

Miklos Tirpak miklos at iptel.org
Wed May 26 17:45:18 CEST 2010


On 05/26/2010 02:22 PM, Klaus Darilion wrote:
> 
> 
> Am 26.05.2010 12:21, schrieb Miklos Tirpak:
>> Hi Klaus,
>>
>> On 05/26/2010 11:56 AM, Klaus Darilion wrote:
>>> Hi Miklos!
>>>
>>> How can the reply status be changed?
>>
>> there should be some other function added, what tm module does is only
>> checking for the change. If you need it then I can add the function to
>> modules_s/textops for instance.
> 
> I think that would be a useful extension.

I have added the function: change_reply_status(code, reason)

Miklos

> 
> regards
> Klaus
> 
>>
>>>
>>> If it is changed in reply-route, will failure route have the 
>>> changed-one?
>>
>> Yes.
>>
>> Miklos
>>
>>>
>>> Thanks
>>> Klaus
>>>
>>> Am 26.05.2010 11:38, schrieb Miklos Tirpak:
>>> > Module: sip-router
>>> > Branch: master
>>> > Commit: 4cca625ce8229c5513451d135c09d9701c80dcd7
>>> > URL:
>>> http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=4cca625ce8229c5513451d135c09d9701c80dcd7 
>>>
>>>
>>> >
>>> > Author: Miklos Tirpak<miklos at iptel.org>
>>> > Committer: Miklos Tirpak<miklos at iptel.org>
>>> > Date: Wed May 26 11:31:51 2010 +0200
>>> >
>>> > tm: support for changing the reply status in the script
>>> >
>>> > The reply status code is re-read after the onreply_route block
>>> > is executed which makes possile to change the status code from the
>>> script.
>>> > The status code shall be rewritten directly in the message buffer
>>> > and in the parsed structure, and the class of provisional and
>>> > positive final replies cannot be changed.
>>> >
>>> > ---
>>> >
>>> > modules/tm/t_reply.c | 11 +++++++++++
>>> > 1 files changed, 11 insertions(+), 0 deletions(-)
>>> >
>>> > diff --git a/modules/tm/t_reply.c b/modules/tm/t_reply.c
>>> > index 9ad1d0e..2e6fd55 100644
>>> > --- a/modules/tm/t_reply.c
>>> > +++ b/modules/tm/t_reply.c
>>> > @@ -2129,6 +2129,17 @@ int reply_received( struct sip_msg *p_msg )
>>> > stop_rb_timers(&uac->request);
>>> > }
>>> > #endif /* TM_ONREPLY_FINAL_DROP_OK */
>>> > + /* Re-read the status code, it can be changed in the route block. */
>>> > +#ifdef EXTRA_DEBUG
>>> > + /* The class of provisional and positive final replies cannot be
>>> changed. */
>>> > + if (((msg_status< 300) || (p_msg->REPLY_STATUS< 300))
>>> > + && (msg_status/100 != p_msg->REPLY_STATUS/100)
>>> > + ) {
>>> > + LOG(L_ERR, "ERROR: The class of provisional and "
>>> > + "positive final replies should not be changed!\n");
>>> > + }
>>> > +#endif /* EXTRA_DEBUG */
>>> > + msg_status=p_msg->REPLY_STATUS;
>>> > }
>>> > #ifdef USE_DST_BLACKLIST
>>> > /* add temporary to the blacklist the source of a 503 reply */
>>> >
>>> >
>>> > _______________________________________________
>>> > sr-dev mailing list
>>> > sr-dev at lists.sip-router.org
>>> > http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev



More information about the sr-dev mailing list