[Freeswitch-dev] missing Diversion header in 300 and 302 messages

Tihomir Culjaga tculjaga at gmail.com
Sun Jun 5 01:37:28 MSD 2011


hello,

i found that FS doesn't transparently map Diversion header from INVITE to
300|302 message in a case of diversion.

i have changed mod_sofia.c to adjust this:

                               char *added_headers =
sofia_glue_get_extra_headers(channel, SOFIA_SIP_HEADER_PREFIX);


--- 2026,2037 ----

                                if (argc > 1) {
                                        nua_respond(tech_pvt->nh,
SIP_300_MULTIPLE_CHOICES, SIPTAG_CONTACT_STR(dest),
!
TAG_IF(!zstr(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
!
TAG_IF(!zstr(added_headers), SIPTAG_HEADER_STR(added_headers)), TAG_END());
                                } else {
                                        nua_respond(tech_pvt->nh,
SIP_302_MOVED_TEMPORARILY, SIPTAG_CONTACT_STR(dest),
!
TAG_IF(!zstr(extra_headers), SIPTAG_HEADER_STR(extra_headers)),
!
TAG_IF(!zstr(added_headers), SIPTAG_HEADER_STR(added_headers)), TAG_END());
                                }



Now 300|302 message contains the original header that was present in INVITE.


since i didn't get any response whether this is a "feature" or a bug ... i
went into the code and changed it myself.

Please check the patch attached and see if it is
possible/feasible/acceptable merge it into FS trunk.



Regards,
Tihomir.


BTW: macros are cool while bringing headache in the same time :=)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-dev/attachments/20110604/f6e7c0ca/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mod_sofia_DiversionHeader.patch
Type: text/x-patch
Size: 1687 bytes
Desc: not available
Url : http://lists.freeswitch.org/pipermail/freeswitch-dev/attachments/20110604/f6e7c0ca/attachment.bin 


More information about the FreeSWITCH-dev mailing list