~ubuntu-branches/debian/sid/kamailio/sid

« back to all changes in this revision

Viewing changes to modules/registrar/path.c

  • Committer: Package Import Robot
  • Author(s): Victor Seva
  • Date: 2014-01-06 11:47:13 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20140106114713-t8xidp4arzrnyeya
Tags: 4.1.1-1
* New upstream release
* debian/patches:
  - add upstream fixes
* Added tls outbound websocket autheph dnssec modules
  - openssl exception added to their license
* removing sparc and ia64 from supported archs
  for mono module (Closes: #728915)

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
#include "../../data_lump.h"
33
33
#include "../../parser/parse_rr.h"
34
34
#include "../../parser/parse_uri.h"
 
35
#include "../../lib/kcore/strcommon.h"
35
36
#include "path.h"
36
37
#include "reg_mod.h"
37
38
 
 
39
 
38
40
/*! \brief
39
41
 * Combines all Path HF bodies into one string.
40
42
 */
41
43
int build_path_vector(struct sip_msg *_m, str *path, str *received)
42
44
{
43
45
        static char buf[MAX_PATH_SIZE];
 
46
        static char uri_buf[MAX_URI_SIZE];
 
47
        static str uri_str;
44
48
        char *p;
45
49
        struct hdr_field *hdr;
46
50
        struct sip_uri puri;
92
96
                                LM_ERR("failed to parse parameters of first hop\n");
93
97
                                goto error;
94
98
                        }
95
 
                        if (hooks.contact.received)
96
 
                                *received = hooks.contact.received->body;
 
99
 
 
100
                        if (hooks.contact.received) {
 
101
                                uri_str.s = uri_buf;
 
102
                                uri_str.len = MAX_URI_SIZE;
 
103
                                if (unescape_user(&(hooks.contact.received->body), &uri_str) < 0) {
 
104
                                        LM_ERR("unescaping received failed\n");
 
105
                                        goto error;
 
106
                                }
 
107
                                *received = uri_str;
 
108
                                LM_DBG("received is <%.*s>\n", received->len, received->s);
 
109
                        }
 
110
                                
97
111
                        /*for (;params; params = params->next) {
98
112
                                if (params->type == P_RECEIVED) {
99
113
                                        *received = hooks.contact.received->body;
107
121
 
108
122
        path->s = buf;
109
123
        path->len = p-buf;
 
124
        LM_DBG("path is <%.*s>\n", path->len, path->s);
110
125
        return 0;
111
126
error:
112
127
        if(route) free_rr(&route);