Hello,
Is there anything special that needs to be done for float comparison?
For example:
if([5.5 >= 4.3]) ....
or
if(5.5 > 4.3) ....
The conditional does not seem to be coming back as true like it should?
This is simply an example... the precision in the actual case is different
(longer decimal places).
Thank you for all and any help in advance!
Hello,
We are using kamailio 1.5 and we have the following problem with ldap_search:
A call comes in. If it is to a VOIP user, it will be routed to kamailio, and eventually go to the ldap lookup route: route[10] to look up the user.
This is always successful (LDAP can connect).
It will then look up user preferences (call forwarding etc.) from SQL in route[12] and route based on this result in route[13].
If the result is "CFU (call forward unconditional) = on", the URI is changed and route[10] (LDAP lookup) is called again.
This is always successful (LDAP can connect).
If the result is "CFB (call forward busy) = on" and the user is busy, the URI is changed and route[10] (LDAP lookup) is called again.
This is also always successful (LDAP can connect).
If the result is "CFNR (call forward no reply) = on", the timeout is changed and the call is delivered to the phone through route[14] (location) and route[15] (relay).
If the user does not answer, the URI is changed in failure_route[1] and route[10] is called.
For some unknown reason, ldap_search always fails in this scenario with the messages: "ldap_session not found", "couldn't get ldap session" and then "no LDAP entry found".
Why?
And why does this result in the -1 return code and not the -2 return code for ldap_search?
The only differences I can think of is that the unsuccessful scenario comes from FAILURE_ROUTE instead of REQUEST_ROUTE, and that longer time has passed since the original invite.
Here's a sample log:
NOTE the three ERROR lines, the INFO line and the ROUTE 10 line.
Dec 27 13:31:55 [3373]: INVITE received from sip:<CALLER>@<SBC_IP> <source IP: <SBC_IP>> to sip:<CALLEE>@<KAM_IP>:
Dec 27 13:31:55 [3373]: ERROR:ldap:ldap_reconnect: [ldapprod]: LDAP reconnect successful
Dec 27 13:31:55 [3373]: ROUTE 10: LDAP returned: UID = <UID>, voipSipPrimaryUri = <PRIMARY_URI>, voipExtensionUri = sip:<CALLEE>@<DOMAIN>
Dec 27 13:31:55 [3373]: ROUTE 12: Effective user properties for UID <UID>: CFU: off <FORWARDTO>, CFB: off <FORWARDTO>, CFNR: on:25 <FORWARDTO>, CFNC: off <FORWARDTO>, VM: <CALLEE>, busy_level: 1, DBrows: 1
Dec 27 13:31:55 [3373]: -------------------- Calling sip:<CALLEE>@<DOMAIN> for 25 seconds. --------------------
Dec 27 13:31:55 [3373]: ROUTE 15: Sending 105 INVITE from sip:<CALLER>@<SBC_IP> to sip:<CALLEE>@<CALLEE_IP> (via <<null>>)
Dec 27 13:31:55 [3383]: Response 100 Trying to Cseq 102 INVITE received from <PROTO>:<CALLEE_IP>:<PORT>
Dec 27 13:31:55 [3385]: Response 180 Ringing to Cseq 102 INVITE received from <PROTO>:<CALLEE_IP>:<PORT>
Dec 27 13:32:20 [3388]: FAILURE_ROUTE 1: Timeout for: 104 INVITE from <CALLER> -> <CALLEE>
Dec 27 13:32:20 [3388]: -------------------- Forwarding on no reply to <FORWARDTO> --------------------
Dec 27 13:32:20 [3388]: ERROR:ldap:get_connected_ldap_session: [ldapprod]: ldap_session not found
Dec 27 13:32:20 [3388]: ERROR:ldap:lds_search: [ldapprod]: couldn't get ldap session
Dec 27 13:32:20 [3388]: INFO:ldap:ldap_search_impl: no LDAP entry found
Dec 27 13:32:20 [3388]: ROUTE 11: Number lookup results for <FORWARDTO>: Node: VOIP.
Dec 27 13:32:20 [3388]: CONFIG ERROR: VOIP number not found in LDAP. Hanging up.
Dec 27 13:32:20 [3373]: Response 487 Request Cancelled to Cseq 102 INVITE received from <PROTO>:<CALLEE_IP>:<PORT>
Here's the ldap config file:
[ldapprod]
ldap_server_url = "ldap://ldap.<DOMAIN>"
ldap_network_timeout = 500
ldap_client_bind_timeout = 500
kamailio config snippets (in case you need them):
# LDAP lookup for UID and primary URI
route[10] {
...
ldap_search("ldap://ldapprod/<DN>?uid,voipSipPrimaryUri,voipExtensionUri?one?(&(objectClass=voipAddress)(|(voipSipUri=sip:$rU@uio.no)(|(voipSipUri=$var(uri))(voipSipUri=$var(e164uri)))))");
if ($retcode < 1) {
switch ($retcode) {
case -1:
# no LDAP entry found
route(11);
return(1);
case -2:
# internal error
sl_send_reply("500", "Internal server error");
exit;
}
}
ldap_result("uid/$avp(s:uid)");
$avp(s:exten) = null;
if (!ldap_result("voipExtensionUri/$avp(s:exten)")) {
xlog("L_INFO", "voipExtensionUri not found.\n");
}
if (!ldap_result("voipSipPrimaryUri/$avp(s:p-uri)")) {
xlog("L_WARN", "voipSipPrimaryUri not found.\n");
#exit here?
}
if (isflagset(1)) {
xlog("L_INFO", "ROUTE 10: LDAP returned: UID = $avp(s:uid), voipSipPrimaryUri = $avp(s:p-uri), voipExtensionUri = $avp(s:exten)\n");
}
if $avp(s:exten) != null {
$ru=$avp(s:exten);
} else {
$ru=$avp(s:p-uri);
}
route(12);
}
}
# Number lookup. Non-VoIP URI's go here.
route[11] {
...
}
# Database lookup for call forwarding.
route[12] {
...
}
# Call forwarding logic
route[13] {
if (is_method("INVITE")) {
$avp(s:uio_timer_avp) = "300";
if ($avp(s:cfu_status) == "on") {
# Forward immediately
xlog("L_INFO", "-------------------- $rU forwarded unconditionally to $avp(s:cfu_number). --------------------\n");
$rU = $avp(s:cfu_number);
route(10);
}
...
if ( $var(dlg_busy) >= $avp(s:busy_level) ) {
if ($avp(s:cfb_status) == "on") {
xlog("L_INFO", "-------------------- $rU has $var(dlg_busy) active calls. Treshold $avp(s:busy_level). Forwarding on busy to $avp(s:cfb_number) --------------------\n");
$rU = $avp(s:cfb_number);
route(10);
}
...
else if ($avp(s:cfnr_status) == "on") {
# Forward to phone with timeout then to $avp(s:cfnr_number).
# t_set_fr($avp(s:cfnr_timeout) + "000"); # Recommended method in 3.1. Function does not exist in 1.5. Using old method (avp).
$avp(s:uio_timer_avp) = $avp(s:cfnr_timeout);
xlog("L_INFO", "-------------------- Calling $ru for $avp(s:uio_timer_avp) seconds. --------------------\n");
route(14);
}
...
}
failure_route[1] {
...
if $avp(s:cfnr_status) == "on" {
if (isflagset(1)) {
xlog("L_INFO", "FAILURE_ROUTE 1: Timeout for: $mi $rm from $fU -> $rU\n");
}
revert_uri();
$rU = $avp(s:cfnr_number);
xlog("L_INFO", "-------------------- Forwarding on no reply to $rU --------------------\n");
route(10);
}
...
}
With kind regards,
Pan
Hello.
I’m trying to get statistics to use charts in SIREMIS v2.0. I was able to
load the “Memory” statistics but I want to know if there is more information
to use from Kamailio, right now I have :
$stat(used_size)
$stat(real_used_size)
$stat(max_used_size)
$stat(free_size)
$stat(location-users)
$stat(location-contacts)
Where can I find the complete list of statistics to get from kamailio?.
Thanks in advance.
Ricardo Martinez.-
i have two sr proxies talking with each other over tcp. one is running
3.0 and the other 3.1. sometimes i notice that no sip requests or any
other tcp packets get through from 3.0 sr host to 3.1 sr host. netstat
on 3.0 sr host shows that tcp connection to 3.1 sr host is in
ESTABLISHED state whereas netstat on 3.1 sr shows that the same tcp
connection is in FIN_WAIT1 state. it takes several minutes before the
hanging tcp connection is replaced by a new working one. there is no ip
level connectivity problem between the two sr hosts.
any suggestions on what might be going on? is there some known bug in
3.0 tcp implementation that could explain this?
-- juha
Hello.
We’re using the LCR module with version 3.1.1 of Kamailio. We’re trying to
add two gateways, with the same IP address, we have this configuration
running in the previous version of Kamailio (v 1.5), without any problem,
but in this version seems to have some issues.
This is what I’m trying to do :
mysql> select * from lcr_gw;
+----+--------+---------+---------------+----------+------+--------+------------+-----------+-------+------+-------+---------+
| id | lcr_id | gw_name | ip_addr | hostname | port | params |
uri_scheme | transport | strip | tag | flags | defunct |
+----+--------+---------+---------------+----------+------+--------+------------+-----------+-------+------+-------+---------+
| 1 | 1 | GW_1 | 10.0.0.209 | NULL | 5060 | NULL
| 1 | 1 | 3 | 303 | 1 | NULL |
| 8 | 1 | GW_33 | 10.0.0.209 | NULL | 5060 | NULL
| 1 | 1 | 3 | 4411 | 1 | NULL |
| 6 | 1 | GW_6 | 10.0.0.212 | NULL | 5060 | NULL
| 1 | 1 | 5 | 308 | 1 | NULL |
+----+--------+---------+---------------+----------+------+--------+------------+-----------+-------+------+-------+---------+
And this is the output from the logs :
/usr/local/sbin/kamailio[2829]: ERROR: lcr [lcr_mod.c:818]: gw <10.0.0.209,
5060, > is not unique
What could be the problem?. Os simply the new LCR does not support have two
gateways with the same IP address?
Thanks,
Ricardo Martinez.-
>Hello,
>with the latest version there are alternatives you can use:
>> On 12/10/09 5:06 PM, David wrote:
>> Hey,
>>
>> I won't pretend to be an expert in Kamailio, someone will probably
>> suggest a better way. But here is how I rewrote my SIP packet's TO
>> header before relaying it to the next hop :
>>
>> # Rewrite RURI
>> avp_printf("$rU", "prefix_$rU");
>$rU = "prefix_" + $rU;
>>
>> # Remove existing header
>> remove_hf("To") ;
>>
>> # Add new header which is copied from RURI
>> insert_hf("To: $ru\r\n", "From");
>you can do in one step, so you avoid operations on r-uri:
>insert_hf("To: sip:prefix_$rU@$rd\r\n", "From");
>>
>>
>> DISCLAIMER : Several threads have said that changing the TO header
is
>>a bad idea, so I only recommend using this as a last resort.
>If devices are RFC3261 (SIP 2.0), then it is ok. If there are SIP 1.0
>devices, then you have to preserve To/From header.
>For the future, I would add options to change the From/To values via
>pseudo-variables. It is the admin to decide to use it or not -- now
>people need and do workarounds with subst or append_hf().
>Cheers,
>Daniel
I use Kamailio 3.0.3, and tried to use both of methods, i.e. insert_ft()
and reassigning pseudo variable $rU and all mentioned in this topic.
However, handle_subscribe() and dlg_manage() somewhy uses unmodified
packet.
Is there any workaround to handle $rU or $tU overwrites that for
pua_dialoginfo module?
I'm doing it like that:
$var(orig_uri) = $rU;
$rU = $(fU{re.subst,/(.*)_(.*)/\1/}) + "_" + $rU;
if (is_method("INVITE")) {
dlg_manage();
}
if (is_method("SUBSCRIBE")) {
handle_subscribe();
}
$rU = $var(orig_uri);
However, according to debug messages, NOTIFY's which are coming just
after INVITE are still without prefixes, but packets on Asterisk, which
is after Kamailio, are coming modified.
Please, advice.
>
> David
>
>
>
>
>
> David a écrit :
>> Hey,
>>
>> I do understand that normally the TO header should not be written, my
>> problem is that I am using the presence_dialoginfo module which uses
the
>> TO header and not the RURI, which means that in order to tell the
>> difference between customer A's extension 101 and Customer B's
extension
>> 101, I rewrite the TO header to add context.
>>
>> This is actually the ame problem that I started discussing here :
>> http://lists.kamailio.org/pipermail/users/2009-August/024316.html
>>
>> Trouble is I have not had time to work on this since then.
>>
>> Thanks,
>>
>> David
>>
>> Olle E. Johansson a écrit :
>>> 10 dec 2009 kl. 15.04 skrev Iñaki Baz Castillo:
>>>
>>>
>>>> El Jueves, 10 de Diciembre de 2009, David escribió:
>>>>> Hey,
>>>>>
>>>>> I need to rewrite the $tU variable on a packet before it is
>>>>> relayed. It
>>>>> is ok if the change is only on the relayed packet and the $tU
>>>>> variable
>>>>> change. The important thing is that I modify the To header, it
seems
>>>>> that rewritting $tU would be the easiest.
>>>> $tU is not writable, but just readable.
>>>> If you want to change the "To" header you should do some "dirty"
>>>> replacing operation (see textops module).
>>>
>>> This is propably something we need to change and make the To and
>>> From headers writable.
>>> It's not dirty to change them any more.
>>>
>>> David: In the original SIP 1.0 protocol the To/From headers was
part
>>> of the dialog identification, thus you where not allowed to change
>>> them in a proxy. THis was kept in RFC3261 - sip v2 - but has been
>>> removed in an additional RFC a short while ago (seen from SIP
history).
>>>
>>> Regards,
>>> /O
>>> _______________________________________________
>>> Kamailio (OpenSER) - Users mailing list
>>> Users at lists.kamailio.org
>>> http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
>>> http://lists.openser-project.org/cgi-bin/mailman/listinfo/users
>>
>>
>>
>> _______________________________________________
>> Kamailio (OpenSER) - Users mailing list
>> Users at lists.kamailio.org
>> http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
>> http://lists.openser-project.org/cgi-bin/mailman/listinfo/users
>
>
> _______________________________________________
> Kamailio (OpenSER) - Users mailing list
> Users at lists.kamailio.org
> http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
> http://lists.openser-project.org/cgi-bin/mailman/listinfo/users
>
--
Daniel-Constantin Mierla
* http://www.asipto.com/
Hello.
Is there a way to adjust the timezone to display the charts and the logs in
the SIREMIS 2.0? I have my linux machine with my local timezone, but the
display in the charts and the logs are not in synch with my local time.
Thanks in advance.
Regards,
Ricardo Martinez.-
To Siremis Admin,
I'm a bit of a php rookie, and even more of a noob with openbiz cubi, but
I've burnt a day and a half trying to implement a new button on the SER Menu
> Server Services > Dialplan List page, and curious if you could give some
words of advice concerning my plight.
Ideally, I would like dialplan to auto update the Kamailio mySQL database
with the dp_reload feature; I am simply sick of bouncing Kamailio with a
"kamctl restart" from the command line each time I implement a change to the
dialplan in Siremis.
I have successfully enabled this feature on the drop-down menu in SER Menu >
Command Services > MI Commands, however, I don't want to have to navigate to
the MI Commands page each time I wish to refresh dialplan. In
siremisMICommands.xml, I was able to activate dp_reload with the following
code:
(taken from siremisMICommands.xml)
<?xml version="1.0" standalone="no"?>
<PluginService Name="siremisMICommands" Package="asipto"
Class="siremisMICommands">
<MIConfig name="MIConfig" type="udp" mode="rich">
<Local name="local" address="127.0.0.1" port="8044" timeout="3.0"/>
<Remote name="remote" address="127.0.0.1" port="8033"/>
<MICommands>
<cmd name="ps" title="List Processes" command="ps"/>
<cmd name="uptime" title="Show Uptime" command="uptime"/>
<cmd name="getstatsall" title="Get All Statistics" command="get_statistics
all"/>
<cmd name="which" title="Get All MI Commands" command="which"/>
<cmd name="dp_reload" title="Reload Dailplan" command="dp_reload"/>
<------ Code I added, WORKS!
</MICommands>
</MIConfig>
</PluginService>
Here's where I'm stuck: I can't seem to get a new button
to implement dp_reload in the DialplanListForm.xml. I'm not sure if I need
to write a function to call dp_reload, or if I can simply activate dp_reload
from the DialplanListForm.xml. The code I have written creates a button on
the SER Menu > Server Services > Dialplan List page, but thats as far as
I've gotten. My code currently looks like this:
(taken from DialplanListForm.xml)
<Element Name="btn_refresh" Class="Button" Text="Activate"
CssClass="button_gray_m" Description="Refresh dialplan in Kamailio without
restarting Kamailio">
<EventHandler Name="dp_reload" Event="onclick" EventLogMsg=""
Function="" ContextMenu="Activate"/>
</Element>
Anything you can say would be most helpful, as this is a feature I'm sure
many using Siremis would appreciate having.
Best,
--
R. Z. Feeser
717.460.8095
www.RZFeeser.comwww.NaturaGardens.com
Hello
I need to add q value while using function append_branch(),but the function
only takes decimal fraction as the parameter.
What if I want to use pv to add q value?
The $var and $avp just have string and integer type.
Thanks a lot!
Hi!
Every time I use the dispatcher(k) module I am confused again. Sometimes
it seems that "probing" is a dedicated state, sometimes it seems that
"probing" is done also in "active" state, but never in "inactive" state.
IMO "probing" should only be a flag which indicates if OPTIONS should
sent or not. If probing is successful, then the state should be
"active". If probing is unsuccessful, then the state should be "inactive".
Current behavior is very strange (ds_probing_mode(0)):
--> startup state: A --> no probing
kamctl fifo ds_set_state i 1 sip:....
--> state: I --> no probing
kamctl fifo ds_set_state a 1 sip:....
--> state: A --> no probing
calling 3 times ds_mark_dst("p")
--> state: P --> probing (and dst is still loaded as last value into the
dst_avp, why?)
kamctl fifo ds_set_state i 1 sip:....
--> state: I --> still probing
kamctl fifo ds_set_state a 1 sip:....
--> state: P (???) --> probing
Thus, "ds_set_state a ..." does not set active, but probing if it was
probing before. Strange.
And as "inactive" does not stop probing when dst was in probing mode,
the destination becomes automatically "active" if the probing succeeds.
And why is a destination in probing mode loaded into the dst_avp? Very
weird.
Is there a reason for this behavior?
Thanks
Klaus