Hi, good moorning.
I have a Kamailio 4.0 with avp module working.
Now, I need write some values in my database and I don't find and example for this.
if (avp_db_query("update subscriber set bloqueado=0 where name=xxxxx"))
{
}
Is possible make this operation with avp_db_query ?
Thanks
--------------------------------
Ángel Elena Medina _o)
craem(a)craem.net / \\
http://blog.craem.net _(___V
@craem_
--------------------------------
I use Asterisk for SIP and Media Proxy. Despite the fact that Asterisk is
not a SIP Proxy at all.
Customer registers in a SIP account, sends the invite and thru de context
Asterisk dials out thru a SIP Trunk. Asterisk does the media proxy, since
customer can't route directly to the SIP Trunk (altough it has a valida
address, it don't have a public route allowed to it).
I need limit customer concurrent calls, mangle some dial-in/dial-out
numbers, keep track of ongoing call, control SIP dialog, retransmit correct
hang-up causes and do media proxy (no transconding at all)
After reading about Kamailio and Opensips, and due to the Kamailio Admin
Book, I decided to go with Kamailio.
Well, I understand that I have to use some kamailio modules, like auth,
dialplan, rtpproxy and db_mysql.
What make me stuck is how does everything fit together in kamailio.cfg and
how do I get ongoing calls and CDR's?
Can anyone point me a direction?
Thanks
We are trying to setup VOIP infrastructure, mainly wholesale and retail.
What is best option if money is not the problem?
Developing our own infrastructure using Kamailio and other open source
packages to act as SBC and switch or buy a commercial solution like
GenBand/Sonus/Sansay.
We are looking for high performance with scalability to handle thousands of
call setups per second over the period of few years.
I have no idea on how/if can kamailio outperform commercial solutions or
not.
Advantage of using kamailio is flexibility and possibility of customization
as per requirement,
I am new to this list so please advise if this is not a valid question to
be asked here.
I recently set up a Kamailio instance using the default configuration
for HOMER with MySQL[1]
The database was not running and Kamailio refused to start.
Would it be better for Kamailio to start anyway and go into a loop
trying to connect to the database, just as if auto_reconnect was set?
This is useful for people who start Kamailio from their init script and
can't be sure if their database host is up before their Kamailio host boots
1.
https://github.com/sipcapture/homer-api/blob/master/examples/sipcapture/sip…
I’m looking to briefly check the sanity of my configuration. I have been
working w/Kamailio the last few months, and have read the SIP router ebook.
Thank you for your efforts and the documentation. It has been a GREAT HELP!
We are attempting to replace an Acme Packet SBC, and our setup is as
follows:
|ACCESSUSERS| ⇔ |KAMAILIO/SEMS| ⇔ |BROADSOFT| ⇔ |GENBAND| ⇔ |PSTN|
Kamailio & SEMS are (currently) on the same box, and communicate using
localhost via different ports. They also listen on the same private (core)
IPs, using different ports.
Since Broadsoft doesn’t support the PATH header, I manipulate the contact
header w/the SEMS privateIP & port in the contact header. This causes it to
be stored in the Broadsoft Registration string, and calls from PSTN route
directly to SEMs to start calls etc… Registraton code looks like this:
route[REGISTRATION] {
remove_hf("Route");
add_path_received();
$avp(contact) = $ct;
xlog("L_INFO", "found contact header $avp(contact)");
setflag(FLAG_REGISTRATION);
if (nat_uac_test("20")){
xlog("L_INFO", "[REGISTRATION_ATTEMPT] [FROM_NAT] R=$ru
ID=$ci UA='$ua'\n");
force_rport();
remove_hf("Contact");
append_hf("Contact: <sip:$fU" + "@" +
"!SEMSPRIVATEIP!:5060;" + "alias=$si~$sp~1>\n");
setflag(FLT_NATS);
}
else {
xlog("L_INFO", "[REGISTRATION_ATTEMPT] [PUBLIC_IP]
\r\n[REGISTRATION_INFO] R=$ru UA='$ua'\r\n");
remove_hf("Contact");
append_hf("Contact: <sip:$fU@" +
"!SEMSPRIVATEIP!:5060;" + "alias=$si~$sp~1>\n");
}
$du = "sip:R_IP:REGISTRAR_PORT";
t_on_reply("REG");
route(RELAY);
exit;
}
Then in the relay route, I force the registration out of the private
interface & port of Kamailio
if (isflagset(FLAG_REGISTRATION)){
$fs = "LISTEN_UDP_PRIVATE";
}
Finally, if a registration is successful from BROADSOFT, I store it in the
location table, to allow me to screen calls from access to ensure they are
‘registered’
onreply_route[REG]{
if(status=="200") {
xlog("L_INFO", "REGISTRATION BE GOOD FOR $fu");
save("location", "0x04");
}
}
Calls from ACCESS, I check USRLOC for screening, then pass the call to SEMS
via the localhost:port. From there, sems enacts the B2BUA/SBC module and
routes the call to BROADSOFT, and along to our GENBAND Gateway… I could
never get calls to work properly without SEMS, just using RTP PROXY/ENGINE,
possibly because the RTP for the GENBAND & KAMAILIO/SEMS are on different
private subnets. Our setup is fairly legacy ‘heavy’ and many things can’t
be changed.
Calls from PSTN route to GENBAND, then BROADSOFT, then SEMS, then KAMAILIO.
Since I have manipulated the contact header, BROADSOFT maintains that in
the INVITE and I can use the ‘handle_ruri_alias’ to route the call
properly. SEMS sets the PUBLIC IP of the KAMAILIO/SEMS box in the SDP, and
facilitates rtp relaying.
if (isflagset(FLAG_TOUSER)){
xlogl("L_INFO", "TOUSERFLAGSET");
if(is_method("INVITE|BYE")){
handle_ruri_alias();
}
/*if(has_body("application/sdp") && nat_uac_test("8"))
{
fix_nated_sdp("10");
xlog("L_INFO", "SDP CONTAINS NAT");
}*/
$fs = "LISTEN_UDP_PUBLIC";
}
I’ve gone headlong into this setup,
and it works!
But, I
wanted to get a ‘Sanity Check’ to determine if there is a better way to do
this. We are at the point where I’m doing load testing and attempting to
validate this for a ‘production’ ready state. If possible, I’d just like to
ask the community if they have encountered a similar setup, and how they
solved it?
Thanks in advance!!!
Daryn Johnson
Senior VoIP Engineer
248.485.1109
www.telnetww.com
1175 W. Long Lake Rd. | Suite 101 | Troy, MI 48098
Hi all - my Kamailio - 4.1.6 is receiving this particular structured INVITES from multiple IPs, and for some reason it is not requesting authentication. I have AUTH & IPAUTH modules in use for two years now, but this is bypassing that and actually forwarding the invite to asterisk servers behind Kamailio.
I notice from the invite that the contact (c=IN IP4 10.10.10.10) is unusual and in the private range. Is this what is bypassing Authentication?
Any Pointers on how to stop this. This is flooding my boxes!
==========================================
2016/09/16 06:45:16.824768 83.48.28.27:63029 -> MYPUBLICIP:5060
INVITE sip:9441134018000@MYPUBLICIPSIP/2.0
Via: SIP/2.0/UDP 83.48.28.27:5060;branch=z9hG4bK898408493
Max-Forwards: 70
From: "442030930112" <sip:442030930112@83.48.28.27>;tag=5044916148
To: <sip:9441134018000@MYPUBLICIP>
Contact: <sip:442030930112@83.48.28.27>
Call-ID: 9xCjfQkrmDwT7D6AqM0BTYAgmWjG84nq
CSeq: 102 INVITE
User-Agent: SIP Call
Date: Fri, 16 Sep 2016 05:45:48 +0000
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, INFO, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 308
v=0
o=442030930112 8982 1536 IN IP4 10.10.10.10
s=SIP
c=IN IP4 10.10.10.10
t=0 0
m=audio 14806 RTP/AVP 0 3 8 4 18 101
a=rtpmap:0 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:8 PCMU/8000
a=rtpmap:4 G723/8000
a=rtpmap:18 G729/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv
Regards
Eric
Hi Guys,
I am just testing with jansson and http_async_query.
Essentially I sent an INVITE into kamailio ,it hits CALL_START_REQUEST (see below) and the query allows the http site I send to, to provide routing details for kamailio.
Logging the $rm that hits CALL_START_ REQUEST, it shows as INVITE, however when CALL_START_REQUEST_REPLY is hit, the message type is OPTIONS, is this expected behaviour?
Essentially I want it to continue in the script with the same $ci,$rm so I can onwards route it for termination, but all I get are options messages being sent, any hints please?
As Ideally I want the transaction to continue to a route where I can forward on modified request for termination.
Thanks
Jon
Routes;
# Send to FreeSWITCHroute[CALL_START_REQUEST]{xlog("L_INFO","route[CALL_START_REQUEST] Call received $ci,$rm,$ru,$du\n");
###Build JSON request to send to MAP$var(params) = $null;jansson_set("string", "username", "xxx", "$var(params)");jansson_set("string", "password", "xxx", "$var(params)");jansson_set("string", "source", "$fU", "$var(params)");jansson_set("string", "route", "$var(carriername)", "$var(params)");jansson_set("string", "destination", "$rU", "$var(params)");/// other fields set herehttp_set_timeout(5000);http_set_method("POST");http_append_header("Content-Type: application/json");http_async_query("http://test.com", "$var(params)", "CALL_START_REQUEST_REPLY");xlog("L_INFO", "Checking here we have status=$var(status)\n");xlog("L_INFO", "Current Destination is $du\n");#return;#exit;}#########################route[CALL_START_REQUEST_REPLY]{xlog("L_INFO", "route[CALL_START_REQUEST_REPLY]: $ci,$rm,$ru,$du\n");
Logs show;
route[CALL_START_REQUEST] Call received b087fa53-f5fc-1234-94ac-f68eb8da94f7,INVITE,sip:441624891676@8.8.8.8:5060;user=phone,<null>
route[CALL_START_REQUEST_REPLY]: 123,OPTIONS,sip:G711A-282951200@kamailio.org,sip:G711A-282951200@8.8.8.8:5080
Hello
I obtained the source from https://www.kamailio.org/pub/kamailio/4.3.4/src/kamailio-4.3.4_src.tar.gz
I found a SPEC file there and I prepared a RPM with this spec file.
When I start a Kamailio (from this rpm) - it starts but the LOG file gives only 1 line:
INFO: <core> [tcp_main.c:4657]: init_tcp(): using epoll_lt as the io watch method (auto detected)
I want to test this rpm and if successfull i willl add patches and rebuild the rpm.
How to get correct RPM?
Hi,
I am struggling to figure out variable scope in branches and branch_failure_routes. Is there a way to store a variable in a branch route so that I can then read it from the branch failure route if that branch fails? Also does writing $ru in branch_failure_route append a branch?
For example I have multiple SIP devices registered to Kamailio on the same account credentials. The devices are behind same NAT, so same public IP. Some devices have SRTP required and some cannot use SRTP at all, Kamailio does not know in advance of the call whether the call will use SRTP or RTP.
When I send a call to that user Kamailio correctly parallel forks to all the registered devices. I use rtpengine offer to send SDP with RTP/SAVP in the initial invites.
If one of the devices sends a 488 due to not being able to handle the RTP/SAVP I then want to run rtpengine_offer with RTP/AVP and send another invite to the same device.
In the branch failure route I seem to have to read the current $ru and then write it back into $ru before calling t_relay() or I get
Sep 14 14:56:06 registrar-secure /usr/sbin/kamailio[10168]: ERROR: tm [t_fwd.c:1771]: t_forward_nonack(): ERROR: t_forward_nonack: no branches for forwarding
This code seems to work, but it feels like I’m doing something very wrong…. in particular $avp(triedrtpout) is set for the transaction, I should be setting it separately for each branch.
event_route[tm:branch-failure:SRTP] { # Handle failure response
xlog("L_INFO", "Handling $T_reply_code response to $rm to ru: <$ru> and du: $du\n");
if(t_check_status("488") && is_method("INVITE")) {
if ($avp(triedsrtpout)==1) {
# set $ru seems to create a new branch ... even when we set it to its current value.
# we want to generate a new SIP INVITE to the same AOR but with different SDP
$avp(buffer)=$ru;
$ru=$avp(buffer);
xlog("L_INFO","488 caught. Resending to $ru");
# try with unencrypted RTP/AVP
rtpengine_delete();
rtpengine_offer("to-tag trust-address replace-origin replace-session-connection ICE=force RTP/AVP");
if (!t_relay()) {
sl_reply_error();
}
}
}
}
I am using kamailio 4.2 debian package for this registrar.
Sorry for the rambling question … I don’t understand enough to write the short version!
Paul
Hello,
Kamailio SIP Server v4.4.3 stable release is out.
This is a maintenance release of the latest stable branch, 4.4, that
includes fixes since the release of v4.4.2. There is no change to
database schema or configuration language structure that you have to do
on previous installations of v4.4.x. Deployments running previous v4.x.x
versions are strongly recommended to be upgraded to v4.4.3.
For more details about version 4.4.3 (including links and guidelines to
download the tarball or from GIT repository), visit:
* https://www.kamailio.org/w/2016/09/kamailio-v4-4-3-released/
RPM, Debian/Ubuntu packages will be available soon as well.
Many thanks to all contributing and using Kamailio!
Cheers,
Daniel
--
Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda