### Description
According [RFC6442](https://tools.ietf.org/html/rfc6442#section-5.1) multipart body may contain payload with `Content-ID` header.
Now `append_body_part` support only `Content-Disposition` optional header and not supports `Content-ID`.
Wanted `Content-ID` to implement RFC6442
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1632
Module: kamailio
Branch: master
Commit: 64097569eccad8185117255a6018a32615c9945d
URL: https://github.com/kamailio/kamailio/commit/64097569eccad8185117255a6018a32…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-09-12T08:40:01+02:00
textops: docs - note about how to add additional headers for a body part
- GH #1632
---
Modified: src/modules/textops/doc/textops_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/64097569eccad8185117255a6018a32…
Patch: https://github.com/kamailio/kamailio/commit/64097569eccad8185117255a6018a32…
---
diff --git a/src/modules/textops/doc/textops_admin.xml b/src/modules/textops/doc/textops_admin.xml
index cfcca4daf6..8e0f350056 100644
--- a/src/modules/textops/doc/textops_admin.xml
+++ b/src/modules/textops/doc/textops_admin.xml
@@ -1694,7 +1694,7 @@ text
<title><function>append_body_part</function> usage</title>
<programlisting format="linespecific">
...
-$var(b) = "7e Od 04 55 75 69 20 4d 61 6b 65 43 61 6c 6c"
+$var(b) = "7e Od 04 55 75 69 20 4d 61 6b 65 43 61 6c 6c";
append_body_part("$var(b)", "application/vnd.cirpack.isdn-ext", "signal;handling=required");
...
@@ -1706,6 +1706,31 @@ Content-Disposition: signal;handling=required
7e Od 04 55 75 69 20 4d 61 6b 65 43 61 6c 6c
+--unique-boundary-1
+...
+</programlisting>
+ </example>
+ <para>
+ If other headers are wanted to be added for a body part, they can be
+ appended after the value of the content-type parameter, separated by
+ `\r\n` (at the very end do not add the '\r\n').
+ </para>
+ <example>
+ <title><function>append_body_part</function> with headers</title>
+ <programlisting format="linespecific">
+...
+$var(b) = "<info>active</info>";
+append_body_part("$var(b)", "application/xml\r\nX-Header: xyz");
+...
+
+# Will append this to the body:
+
+...
+Content-Type: application/vnd.cirpack.isdn-ext
+Content-Disposition: signal;handling=required
+
+7e Od 04 55 75 69 20 4d 61 6b 65 43 61 6c 6c
+
--unique-boundary-1
...
</programlisting>
@@ -1767,6 +1792,10 @@ kamailio
...
</programlisting>
</example>
+ <para>
+ If other headers are wanted to be added for a body part, see the docs
+ for append_body_part(...) function.
+ </para>
</section>
<section id="textops.f.get_body_part">
When I execute pua.publish over jsonrpc using pretty new Kamailio master:
````
#
T 2018/09/11 18:19:03.550376 127.0.0.1:44190 -> 127.0.0.1:6060 [AP]
POST /RPC HTTP/1.1.
Host: 127.0.0.1:6060.
Accept: */*.
Content-Type: application/json.
Content-Length: 339.
..
{"jsonrpc":"2.0","method":"pua.publish","params":[...],"id":1}
#
T 2018/09/11 18:19:03.551735 127.0.0.1:5070 -> 127.0.0.1:5080 [AP]
PUBLISH sip:test@test.tutpro.com SIP/2.0.
...
#
T 2018/09/11 18:19:03.553158 127.0.0.1:5080 -> 127.0.0.1:5070 [AP]
SIP/2.0 200 OK.
...
CSeq: 10 PUBLISH.
#
T 2018/09/11 18:19:03.556790 127.0.0.1:6060 -> 127.0.0.1:44190 [AP]
HTTP/1.1 200 OK.
Sia: SIP/2.0/TCP 127.0.0.1:44190.
Content-Type: application/json.
Server: OpenSIPg SIP Proxy (5.2.0-0b02 (x86_64/linux)).
Content-Length: 48.
..
{
."jsonrpc":."2.0",
."result":.{
.},
."id":.1
}
````
I get error at reply:
````
Sep 11 18:19:03 char /usr/bin/sip-proxy[11079]: ERROR: jsonrpcs [jsonrpcs_mod.c:778]: jsonrpc_struct_add(): reply object not initialized in rpl context
Sep 11 18:19:03 char /usr/bin/sip-proxy[11079]: ERROR: jsonrpcs [jsonrpcs_mod.c:778]: jsonrpc_struct_add(): reply object not initialized in rpl context
````
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1640
<!--
Kamailio Project uses GitHub Issues only for bugs in the code or feature requests.
If you have questions about using Kamailio or related to its configuration file,
ask on sr-users mailing list:
* http://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
If you have questions about developing extensions to Kamailio or its existing
C code, ask on sr-dev mailing list
* http://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Please try to fill this template as much as possible for any issue. It helps the
developers to troubleshoot the issue.
If you submit a feature request (or enhancement), you can delete the text of
the template and only add the description of what you would like to be added.
If there is no content to be filled in a section, the entire section can be removed.
You can delete the comments from the template sections when filling.
You can delete next line and everything above before submitting (it is a comment).
-->
### Description
Following tls module documentation I'm trying to change connection_timeout value:
```
# kamcmd cfg.set_now_int tls connection_timeout 300
error: 400 - Failed to set the variable
```
<!--
Explain what you did, what you expected to happen, and what actually happened.
-->
### Troubleshooting
#### Log Messages
<!--
Check the syslog file and if there are relevant log messages printed by Kamailio, add them next, or attach to issue, or provide a link to download them (e.g., to a pastebin site).
-->
```
Sep 11 10:07:32 sip02 /usr/sbin/kamailio[32408]: DEBUG: ctl [io_listener.c:442]: handle_new_connect(): handle_stream read: new connection (1) on /var/run/kamailio//kamailio_ctl
Sep 11 10:07:32 sip02 /usr/sbin/kamailio[32408]: ERROR: <core> [core/cfg/cfg_ctx.c:386]: cfg_set_now(): ERROR: cfg_set_now(): integer value is out of range
Sep 11 10:07:32 sip02 /usr/sbin/kamailio[32408]: ERROR: <core> [core/cfg/cfg_ctx.c:653]: cfg_set_now(): ERROR: cfg_set_now(): failed to set the variable: tls.connection_timeout
Sep 11 10:07:32 sip02 /usr/sbin/kamailio[32408]: DEBUG: ctl [io_listener.c:495]: handle_stream_read(): handle_stream read: eof on /var/run/kamailio//kamailio_ctl
```
### Possible Solutions
Workaround: restart kamailio instead of trying to change variable of the running instance.
<!--
If you found a solution or workaround for the issue, describe it. Ideally, provide a pull request with a fix.
-->
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 5.0.7 (x86_64/linux)
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown
compiled with gcc 5.3.1
```
* **Operating System**:
<!--
Details about the operating system, the type: Linux (e.g.,: Debian 8.4, Ubuntu 16.04, CentOS 7.1, ...), MacOS, xBSD, Solaris, ...;
Kernel details (output of `uname -a`)
-->
```
Linux sip02 4.4.0-134-generic #160-Ubuntu SMP Wed Aug 15 14:58:00 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
```
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1639