Hello,
kamcli (kamailio command line interface tool written in python) got a
consistent set of features trying to become in pair with kamctl. It is
currently hosted by asipto organization on github, but I am considering
to transfer (move) it to kamailio organization in order to manage easier
the access for kamailio devs as well as increase its exposure to community.
It interacts with kamailio using rpc commands via jsonrpcs module.
You can read more about what it can do at:
- https://github.com/asipto/kamcli
The commands are implemented in a plugin-like fashion -- see the ones
done so far:
- https://github.com/asipto/kamcli/tree/master/kamcli/commands
Given that it can handle better the jsonrpc responses, provides more
options to format the output and the help is embedded in each command, I
think it is a good candidate to replace the old shell(bash)-based kamctl.
Probably we can adjust kamctl for rpc when mi code will be removed, but
the options to build and extend in long term a good cli for kamailio are
quite limited in shell.
For the sake of an example, here is the implementation of 'ps' command,
handling the json rpc to display a very compact list of kamailio processes:
- https://github.com/asipto/kamcli/blob/master/kamcli/commands/cmd_ps.py
Dealing with database records is also rather trivial:
-
https://github.com/asipto/kamcli/blob/master/kamcli/commands/cmd_group.py
Anyone with comments/suggestions/alternatives?
Cheers,
Daniel
--
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.com
Hello all,
I am looking for a solution to forward emergency calls inside an enterprise
network.
Is there any way to forward calls based on the IP address of caller device?
The requirement is that calls to a unique emergency number must be
forwarded to specific local numbers in each building, and the IP address of
the caller is the criteria for choosing the destination. A table maps IP
nets to specific local numbers.
The SIP contact header has the caller IP address, but I am new to Kamailio
and I am not sure where to start. Any suggestions?
Thanks in advance.
João Vitor.
Hello,
the log message you refer to is inside the if block:
if ($sht(pht=>$ci)!=$null) { ... }
but you don't set the item in memory, no assignment like:
$sht(pht=>$ci) = ...;
The sht_lock(pht=>$ci) is just locking the slot where the value of
$sht(pht=>$ci) will be stored, but don't store any valye for that variable.
Cheers,
Daniel
On 15/12/2016 11:46, Marino Mileti wrote:
>
> Hi guys,
>
>
>
> I'm going out of mind J
>
> I've this piece of script inside an "on_reply_route" that captures
> only 200OK of INVITE (i would like to save in ht the contact of who
> has answered a call)
>
>
>
> sht_lock("pht=>$ci");
>
> if ($sht(pht=>$ci)!=$null){
>
> xlog("L_INFO","Before assignment..");
>
> $sht(pht=>$ci)=$var(myvar);
>
> xlog("L_INFO","Assigned done...");
>
> sht_unlock("pht=>$ci");
>
> }
>
> else{
>
> xlog("L_INFO","Skipping..");
>
> }
>
> sht_unlock("pht=>$(hdr(Call-ID))");
>
>
>
> The situation is that I never see the "Assigned done" message in log
> file...
>
>
>
> Is this the right use of sht_lock/sht_unlock method?
>
>
>
> /Marino Maria Mileti///
>
> /marino.mileti(a)alice.it <mailto:marino.mileti@alice.it>/
>
> / /
>
> /cid:006a01cb6b0e$67eecdae$_CDOSYS2.0//Reduce your energy consumption
> and keep polar bears on ice!/
>
>
>
>
>
> ------------------------------------------------------------------------
> Avast logo
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campai…>
>
>
> Questa e-mail è stata controllata per individuare virus con Avast
> antivirus.
> www.avast.com
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campai…>
>
>
>
>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users(a)lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.com
Hello fellow SIP people:
I upgraded from SIREMIS 4.2 to 4.3 for my Kamailio system and I now get the
error message shown below.
Any ideas on how to solve it?
I am assuming there was a change on how SIREMIS did a date query and my version
of Linux (6.8) or my PHP does not support it as expected.
Any help would be useful.
Thanks.
Kevin
[{"target":"ERROR","content":"\n[2016-12-14 22:59:55 (GMT)] An exception
occurred while executing this script:
\nError message: #2, date(): It is not safe to rely on the system's timezone
settings. You are *required* to use the date.timezone setting or the
date_default_timezone_set() function. In case you used any of those methods and
you are still getting this warning, you most likely misspelled the timezone
identifier. We selected 'UTC' for 'UTC\/0.0\/no DST' instead<\/font>
\nScript name and line number of error:
\/var\/www\/siremis-4.3.0\/openbiz\/bin\/service\/logService.php:160<\/font>
\n
*function:<\/b> errorHandler ( 2, \"date(): It is not safe to rely on the
system's timezone settings...\",
\"\/var\/www\/siremis-4.3.0\/openbiz\/bin\/service\/logService.php\", 160,
Array(8) ) @ \/var\/www\/siremis-4.3.0\/openbiz\/bin\/sysheader.inc 117\n
*function:<\/b> userErrorHandler ( 2, \"date(): It is not safe to rely on the
system's timezone settings...\",
\"\/var\/www\/siremis-4.3.0\/openbiz\/bin\/service\/logService.php\", 160,
Array(8) ) @ \n
*function:<\/b> date ( \"m\/d\/Y\" ) @
\/var\/www\/siremis-4.3.0\/openbiz\/bin\/service\/logService.php 160\n
The "date" command returns:
$ date
Thu Dec 15 01:13:41 UTC 2016
The /etc/localtime entry is:
$ more /etc/localtime
TZif2
UTC
$ which php
/usr/bin/php
$ php -version
PHP 5.3.3 (cli) (built: Aug 11 2016 13:38:15)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
PHP I am using is the latest patched version I have.
***
Hi guys,
I'm going out of mind J
I've this piece of script inside an "on_reply_route" that captures only
200OK of INVITE (i would like to save in ht the contact of who has answered
a call)
sht_lock("pht=>$ci");
if ($sht(pht=>$ci)!=$null){
xlog("L_INFO","Before assignment..");
$sht(pht=>$ci)=$var(myvar);
xlog("L_INFO","Assigned done...");
sht_unlock("pht=>$ci");
}
else{
xlog("L_INFO","Skipping..");
}
sht_unlock("pht=>$(hdr(Call-ID))");
The situation is that I never see the "Assigned done" message in log file...
Is this the right use of sht_lock/sht_unlock method?
Marino Maria Mileti
<mailto:marino.mileti@alice.it> marino.mileti(a)alice.it
cid:006a01cb6b0e$67eecdae$_CDOSYS2.0Reduce your energy consumption and keep
polar bears on ice!
---
Questa e-mail è stata controllata per individuare virus con Avast antivirus.
https://www.avast.com/antivirus
Hi forum,
This is the scenario:
VM <- Kamailio -> SP1 ----- SP2 ---- PhoneA (john)
PhoneB
PhoneA is configured in *dbaliases* table:
alias_username, alias_domain, username, domain
11111111, sp1.com, john, sp2.com
When PhoneB dials 1111111, Kamailio converts 111111(a)sp1.com to john(a)sp2.com
Now I need to provide VM services to PhoneA. (Opposite direction)
PhoneA calls voicemail but the calling number is john(a)sp2.com
I need to have SP1 use the 11111111(a)sp1.com format
How can I overwrite the From?
Pseudo algorithm
------------------------
If destination is VM and from domain ($fU) is sp2.com:
Find user URI: ( In this case john extracted from john(a)sp2.com in
dbaliases)
If user is found:
rewrite From URI:
use alias_username@alias_domain
I'm using default kamailio.cfg and calls successfully are forwarded to VM
Thank you
Hi guys,
I've a Kamailio instance listening on both eth0 and wlan0.
Kamailio forks call to two branches, so both clients rings together.
In case (very very very rare J) of simultaneous answers is there any way to
kill/hangup/destroy/cancel the "slowest" leg? I've tried to arrange a
semaphore with lock/unlock capabilities of cfgutils, I've used the drop
command but client still sending the 200OK because it's waiting for an ACK L
Any help will be very appreciated J
Marino Maria Mileti
<mailto:marino.mileti@alice.it> marino.mileti(a)alice.it
cid:006a01cb6b0e$67eecdae$_CDOSYS2.0Reduce your energy consumption and keep
polar bears on ice!
---
Questa e-mail è stata controllata per individuare virus con Avast antivirus.
https://www.avast.com/antivirus
I have a peculiar scenario, maybe you guys have an easy solution:
1. a call comes in through an SBC (which is also kamailio)
2. SBC passes call to core kamailio server
3. call reaches 180 ringing state
4. client suddenly changes from wifi to 4G (using 4G IP, VIA headers are
all updated)
5. client sends cancel and receives cancelling msg from SBC
6. SBC sends cancel to kamailio core
7. kamailio core sends back Request Terminated after termination
the issue is, this message was sent to the wifi IP not the 4G
when checking the network dumps, looks like this was because the INVITE was
received
on kamailio core from the old wifi IP. Is there maybe a way to update the
transaction perhaps?
Kelvin Chua
We have currently dispatcher running for single domain, but in future
we have more domain coming so i want to do multi domain dispatching
for example
dispatcher redirect request for foo.com to foo.registar and bar.com to
bar.registar SIP server currently we have following code in dispatcher
logic.
what should we do to handle multi-domain
if(!ds_select_dst("1", "2"))
{
# if we are here that means no destination is
available. We notify the user by 404 and exit the script.
xlog("L_NOTICE", "No destination available!");
send_reply("404", "No destination");
exit;
}
I am trying to block SIP scanner so i am trying to use following logic
only allow "My-UserAgent" and block rest but its throwing error, but
if i use =~ regular expression which works! why negative match
doesn't work?
if($ua !~ "(My-UserAgent") {
xlog("L_INFO","On more scriptkiddie, coming from
$si, blocking");
exit;
}
what could be wrong here?