[sr-dev] Contact parameter parsing broken?

Peter Dunkley peter.dunkley at crocodile-rcs.com
Wed Jan 2 12:15:10 CET 2013


Hi Juha,

It must be something silly that I am doing then, but I can't see what. 
This code fragment:

        if (msg->contact || parse_headers(msg, HDR_CONTACT_F, 0) != -1)
        {
                if (parse_contact(msg->contact) < 0)
                {
                        LM_ERR("parsing Contact: header body\n");
                        return 0;
                }
                contact = ((contact_body_t *)
msg->contact->parsed)->contacts;
                if (!contact)
                {
                        LM_ERR("empty Contact:\n");
                        return 0;
                }
                if (parse_uri(contact->uri.s, contact->uri.len, &puri) < 0)
                {
                        LM_ERR("parsing Contact-URI\n");
                        return 0;
                }
                if (parse_params(&puri.params, CLASS_CONTACT, &hooks,
                        &params) != 0)
                {
                        LM_ERR("parsing Contact-URI parameters\n");
                        return 0;
                }

                if (msg->REQ_METHOD == METHOD_REGISTER &&
hooks.contact.reg_id)
                {
                        LM_INFO("found REGISTER with ;reg-id paramter on"
                                "Contact-URI - outbound used\n");
                        return 1;
                }

Prints out the last diagnostic when reg-id is a Contact-URI parameter, but
not a Contact: header parameter.

I've no idea why, but this is obviously not right.  Any ideas?

Peter

> peter,
>
> i just tested and at least when reg-id and +sip.instance are in contact
> header
>
> Contact:
> <sip:0x82a0798 at 192.98.102.10:5052;transport=tcp>;expires=600;+sip.instance="<urn:uuid:447ff092-6236-47d9-bc0a-a3c6856aacf2>";q=0.8;reg-id=1.
>
> of register request, they do get parsed correctly, because they show up
> in instance and reg_id fields of location table.
>
> -- juha
>
> _______________________________________________
> sr-dev mailing list
> sr-dev at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
>


-- 
Peter Dunkley
Technical Director
Crocodile RCS Ltd




More information about the sr-dev mailing list