On 4/22/13 5:30 PM, Juha Heinanen wrote:
> Andreas Granig writes:
>
>> Let me know if this is stupid and/or a complete overkill, but what about
>> introducing some kind of dummy mode, where you'd pipe a message into
>> kamailio via stdin, and get the resulting message out on stdout (e.g. in
>> ngrep style with ip information as first line, plus the content
>> following), plus a dump of internals (e.g. vars, avps) on stderr as
>> they're being assigned, and once the message is processed, kamailio
>> would just shut down again?
> in addition to the message, you would need to be able to tell which
> ip addr it is coming from and which ip/port in kamailio it is going to.
> also, on the output side, kamailio would need to tell which
> proto/ip/port it would use to send the message out.
Details about going out can be printed on onsend_route. In this route
block, one can execute drop and nothing is sent to the wire. It can be a
config started with a special define specified with -A parameter.
Enabling debugger module with cfg trace should give valuable information
about what has been executed from config.
From what Andreas suggesting, printing the value of variables as they
are assigned is missing, probably can be added by hooking in the
interpreter when doing the assignment operation.
Grouping all above under some global/command line parameter can be
useful to make it easier to do a dry run.
Cheers,
Daniel
--
Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Hello,
I followed the step by step guide (http://kb.asipto.com/asterisk:realtime:kamailio-3.3.x-asterisk-10.7.0-astdb) that describe the realtime integration between Kamailio and Asterisk. I have no problem with registration but when I try a call from 101 to 102 I get the followng error:
[Mar 31 01:18:44] NOTICE[32330][C-00000006]: chan_sip.c:25195 handle_request_invite: Call from '101' (192.168.1.100:5060) to extension '103' rejected because extension not found in context 'DEFAULT NULL'.
Kamailio and Asterisk are running in the same machine.
Any idea about the cause of this problem?
Best Regards,
Theo
Hi All,
I need forking a call to multiple destinations in paralel on different
network segments, requiring different rtpproxy parameters. Reading the
rtpproxy module documentation I discovered that is possible by setting the
"b" parameter on rtpproxy_manage(), rtpproxy_offer(), rtpproxy_answer() and
rtpproxy_destroy() functions, but I'm with some doubts...
I can't understanding how set the extra_id_pv parameter correctly to use
when the "b" parameter is used.
The "b" parameter is supported on rtpproxy version 1.2.1?
Best Regards
Hi,
Currently, I'm using TLS and it works fine. But eventually, TLS is just
used to agree upon a secret key. And both client and Kamailio use that
secret key to encrypt message.
In my solution, I have a fixed secret key. And client encrypt SIP message
with that secret key.
What code should I insert in Kamalio to decrypt it?
--
Khoa Pham
HCMC University of Science
Faculty of Information Technology
Hi,
We're hitting an issue in a deployment where all udp receivers are
sitting in FUTEX_WAIT caused by save() -> lock_udomain() and seem to
have deadlocked themselves every couple of days.
Looking at the code, enable_gruu in registrar is active by default, and
in lookup there is a code path
/* temp-gruu lookup */
res = ul.get_urecord_by_ruid(_d, ahash, &inst, &r, &ptr);
but no lock_udomain is obtained. However, when the execution falls
through to the "done:" marker, it does
ul.unlock_udomain(_d, &aor);
without having called ul.lock_udomain first.
1.) Could someone please review this part? Looks a bit suspicious,
although I don't know what implicitly happens in this case. If it were a
semaphore and you decrease it to -1 by decrementing it without prior
increment, it's essentially causing a dead-lock, but the current locking
implementation might work completely different.
2.) Since I have no clue how gruu is supposed to work in detail, and
since in our config we don't explicitly handle gruu (no lookup in
loose-route, but gruu is enabled by default in registrar and we don't
explicitly turned it off), I'm not even sure if we ever hit this code
path. I only see that the ruid column in the location table is filled,
but in order to get to this part, the ";gr" flag needs to be set in the
R-URI for a lookup(), which I don't know whether that happened somehow
in some call flows (we only log $ru, which I don't think logs these
parameters, right?).
Some input is highly appreciated!
Andreas
Hi everyone,
I believe I've run into a problem when using dlg_end_dlg (with mi_datagram ) called from an external perl script with perl_exec() .
Kamailio just locks after a while (few seconds) after disconnecting a call.
Some parts of my debug log can be found here:
http://pastebin.com/ANaTEifC
The problem was observed while performing a stress test.
Is it a good idea to call dlg_end_dlg() like that or I can kill an established dialog from the routing script in some other way ?
Regards,
Dragos
Thank you very much for your reply Barry.
Can you explain us yours ip 10.5.75. and 10.5.76. ?
Seems your asterisks have two interfaces, one private and one public?
In my infrastructure I have:
SIP client -> Kamailio ---> Asterisk 01
---> Asterisk 02
...
---> Asterisk N
Only Kamailio has a public IP address.
In the REGFWD route you send all the registrations to ALL the Asterisks?
If so, why?
I'm trying to achieve something like:
SIP clientA ---> REG ---> Kamailio Is Asterisk01 alive? Yes --> REG ---> Asterisk 01
NO --> Choose next one
---> Asterisk 02
...
---> Asterisk N
---> Asterisk 01
SIP clientB ---> REG ---> Kamailio Is Asterisl02 alive? Yes --> REG ---> Asterisk 02
NO --> Choose next one
---> Asterisk 03
...
---> Asterisk N
and so on, with a round robin algorithm.
When Sip ClientA want to call Sip ClientB, it asks Kamailio, that know that SIP Client B is
registered on Asterisk 02 and so send the invite to it.
I'm going to work over this in the next few days and let you know the result,
if positive I'll write a new complete guide on this topic with your valuable suggestions.
Any suggestion is welcome
BR,
Anty
------------------------------------------------------------------------------------------------------
>> I have read and applied the excellent guide found on:
>> http://kb.asipto.com/asterisk:realtime:kamailio-3.3.x-asterisk-10.7.0-astdb
>>
>> Now I have added to Kamailio the HA/Load Balancer support, with the
>> "dispatcher" module.
>> This way I have 1 Kamailio and 2 Asterisk machines.
>>
>> How can I change the routing logic of the sections route[REGFWD] |
>> route[FROMASTERISK] route[TOASTERISK] to use the dispatcher module? (in the
>> guide above the asterisk binded ip address is cabled in the kamailio config
>> code)
I have done that. Relevant route entries below.
# Forward REGISTER to Asterisk
route[REGFWD] {
if(!is_method("REGISTER"))
{
return;
}
# for each Asterisk server in setid=2 (External) we send a registration on
behalf of the user.
sql_xquery("ca", "SELECT SUBSTRING_INDEX(destination,':',-1) AS port,
SUBSTRING_INDEX(SUBSTRING(destination,5),':',1) AS address
FROM dispatcher WHERE setid = 2", "ra");
$var(i) = 0;
while($xavp(ra[$var(i)]) != $null)
{
$var(rip) = $xavp(ra[$var(i)]=>address);
$uac_req(method)="REGISTER";
$uac_req(ruri)="sip:" + $var(rip) + ":" + $xavp(ra[$var(i)]=>port);
$uac_req(furi)="sip:" + $au + "@" + $var(rip);
$uac_req(turi)="sip:" + $au + "@" + $var(rip);
$uac_req(hdrs)="Contact: <sip:" + $au + "@"
+ $sel(cfg_get.kamailio.bindip)
+ ":" + $sel(cfg_get.kamailio.bindport) + ">\r\n";
if($sel(contact.expires) != $null)
$uac_req(hdrs)= $uac_req(hdrs) + "Expires: " + $sel(contact.expires) +
"\r\n";
else
$uac_req(hdrs)= $uac_req(hdrs) + "Expires: " + $hdr(Expires) + "\r\n";
uac_req_send();
$var(i) = $var(i) + 1;
}
sql_result_free("ra");
}
# Test if coming from Asterisk. We check the dispatcher "ds_is_from_list()"
function to see if this is one of our Asterisk IPs
route[FROMASTERISK] {
if(ds_is_from_list())
{
return 1;
} else {
return -1;
}
}
# Send to Asterisk
route[TOASTERISK] {
# If call comes in to the .75 iface, we need to send it to the .75 iface of
Asterisk as well.
# otherwise we send to the .76 iface. We do this by calling different
dispatcher sets. This is
# because Asterisk needs to use NAT on the .76. (public) interface but not
on the .75.
if($td=~"10.5.75.")
{
$var(setid) = 4;
xlog("SCRIPT: Call to 10.5.75. ip - using set $var(setid) \n");
} else {
$var(setid) = 2;
xlog("SCRIPT: Call from $fn to 10.5.76. ip - using set $var(setid) \n");
}
# round robin dispatching on set determined above
if(!ds_select_dst($var(setid), "4"))
{
send_reply("404", "No destination");
exit;
}
t_on_failure("RTF_DISPATCH");
route(RELAY);
exit;
}
Hope this helps.
-Barry Flanagan
I have read and applied the excellent guide found on:
http://kb.asipto.com/asterisk:realtime:kamailio-3.3.x-asterisk-10.7.0-astdb
Now I have added to Kamailio the HA/Load Balancer support, with the "dispatcher" module.
This way I have 1 Kamailio and 2 Asterisk machines.
How can I change the routing logic of the sections route[REGFWD] | route[FROMASTERISK] route[TOASTERISK] to use the dispatcher module? (in the guide above the asterisk binded ip address is cabled in the kamailio config code)
Thanks,
Anty
Hi again!
Need tips to some tricks with radius.
1. when receive sip message with REGISTER method - initiate auth with
radius. (Authentification)
- radius_www_authorize in auth_radius.so
2. when receive INVITE message - ask radius 'bout permissions and parse
answer: get permission and next hop IP. (Authorization)
???? misc_radius ????
3. when call
a) before call send Acct-Status-Type = Start with attributes.
b) after call send Acct-Status-Type = Stop with attributes.
(Accounting)
- acc_radius.so
1,3 - clear, I understand how it works.
2 - ? Kamailio must send request to radius server, get answer and route
call to server from "next-hop-IP" field. Can I make it?
--
С уважением,
Виктор В. Кустов
ООО "Брянск Связь-ТВ"
+7 (952) 966 76 24
JID: coyote(a)bks.tv
JID: coyote(a)bryansktel.ru
I use FREE operation system: 3.8.4-calculate GNU/Linux
Hi all
loadmodule "siptrace.so"
modparam("siptrace", "db_url", "flatstore:/var/log/siptrace")
call sip_trace();
nothing in /var/log/siptrace, no errors in logs. whats wrong?
--
SY,
Victor
JID: coyote(a)bks.tv
JID: coyote(a)bryansktel.ru
I use FREE operation system: 3.8.4-calculate GNU/Linux