New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add_body() doesn't insert content-type #698
Comments
I did as you specified, but it works ok for me. The message looks like this
and i generate a t_new_request() on each INVITE received. Are you modifying the message with any other function before or after you call add_body()? |
yes, before add_body() i do some work with variables and also call strip_body(). |
@achalkov I guess you get the bug because the new body has the same Content-Type with the one you strip. Because of this, there is an incompatibility between strip_body() and add_body() functions, because of the lumps(opensips message editing mechanism). Anyhow, isn't the add_body() function enough for what you need? Don't know whether you read the docs, but they state that " If a body already exists, it will be replaced with the new one."[0] So you don't need to call the strip_body() function. [0]http://www.opensips.org/html/docs/modules/2.2.x/sipmsgops.html#id294297 |
but Bogdan said that to push new body, both strip_body() and add_body() must be called (proof: http://opensips.org/pipermail/users/2014-October/030200.html) |
Bogdan might have missed this, but after you strip the body, and you add another one, the content type will not be set in your case |
I'm going to close this ticket. If it doesn't work without strip_body() you can reopen it. |
ok, thanks. i'll try ur solution later |
version: opensips 2.1.1 (x86_64/linux)
flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC, F_MALLOC, FAST_LOCK-ADAPTIVE_WAIT
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
main.c compiled on 00:00:43 Aug 29 2015 with gcc 4.4.7
When i trying to insert new body to some message in local_route by using add_body("$var(newbody)", "application/dialog-info+xml"), it inserts body itself, but doesn't insert content-type header
The text was updated successfully, but these errors were encountered: