Re: [SR-Users] pseudo variables in strings

2016-04-04 Thread Juha Heinanen
Daniel-Constantin Mierla writes:

> I added pv_evalx() function in pv module which evaluates twice a string
> containing variables. No time to test it, so any feedback is
> appreciated. It will be also good to stress test it and check if there
> is a memory leak for pkg, as the result for first evaluation needs to be
> parsed again for other variables -- pv caching should prevent a leak,
> but to be safe is good to test if plans are to use in production.

Thank you very much.  I'll give it a try later this week.

-- Juha

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] pseudo variables in strings

2016-04-04 Thread Daniel-Constantin Mierla
I added pv_evalx() function in pv module which evaluates twice a string
containing variables. No time to test it, so any feedback is
appreciated. It will be also good to stress test it and check if there
is a memory leak for pkg, as the result for first evaluation needs to be
parsed again for other variables -- pv caching should prevent a leak,
but to be safe is good to test if plans are to use in production.

Cheers,
Daniel

On 04/04/16 07:35, Daniel-Constantin Mierla wrote:
>
> On 02/04/16 10:09, Juha Heinanen wrote:
>> Alex Balashov writes:
>>
>>> Yes, either by separating the PV elements, e.g.
>>>
>>> $var(x) = $fU + "abc";
>> Alex,
>>
>> I cannot do that, because the string that contains pvs is result of
>> a dp_translate call.
> Dialplan can evaluate variables, is it a special case you need to return
> variables and then evaluate after dp_translate() again?
>
> It might work by returning a lua script string that you can evaluate
> with app_lua().
>
> Cheers,
> Daniel
>
>>> ... or with the newer $_s() PV created for this purpose:
>>>
>>> $var(x) = $_s($fUabc);
>> No luck with that either.  This test
>>
>> $var(pv_string) = "foo$var(pv)bar";
>> $var(pv) = "car";
>> $var(res_string) = $_s($var(pv_string));
>> xlog("L_INFO", "res_string is '$var(res_string)'\n");
>>
>> produces to syslog:
>>
>> Apr  2 11:07:26 lohi /usr/bin/sip-proxy[24536]: INFO: res_string is 
>> 'foo$var(pv)bar'
>>
>> when I need to get 'foocarbar'.
>>
>> -- Juha
>>
>> ___
>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>> sr-users@lists.sip-router.org
>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla
http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio World Conference, Berlin, May 18-20, 2016 - 
http://www.kamailioworld.com


___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] dispatcher [dispatch.c:1416]: ds_load_remove(): cannot find load for (from asterisk call-id)

2016-04-04 Thread TEG AMJG
Hi again

There is something that i am starting to realize and i think is the source
of the problem. Since i am not sure, I think someone can clarify this to me.

As i said the problem rises when i do a 2 call leg conversation. In which,
since Asterisk is a B2BUA and creates another channel (which ends up being
another dialog), there is a point where Asterisk initiates the SIP flow.

Sip Client 1 ---> Kamailio --> Asterisk (dialog 1)
Asterisk -> Kamailio -> Sip Client 2 (dialog 2)

Now, since both Asterisk takes part of the destination addresses which the
dispatcher modules are managing at the moment, there is no way (from what i
know) that the ds_load_update() actually records that call load.

I am pretty sure that there is some way to manage this better, and since i
am new to Kamailio, I think you guys can help me out easily

Thank you very much for your time



2016-04-04 18:35 GMT-03:00 TEG AMJG :

> Hi Alberto, thanks for your reply
>
> yeah, i am using ds_select_dst("0","10") in this case because i use
> setid=0 in the dispatcher table as you can see in this route block
>
> route[TOASTERISK] {
> #!ifdef WITH_LOADBALANCE
> xlog("L_INFO","UBICAR: Forwarding non-registrar requests to
> Asterisk \n");
>  if(!ds_select_dst("0", "10")) {
> sl_send_reply("500", "Service Unavailable");
> xlog("L_ERROR","UBICAR: No destinations available for $rd
> \n");
> exit;
> }
> xlog("L_ERROR","UBICAR: AVP $avp(dsdstid)\n");
> xlog("L_INFO","UBICAR: Dispatching to Asterisk Box $du\n");
> t_set_fr(0,1);
> t_on_failure("MANAGE_FAILURE");
> route(RELAY);
> exit;
> #!endif
> }
>
> Also both Asterisk are responding to ping probes done by Kamailio, they
> are actually responding 404 but are still kept alive thanks to this param:
>
> modparam("dispatcher", "ds_ping_reply_codes", "class=2;code=480;code=404")
>
> and the command kamctl dispatcher dump shows them with flags=AP
>
> URI:: sip:192.168.10.191:5060 flags=AP priority=0
> attrs=duid=PBX2;my=pbx2;maxload=200
> URI:: sip:192.168.10.190:5060 flags=AP priority=0
> attrs=duid=PBX1;my=pbx1;maxload=200
>
> Also, i would like to know if there is a way to print some kind of table
> to see how kamailio are keeping these call loads recorded. I have been
> looking for it but i cannot find any way of doing it
>
> Again, thank you very much for your reply
>
>
> 2016-04-04 14:23 GMT-03:00 Alberto Sagredo 
> :
>
>> Hi
>>
>> Are you using ds_select_dst("1", "10"); somewhere ?
>>
>> You have to check Asterisk is responding to OPTIONS as dispatcher
>> considered UP when 200 OK from Asterisk or SIP Gateway is received.. and
>> not if not received.
>>
>> I have used dispatcher but not with 10 option on algo...
>>
>> BR
>>
>>
>>
>>
>> 2016-04-04 8:07 GMT+02:00 TEG AMJG :
>>
>>> Hi
>>>
>>> I am new to Kamailio and i am just trying to setup a kamailio (v4.2.3)
>>> dispatcher to distribute calls to 2 asterisk using the call load
>>> distribution algorithm (alg 10). I started to test and see how all it is
>>> working and in the logs appears that the call load record it cannot be
>>> found.
>>>
>>> - ERROR: dispatcher [dispatch.c:1416]: ds_load_remove(): cannot find
>>> load for (call id generated by asterisk)
>>>
>>> I am getting this error  trying a 2 call leg conversation when asterisk
>>> is creating the BYE message destinated to the callee after receiving a BYE
>>> message from the caller, and the BYE message by Asterisk reach Kamailio to
>>> then apply the ds_load_update function
>>>
>>> From what i understand about ds_load_update it is that it sets the load
>>> to an specific destination if Kamailio receives a 2xx reply of an INVITE
>>> message, and removes it if Kamailio receives a BYE message based from the
>>> Call-id received in that message, where it is actually failing in my
>>> implementation at the moment
>>>
>>> Here are the blocks of code of the dispatcher parameters and where the
>>> function ds_load_update() is being used:
>>> #!ifdef WITH_LOADBALANCE
>>>
>>> #Parameters using Dispatcher from DB
>>> # --
>>> modparam("dispatcher", "db_url", DBURL)
>>> modparam("dispatcher", "table_name", "dispatcher")
>>> # --
>>>
>>> #Enabling failover mechanism
>>> # ---
>>> modparam("dispatcher", "flags", 2)
>>> # ---
>>>
>>> #Setting dispatcher parameters in AVP
>>> # ---
>>> modparam("dispatcher", "dst_avp", "$avp(AVP_DST)")
>>> modparam("dispatcher", "grp_avp", "$avp(AVP_GRP)")
>>> modparam("dispatcher", "cnt_avp", "$avp(AVP_CNT)")
>>> modparam("dispatcher", "dstid_avp", "$avp(dsdstid)")
>>> # ---
>>>
>>> #Setting dispatcher result in PV variables
>>> # ---
>>> modparam("dispatcher", "attrs_pvname", "$var(attrs)")
>>> # ---
>>>
>>>
>>> #Enabling dispatcher algorithm according to call loads
>>> # 

Re: [SR-Users] Detecting calls with missing ACK (Lazy SIP scanners)

2016-04-04 Thread Marrold
Thanks for the speedy response as always.

The current scenarios are taken from Asterisk only, Kamailio is not yet in
front of it - so no record route headers.

I imagine the ACKs aren't being sent due to it being a waste of resources
as you suggest, but I'm interested in detecting these in Kamailio so I can
add them to a block list if they exceed a certain limit.

On Tue, Apr 5, 2016 at 12:12 AM, Alex Balashov 
wrote:

> I am assuming you're adding Record-Route to your initial INVITEs?
>
> If so, in the case of the answered call, it might be a defective UA that
> doesn't follow Record-Route for in-dialog messages (which include e2e ACK).
>
> In the case of the negative replies, a scanner might not waste additional
> resources sending a formally requisite ACK. It'll just move on to the next
> target, and leave you holding the bag on the unacknowledged failed
> transaction.
>
> -- Alex
>
> --
> Alex Balashov | Principal | Evariste Systems LLC
> 1447 Peachtree Street NE, Suite 700
> Atlanta, GA 30309
> United States
>
> Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct)
> Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
>
> ___
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users@lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] get_redirects with t_next_contacts

2016-04-04 Thread Marrold
To not leave this thread forever unanswered, it turns out the above method
using t_next_contacts() was working as it should be, but as every contact
in the 302 redirect response was returning a 401, it tried all available
contacts and then ran out of options which resulted in  t_reply("408",
"Request Timeout MH 2");

This was due to my lazy regex whilst debugging. "[456][0-9][0-9]"

Apologies for the noise.


On Thu, Mar 31, 2016 at 11:57 AM, Marrold  wrote:

> I've found the following in an old thread that should help me debug, I
> will let the list know how I get on.
>
> pv_printf("$var(contact)", "$xavp(contacts[0]=>uri)");
> xlog ("L_NOTICE", "var(contact)=$var(contact)\r\n");
>
> On Thu, Mar 31, 2016 at 12:46 AM, Marrold  wrote:
>
>> Hi all,
>>
>> I am having some issues using get_redirects() from the UAC_Redirect
>> module in conjunction with  t_next_contacts from the TM Module. I've
>> searched Google and the list but the only references I can find are several
>> years old.
>>
>> I am attempting to configure Kamailio so it if receives a 3XX redirect
>> message, it will store the Contacts it contains, and attempt them in 'Q'
>> parameter order.
>>
>> So for the Contact below-
>>
>> Contact: ;q=0.2,;q=0.5.
>>
>> I want Kamailio to try 5.29.13.139, and if that times out, or is rejected
>> in someway, try 10.0.97.21.
>>
>> If I use t_relay rather than t_next_contacts, kamailio branches the calls
>> and relays them in parallel regardless of Q value - this is not what I want.
>>
>> If I use t_next_contacts, it attempts 5.29.13.139 which is rejected with
>> a 401, but it doesn't attempt 5.29.13.139 and responds "408", "Request
>> Timeout MH 2"
>>
>> Relevant script section is below, has anyone been able to get this
>> working?
>>
>> failure_route[302] {
>>
>> if (t_check_status("302")){
>> xlog("L_ALERT","Failure Route: 302\n$mb");
>>
>> get_redirects("*");
>>
>> if (!t_load_contacts()) {
>> send_reply("500", "Server Internal Error - Cannot load
>> contacts MH");
>> exit;
>> };
>>
>> if (!t_next_contacts()) {
>> t_reply("408", "Request Timeout MH");
>> } else {
>> t_on_failure("302");
>> t_relay();
>> exit;
>> };
>> } else if (t_check_status("[456][0-9][0-9]")){
>>
>> if (!t_next_contacts()) {
>> t_reply("408", "Request Timeout MH 2");
>> } else {
>> t_on_failure("302");
>> t_relay();
>> exit;
>> }
>> }
>> }
>>
>> Thanks,
>>
>> Matthew
>>
>
>
___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Detecting calls with missing ACK (Lazy SIP scanners)

2016-04-04 Thread Alex Balashov

I am assuming you're adding Record-Route to your initial INVITEs?

If so, in the case of the answered call, it might be a defective UA that 
doesn't follow Record-Route for in-dialog messages (which include e2e ACK).


In the case of the negative replies, a scanner might not waste 
additional resources sending a formally requisite ACK. It'll just move 
on to the next target, and leave you holding the bag on the 
unacknowledged failed transaction.


-- Alex

--
Alex Balashov | Principal | Evariste Systems LLC
1447 Peachtree Street NE, Suite 700
Atlanta, GA 30309
United States

Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct)
Web: http://www.evaristesys.com/, http://www.csrpswitch.com/

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] Detecting calls with missing ACK (Lazy SIP scanners)

2016-04-04 Thread Marrold
Hi,

I have been running a couple of Asterisk honey pots to get a better
understanding of the tools and methods potential hackers are using to
exploit SIP servers.

I have observed many attacks from the 'sipcli' user agent that don't send
ACKs.

At this stage I'm not sure what they're trying to achieve, whether it's a
successful call to one of their test numbers, or maybe they will brute
force anything that returns a 401 later, or maybe they're waiting for a 18X
response.

Below are three typical scenarios-

-- INVITE -- >
<--- 100 Trying ---
<- 200 OK -
<- 200 OK -
<- 200 OK -
( No ACK)

-- INVITE -- >
< 503 
< 503 
< 503 
( No ACK)

-- INVITE -- >
< 401 
< 401 
< 401 
( No ACK)


Please could anyone point me in the right direction to detect these non
completed calls with a missing ACK in Kamailio? I am unsure on the
terminology I should be using to search the online documentation.

Thanks
___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] dispatcher [dispatch.c:1416]: ds_load_remove(): cannot find load for (from asterisk call-id)

2016-04-04 Thread Vladimer Gabunia
hello.
how can i block SIP messages  by message content type. for exlamle : text/plain
tanks in advance!

From: sr-users [sr-users-boun...@lists.sip-router.org] on behalf of TEG AMJG 
[tega...@gmail.com]
Sent: Tuesday, April 05, 2016 1:35 AM
To: Kamailio (SER) - Users Mailing List
Subject: Re: [SR-Users] dispatcher [dispatch.c:1416]: ds_load_remove(): cannot 
find load for (from asterisk call-id)

Hi Alberto, thanks for your reply

yeah, i am using ds_select_dst("0","10") in this case because i use setid=0 in 
the dispatcher table as you can see in this route block

route[TOASTERISK] {
#!ifdef WITH_LOADBALANCE
xlog("L_INFO","UBICAR: Forwarding non-registrar requests to Asterisk 
\n");
 if(!ds_select_dst("0", "10")) {
sl_send_reply("500", "Service Unavailable");
xlog("L_ERROR","UBICAR: No destinations available for $rd \n");
exit;
}
xlog("L_ERROR","UBICAR: AVP $avp(dsdstid)\n");
xlog("L_INFO","UBICAR: Dispatching to Asterisk Box $du\n");
t_set_fr(0,1);
t_on_failure("MANAGE_FAILURE");
route(RELAY);
exit;
#!endif
}

Also both Asterisk are responding to ping probes done by Kamailio, they are 
actually responding 404 but are still kept alive thanks to this param:

modparam("dispatcher", "ds_ping_reply_codes", "class=2;code=480;code=404")

and the command kamctl dispatcher dump shows them with flags=AP

URI:: sip:192.168.10.191:5060 flags=AP priority=0 
attrs=duid=PBX2;my=pbx2;maxload=200
URI:: sip:192.168.10.190:5060 flags=AP priority=0 
attrs=duid=PBX1;my=pbx1;maxload=200

Also, i would like to know if there is a way to print some kind of table to see 
how kamailio are keeping these call loads recorded. I have been looking for it 
but i cannot find any way of doing it

Again, thank you very much for your reply


2016-04-04 14:23 GMT-03:00 Alberto Sagredo 
>:
Hi

Are you using ds_select_dst("1", "10"); somewhere ?

You have to check Asterisk is responding to OPTIONS as dispatcher considered UP 
when 200 OK from Asterisk or SIP Gateway is received.. and not if not received.

I have used dispatcher but not with 10 option on algo...

BR




2016-04-04 8:07 GMT+02:00 TEG AMJG 
>:
Hi

I am new to Kamailio and i am just trying to setup a kamailio (v4.2.3) 
dispatcher to distribute calls to 2 asterisk using the call load distribution 
algorithm (alg 10). I started to test and see how all it is working and in the 
logs appears that the call load record it cannot be found.

- ERROR: dispatcher [dispatch.c:1416]: ds_load_remove(): cannot find load for 
(call id generated by asterisk)

I am getting this error  trying a 2 call leg conversation when asterisk is 
creating the BYE message destinated to the callee after receiving a BYE message 
from the caller, and the BYE message by Asterisk reach Kamailio to then apply 
the ds_load_update function

From what i understand about ds_load_update it is that it sets the load to an 
specific destination if Kamailio receives a 2xx reply of an INVITE message, and 
removes it if Kamailio receives a BYE message based from the Call-id received 
in that message, where it is actually failing in my implementation at the moment

Here are the blocks of code of the dispatcher parameters and where the function 
ds_load_update() is being used:
#!ifdef WITH_LOADBALANCE

#Parameters using Dispatcher from DB
# --
modparam("dispatcher", "db_url", DBURL)
modparam("dispatcher", "table_name", "dispatcher")
# --

#Enabling failover mechanism
# ---
modparam("dispatcher", "flags", 2)
# ---

#Setting dispatcher parameters in AVP
# ---
modparam("dispatcher", "dst_avp", "$avp(AVP_DST)")
modparam("dispatcher", "grp_avp", "$avp(AVP_GRP)")
modparam("dispatcher", "cnt_avp", "$avp(AVP_CNT)")
modparam("dispatcher", "dstid_avp", "$avp(dsdstid)")
# ---

#Setting dispatcher result in PV variables
# ---
modparam("dispatcher", "attrs_pvname", "$var(attrs)")
# ---


#Enabling dispatcher algorithm according to call loads
# ---
modparam("dispatcher", "ds_hash_size",8)
modparam("dispatcher", "ds_hash_expire", 3600)
modparam("dispatcher", "ds_hash_initexpire", 60)
# ---

# Setting parameters for probing dispatcher destinations
# ---
modparam("dispatcher", "ds_ping_interval", 20)
modparam("dispatcher", "ds_ping_from", "sip:kamailio1@")
modparam("dispatcher", "ds_probing_mode", 1)
modparam("dispatcher", "ds_probing_threshhold", 2)
modparam("dispatcher", "ds_ping_reply_codes", "class=2;code=480;code=404")
# ---

...
route[WITHINDLG] {
 if (has_totag()) {
  # sequential request withing a dialog should
  # take the path determined by record-routing

#!ifdef WITH_LOADBALANCE
if(is_method("BYE|CANCEL")){
 

Re: [SR-Users] dispatcher [dispatch.c:1416]: ds_load_remove(): cannot find load for (from asterisk call-id)

2016-04-04 Thread TEG AMJG
Hi Alberto, thanks for your reply

yeah, i am using ds_select_dst("0","10") in this case because i use setid=0
in the dispatcher table as you can see in this route block

route[TOASTERISK] {
#!ifdef WITH_LOADBALANCE
xlog("L_INFO","UBICAR: Forwarding non-registrar requests to
Asterisk \n");
 if(!ds_select_dst("0", "10")) {
sl_send_reply("500", "Service Unavailable");
xlog("L_ERROR","UBICAR: No destinations available for $rd
\n");
exit;
}
xlog("L_ERROR","UBICAR: AVP $avp(dsdstid)\n");
xlog("L_INFO","UBICAR: Dispatching to Asterisk Box $du\n");
t_set_fr(0,1);
t_on_failure("MANAGE_FAILURE");
route(RELAY);
exit;
#!endif
}

Also both Asterisk are responding to ping probes done by Kamailio, they are
actually responding 404 but are still kept alive thanks to this param:

modparam("dispatcher", "ds_ping_reply_codes", "class=2;code=480;code=404")

and the command kamctl dispatcher dump shows them with flags=AP

URI:: sip:192.168.10.191:5060 flags=AP priority=0
attrs=duid=PBX2;my=pbx2;maxload=200
URI:: sip:192.168.10.190:5060 flags=AP priority=0
attrs=duid=PBX1;my=pbx1;maxload=200

Also, i would like to know if there is a way to print some kind of table to
see how kamailio are keeping these call loads recorded. I have been looking
for it but i cannot find any way of doing it

Again, thank you very much for your reply


2016-04-04 14:23 GMT-03:00 Alberto Sagredo :

> Hi
>
> Are you using ds_select_dst("1", "10"); somewhere ?
>
> You have to check Asterisk is responding to OPTIONS as dispatcher
> considered UP when 200 OK from Asterisk or SIP Gateway is received.. and
> not if not received.
>
> I have used dispatcher but not with 10 option on algo...
>
> BR
>
>
>
>
> 2016-04-04 8:07 GMT+02:00 TEG AMJG :
>
>> Hi
>>
>> I am new to Kamailio and i am just trying to setup a kamailio (v4.2.3)
>> dispatcher to distribute calls to 2 asterisk using the call load
>> distribution algorithm (alg 10). I started to test and see how all it is
>> working and in the logs appears that the call load record it cannot be
>> found.
>>
>> - ERROR: dispatcher [dispatch.c:1416]: ds_load_remove(): cannot find load
>> for (call id generated by asterisk)
>>
>> I am getting this error  trying a 2 call leg conversation when asterisk
>> is creating the BYE message destinated to the callee after receiving a BYE
>> message from the caller, and the BYE message by Asterisk reach Kamailio to
>> then apply the ds_load_update function
>>
>> From what i understand about ds_load_update it is that it sets the load
>> to an specific destination if Kamailio receives a 2xx reply of an INVITE
>> message, and removes it if Kamailio receives a BYE message based from the
>> Call-id received in that message, where it is actually failing in my
>> implementation at the moment
>>
>> Here are the blocks of code of the dispatcher parameters and where the
>> function ds_load_update() is being used:
>> #!ifdef WITH_LOADBALANCE
>>
>> #Parameters using Dispatcher from DB
>> # --
>> modparam("dispatcher", "db_url", DBURL)
>> modparam("dispatcher", "table_name", "dispatcher")
>> # --
>>
>> #Enabling failover mechanism
>> # ---
>> modparam("dispatcher", "flags", 2)
>> # ---
>>
>> #Setting dispatcher parameters in AVP
>> # ---
>> modparam("dispatcher", "dst_avp", "$avp(AVP_DST)")
>> modparam("dispatcher", "grp_avp", "$avp(AVP_GRP)")
>> modparam("dispatcher", "cnt_avp", "$avp(AVP_CNT)")
>> modparam("dispatcher", "dstid_avp", "$avp(dsdstid)")
>> # ---
>>
>> #Setting dispatcher result in PV variables
>> # ---
>> modparam("dispatcher", "attrs_pvname", "$var(attrs)")
>> # ---
>>
>>
>> #Enabling dispatcher algorithm according to call loads
>> # ---
>> modparam("dispatcher", "ds_hash_size",8)
>> modparam("dispatcher", "ds_hash_expire", 3600)
>> modparam("dispatcher", "ds_hash_initexpire", 60)
>> # ---
>>
>> # Setting parameters for probing dispatcher destinations
>> # ---
>> modparam("dispatcher", "ds_ping_interval", 20)
>> modparam("dispatcher", "ds_ping_from", "sip:kamailio1@")
>> modparam("dispatcher", "ds_probing_mode", 1)
>> modparam("dispatcher", "ds_probing_threshhold", 2)
>> modparam("dispatcher", "ds_ping_reply_codes", "class=2;code=480;code=404")
>> # ---
>>
>> ...
>> route[WITHINDLG] {
>>  if (has_totag()) {
>>   # sequential request withing a dialog should
>>   # take the path determined by record-routing
>>
>> #!ifdef WITH_LOADBALANCE
>> if(is_method("BYE|CANCEL")){
>> xlog("L_ERROR","UBICAR BYE ds_load_update  requesturi=$ru
>> from=$fu method=$rm callid=$ci to=$tu reply=$mt rrcode=$rr rcode=$rs\n");
>> ds_load_update();
>> }
>> #!endif
>> ...
>> }
>>
>> ...
>>
>> onreply_route[MANAGE_REPLY] {
>> #!ifdef WITH_LOADBALANCE
>> if(is_method("INVITE")) {
>> 

Re: [SR-Users] Using 302 redirects with Dispatcher Module

2016-04-04 Thread Alberto Sagredo
Just a point about using 302 redirect. It is expected to be handled by any
SIP device.. but maybe you could find some (I found them on Spectralink
DECT ) that could not handle 302 redirect and had to change way to use
dispatching for that devices..

BR

2016-03-28 22:16 GMT+02:00 Marrold :

> Well spotted, I was studying the dispatcher docs but over looked sl.
>
> Thanks
>
> On Mon, Mar 28, 2016 at 8:42 PM, Alex Balashov 
> wrote:
>
>> On 03/28/2016 03:40 PM, Alex Balashov wrote:
>>
>>> On 03/28/2016 03:37 PM, Marrold wrote:
>>>
>>> That works, thanks. It turns out the following does work *without*
 appending the contact header-

  ds_select_domain("1", "8")
  sl_send_reply("302","Redirect");

>>>
>>> Huh. I would not have expected that.
>>>
>>
>> Oh. Yeah. The documentation actually says that:
>>
>> http://kamailio.org/docs/modules/4.3.x/modules/sl.html#sl_send_reply
>>
>> -- Alex
>>
>>
>> --
>> Alex Balashov | Principal | Evariste Systems LLC
>> 1447 Peachtree Street NE, Suite 700
>> Atlanta, GA 30309
>> United States
>>
>> Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct)
>> Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
>>
>> ___
>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>> sr-users@lists.sip-router.org
>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>
>
>
> ___
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users@lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>
___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] dispatcher [dispatch.c:1416]: ds_load_remove(): cannot find load for (from asterisk call-id)

2016-04-04 Thread Alberto Sagredo
Hi

Are you using ds_select_dst("1", "10"); somewhere ?

You have to check Asterisk is responding to OPTIONS as dispatcher
considered UP when 200 OK from Asterisk or SIP Gateway is received.. and
not if not received.

I have used dispatcher but not with 10 option on algo...

BR




2016-04-04 8:07 GMT+02:00 TEG AMJG :

> Hi
>
> I am new to Kamailio and i am just trying to setup a kamailio (v4.2.3)
> dispatcher to distribute calls to 2 asterisk using the call load
> distribution algorithm (alg 10). I started to test and see how all it is
> working and in the logs appears that the call load record it cannot be
> found.
>
> - ERROR: dispatcher [dispatch.c:1416]: ds_load_remove(): cannot find load
> for (call id generated by asterisk)
>
> I am getting this error  trying a 2 call leg conversation when asterisk is
> creating the BYE message destinated to the callee after receiving a BYE
> message from the caller, and the BYE message by Asterisk reach Kamailio to
> then apply the ds_load_update function
>
> From what i understand about ds_load_update it is that it sets the load to
> an specific destination if Kamailio receives a 2xx reply of an INVITE
> message, and removes it if Kamailio receives a BYE message based from the
> Call-id received in that message, where it is actually failing in my
> implementation at the moment
>
> Here are the blocks of code of the dispatcher parameters and where the
> function ds_load_update() is being used:
> #!ifdef WITH_LOADBALANCE
>
> #Parameters using Dispatcher from DB
> # --
> modparam("dispatcher", "db_url", DBURL)
> modparam("dispatcher", "table_name", "dispatcher")
> # --
>
> #Enabling failover mechanism
> # ---
> modparam("dispatcher", "flags", 2)
> # ---
>
> #Setting dispatcher parameters in AVP
> # ---
> modparam("dispatcher", "dst_avp", "$avp(AVP_DST)")
> modparam("dispatcher", "grp_avp", "$avp(AVP_GRP)")
> modparam("dispatcher", "cnt_avp", "$avp(AVP_CNT)")
> modparam("dispatcher", "dstid_avp", "$avp(dsdstid)")
> # ---
>
> #Setting dispatcher result in PV variables
> # ---
> modparam("dispatcher", "attrs_pvname", "$var(attrs)")
> # ---
>
>
> #Enabling dispatcher algorithm according to call loads
> # ---
> modparam("dispatcher", "ds_hash_size",8)
> modparam("dispatcher", "ds_hash_expire", 3600)
> modparam("dispatcher", "ds_hash_initexpire", 60)
> # ---
>
> # Setting parameters for probing dispatcher destinations
> # ---
> modparam("dispatcher", "ds_ping_interval", 20)
> modparam("dispatcher", "ds_ping_from", "sip:kamailio1@")
> modparam("dispatcher", "ds_probing_mode", 1)
> modparam("dispatcher", "ds_probing_threshhold", 2)
> modparam("dispatcher", "ds_ping_reply_codes", "class=2;code=480;code=404")
> # ---
>
> ...
> route[WITHINDLG] {
>  if (has_totag()) {
>   # sequential request withing a dialog should
>   # take the path determined by record-routing
>
> #!ifdef WITH_LOADBALANCE
> if(is_method("BYE|CANCEL")){
> xlog("L_ERROR","UBICAR BYE ds_load_update  requesturi=$ru
> from=$fu method=$rm callid=$ci to=$tu reply=$mt rrcode=$rr rcode=$rs\n");
> ds_load_update();
> }
> #!endif
> ...
> }
>
> ...
>
> onreply_route[MANAGE_REPLY] {
> #!ifdef WITH_LOADBALANCE
> if(is_method("INVITE")) {
> if(status=~"2[0-9][0-9]") {
> xlog("L_ERROR","UBICAR setting ds_load_update
>  requesturi=$ru from=$fu method=$rm callid=$ci to=$tu reply=$mt rrcode=$rr
> rcode=$rs");
> ds_load_update();
> }else if(status=~"[3-7][0-9][0-9]") {
> ds_load_unset();
> }
> }
> #!endif
>
> if(status=~"[12][0-9][0-9]"){
> route(NATMANAGE);
>  }
> }
>
>
> This is what i am getting from logs after the 2 call legs conversation
> completes:
>
> kam1 /usr/sbin/kamailio[4082]: ERROR: 

Re: [SR-Users] kamailio number translation and route

2016-04-04 Thread Alberto Sagredo
Take a look to LCR module and DIALPLAN module

BR

2016-04-04 6:43 GMT+02:00 li...@neulinx.com :

> hi  all;
>
> I want to use kamailio  achieve:
>
> First phase:
>
> 1) inbound  caller  number translation;
> 2) outbound caller  number translation;
> 3) inbound   callee  number translation;
> 4) outbound  callee  number tanslation;
>
> Example :
>  Call Flow
>  backend server  --> kamailio
> --> GateWay --->PSTN
>
> caller -->callee
>  caller  --->  callee
> 1000  --> 2000
>111000--->222000
>  inbound
> outbound
>caller --->calleecaller
> ---> callee
> 1000 ---> 2000   11000  ---> 22000
>
>  | translation |   |
> translation |
>   11000  ---> 22000   111000--->
> 222000
>
>
>
> Second  phase:
>
>
>   /  >gateway1  ->pstn
>   /
>backend server  --->  kamailio  ->gateway2
> -> pstn
>  \
>
>   \ > gateway3 --->pstn
>
>
>
>
> Could you give me  some suggest or  example configuration?
>
>
> --
> li...@neulinx.com
>
> ___
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users@lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>
___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Load balancing traffic based on SIP URI

2016-04-04 Thread Alberto Sagredo
Great. You can share with us how did you did it :)

Others would thank you also

BR

2016-04-04 15:22 GMT+02:00 NITESH BANSAL :

> Thanks guys for your ideas, I finally think that I have an idea on how to
> do it.
>
> Nitesh
>
> --
> Date: Fri, 1 Apr 2016 16:28:02 +0200
> From: alberto.sagr...@avanzada7.com
> To: sr-users@lists.sip-router.org
> Subject: Re: [SR-Users] Load balancing traffic based on SIP URI
>
>
> Hi Federico. In mi case i have to force some RURIs to a determinate
> Asterisk . There was some logic to do that instead letting kamailio to
> handle that situations
>
> I haven't tested option 3 , but it must do what you expect i think. Maybe
> you would need to adjust
>  ds_hash_expire
> Regards
>
> 2016-04-01 14:46 GMT+02:00 Federico Cabiddu :
>
> Hi,
> if I understand correctly your problem is that the first INVITE for a
> specific URI will go to a server and the conference will be instantiated
> there. Then you must route all the INVITEs from the other participants to
> the same server, is it right?
> If this is the case why not use algorithm 3 in ds_select_ds (or
> ds_select_domain) which does hashing over Request-URI?
> (
> http://www.kamailio.org/docs/modules/devel/modules/dispatcher.html#dispatcher.f.ds_select_dst
> )
>
> Regards,
>
> Federico
>
> On Fri, Apr 1, 2016 at 12:26 PM, NITESH BANSAL 
> wrote:
>
> Hello,
>
> I want to use Kamailio to load balance traffic across multiple asterisks.
> The problem is that my SIP traffic is related to conference, so if a SIP
> call
> for a particular URI is sent to an Asterisk instance, any subsequent calls
> for that
> SIP URI should be sent to the same Asterisk instance.
> Is there anyway to achieve this in Kamailio?
>
> Thanks,
> Nitesh
>
> ___
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users@lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>
>
> ___
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users@lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>
>
> ___ SIP Express Router (SER)
> and Kamailio (OpenSER) - sr-users mailing list
> sr-users@lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
> ___
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users@lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>
___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Kamailio as a presence server

2016-04-04 Thread SamyGo
Hi Igor,
If Im understanding this correctly you have a separate Kamailio just to
handle Presence.
In this case you mention that a SUBscribe has been acknowledged by this
Presence Kamailio but it does not do anything further!!
What are the chances that this new Presence kamailio is separate from the
main environment and probably has no dialog info in it and hence it is not
releasing any NOTIFY or PUBLishes?

Question: sharing a common database with dialog and registrations in their
tables...this new Presence kamailio is supposed to work as it is ? Right ?
Or does OP need to do some registrations and dialog replication via DMQ or
some other module?

Regards,
Sammy
On Apr 4, 2016 07:12, "Igor Olhovskiy"  wrote:

> Hi!
>
> Thanks, but actually with debug=3(4) in syslog last message I get is
> messages about hash tables in tm module.
>
> 2016-04-04 8:45 GMT+03:00 Daniel-Constantin Mierla :
>
>> Hello,
>>
>> can you run with debug=3 in config file and see if you get some hints
>> from syslog messages about what happens ?
>>
>> Cheers,
>> Daniel
>>
>>
>> On 01/04/16 17:17, Igor Olhovskiy wrote:
>>
>> Hi!
>> I want to create custom Presence server. Main idea - phones subscribes to
>> it (for ex, extension 100@domain). This subscription actually lit BLF
>> button on a phone.
>> But main idea - change status of BLF can arrive from different locations
>> via PUBLISH, I assume.
>> Problem - phones has different type of SUBSCRIBE, like
>> dialog(application/dialog-info+xml) or presence(application/pidf+xml). Some
>> of phones are not fully follow RFC (Like using in SUBSCRIBE R-URI not
>> domain, but IP, but in From or To - domains are used)
>> Phones are registered elsewhere, not on Kamailio. After reading RFC
>> (especially event:dialog part) I’ve found about SIP-If-Match part, but
>> problem about sync this data across multiple PUBLISH locations.
>> Can be Kamailio be a presence server in this scenario?
>>
>> For ex, SUBSCRIBE
>>
>> SUBSCRIBE sip:212.232.26.232:5060;transport=udp SIP/2.0
>> Via: SIP/2.0/UDP 192.168.88.60:5060;branch=z9hG4bK1656003104;rport
>> From: ;tag=521811605
>> To: ;tag=05ea6038656678bd0198b8977f3c0221.4e93
>> Call-ID: 805970257-506...@bjc.bgi.ii.ga
>> CSeq: 20202 SUBSCRIBE
>> Contact: 
>> X-Grandstream-PBX: true
>> Max-Forwards: 70
>> User-Agent: Grandstream GXP2160 1.0.5.33
>> Expires: 180
>> Supported: replaces, path, timer, eventlist
>> Event: dialog
>> Accept: application/dialog-info+xml,multipart/related,application/rlmi+xml
>> Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER,
>> UPDATE, MESSAGE
>> Content-Length: 0
>>
>>
>> I’ve tried send to Kamailio this PUBLISH
>>
>> PUBLISH sip:*5...@master.rufan.at:5060 SIP/2.0
>> Via: SIP/2.0/UDP 10.0.20.71:5060;branch=z9hG4bK-6930-1-0
>> Max-Forwards: 70
>> To: 
>> From: ;tag=1
>> Call-ID: 1-6930@127.0.1.1
>> CSeq: 1 PUBLISH
>> Contact: 
>> Event: presence
>> Expires: 3600
>> Content-Type: application/pidf+xml
>> Content-Length:  486
>>
>> 
>> > xmlns:dm='urn:ietf:params:xml:ns:pidf:data-model'
>> xmlns:rpid='urn:ietf:params:xml:ns:pidf:rpid'
>> xmlns:c='urn:ietf:params:xml:ns:pidf:cipid' entity='sip:*
>> 5...@master.rufan.at'>
>> 
>> 
>> open
>> 
>> 
>> 
>> 
>> 
>> 
>> Night
>> 
>> 
>>
>> Kamailio answers with 200OK, but after this - no NOTIFY to subscribed
>> clients.
>>
>> --
>> Best regards,
>> Igor
>>
>>
>> ___
>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing 
>> listsr-us...@lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>
>>
>> --
>> Daniel-Constantin Mierlahttp://www.asipto.comhttp://twitter.com/#!/miconda - 
>> http://www.linkedin.com/in/miconda
>> Kamailio World Conference, Berlin, May 18-20, 2016 - 
>> http://www.kamailioworld.com
>>
>>
>> ___
>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>> sr-users@lists.sip-router.org
>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>
>>
>
>
> --
> Best regards,
> Igor
>
> ___
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users@lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>
___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Load balancing traffic based on SIP URI

2016-04-04 Thread NITESH BANSAL
Thanks guys for your ideas, I finally think that I have an idea on how to do it.
Nitesh

Date: Fri, 1 Apr 2016 16:28:02 +0200
From: alberto.sagr...@avanzada7.com
To: sr-users@lists.sip-router.org
Subject: Re: [SR-Users] Load balancing traffic based on SIP URI

Hi Federico. In mi case i have to force some RURIs to a determinate Asterisk . 
There was some logic to do that instead letting kamailio to handle that 
situations
I haven't tested option 3 , but it must do what you expect i think. Maybe you 
would need to adjust  ds_hash_expireRegards
2016-04-01 14:46 GMT+02:00 Federico Cabiddu :
Hi,if I understand correctly your problem is that the first INVITE for a 
specific URI will go to a server and the conference will be instantiated there. 
Then you must route all the INVITEs from the other participants to the same 
server, is it right?If this is the case why not use algorithm 3 in ds_select_ds 
(or ds_select_domain) which does hashing over 
Request-URI?(http://www.kamailio.org/docs/modules/devel/modules/dispatcher.html#dispatcher.f.ds_select_dst)
Regards,
Federico
On Fri, Apr 1, 2016 at 12:26 PM, NITESH BANSAL  
wrote:



Hello,
I want to use Kamailio to load balance traffic across multiple asterisks.The 
problem is that my SIP traffic is related to conference, so if a SIP callfor a 
particular URI is sent to an Asterisk instance, any subsequent calls for 
thatSIP URI should be sent to the same Asterisk instance.Is there anyway to 
achieve this in Kamailio?
Thanks,Nitesh 

___

SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list

sr-users@lists.sip-router.org

http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users





___

SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list

sr-users@lists.sip-router.org

http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users





___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users   
  ___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] Kamailio setting the reqeust URI

2016-04-04 Thread NITESH BANSAL
Hello,I'm using Asterisk to originate a call via Kamailio.Request-URI in SIP 
INVITE coming from Asterisk looks like thisBut my 
objective is to use Kamailio to forward the call to a remote endpoint.
What header should I put in the SIP INVITE from Asterisk to Kamailio to 
conveythat Kamailio should use this 'SIP URI' to route the call onwards.I tried 
'Route' header, but it doesn't seem very clean, as kamailio doesn't updatethe 
Request-URI in the forwarded INVITE if I use the Route header.
Thanks,Nitesh

  ___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Kamailio as a presence server

2016-04-04 Thread Igor Olhovskiy
Hi!

Thanks, but actually with debug=3(4) in syslog last message I get is
messages about hash tables in tm module.

2016-04-04 8:45 GMT+03:00 Daniel-Constantin Mierla :

> Hello,
>
> can you run with debug=3 in config file and see if you get some hints from
> syslog messages about what happens ?
>
> Cheers,
> Daniel
>
>
> On 01/04/16 17:17, Igor Olhovskiy wrote:
>
> Hi!
> I want to create custom Presence server. Main idea - phones subscribes to
> it (for ex, extension 100@domain). This subscription actually lit BLF
> button on a phone.
> But main idea - change status of BLF can arrive from different locations
> via PUBLISH, I assume.
> Problem - phones has different type of SUBSCRIBE, like
> dialog(application/dialog-info+xml) or presence(application/pidf+xml). Some
> of phones are not fully follow RFC (Like using in SUBSCRIBE R-URI not
> domain, but IP, but in From or To - domains are used)
> Phones are registered elsewhere, not on Kamailio. After reading RFC
> (especially event:dialog part) I’ve found about SIP-If-Match part, but
> problem about sync this data across multiple PUBLISH locations.
> Can be Kamailio be a presence server in this scenario?
>
> For ex, SUBSCRIBE
>
> SUBSCRIBE sip:212.232.26.232:5060;transport=udp SIP/2.0
> Via: SIP/2.0/UDP 192.168.88.60:5060;branch=z9hG4bK1656003104;rport
> From: ;tag=521811605
> To: ;tag=05ea6038656678bd0198b8977f3c0221.4e93
> Call-ID: 805970257-506...@bjc.bgi.ii.ga
> CSeq: 20202 SUBSCRIBE
> Contact: 
> X-Grandstream-PBX: true
> Max-Forwards: 70
> User-Agent: Grandstream GXP2160 1.0.5.33
> Expires: 180
> Supported: replaces, path, timer, eventlist
> Event: dialog
> Accept: application/dialog-info+xml,multipart/related,application/rlmi+xml
> Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER,
> UPDATE, MESSAGE
> Content-Length: 0
>
>
> I’ve tried send to Kamailio this PUBLISH
>
> PUBLISH sip:*5...@master.rufan.at:5060 SIP/2.0
> Via: SIP/2.0/UDP 10.0.20.71:5060;branch=z9hG4bK-6930-1-0
> Max-Forwards: 70
> To: 
> From: ;tag=1
> Call-ID: 1-6930@127.0.1.1
> CSeq: 1 PUBLISH
> Contact: 
> Event: presence
> Expires: 3600
> Content-Type: application/pidf+xml
> Content-Length:  486
>
> 
>  xmlns:dm='urn:ietf:params:xml:ns:pidf:data-model'
> xmlns:rpid='urn:ietf:params:xml:ns:pidf:rpid'
> xmlns:c='urn:ietf:params:xml:ns:pidf:cipid' entity='sip:*
> 5...@master.rufan.at'>
> 
> 
> open
> 
> 
> 
> 
> 
> 
> Night
> 
> 
>
> Kamailio answers with 200OK, but after this - no NOTIFY to subscribed
> clients.
>
> --
> Best regards,
> Igor
>
>
> ___
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing 
> listsr-us...@lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>
> --
> Daniel-Constantin Mierlahttp://www.asipto.comhttp://twitter.com/#!/miconda - 
> http://www.linkedin.com/in/miconda
> Kamailio World Conference, Berlin, May 18-20, 2016 - 
> http://www.kamailioworld.com
>
>
> ___
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users@lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>


-- 
Best regards,
Igor
___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] kamailio number translation and route

2016-04-04 Thread li...@neulinx.com
hi  all;

I want to use kamailio  achieve:

First phase:

1) inbound  caller  number translation;
2) outbound caller  number translation;
3) inbound   callee  number translation;
4) outbound  callee  number tanslation;

Example :
 Call Flow
 backend server  --> kamailio --> 
GateWay --->PSTN

caller -->callee
caller  --->  callee
1000  --> 2000  
  111000--->222000
 inbound   outbound 

   caller --->calleecaller ---> 
callee
1000 ---> 2000   11000  ---> 22000  
  
 | translation |   | 
translation |   
  11000  ---> 22000   111000---> 222000



Second  phase:

/  
>gateway1  ->pstn
  /
   backend server  --->  kamailio  ->gateway2 -> 
pstn
 \
\ 
> gateway3 --->pstn




Could you give me  some suggest or  example configuration?




li...@neulinx.com
___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Kamailio 4.3.4: receive_msg(): no via found in reply

2016-04-04 Thread Grant Bagdasarian
Thank you Olle! I’ll discuss this with our supplier.

From: sr-users [mailto:sr-users-boun...@lists.sip-router.org] On Behalf Of Olle 
E. Johansson
Sent: Monday, April 4, 2016 10:16 AM
To: Kamailio (SER) - Users Mailing List 
Subject: Re: [SR-Users] Kamailio 4.3.4: receive_msg(): no via found in reply


On 04 Apr 2016, at 10:02, Grant Bagdasarian > 
wrote:

Hi Daniel,

You mentioned below about this issue not being complaint with the RFC.
Our supplier is telling us this is normal behavior and that they went through 
the RFC and found this was normal behavior.

If it’s not too much work, could you tell me in which part of the RFC this is 
described?

8.2.6.2 Headers and Tags


   The From field of the response MUST equal the From header field of
   the request.  The Call-ID header field of the response MUST equal the
   Call-ID header field of the request.  The CSeq header field of the
   response MUST equal the CSeq field of the request.  The Via header
   field values in the response MUST equal the Via header field values
   in the request and MUST maintain the same ordering.



RFC 3261 basics. The UAS copies ALL Via:s from the request into the response. 
This is how we route responses through
a SIP network, so without all headers, communication will likely be very broken.

/O



___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Multiple SIP-servers with SRV-records and authentication secrets

2016-04-04 Thread Olle E. Johansson

> On 03 Apr 2016, at 18:09, Alfred E. Heggestad  wrote:
> 
> Dear SIP-experts and DNS-SRV gurus;
> 
> 
> I have some questions to the deployers of SER/Kamailio and
> best current practice for multiple SIP-servers with SRV-records
> and authentication. This is not a question about Kamailio itself
> but rather experience with deployment of it in the field.
> 
> 
> The current usecase is:
> 
> 1. Multiple SIP-servers are deployed for the same domain
> 
> 2. The DNS is configured with SRV-records for load balancing,
>   example: (lets call the domain "example.com")
> 
>   $ host -t SRV _sip._udp.example.com
>   _sip._udp.example.com has SRV record 20 0 5080 alpha1.example.com.
>   _sip._udp.example.com has SRV record 20 0 5080 alpha2.example.com.
> 
> 3. when a SIP client registers, it resolves the domain using RFC3263 [1]
>   and the first REGISTER request is sent to SIP-Server #1
> 
> 4. SIP-server #1 replies with 401 containing the authentication challenge
> 
> 5. The SIP Client adds the authentication header to the REGISTER
>   request and re-sends it, but this time also using RFC 3263, and due
>   to DNS rotation the request is sent to SIP-Server #2
> 
> 6. Now, because the SIP-Servers are configured with _different_
>   secrets in the "auth" module [2], the REGISTER request
>   fails with authentication error.
> 
> 
> 
> Now, I know that it is common for SIP user-agents to send both requests
> to the same SIP-server instance. Baresip [3] is not doing that, it does
> a new RFC 3263 lookup for all requests (except e2e ACK/CANCEL).
> 
> 
> so here are my questions:
> 
> - What is common practice in the field, to configure auth module
>  with the same "secret" or different "secret" values?
Within the same realm the user has the same credentials. As long as
you have the same realm, one user name should NOT have different
secrets. If the two servers have different secrets for the same user, the
realm should be different.
I am not sure if there’s a document stating that every server in the same
realm has to handle the same set of nonces, i.e. accept an authentication
based on a nonce from another server, but in my world that follows
the idea of a realm.

> 
> - Do you know if there is any reference to IETF documents about how
>  this should be handled? RFC 3263 says that every request should be
>  resolved, except:
> 
>  "The procedures here MUST be done exactly once per transaction, where
>   transaction is as defined in [1].  That is, once a SIP server has
>   successfully been contacted (success is defined below), all
>   retransmissions of the SIP request and the ACK for non-2xx SIP
>   responses to INVITE MUST be sent to the same host.  Furthermore, a
>   CANCEL for a particular SIP request MUST be sent to the same SIP
>   server that the SIP request was delivered to.”

I think many developers are confused about REGISTER. It does not
create a dialog but some software handles it like one. It’s easy to
fall into a trap thinking about REGISTER as a dialog.

> 
> - What is common practice for SIP user-agents to do in this case?
Not many does what baresip does, which I think is correct. In Kamailio
multiple servers can handle the same nonce, so this behaviour works
very well with multiple Kamailios .

/O
> 
> 
> 
> 
> 
> 
> /alfred
> 
> [1] https://tools.ietf.org/html/rfc3263#section-4.4
> 
> [2] http://www.kamailio.org/docs/modules/3.4.x/modules/auth.html#auth.secret
> 
> [3] https://github.com/alfredh/baresip/issues/39
> 
> 
> 
> ___
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users@lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Kamailio 4.3.4: receive_msg(): no via found in reply

2016-04-04 Thread Olle E. Johansson

> On 04 Apr 2016, at 10:02, Grant Bagdasarian  wrote:
> 
> Hi Daniel,
>  
> You mentioned below about this issue not being complaint with the RFC.
> Our supplier is telling us this is normal behavior and that they went through 
> the RFC and found this was normal behavior.
>  
> If it’s not too much work, could you tell me in which part of the RFC this is 
> described?
>  
8.2.6.2 Headers and Tags


   The From field of the response MUST equal the From header field of
   the request.  The Call-ID header field of the response MUST equal the
   Call-ID header field of the request.  The CSeq header field of the
   response MUST equal the CSeq field of the request.  The Via header
   field values in the response MUST equal the Via header field values
   in the request and MUST maintain the same ordering.



RFC 3261 basics. The UAS copies ALL Via:s from the request into the response. 
This is how we route responses through
a SIP network, so without all headers, communication will likely be very broken.

/O
 
> 
> 

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] pseudo variables in strings

2016-04-04 Thread Juha Heinanen
Daniel-Constantin Mierla writes:

> Dialplan can evaluate variables, is it a special case you need to return
> variables and then evaluate after dp_translate() again?

I made a test rule:

match_exp  subst_exp  repl_exp

^\#11\#$   (empty)$fu

and dp_translate(id) on sip:#11#@test.tutpro.com produced
sip:$f...@test.tutpro.com.

Same with or without

modparam("dialplan", "match_dynamic", 1)

Also, I would prefer to have a function to evaluate strings rather than
have a dp_translate specific feature.

-- Juha

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] dispatcher [dispatch.c:1416]: ds_load_remove(): cannot find load for (from asterisk call-id)

2016-04-04 Thread TEG AMJG
Hi

I am new to Kamailio and i am just trying to setup a kamailio (v4.2.3)
dispatcher to distribute calls to 2 asterisk using the call load
distribution algorithm (alg 10). I started to test and see how all it is
working and in the logs appears that the call load record it cannot be
found.

- ERROR: dispatcher [dispatch.c:1416]: ds_load_remove(): cannot find load
for (call id generated by asterisk)

I am getting this error  trying a 2 call leg conversation when asterisk is
creating the BYE message destinated to the callee after receiving a BYE
message from the caller, and the BYE message by Asterisk reach Kamailio to
then apply the ds_load_update function

