[SR-Users] Wrong from/to header compose way in print_to and print_from

dongwf dongwflj at 163.com
Fri Sep 19 12:57:16 CEST 2014

Hi Daniel:
I added my fixing in attached t_msgbuilder.c, please take a review, mainly change in build_uac_req, print_to and print_from, thanks!

At 2014-09-17 04:25:17, "Daniel-Constantin Mierla" <miconda at gmail.com> wrote:

your remarks seems legit -- if you send a patch, I will review and commit it. Otherwise, open an issue on bugh tracker and will be fixed soon. I tested the patch with my scenario, it works fine.


On 17/09/14 10:06, dongwf wrote:

Hi kamailio dev:
I am writing a module to implement some features, my version is 4.1.2, I am not sure if it is a known issue, I found:
1. When I get a INVITE request with from/to like from:"display"<aaa at sip.com>, then I call tm's new_dlg_uas with the sip req, now the dlg's rem_uri set as value: "display"<aaa at sip.com>;
2. After that, when I need use the dlg to send BYE with tm's req_within with the above saved dlg, the print_to function will check the rem_uri's first value if "<" or not, now my uri has display name, so the outgoing BYE's to header becomes to:<"display"<aaa at sip.com>>, is it wrong? Should we check the last char in the rem_uri as ">"?

The detail code is :
static inline char* print_to(char* w, dlg_t* dialog, struct cell* t)
    t->to.s = w;
    t->to.len = TO_LEN + dialog->rem_uri.len + CRLF_LEN
        + ((dialog->rem_uri.s[0]!='<')?2:0);

    memapp(w, TO, TO_LEN);
    if(dialog->rem_uri.s[0]!='<') memapp(w, "<", 1);
    memapp(w, dialog->rem_uri.s, dialog->rem_uri.len);
    if(dialog->rem_uri.s[0]!='<') memapp(w, ">", 1);

SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users at lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 - http://www.asipto.com
Sep 22-25, Berlin, Germany
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20140919/e2f14a7d/attachment.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: t_msgbuilder.c
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20140919/e2f14a7d/attachment.c>

More information about the sr-users mailing list