Hi all,
as described before, I am currently implementing
draft-ietf-soc-overload-control-02
(
http://tools.ietf.org/html/draft-ietf-soc-overload-control-02) and I
have to add one or more additional parameters to the (remaining) topmost
Via-header in SIP-responses.
So, if my server (
server10.biloxi.com) gets (e.g., from rfc3261) a
response from a downstream server like
SIP/2.0 200 OK
Via: SIP/2.0/UDP
server10.biloxi.com
;branch=z9hG4bKnashds8;received=192.0.2.3
Via: SIP/2.0/UDP
bigbox3.site3.atlanta.com
;branch=z9hG4bK77ef4c2312983.1;received=192.0.2.2
Via: SIP/2.0/UDP
pc33.atlanta.com
;branch=z9hG4bK776asdhds ;received=192.0.2.1
To: Bob <sip:bob@biloxi.com>;tag=a6c85cf
...
if of course have to remove the topmost via and then - according to the
oc-draft - add additional oc-paramters (in this example "oc=20"). The
resulting SIP response looks like this:
SIP/2.0 200 OK
Via: SIP/2.0/UDP
bigbox3.site3.atlanta.com
;branch=z9hG4bK77ef4c2312983.1;received=192.0.2.2;oc=20
Via: SIP/2.0/UDP
pc33.atlanta.com
;branch=z9hG4bK776asdhds ;received=192.0.2.1
To: Bob <sip:bob@biloxi.com>;tag=a6c85cf
...
Well, my question is now, where to modify/add this parameter.
If I understood the code correctly, the function
"build_res_buf_from_sip_buf()" (in msg_translator.c) might be the right
location to add the modification. My aditional oc-parameter is stored in
a char* and the msg is stored in the struct sip_msg. I saw that many
request-modifications are done with the "lumps"-functions, but I don't
get an idea how they are helping to solve my problem.
So, how can I add this char* to the end of the remaining topmost
via-header?
Any hint/idea?
br
Michael Hirschbichler
--
Michael Hirschbichler, Mag. Dipl.-Ing.
Institute of Telecommunications
Vienna University of Technology
A-1040 Wien, Favoritenstr. 9-11/388
Phone: +43 1 58801 38846