Skip to content

SIP OPTIONS capabilities headers not being added correctly. #38

@GoogleCodeExporter

Description

@GoogleCodeExporter
Below code snippet breaks the addCaps method in low-level Doubango SWIG API and 
causes OPTIONS to be missing an important 'Contact: ' header. addCaps should 
append the 'capabilities' to the 'Contact: ' header but since it's not there 
due to the code below, it creates multiple lines of 'Accept-Contact: ' 
headers...

The code section that needs to be checked is here. To fix it for OPTIONS, I 
simply commented out and took the lower default behavior to get a 'Contact: ' 
header and manually create an 'Accept-Contact: ' header.

tsip_dialog.c - Line 175 (code snippet):

    switch(request->line.request.request_type){
        case tsip_MESSAGE:
        case tsip_PUBLISH:
        case tsip_BYE:
        case tsip_OPTIONS:
            {
                if(request->line.request.request_type == tsip_PUBLISH) {
                    TSIP_MESSAGE_ADD_HEADER(request, TSIP_HEADER_EXPIRES_VA_ARGS(TSK_TIME_MS_2_S(self->expires)));
                }
                /* add caps in Accept-Contact headers */
                tsk_list_foreach(item, self->ss->caps) {
                    const tsk_param_t* param = TSK_PARAM(item->data);
                    char* value = tsk_null;
                    tsk_sprintf(&value, "*;%s%s%s", 
                        param->name,
                        param->value ? "=" : "",
                        param->value ? param->value : "");
                    if(value) {
                        TSIP_MESSAGE_ADD_HEADER(request, TSIP_HEADER_DUMMY_VA_ARGS("Accept-Contact", value));
                        TSK_FREE(value);
                    }
                }
                break;
            }

Original issue reported on code.google.com by rich.ho...@gmail.com on 19 May 2011 at 3:46

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions