Module: kamailio
Branch: master
Commit: 878c41b7dbd1a716d5a2a9281ab99af585737022
URL: https://github.com/kamailio/kamailio/commit/878c41b7dbd1a716d5a2a9281ab99af…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2019-08-19T11:37:40+02:00
lost: docs - note that http_client param query_result has to be set to 0
---
Modified: src/modules/lost/doc/lost_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/878c41b7dbd1a716d5a2a9281ab99af…
Patch: https://github.com/kamailio/kamailio/commit/878c41b7dbd1a716d5a2a9281ab99af…
---
diff --git a/src/modules/lost/doc/lost_admin.xml b/src/modules/lost/doc/lost_admin.xml
index d4228f3044..b5701d3fb8 100644
--- a/src/modules/lost/doc/lost_admin.xml
+++ b/src/modules/lost/doc/lost_admin.xml
@@ -255,11 +255,13 @@ xlog("L_INFO", "LOST findService: Result code $var(res)\nUri: $var(uri)\nName: $
https://www.digitalocean.com/community/questions/how-to-upgrade-curl-in-cen…</ulink>
</para>
<para>
- Note: http_client_query exported by the http_client API returns the first line of
+ Note: http_client_query exported by the http_client API returns by default the first line of
the HTTP response (query_params.oneline = 1), but the lost module requires the complete
response message, which requires query_params.oneline set to 0. In the case lost_query
is used with the default http_client API, dereferencing location via HTTP provided with
- the Geolocation header causes an error.
+ the Geolocation header causes an error. Therefore, to work properlu=y, it requires to set
+ <ulink url="https://www.kamailio.org/docs/modules/devel/modules/http_client.html#http_c…">
+ http_client module parameter query_result to 0</ulink>.
</para>
</section>
</chapter>
Module: kamailio
Branch: master
Commit: 9115bcdabaa3da04e3e563bb43a04358b33e2c17
URL: https://github.com/kamailio/kamailio/commit/9115bcdabaa3da04e3e563bb43a0435…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2019-08-16T11:05:35+02:00
core: dset - function to push a new branch and return its pointer
---
Modified: src/core/dset.c
Modified: src/core/dset.h
---
Diff: https://github.com/kamailio/kamailio/commit/9115bcdabaa3da04e3e563bb43a0435…
Patch: https://github.com/kamailio/kamailio/commit/9115bcdabaa3da04e3e563bb43a0435…
---
diff --git a/src/core/dset.c b/src/core/dset.c
index 1803155206..184ddc9e92 100644
--- a/src/core/dset.c
+++ b/src/core/dset.c
@@ -328,7 +328,7 @@ void clear_branches(void)
-/** Add a new branch to the current transaction.
+/** Add a new branch to the current destination set.
* @param msg sip message, used for getting the uri if not specified (0).
* @param uri uri, can be 0 (in which case the uri is taken from msg)
* @param dst_uri destination uri, can be 0.
@@ -352,7 +352,7 @@ int append_branch(struct sip_msg* msg, str* uri, str* dst_uri, str* path,
str luri;
/* if we have already set up the maximum number
- * of branches, don't try new ones
+ * of branches, don't try new ones
*/
if (unlikely(nr_branches == sr_dst_max_branches - 1)) {
LM_ERR("max nr of branches exceeded\n");
@@ -466,12 +466,40 @@ int append_branch(struct sip_msg* msg, str* uri, str* dst_uri, str* path,
branches[nr_branches].location_ua[0] = '\0';
branches[nr_branches].location_ua_len = 0;
}
-
+
nr_branches++;
return 1;
}
+/** Push a new branch to the current destination set.
+ * @param msg sip message, used for getting the uri if not specified (0).
+ * @param uri uri, can be 0 (in which case the uri is taken from msg)
+ * @param dst_uri destination uri, can be 0.
+ * @param path path vector (passed in a string), can be 0.
+ * @param q q value.
+ * @param flags per branch flags.
+ * @param force_socket socket that should be used when sending.
+ * @param instance sip instance contact header param value
+ * @param reg_id reg-id contact header param value
+ * @param ruid ruid value from usrloc
+ * @param location_ua location user agent
+ *
+ * @return NULL on failure, new branch pointer on success.
+ */
+branch_t* ksr_push_branch(struct sip_msg* msg, str* uri, str* dst_uri, str* path,
+ qvalue_t q, unsigned int flags,
+ struct socket_info* force_socket,
+ str* instance, unsigned int reg_id,
+ str* ruid, str* location_ua)
+{
+ if(append_branch(msg, uri, dst_uri, path, q, flags, force_socket,
+ instance, reg_id, ruid, location_ua)<0) {
+ return NULL;
+ }
+ return &branches[nr_branches-1];
+}
+
/*! \brief
* Combines the given elements into a Contact header field
* dest = target buffer, will be updated to new position after the printed contact
diff --git a/src/core/dset.h b/src/core/dset.h
index 96f31978a6..ebb4e765bb 100644
--- a/src/core/dset.h
+++ b/src/core/dset.h
@@ -94,7 +94,16 @@ branch_t *get_sip_branch(int idx);
int drop_sip_branch(int idx);
/*! \brief
- * Add a new branch to current transaction
+ * Push a new branch to current destination set
+ */
+branch_t *ksr_push_branch(sip_msg_t* msg, str* uri, str* dst_uri, str* path,
+ qvalue_t q, unsigned int flags,
+ struct socket_info* force_socket,
+ str* instance, unsigned int reg_id,
+ str* ruid, str* location_ua);
+
+/*! \brief
+ * Add a new branch to current destination set
*/
int append_branch(struct sip_msg* msg, str* uri, str* dst_uri, str* path,
qvalue_t q, unsigned int flags,