>From what i understand about ds_load_update it is that it sets the load to
an specific destination if Kamailio receives a 2xx reply of an INVITE
message, and removes it if Kamailio receives a BYE message based from the
Call-id received in that message, where it is actually failing in my
implementation at the moment

Here are the blocks of code of the dispatcher parameters and where the
function ds_load_update() is being used:
#!ifdef WITH_LOADBALANCE

#Parameters using Dispatcher from DB
# --
modparam("dispatcher", "db_url", DBURL)
modparam("dispatcher", "table_name", "dispatcher")
# --

#Enabling failover mechanism
# ---
modparam("dispatcher", "flags", 2)
# ---

#Setting dispatcher parameters in AVP
# ---
modparam("dispatcher", "dst_avp", "$avp(AVP_DST)")
modparam("dispatcher", "grp_avp", "$avp(AVP_GRP)")
modparam("dispatcher", "cnt_avp", "$avp(AVP_CNT)")
modparam("dispatcher", "dstid_avp", "$avp(dsdstid)")
# ---

#Setting dispatcher result in PV variables
# ---
modparam("dispatcher", "attrs_pvname", "$var(attrs)")
# ---


#Enabling dispatcher algorithm according to call loads
# ---
modparam("dispatcher", "ds_hash_size",8)
modparam("dispatcher", "ds_hash_expire", 3600)
modparam("dispatcher", "ds_hash_initexpire", 60)
# ---

