I've been trying to track this issue down myself for the last two days but it appears the value is coming from somewhere in the tm module or somewhere else lower than that, which I haven't worked with at all. I have siptrace turned on and I'm using the destination port from the HEPv2 header but it seems to always come to me as 5060 even if the packet is actually sent to a different port (such as 51000). I'm able to reproduce this with my Polycom phone by having two registrations (one UDP and one TCP) going through a Kamailio server from the same phone. It looks like the first request comes from 5060 and is responded to on 5060, but the second connection comes from a random port on the phone (let's say 35000). When the reply (such as a 200) comes back from the server sitting behind the Kamailio proxy, the siptrace HEP header says the packet is going back to 5060 when it's actually being sent to 35000. I'm not even sure where the 5060 value is coming from in the first place
.
I've tracked the '5060' value to `t.uas.response.dst.to.sin.sin_port` in `t_reply.c:reply_received()` but the value of `t` is retrieved from `get_t()` and I'm not sure where that's added to the hash table in the first place. I can see the actual value of the destination port with `t.uas.request.rcv.src_port` within that same `t_reply.c:reply_received()` but I can't figure out how to get that value into the destination port at the source.
---
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/581
Module: kamailio
Branch: 4.4
Commit: fbfaa30bc9f3e7fe63f05c0a488e3c331436b9c3
URL: https://github.com/kamailio/kamailio/commit/fbfaa30bc9f3e7fe63f05c0a488e3c3…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Kamailio Dev <kamailio.dev(a)kamailio.org>
Date: 2016-09-14T15:16:16+02:00
modules: readme files regenerated - textops ...
---
Modified: modules/textops/README
---
Diff: https://github.com/kamailio/kamailio/commit/fbfaa30bc9f3e7fe63f05c0a488e3c3…
Patch: https://github.com/kamailio/kamailio/commit/fbfaa30bc9f3e7fe63f05c0a488e3c3…
---
diff --git a/modules/textops/README b/modules/textops/README
index e6c09c9..752607e 100644
--- a/modules/textops/README
+++ b/modules/textops/README
@@ -999,11 +999,19 @@ if (starts_with("$rU", "+358"))
The core will take care of the last boundary ending "--". Detecting
wich one is the last and fixing the others if needed.
+ Note: it may be required that msg_apply_changes() from textops module
+ has to be executed if there are other operations over the new body.
+
Example 1.37. set_body_multipart usage
...
set_body_multipart("test", "text/plain", "delimiter");
+msg_apply_changes();
+append_body_part(...);
+
...
-Will produce:
+
+# Will produce:
+
...
Content-Type: multipart/mixed;boundary="delimiter"
Mime-Version: 1.0
@@ -1040,7 +1048,9 @@ $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");
...
-Will append this the body:
+
+# Will append this to the body:
+
...
Content-Type: application/vnd.cirpack.isdn-ext
Content-Disposition: signal;handling=required
Module: kamailio
Branch: master
Commit: 981993bdaaaf0efa5b14cf99b2da1c2f7a71b9bf
URL: https://github.com/kamailio/kamailio/commit/981993bdaaaf0efa5b14cf99b2da1c2…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2016-09-14T15:07:00+02:00
sca: fixed the xml docbook - an extra para tag was removed
---
Modified: modules/sca/doc/sca_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/981993bdaaaf0efa5b14cf99b2da1c2…
Patch: https://github.com/kamailio/kamailio/commit/981993bdaaaf0efa5b14cf99b2da1c2…
---
diff --git a/modules/sca/doc/sca_admin.xml b/modules/sca/doc/sca_admin.xml
index b422dc5..f024674 100644
--- a/modules/sca/doc/sca_admin.xml
+++ b/modules/sca/doc/sca_admin.xml
@@ -266,7 +266,6 @@ modparam( "sca", "db_update_interval", 120 )
<section id="sca.p.onhold_bflag">
<title><varname>onhold_bflag</varname> (integer)</title>
<para>
- <para>
Which branch flag should be used by the module to identify if the call
is on-hold instead of parsing the sdp.
</para>
Hello,
If I understand correctly to insert some additional ISUP(SIP-T) data after SDP into INVITE SIP message the first step would be to convert a single body of this SIP message to a multipart body with `set_body_multipart` (from `textops` module) without any parameters (according to https://www.kamailio.org/docs/modules/stable/modules/textops.html#textops.f…) and then it would convert this message to a multipart one. Then use `append_body_part` from the same module to insert ISUP data. However when we tested the first step `set_body_multipart` didn't insert a proper closing boundary delimiter (ending with two more hyphens) as it's supposed to according its documentation: _The core will take care of the last boundary ending "--". Detecting which one is the last and fixing the others if needed._
We tested with the latest release 4.4.1:
kamailio.cfg:
```
route {
# CANCEL processing
if (is_method("CANCEL"))
{
if (t_check_trans())
t_relay();
exit;
}
# account only INVITEs
if (is_method("INVITE"))
{
setflag(1); # do accounting
if(!ds_is_from_list("1")){
## handle INBOUND ISUP
route(ISUP);
} else {
xlog("SIP message from $ru\n");
## handle OUTBOUND ISUP
route(TO_PSTN);
}
}
if ($rU==$null)
{
# request with no Username in RURI
sl_send_reply("484","Address Incomplete");
exit;
}
# dispatch destinations
route(DISPATCH);
}
route[TO_PSTN] {
set_body_multipart(); # supposed to do the right thing
msg_apply_changes(); # tested with and without this call, still the same result
}
```
Malformed INVITE SIP message (from Wireshark):
```
INVITE sip:1000@192.168.38.88:5080 SIP/2.0
Record-Route: <sip:192.168.38.88:5080;lr=on;callgenie=true>
Via: SIP/2.0/UDP 192.168.38.88:5080;branch=z9hG4bK61df.358abca8ab3f0186f30b081e906e09d0.0
Via: SIP/2.0/UDP 192.168.38.88:5060;branch=z9hG4bK0fdf4145
Max-Forwards: 69
From: "Anonymous" <sip:anonymous@anonymous.invalid>;tag=as6510bcf9
To: <sip:1000@192.168.38.88:5080>
Contact: <sip:anonymous@192.168.38.88:5060>
Call-ID: 4ad0a0133cdbea9c6a05677715d4bd21@192.168.38.88:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX 13.6.0
Date: Tue, 07 Jun 2016 08:38:02 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
X-ISUP-ANI: 081101213
Content-Length: 435
Content-Type: multipart/mixed;boundary="unique-boundary-1"
Mime-Version: 1.0
--unique-boundary-1
Content-Type: application/sdp
v=0
o=root 957277759 957277759 IN IP4 192.168.38.88
s=Asterisk PBX 13.6.0
c=IN IP4 192.168.38.88
b=CT:384
t=0 0
m=audio 11424 RTP/AVP 0 8 3 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=maxptime:150
a=sendrecv
m=video 13788 RTP/AVP 34
a=rtpmap:34 H263/90000
a=sendrecv
--unique-boundary-1
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.38.88:5080;branch=z9hG4bK61df.358abca8ab3f0186f30b081e906e09d0.0
Via: SIP/2.0/UDP 192.168.38.88:5060;branch=z9hG4bK0fdf4145
To: <sip:1000@192.168.38.88:5080>
From: "Anonymous" <sip:anonymous@anonymous.invalid>;tag=as6510bcf9
Call-ID: 4ad0a0133cdbea9c6a05677715d4bd21@192.168.38.88:5060
CSeq: 102 INVITE
Content-Length: 0
<skipped>
```
Thanks.
---
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/661
Module: kamailio
Branch: 4.4
Commit: d83ee9787f3df8da718b69e41d2e8d452ea2bc26
URL: https://github.com/kamailio/kamailio/commit/d83ee9787f3df8da718b69e41d2e8d4…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2016-09-14T15:01:19+02:00
textops: more details for set_body_multipart() and need of msg_apply_changes()
(cherry picked from commit ba3df9a65aaa60b9236f3ac6d3c748079174ecd5)
---
Modified: modules/textops/doc/textops_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/d83ee9787f3df8da718b69e41d2e8d4…
Patch: https://github.com/kamailio/kamailio/commit/d83ee9787f3df8da718b69e41d2e8d4…
---
diff --git a/modules/textops/doc/textops_admin.xml b/modules/textops/doc/textops_admin.xml
index 1cbe72a..6180e4c 100644
--- a/modules/textops/doc/textops_admin.xml
+++ b/modules/textops/doc/textops_admin.xml
@@ -1391,13 +1391,22 @@ if (starts_with("$rU", "+358"))
The core will take care of the last boundary ending "--". Detecting wich one is
the last and fixing the others if needed.
</para>
+ <para>
+ Note: it may be required that msg_apply_changes() from textops module
+ has to be executed if there are other operations over the new body.
+ </para>
<example>
<title><function>set_body_multipart</function> usage</title>
<programlisting format="linespecific">
...
set_body_multipart("test", "text/plain", "delimiter");
+msg_apply_changes();
+append_body_part(...);
+
...
-Will produce:
+
+# Will produce:
+
...
Content-Type: multipart/mixed;boundary="delimiter"
Mime-Version: 1.0
@@ -1452,7 +1461,9 @@ text
$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");
...
-Will append this the body:
+
+# Will append this to the body:
+
...
Content-Type: application/vnd.cirpack.isdn-ext
Content-Disposition: signal;handling=required
Module: kamailio
Branch: master
Commit: a2b4207cf7d00f10d4243cc880f8257bca7afd9b
URL: https://github.com/kamailio/kamailio/commit/a2b4207cf7d00f10d4243cc880f8257…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Kamailio Dev <kamailio.dev(a)kamailio.org>
Date: 2016-09-14T15:01:26+02:00
modules: readme files regenerated - textops ...
---
Modified: modules/textops/README
---
Diff: https://github.com/kamailio/kamailio/commit/a2b4207cf7d00f10d4243cc880f8257…
Patch: https://github.com/kamailio/kamailio/commit/a2b4207cf7d00f10d4243cc880f8257…
---
diff --git a/modules/textops/README b/modules/textops/README
index 0ae388e..de571f5 100644
--- a/modules/textops/README
+++ b/modules/textops/README
@@ -992,11 +992,19 @@ if (starts_with("$rU", "+358"))
The core will take care of the last boundary ending "--". Detecting
wich one is the last and fixing the others if needed.
+ Note: it may be required that msg_apply_changes() from textops module
+ has to be executed if there are other operations over the new body.
+
Example 1.37. set_body_multipart usage
...
set_body_multipart("test", "text/plain", "delimiter");
+msg_apply_changes();
+append_body_part(...);
+
...
-Will produce:
+
+# Will produce:
+
...
Content-Type: multipart/mixed;boundary="delimiter"
Mime-Version: 1.0
@@ -1033,7 +1041,9 @@ $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");
...
-Will append this the body:
+
+# Will append this to the body:
+
...
Content-Type: application/vnd.cirpack.isdn-ext
Content-Disposition: signal;handling=required