Module: sip-router
Branch: master
Commit: b515ac33300f3c1d47195961409812d49fafb58f
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b515ac3…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Mon Oct 31 17:16:36 2011 +0100
ctl: use SRNAME define to build default ctl file path
- this define is set by sercmd comilation (NAME is set to sercmd in this
case)
- otherwise use NAME, which is set by sip server compilation
- reported by Henning Westerholt
---
modules/ctl/ctl_defaults.h | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/modules/ctl/ctl_defaults.h b/modules/ctl/ctl_defaults.h
index c50af47..5c10c17 100644
--- a/modules/ctl/ctl_defaults.h
+++ b/modules/ctl/ctl_defaults.h
@@ -4,7 +4,13 @@
#ifndef __ctl_defaults_h
#define __ctl_defaults_h
/*listen by default on: */
+#ifdef SRNAME
+/* this is used when compiling sercmd tool */
+#define DEFAULT_CTL_SOCKET "unixs:/tmp/" SRNAME "_ctl"
+#else
+/* this is used when compiling sip server */
#define DEFAULT_CTL_SOCKET "unixs:/tmp/" NAME "_ctl"
+#endif
/* port used by default for tcp/udp if no port is explicitely specified */
#define DEFAULT_CTL_PORT 2049
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#170 - get_body_part2 (parse_body)
User who did this - Luis Martin (lmartin)
----------
There could scenarios where more than one multipart part with the same TYPE/SUBTYPE are conveyed within the SIP message. How to search for the correct one? In that cases the Content-ID should be provided and is gonna be the key in your multipart search.
Let's say there is an incoming SIP INVITE with some xml information:
Session Initiation Protocol
Request-Line: INVITE
Method: INVITE
(...)
Message Header
(...)
Content-Type: multipart/mixed;boundary=unique-boundary-001
Content-Length: 900
Message Body
MIME Multipart Media Encapsulation, Type: multipart/mixed, Boundary: "unique-boundary-001"
[Type: multipart/mixed]
Preamble
First boundary: --unique-boundary-001\r\n
Encapsulated multipart part: (application/sdp)
Content-Type: application/sdp\r\n
Content-Length: 400\r\n\r\n
Session Description Protocol
(...)
Boundary: \r\n--unique-boundary-001\r\n
Encapsulated multipart part: (application/xml)
Content-ID: content1\r\n
Content-Type: application/xml\r\n
Content-Length: 300\r\n\r\n
eXtensible Markup Language
(...)
Boundary: \r\n--unique-boundary-001\r\n
Encapsulated multipart part: (application/xml)
Content-ID: content2\r\n
Content-Type: application/xml\r\n
Content-Length: 200\r\n\r\n
eXtensible Markup Language
(...)
Last boundary: \r\n--unique-boundary-001--\r\n
What if you want to get the second application/xml part of the multipart message?
get_body_part can't retrieve that
get_body_part2 can retrieve that part with:
"get_body_part2(msg, APPLICATION, XML, "content2", NULL, &len)"
and also with:
"get_body_part2(msg, 0, 0, "content2", NULL, &len)"
Hope it helps,
Luis
----------
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=170#comment313
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#170 - get_body_part2 (parse_body)
User who did this - Iñaki Baz Castillo (ibc)
----------
Hi, I'm not an expert in multipart bodies. What is the use case of matching by Content-ID? Could you please explain it with an example?
Thanks a lot.
----------
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=170#comment312
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
A new Flyspray task has been opened. Details are below.
User who did this - Luis Martin (lmartin)
Attached to Project - sip-router
Summary - get_body_part2 (parse_body)
Task Type - Improvement
Category - Core
Status - Assigned
Assigned To - Andrei Pelinescu-Onciul
Operating System - All
Severity - Low
Priority - Normal
Reported Version - Development
Due in Version - Undecided
Due Date - Undecided
Details - I made a new function for the "parser/parse_body.c" module : get_body_part2
--------------------
get_body_part,
char *get_body_part(struct sip_msg *msg, unsigned short type, unsigned short subtype, int *len)
get_body_part allows you to pick the first multipart part of the SIP message which matches TYPE/SUBTYPE. It will return a pointer to the multipart structure as well as its length. The code it is not easy-readable but this function is working great. The point is, what if I would like to search a multipart part within a SIP message that matches TYPE/SUBTYPE but also the Content-ID header or the Content-Length header?
--------------------
New function:
get_body_part2,
char *get_body_part_strict(struct sip_msg *msg, unsigned short content_type, unsigned short content_subtype, char *content_id, char *content_length, int *len)
It returns the first multipart part of the SIP message which matches "TYPE/SUBTYPE" and/or the "Content-ID" and/or the "Content-Length", and its length. If you want to be less restrictive, you can unflag the parameter by:
- setting 0/0 in case of the TYPE/SUBTYPE.
- setting NULL in case of the Content-ID and the Content-Length.
So setting Content-Length == NULL will make the function to skip the Content-Length from its filter and will give you back the first part which matches the TYPE/SUBTYPE and Content-ID, and its length.
--------------------
Already tested and working fine.
See patch attached.
Luis Martin Gil
One or more files have been attached.
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=170
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
A user has added themself to the list of users assigned to this task.
FS#170 - get_body_part2 (parse_body)
User who did this - Luis Martin (lmartin)
http://sip-router.org/tracker/index.php?do=details&task_id=170
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.