# Setting parameters for probing dispatcher destinations
# ---
modparam("dispatcher", "ds_ping_interval", 20)
modparam("dispatcher", "ds_ping_from", "sip:kamailio1@")
modparam("dispatcher", "ds_probing_mode", 1)
modparam("dispatcher", "ds_probing_threshhold", 2)
modparam("dispatcher", "ds_ping_reply_codes", "class=2;code=480;code=404")
# ---

...
route[WITHINDLG] {
 if (has_totag()) {
  # sequential request withing a dialog should
  # take the path determined by record-routing

#!ifdef WITH_LOADBALANCE
if(is_method("BYE|CANCEL")){
xlog("L_ERROR","UBICAR BYE ds_load_update  requesturi=$ru
from=$fu method=$rm callid=$ci to=$tu reply=$mt rrcode=$rr rcode=$rs\n");
ds_load_update();
}
#!endif
...
}

...

onreply_route[MANAGE_REPLY] {
#!ifdef WITH_LOADBALANCE
if(is_method("INVITE")) {
if(status=~"2[0-9][0-9]") {
xlog("L_ERROR","UBICAR setting ds_load_update
 requesturi=$ru from=$fu method=$rm callid=$ci to=$tu reply=$mt rrcode=$rr
rcode=$rs");
ds_load_update();
}else if(status=~"[3-7][0-9][0-9]") {
ds_load_unset();
}
}
#!endif

if(status=~"[12][0-9][0-9]"){
route(NATMANAGE);
 }
}


This is what i am getting from logs after the 2 call legs conversation
completes:

kam1 /usr/sbin/kamailio[4082]: ERROR: