Hi List,
I use Kamailio 5.2.x and I want to fetch an value from an X Header and do
some checks like "is not empty" and "should be an integer".
AFAIK per default all values are strings with the hdr function.
What are the best way for some validations within Kamailio script language?
if(is_present_hf("X-someheader")) {
$avp(routing_target) = $(hdr(X-someheader){s.int});
if(!ds_list_exists("$avp(routing_target)"))
Cheers
Karsten Horsmann
Hello,
We are using kamailio for load balancing as stateless proxy as mentioned below.
{$du = "sip:192.168.130.XXX;transport=udp";
forward();}
We have set $du to the correct media server value in the dispatcher module.Can you please tell me how to
get the correct dispatcher value(Media server IP) and print this into log file.
I am using $ru and $du to print,but it is not giving the correct one.
for example: Suppose for the first call ;
$du = "sip:192.168.130.XXX:5060;transport=udp";
$du = "sip:192.168.130.XXX:5062;transport=udp";
and so on.
How to fetch the correct dispatcher value dynamically.
Any response will be highly appreciated.
Thanks,
Rudra
Hi,
I have an issue where a client is sending cancel after the call has been answered but before the client received the 200OK, I know they should then respond with a BYE based on the 200 final result, but they don’t (Meaning the call / billing stays up)..
Is there a way I can timeout a call if ACK is not received to the 200 OK?
I know technically this is the clients issue but they can’t / won’t fix
Thanks is advance
Oz.
Hi!
I have small problem. When I assign $fU or $fn in request-route and then
one more time I make new assignment in branch_route. Instead of rewriting
it is just concatenate needed value at the end. lets assume
$avp(cli)=1234567 and $avp(cliplus)=+1234567. So if in request_route I
do $fU=$avp(cli); and then in branch_route $fU=$avp(cliplus);. $fU becomes
one string: "1234567+1234567". Is it a bug or I missing something?
Here is config snippet:
request_route {
...
route(MY);
...
}
route[MY] {
...
$avp(cli) = "1234567"
$avp(cliplus) = "+"+$avp(cli);
$fU=$avp(cli); # here $fU=1234567
$fn=$avp(cli); # here $fn=1234567
route(LCR_ROUTE);
exit;
}
route[LCR_ROUTE]
{
if(!is_method("INVITE"))
return;
if (!load_gws("1",$rU,$avp(cli))) {
send_reply("503", "Error loading gateways");
exit;
}
$var(i)=0;
while($(avp(lcr_gw_uri)[$var(i)])!= $null){
xlog("L_INFO", "loaded
gw_uri_avp[$var(i)]=$(avp(lcr_gw_uri)[$var(i)]) \n");
$var(i) = $var(i)+1;
}
if (!next_gw()) {
send_reply("503", "No available gateways");
exit;
}
xlog("L_INFO", "request-uri $ru \n");
xlog("L_INFO", "$avp(lcr_gw_uri), $avp(lcr_id)\n");
xlog("L_INFO", "flag $avp(lcr_flag) \n");
t_set_fr(0, 4000);
t_on_failure("RTF_LCR_ROUTE");
t_on_branch("BRANCH_CUST");
route(RELAY);
exit;
}
branch_route[BRANCH_CUST] {
if ( $avp(lcr_flag) == 4) {
$fU=$avp(cliplus); #here $fU=1234567+1234567
$fn=$avp(cliplus); #here $fn=1234567+1234567
}
}
Jurijs
I have used in config file these kind of constructs:
#!ifdef MOD_<module name>
...
#!endif
Is the MOD_xxx keyword automatically set when module xxx is loaded?
Perhaps I have invented the whole concept in a dream?
-- Juha
I have a Boghe (v2.0.153.836) working fine with Kamailio with MD5 algorithm however fails to authenticate if I configure S-CSCF to use AKAv1-MD5. We have the same configuration on private user identity in FHoSS on both the succ MD5 run and failed AKAv1-MD5 run.
I wonder if anyone has faced this issue before. Here are some details on message exchanges:
* S-CSCF included the challenge in 401 Unauthorized – Challenging the UE:
WWW-Authenticate: Digest realm="example.example.org", nonce="rzGnTBGPw3hE+mDPHrZ1PAAAAAAApAAAmfftHqYUuUA=", algorithm=AKAv1-MD5, ck="629d6d9a6a6befa509b1a9bb17a9c2a3", ik="32fcd14a102279de2e38200a2257efcb", qop="auth,auth-int"\r\n
* The same header was seen when 401 Unauth travelled through I-CSCF and P-CSCF (shouldn’t P-CSCF strips out the ck and ik fields before sending to UE?)
* UE responded with another register with response:
Authorization: Digest username="bob(a)example.example.org",realm="example.example.org",nonce="rzGnTBGPw3hE+mDPHrZ1PAAAAAAApAAAmfftHqYUuUA=",uri="sip:example.example.org",response="6445f9df2b785eab3fa461849880b48d",algorithm=AKAv1-MD5,cnonce="34baf441e99a23e0fcb2bc001355c4bf",qop=auth-int,nc=00000001\r\n
* S-CSCF failed the calculation and sent back 403 Authentication Failed
I tried AKAv2-MD5 setting as default algorithm on S-CSCF and the result is the same as above. It seems that only MD5 works on my setup.
What are the different configs in HSS (or other places) AKAv1-MD5 need? I checked the AMF/OP on both HSS and Boghe and they match. Boghe does not have SQN setting but I set HSS to start with 0.
Any pointers are appreciated!
Yin
Hi,
I want to implement conference messaging functionality into a client. IMC module seems perfect. In our scenario, the rooms and members are managed in a different server bacause of other user management functionalities and the kamailio only uses the rooms to broadcast messages to members.
Is it possible anyway to create rooms and join members from a separate server like through http protocol with XHTTP module?
The idea is:
1. Create a room on server A with adding members. Server A store the room data.
2. Server A sends http message to kamailio with proper format, like POST .../createRoom with jsonBody { name: „room1” }
3. Kamailio receives the http request and process it with creating a room ’room1’.
4. Server A sends members of room like POST .../addMembers with json body { room: „room1”, members: [ username: „user1”, username: „user2” ] }
5. Kamailio receives the https request and process it with joining memers into room
All commands should have the belonging http request.
Is it possible?
Regards,
Peter
Hi All,
As per our requirement, when A party send a cancel to B party we do not
want "200 cancelling" message from Kamailio.We try to find any high-level
flag to disable it. but could not able to find. Can you please help us on
how to achieve this.
A Party Kamailio B Party
---------------->INVITE------------------------>
<---------180 Ringing<------------------------
------------>CANCEL-------------------------->
<---------200 canceling [we want to suppress this message and do not
want kamialio to inform A party about progress status of cancel]
<------------OK-----------------------------------
Thanks,
Amit