Module: kamailio Branch: master Commit: d93e0bc19f577114ef7e07afad3ce329c399a488 URL: https://github.com/kamailio/kamailio/commit/d93e0bc19f577114ef7e07afad3ce329...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2024-11-19T16:18:01+01:00
pv: made is_uri_enclosed() condition function inline
---
Modified: src/modules/pv/pv_core.c
---
Diff: https://github.com/kamailio/kamailio/commit/d93e0bc19f577114ef7e07afad3ce329... Patch: https://github.com/kamailio/kamailio/commit/d93e0bc19f577114ef7e07afad3ce329...
---
diff --git a/src/modules/pv/pv_core.c b/src/modules/pv/pv_core.c index f112931a735..1054a6ae57b 100644 --- a/src/modules/pv/pv_core.c +++ b/src/modules/pv/pv_core.c @@ -76,8 +76,6 @@ int _pv_pid = 0; #define PV_HDR_DELIM "," #define PV_HDR_DELIM_LEN (sizeof(PV_HDR_DELIM) - 1)
-static int is_uri_enclosed(struct sip_msg *msg, struct to_body *tb); - int pv_get_msgid(struct sip_msg *msg, pv_param_t *param, pv_value_t *res) { if(msg == NULL) @@ -3605,6 +3603,26 @@ int pv_set_bflag( return 0; }
+static inline int is_uri_enclosed(struct sip_msg *msg, struct to_body *tb) +{ + /* Check for the presence of display name */ + if(tb->display.len == 0) { + /* Display name not found */ + char *uri_body = tb->body.s; + + /* Assuming a valid sip message (true otherwise parser fails way before) + if it starts with '<' there is a respective '>'. + Also, parser trims any leading white space if no DisplayName is found + */ + if(uri_body[0] == '<') { + return 1; + } + return 0; + } + /* Display name found, URI should/must be enclosed */ + return 1; +} + int pv_set_xto_attr(struct sip_msg *msg, pv_param_t *param, int op, pv_value_t *val, struct to_body *tb, int type) { @@ -3799,26 +3817,6 @@ int pv_set_xto_attr(struct sip_msg *msg, pv_param_t *param, int op, return -1; }
-int is_uri_enclosed(struct sip_msg *msg, struct to_body *tb) -{ - /* Check for the presence of display name */ - if(tb->display.len == 0) { - /* Display name not found */ - char *uri_body = tb->body.s; - - /* Assuming a valid sip message (true otherwise parser fails way before) - if it starts with '<' there is a respective '>'. - Also, parser trims any leading white space if no DisplayName is found - */ - if(uri_body[0] == '<') { - return 1; - } - return 0; - } - /* Display name found, URI should/must be enclosed */ - return 1; -} - int pv_set_to_attr(struct sip_msg *msg, pv_param_t *param, int op, pv_value_t *val, int type) {