#23 registrar: new AVP to add extra headers to the REGISTER repl

modules (179)
Kim Vandry

This patch adds the ability to add custom headers to the successful reply to a REGISTER request.

The user must load the extra headers into an AVP from the request route before calling save(). During the construction of the 200 OK reply inside save() this AVP is consulted and its contents are inserted into the reply.

Motivating use case:

In IMS environments, the SIP registrar supplies the terminal with a list of PUIs (public user identities) that are associated with the registering endpoint. This list is passed in the reply to a successful REGISTER by the endpoint as a list of "P-Associated-URI" headers.

In OpenSIPS there is no existing general way to customize the reply to a REGISTER request.

The patch is for opensips-1.4.1-tls



  • Nobody/Anonymous

    I just wonder if save_no_reply(), append_to_reply() and sl_send_reply("200","")
    does not work

  • Kim Vandry

    Kim Vandry - 2008-09-26

    Thank you for your suggestion. I didn't know about append_to_reply().

    I tried your method but it has a big drawback: there is no Contact header generated in the REGISTER reply. One of the functions of the builtin reply function of save() is to generate the Contact header. Using your method I would have to somehow build the Contact header manually, which means querying the usrloc database and iterating over each contact with its expiry time and q value and formatting them. I definitely expect the registrar module to do all that work for me.

    So I maintain that there is a requirement for a method of taking advantage of save()'s builtin reply generator while still adding extra headers.


  • Bogdan-Andrei Iancu

    • milestone: 869101 --> trunk
    • assigned_to: nobody --> bogdan_iancu
    • status: open --> open-invalid
  • Bogdan-Andrei Iancu

    Hi Phil,

    If I understand correctly what you try to achieve, I would say you
    already can do it - before doing save("location") you can do
    append_to_reply("P-Associated-URI: ..................\r\n"); - this new
    header will be added to the reply generated by the save() function.

    Please let me know if I'm missing something.

    Thanks and regards,

  • Kim Vandry

    Kim Vandry - 2008-10-01

    Hi Bogdan,

    You are absolutely right. I don't need the new feature. I missed that
    function in the first place because I did not think to look in textops.


  • Kim Vandry

    Kim Vandry - 2008-10-01
    • status: open-invalid --> closed-invalid

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks