hi,
is it possible create log of SIP dialog like
https://wiki.asterisk.org/wiki/display/AST/Unique+Call-ID+Logging ?
it looks like its possible like this
xlog("L_INFO", "D$dlg(h_id) something to log \n");
but i must copy $dlg(h_id) in every xlog
tried this
modparam("xlog", "prefix", "D$dlg(h_id)")
but it not works with variables
any other tips/ideas?
goal is to correlate logs for one dialog (call)
thanks
Marek
Hi there,
I have a weird issue with kamailio (latest docker
image kamailio-ci:5.5.2-alpine) and http_async_client.
Before posting a lot of logs, let me describe what I want to achieve.
I have a Kamailio and a SIP Phone.
The SIP phone sends a REGISTER to kamailio, then in my routing block, I
check if I have an Authorization header.
Since I don't have an Authorization (first message), I
use "www_challenge()".
This replies to the SIP phone, and then the SIP phone sends a new REGISTER
with the correct Authorization header.
So far so good.
Now, when I get the REGISTER with Authorization header, I want to ask an
HTTP endpoint if this user is allowed to connect and check the password
using http_async_query().
The problem is that when the transaction resumes, the tmx module is unhappy
and throws this error :
30(36) CRITICAL: tmx [t_var.c:546]: pv_get_tm_reply_code(): no picked
branch (-1) for a final response in MODE_ONFAILURE
And a 500 error is sent back to the sip phone.
The AUTH_REPLY route is still called and I can use the $http* values.
It seems that my AUTH_REPLY route is called but considered as a
"failure_route"
19(27) exec: *** cfgtrace:dbg_cfg_trace(): failure_route=[AUTH_REPLY]
c=[/etc/kamailio/kamailio.cfg] l=665 a=16 n=if
17(23) NOTICE: <script>: [AUTH_REPLY] FAILURE ROUTE
If I remove the http_async_client and try with route(AUTH_REPLY) then it is
considered as request_route (but this is not a solution since I need to do
this http request)
Do you see something that I am doing wrong or missing in my logic?
Is pausing/resuming to use the async http client is allowed if I'm handling
a REGISTER transaction?
Here's a simplified version of my routing block (not far from reality):
##### SNIP
request_route{
route(AUTH);
route[AUTH]{
if (is_method("REGISTER"){
if(no_auth_header){
www_challenge("$td","1");
exit;
}
else{
t_newtran();
http_async_query("http://xxx.xxx.xxx.xxx:9000/auth?foo=bar",
"AUTH_REPLY");
}
}
}
route[AUTH_REPLY]{
xlog("L_INFO", "route[HTTP_REPLY]: status $http_rs\n");
if(t_is_failure_route()) {
xlog("L_NOTICE", "[AUTH_REPLY] FAILURE ROUTE \n\n");
}
}
}
##### END SNIP
Best regards!
Hi,
I have a requirement to specify a REGISTER max_expires based on the
User-Agent.
I checked the docs and it seems there is no pseudo-variable or something
like that would permit this.
I would like to be able to do something like this:
if($ua ~= "Some-UA") {
$max_expires=100;
} else {
$max_expires=150;
}
save("location");
Is there some way to achieve this?
I tried to check if message body contains a string using function call
str_find("$rb", "string"))
but it failed like this:
Jan 29 17:37:03 siika /usr/bin/sip-proxy[2577003]: ERROR: <core> [core/pvapi.c:1491]: pv_printf_mode(): no more space for spec value - printed:0 token:6880 buffer:4096
Jan 29 17:37:03 siika /usr/bin/sip-proxy[2577003]: ERROR: <core> [core/pvapi.c:1503]: pv_printf_mode(): buffer overflow -- increase the buffer size...
Jan 29 17:37:03 siika /usr/bin/sip-proxy[2577003]: ERROR: <core> [core/sr_module.c:1698]: get_str_fparam(): Could not convert the PV-formated string to str
Jan 29 17:37:03 siika /usr/bin/sip-proxy[2577003]: ERROR: textops [textops.c:4457]: str_find_f(): cannot get first parameter
Any suggestions on how to get it done properly?
-- Juha
Hello List,
I observe an interesting behavior. We use siptrace as an active capture
agent for QXIP HOMER/HEPIC installations.
The destination port and the source port in the HEPv3 Header are not
correct if you use transport tcp for example.
My Question: is that intended or a bug and i should fill up an issue?
On udp, it's filled with 5060 or whatever your listening directive says.
I tested that with kamailio 5.5 and kamailio master.
I attached an HEPv3 capture from two kamailios (master) speaking with each
other.
You need the https://github.com/sipcapture/hep-wireshark lua dissector to
read the capture.
10.0.2.15 (kamailio with uacreg and sipcapture/HEPv3 mode)
192.168.50.4 (kamailio as registrar)
Frame 1 shows an tcp transport register Request from 10.0.2.15 to
192.168.50.4 in HEPv3.
The Source Port in the HEP3 Protocol is not correct (its an highport /
45419).
Frame 4 shows the 401 answer and the Destination port is 0.
Frame 7 also had this behavior.
----- params (nearly at the end):
modparam("siptrace", "duplicate_uri", "MY_HOMER_CAPTURE")
modparam("siptrace", "hep_mode_on", 1)
modparam("siptrace", "hep_version", 3)
modparam("siptrace", "hep_capture_id", MY_HOMER_CAPTURE_ID) # capture agent
id Limitation: 32-bit for HEPv3.
modparam("siptrace", "trace_to_database", 0)
modparam("siptrace", "trace_on", 1)
modparam("siptrace", "trace_mode", 1) # default 0, if 1 then you dont need
call siptrace flag or sip_trace()
--
Mit freundlichen Grüßen / Kind Regards
*Karsten Horsmann*
Hello all,
I am using kamailio code to establish calls with the real ue's. Our calls
are getting established with an issue , whenever invite is send from A
party to B party with teluri
that tel uri is converted to sip uri. While converting to sip uri some
extra bytes are getting added after user=phone and the call ends.
Can someone help us on this issue of getting some extra bytes added in the
sip uri? for example :-
sip:405874112224411@ims.mnc123.mcc456.3gppnetwork.org;user=phone��
Thanks,
*Jyoti Bansal*
Software Engineer .
Great Software Laboratory | www.gslab.com
--
Confidentiality Notice and Disclaimer: This email (including any
attachments) contains information that may be confidential, privileged
and/or copyrighted. If you are not the intended recipient, please notify
the sender immediately and destroy this email. Any unauthorized use of the
contents of this email in any manner whatsoever, is strictly prohibited. If
improper activity is suspected, all available information may be used by
the sender for possible disciplinary action, prosecution, civil claim or
any remedy or lawful purpose. Email transmission cannot be guaranteed to be
secure or error-free, as information could be intercepted, lost, arrive
late, or contain viruses. The sender is not liable whatsoever for damage
resulting from the opening of this message and/or the use of the
information contained in this message and/or attachments. Expressions in
this email cannot be treated as opined by the sender company management –
they are solely expressed by the sender unless authorized.
I'm trying to configure Kamailio to permit communication between devices:
some use TLS and SRTP
some UDP and RTP
with RTPEngine in the middle.
A priori I don't know if the device support SRTP or RTP so in the
routing I have to detect on the fly how to act. The problem is this:
Call from RTP to SRTP device: 488 Not Acceptable here
Call from SRTP to RTP device: 415 Unsupported Media Type
Any hint?
Thank you
Regards
--
---
I'm SoCIaL, MayBe
First of all I should start by saying this is my first post so go easy on me!! : ) and thank for everyone's efforts to share knowledge it has been invaluable for my kamailio learning.
Build Details
Version: kamailio 5.5.3 (x86_64/linux)
Kamailio kemi python
Scenario
Relevant config
def ksr_route_api_query(self, msg):
KSR.log("info", "SUBSCRIBE API Query Starts")
# Create new Transaction
KSR.tm.t_newtran()
async def main():
url = 'https://api.hidingtheurl.com/subscribe'
payload = {
"ruri": KSR.pv.get("$ru"),
"from": KSR.pv.get("$fu"),
"from_tag": KSR.pv.gete("$ft"),
"to": KSR.pv.get("$tu"),
"callid": KSR.pv.get("$ci"),
"cseq": KSR.pv.get("$cs"),
"contact": KSR.pv.gete("$ct"),
"supported": KSR.pv.get("$hdr(Supported)"),
"event": KSR.pv.get("$hdr(Event)"),
"expires": KSR.pv.get("$hdr(Expires)"),
"diversion": KSR.pv.get("$di"),
"body": KSR.pv.get("$rb")
}
async with aiohttp.ClientSession() as session:
async with session.post(url, json=payload) as response:
if response.status == 0:
KSR.xlog.xinfo(f"SUB Manager Timeout: {response.status}")
KSR.tm.t_reply(408, "SUB Manager Timeout")
elif response.status >= 500:
KSR.xlog.xinfo(f"SUB Manager Down: {response.status}")
KSR.tm.t_reply(500, "SUB Manager Down")
elif response.status >= 400:
KSR.xlog.xinfo(f"SUB Manager Error: {response.status}")
KSR.tm.t_reply(400, "SUB Manager Error")
else:
if response.status == 200:
KSR.xlog.xinfo(f"SUB Manager Success: {response.status}")
KSR.tm.t_reply(200, "OK")
KSR.log("info", "SUBSCRIBE API Query Ends")
asyncio.run(main())
# API Query Ends
Scenario
Initial SUBSCRIBE >>> hits Kamailio >>> send payload in JSON to API get receive 200OK response from API and send a 200OK on to Device
SUBSCRIBE -------->
<------------ 200 OK
After Subscription Expiry
re-SUBSCRIBE >>> hits Kamailio >>> send payload in JSON to API get 200OK response from API and send a 200OK on to Device but also another 200OK a fraction of a second later...
SUBSCRIBE -------->
<------------ 200 OK
<<<--------- 200 OK
This happens for all following re-SUBSCRIBE's
The 200 OK are identical, and it is a re transmission, but I can't work out why..
Relevant DEBUG is below
Jan 26 12:31:17 ip-172-20-46-39 kamailio[11234]: INFO: <script>: SUB Manager Success: 200
Jan 26 12:31:17 ip-172-20-46-39 kamailio[11234]: DEBUG: app_python3 [apy_kemi.c:232]: sr_apy_kemi_exec_func_ex(): execution of method: t_reply
Jan 26 12:31:17 ip-172-20-46-39 kamailio[11234]: DEBUG: app_python3 [apy_kemi.c:287]: sr_apy_kemi_exec_func_ex(): params[2] for: t_reply are int-str: [200] [OK]
Jan 26 12:31:17 ip-172-20-46-39 kamailio[11234]: DEBUG: tm [t_lookup.c:1034]: t_check_msg(): msg (0x7eff0cd4e828) id=2/11234 global id=2/11234 T start=0x7eff0918d7d8
Jan 26 12:31:17 ip-172-20-46-39 kamailio[11234]: DEBUG: tm [t_lookup.c:1108]: t_check_msg(): T (0x7eff0918d7d8) already found for msg (0x7eff0cd4e828)!
Jan 26 12:31:17 ip-172-20-46-39 kamailio[11234]: DEBUG: <core> [core/msg_translator.c:162]: check_via_address(): (80.111.111.111, 80.111.111.111, 0)
Jan 26 12:31:17 ip-172-20-46-39 kamailio[11234]: DEBUG: tm [t_reply.c:1763]: cleanup_uac_timers(): RETR/FR timers reset
Jan 26 12:31:17 ip-172-20-46-39 kamailio[11234]: DEBUG: tm [t_reply.c:637]: _reply_light(): reply sent out - buf=0x7eff0cd50938: SIP/2.0 200 OK#015#012Via:... shmem=0x7eff09190ca8: SIP/2.0 200 OK#015#012Via:
Jan 26 12:31:17 ip-172-20-46-39 kamailio[11234]: DEBUG: tm [t_reply.c:648]: _reply_light(): finished
Jan 26 12:31:17 ip-172-20-46-39 kamailio[11234]: DEBUG: app_python3 [apy_kemi.c:232]: sr_apy_kemi_exec_func_ex(): execution of method: t_precheck_trans
Jan 26 12:31:17 ip-172-20-46-39 kamailio[11234]: DEBUG: app_python3 [apy_kemi.c:232]: sr_apy_kemi_exec_func_ex(): execution of method: t_check_trans
Jan 26 12:31:17 ip-172-20-46-39 kamailio[11234]: DEBUG: tm [t_lookup.c:1034]: t_check_msg(): msg (0x7eff0cd4e828) id=2/11234 global id=2/11234 T start=0x7eff0918d7d8
Jan 26 12:31:17 ip-172-20-46-39 kamailio[11234]: DEBUG: tm [t_lookup.c:1108]: t_check_msg(): T (0x7eff0918d7d8) already found for msg (0x7eff0cd4e828)!
Jan 26 12:31:17 ip-172-20-46-39 kamailio[11234]: DEBUG: tm [t_reply.c:1703]: t_retransmit_reply(): reply retransmitted. buf=0x7eff0cb18220: SIP/2.0 2..., shmem=0x7eff09190ca8: SIP/2.0 2
Jan 26 12:31:17 ip-172-20-46-39 kamailio[11234]: DEBUG: app_python3 [apy_kemi.c:112]: sr_kemi_config_engine_python(): execution of route type 1 with no name returned 1
Jan 26 12:31:17 ip-172-20-46-39 kamailio[11234]: DEBUG: <core> [core/receive.c:514]: receive_msg(): request-route executed in: 38258 usec
Everything works well as is but I want to clean up this issue or at least understand what is causing it.
Lewis
Hi,
I'm trying to use siptrace to getting copy of my SIP transactions,
especially in TLS.
Here's my configuration :
*loadmodule "siptrace.so" modparam("siptrace", "trace_mode", 1)
modparam("siptrace", "trace_to_database", 0) modparam("siptrace",
"trace_on", 1) modparam("siptrace", "duplicate_uri", "sip:MY_IP:5065")
modparam("siptrace", "trace_local_ip", "MY_IP:5061") modparam("siptrace",
"hep_mode_on", 1) modparam("siptrace", "hep_version", 2)
modparam("siptrace", "hep_capture_id", 1) modparam("siptrace",
"trace_flag",22); *
And in my Routing Logic :
*request_route {*
*sip_trace();setflag(22);*
*(...)*
But I didn't receive anything on my listening port 5065 according my
TCPDUMP.
Status confirm me siptrace is working :
*root@debian:/# kamcmd siptrace.status checkEnabled*
I think I made a mistake in the configuration, but I don't know where.
My second question is when I try to use sip_trace_mode("t"); I getting :
failed to find command sip_trace_mode.
Is it in an other module ?
Many thanks for your help.
Regards,
Arnaud
Hi Aditya,
There are 2 options to achieve this:
Option-1 use below param in auth_db module and while doing authentication
change table name to your table
user_column (string)
<https://www.kamailio.org/docs/modules/devel/modules/auth_db.html#auth_db.p.…>
domain_column (string)
<https://www.kamailio.org/docs/modules/devel/modules/auth_db.html#auth_db.p.…>
password_column (string)
<https://www.kamailio.org/docs/modules/devel/modules/auth_db.html#auth_db.p.…>
Option-2 create a new http service that will connect to kamailio via evapi
and will be responsible for authentication and location service.
On Wed, 26 Jan 2022 at 16:31, <sr-users-request(a)lists.kamailio.org> wrote:
> Send sr-users mailing list submissions to
> sr-users(a)lists.kamailio.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
> or, via email, send a message with subject or body 'help' to
> sr-users-request(a)lists.kamailio.org
>
> You can reach the person managing the list at
> sr-users-owner(a)lists.kamailio.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of sr-users digest..."
>
>
> Today's Topics:
>
> 1. Kamailio as a SIP registrar (Aditya Uppuluri)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 26 Jan 2022 16:21:33 +0530
> From: Aditya Uppuluri <uppuluriaditya(a)gmail.com>
> To: sr-users(a)lists.kamailio.org
> Subject: [SR-Users] Kamailio as a SIP registrar
> Message-ID:
> <CAKWpYb=
> 9EABvpmbPhvCyt-roQaOkiJnZSh17vVu6Wk26PiBbeg(a)mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hello Team,
> Thank you for the amazing product. I am a newbie to kamailio and currently
> trying to use kamailio as a SIP Registrar (for a multidomain). Here is the
> requirement
>
> 1. We already have a mysql database (name: VOIP) with a table named
> VoipSubscribers which contains the userid, password and domain information
> of all the users.
> 2. We want the ability in kamailio to use the same VoipSubscribers table
> for user registrations and also store the location information in the same
> database (VOIP)
>
> May I know how to achieve this without altering the table schema?
> Thank you in advance.
>
> Regards,
> Aditya Uppuluri
>