Re: [SR-Users] Remote Party ID

2011-12-07 Thread Daniel-Constantin Mierla

Hello,

On 12/7/11 10:03 AM, Pavel Segeč wrote:


HI,

Thank you. Just as I sent my previous mail I look into kamctl command 
syntax and I found


-- command 'rpid' - manage Remote-Party-ID (RPID)

rpid add   . add rpid for a user (*)

rpid rm  . set rpid to NULL for a user (*)

rpid show  ... show rpid of a user

How this work?

this is for adding/removing/showing the rpid column in subscriber table 
-- if you look in database, there is a column named rpid for subscriber 
table.


Practically, setting it and loading with load_credentials is a way to 
use it in the config file. In config then you can use append_hf() add 
header as you need, or if it is rpid specific format, see siputils 
module for other options:


http://kamailio.org/docs/modules/stable/modules_k/siputils.html

Cheers,
Daniel



pavel

*From:*Daniel-Constantin Mierla [mailto:mico...@gmail.com]
*Sent:* Tuesday, December 06, 2011 11:14 PM
*To:* SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - 
Users Mailing List

*Cc:* Pavel Segeč
*Subject:* Re: [SR-Users] Remote Party ID

Hello,

On 12/6/11 2:50 PM, Pavel Segeč wrote:

Hi,

I'm looking for some recommendations or guidlines. My leading IT 
department which is providing PSTN connectivity requires to include 
Remote Party ID in SIP Messages in a case where From URI is not in 
telco format (I prefer email like style of addressing). How to simply 
assign to an user its Remote Party ID which will be used when PSTN 
calling will occure? On what should I focus on? To use user 
preferences with AVP pairs? or something another?


since it is about one attribute associated with the caller, a 
recommended way is to add a new column in subscriber table, say it is 
named 'rpid'.


Then, in config file, set the load_credentials parameter of auth_db to 
load the rpid value and store in an avp. After you authenticate the 
caller, the avp will be set to the rpid value, see:


http://kamailio.org/docs/modules/stable/modules_k/auth_db.html#id2528175

Using this option, practically you use same db query that loads the 
user password for authentication to fetch the rpid value.


Cheers,
Daniel

--
Daniel-Constantin Mierla --http://www.asipto.com
http://linkedin.com/in/miconda  -- http://twitter.com/miconda


--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda

___
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] Running Kamailio as non-root user

2011-12-08 Thread Daniel-Constantin Mierla

Hello,

On 12/9/11 2:45 AM, Nathaniel L Keeling wrote:
I have just installed Kamailio 3.2 on Solaris sparc and would like to 
know what is the best way to have Kamailio to run under another 
userid, like kamailio.


you can provide user/group in the command line starting kamailio. See 
kamailio -h for the options.


Cheers,
Daniel

--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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] How to i use record_route_advertised_address

2011-12-08 Thread Daniel-Constantin Mierla

Hello,

On 12/8/11 11:13 PM, Peter Dunkley wrote:

Hi,

The record_route_advertised_address() config file function is now in 
git master.
from the readme I see that it takes the address from the function 
parameter, not from advertised_address global parameter, which is 
getting close to what record_route_preset() does, just that 
record_route_advertised_address() can do double rr with the address 
parameter based on auto-detection of transport change.


Probably would be useful to have the option of no parameter for this new 
function, in which case the global parameter 
advertised_adress/advertised_port will be used for building rr.


Cheers,
Daniel



Peter

On Wed, 2011-12-07 at 10:27 +, Hugh Waite wrote:

Hi,
I've implemented the config file function for
record_route_advertised_address and it should appear in git head later
today. Just doing the documentation and some testing...

Hugh

On 05/12/2011 21:52, Daniel-Constantin Mierla wrote:
>  Hello,
>
>  maybe the option for now is to set the parameters for
>  record_route_preset() to advertised_address/port:
>
>  http://kamailio.org/docs/modules/stable/modules_k/rr.html#id2542169
>
>  I have some deployments (like on EC2) where I use advertise_address
>  for have the proper Via and record_route_preset() for record route
>  headers.
>
>  For simplicity, it would be good to have the function in config to
>  take advertised address value for building the rr header.
>
>  Cheers,
>  Daniel
>
>  On 12/3/11 9:41 PM, Hugh Waite wrote:
>>  Hi,
>>  I do not think that record_route() uses the advertised_address
>>  variables. We have been using the advertised_address /
>>  advertised_port variables in the config file and although they are
>>  used in the Via headers, they are not substituted into the Record
>>  Route lines.
>>
>>  record_route_advertised_address() was added about 2 weeks ago for
>>  exactly this reason - using an advertised address in record routes
>>  when the transport changes. It automatically inserts double (rr2=on)
>>  routes in these cases and extra custom parameters can be added later.
>>
>>  However, we only needed the C API, so it isn't exported as a config
>>  file function yet. This won't be difficult.
>>
>>  Regards,
>>  Hugh
>>
>>  On 03/12/11 15:57, Ovidiu Sas wrote:
>>>  Take a look at set_advertised_address:
>>>  
http://www.kamailio.org/dokuwiki/doku.php/core-cookbook:3.1.x#set_advertised_address
>>>
>>>  Set it and then record_route() will properly fill the Record-Route
>>>  header.
>>>
>>>
>>>  Regards,
>>>  Ovidiu Sas
>>>
>>
>>
>>  ___
>>  SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>>  sr-users@lists.sip-router.org  <mailto:sr-users@lists.sip-router.org>
>>  http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>




--
Peter Dunkley
Technical Director
Crocodile RCS Ltd



___
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://linkedin.com/in/miconda -- http://twitter.com/miconda

___
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] set host as inactive and probing in dispatcher

2011-12-08 Thread Daniel-Constantin Mierla

Hello,

On 12/7/11 3:02 PM, Uri Shacked wrote:

hi,
i use "ds_select_domain()" to route a call.
if the destination reply with an error i am using the next lines in a 
route that i called from the failure route:

if($avp(OSPRPL)!=404) {
where do you set $avp(OSPRPL)? Can you add a xlog() message inside the 
if to be sure the ds_mark_dst() is executed? Alternative, use debugger 
module with cfgtrace to see what actions are executed from config file.


Cheers,
Daniel


 ds_mark_dst("IP");
 }
after trying this line i do "kamctl fifo ds_list" and i see the host 
is still at "AX". and in the next call the dispatcher still tries the 
same destination.

why? how do i set a destinatio in dispatcher to be inactive?
this is my modparams:
#!ifdef WITH_DISPATCHER
#-- dispatcher params -
modparam("dispatcher", "db_url", DBURL)
modparam("dispatcher", "dst_avp", "$avp(dsdst)")
modparam("dispatcher", "cnt_avp", "$avp(dscnt)")
modparam("dispatcher", "grp_avp", "$avp(dsgrp)")
modparam("dispatcher", "attrs_avp", "$avp(dsattrs)")
modparam("dispatcher", "ds_ping_from", "sip:u...@host.com 
<mailto:sip%3au...@host.com>")

modparam("dispatcher", "ds_ping_reply_codes", "class=2;code=405")
modparam("dispatcher", "ds_ping_interval", 30)
modparam("dispatcher", "ds_probing_mode", 1)
modparam("dispatcher", "ds_hash_size", 8)
modparam("dispatcher", "flags", 2)
#!endif



___
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://linkedin.com/in/miconda -- http://twitter.com/miconda

___
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] unset host domain in dispatcher module

2011-12-08 Thread Daniel-Constantin Mierla

Hello,

On 12/7/11 9:37 AM, Uri Shacked wrote:

Daniel hi,
thanks for the reply.
i woke up this mornning and tried to change the destination set on the 
dispatcher DB table.
it was "sip:user@host"... i changed it to "sip:host" and used 
ds_select_domain.

worked great, the R-URI host changed as needed.
regarding the t_relay(host,port) option. the problem with that is that 
the t_relay does not accept $avp()

any ideas?


you can do:

$du = $var(dst);
t_relay();

In $var(dst) you must have a valid sip URI address (can include 
protocol, like: sip:127.0.0.1:5060;transport=tcp)


Cheers,
Daniel



On Wed, Dec 7, 2011 at 12:09 AM, Daniel-Constantin Mierla 
mailto:mico...@gmail.com>> wrote:


Hello,


On 12/6/11 7:08 PM, Uri Shacked wrote:

Hi,
i am using the dispatcher module in order to send the call to a
LNP server.
after the 3xx reply from the LNP server, i would like to send the
invite back to the proxy that initiate the call from the beginnig.
how do i do that?

one option: t_relay_to(...) with the parameter pointing to the
proxy where you want to send the request.



it seems that kamailio dispatcher sets the host domain in the
Internet Protocol, and the sip request line does not change


No, the dispatcher does not work at IP packet layer, it is
updating the request URI with ds_select_domain() or sets internal
outbound proxy address with ds_select_dst().



so to be short.. two questions:
1. how do i "undo" the dispatcher?
2. how do i make the dispatcher change the requst lineas well? (i
am using ds_select_dst or ds_select_domain and they do the same...)

Changing the request URI is via ds_select_domain(), I can bet it
is working fine as I use it in many places -- if it does not do it
for you, can you paste here the config file used for doing
dispatching along with the SIP trace (ngrep) of such call?

Cheers,
Daniel


the carrierroute module, do it better, but i need the dispatcher
for the "keep alive" usage.
ideas will be great :-)
Uri


___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org  <mailto: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://www.asipto.com/>

http://linkedin.com/in/miconda  -- http://twitter.com/miconda




___
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://linkedin.com/in/miconda -- http://twitter.com/miconda

___
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] set host as inactive and probing in dispatcher

2011-12-12 Thread Daniel-Constantin Mierla

Hello,

cn you give output of 'kamailio -V' and the log messages with debug=3 in 
config file?


Note that from the moment you set the gateway in some state and you dump 
the list via mi, there can be keepalives that change the state.


Cheers,
Daniel

On 12/11/11 3:42 PM, Uri Shacked wrote:

Hi,
i tried to change the ds_probing_mode as well. it didn't do any good.
i need the probing mode to be set to 1 anyway.
so,
any ideas?
here is the cfg again:
after the failure route i turn to this route
"route[OSPRPLERR] {
xlog("$C(rg) SCRIPT : in OSPRPLERR $ru $C(xx)\n");
if($avp(OSPRPL)!=404) {
 xlog("$C(rg) OSPRPL is $avp(OSPRPL)*now disable destination* $C(xx)\n");
 ds_mark_dst("AP");
 xlog("$C(rg) *after disabling destination* $C(xx)\n");
 }"
here is the log:

13(5760) ERROR: 

Re: [SR-Users] Via header branch parameter in ACK message not unique

2011-12-12 Thread Daniel-Constantin Mierla

Hello,


On 12/12/11 8:18 AM, Phillman25 Kyriacou wrote:

Dear List

I'm currently facing an issue with a carrier whereby they are 
complaining that the via header branch parameter (sip.Via.branch == 
"z9hG4bKcydzigwkX") in the ACK messages is not unique which results in 
some calls being successful and some terminating after 20 seconds as 
their sip proxy determines it as a duplicate request. Is there a way 
to make the via header branch parameter in the ACK message unique 
across every transaction?

set in your config file the global parameter:

syn_branch=0

On the other hand, the behavior of the devises used by carrier is 
completely broken. ACK can have a different path than INVITE, so there 
should be no match done on Via branch parameter. Since it is ACK for 
200OK, it has to be matched for dialog. Having the RFC3261 cookie in the 
branch parameter, it has to be matched with (callid, from tag, to tag).


Cheers,
Daniel

--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda

___
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] use of $stat(name)

2011-12-12 Thread Daniel-Constantin Mierla

Hello,

On 12/12/11 10:17 AM, Uri Shacked wrote:

hi,
anyone knows what is the options to use $stat ?
in siremis there are some examples.
but, where can i see what kind of names can i write in the (name) part 
and what kind of info do they give?

using $stat(x) can be done if you load pv module.

There are predefined statistics implemented in modules -- these ones are 
documented in the readmes. Then you can define extra statistics from 
config file via statistics module and operate them in routing blocks.


To see what statistics are available on your kamailio running instance, do:

kamctl fifo get_statistics all

In the output you should get a prefix on statistics name which should 
lead you to the module exporting them -- if there is no such module, 
they are exported by the core, kex module or they are custom.


Cheers,
Daniel

--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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] 503 on DB Error

2011-12-12 Thread Daniel-Constantin Mierla

Hello,

On 12/10/11 11:36 AM, Olle E. Johansson wrote:

9 dec 2011 kl. 18:54 skrev Spencer Thomason:


Hello all,
Is it possible to configure Kamailio to reply to a request with a 503 if it 
cannot connect to a necessary database for the operation?

I.e.  Kamailio cannot connect to the database, when a REGISTER comes in and 
userloc can't find the credentials (due to DB failure), respond with a 503.  
The requesting endpoint can then fail over properly.  The same behaviour would 
be desired for other modules as well, i.e. aliasdb.


I noticed using 3.1.5 that it simply does not authorize the user.



I have been thinking about this as well. We could implement a db_ping function 
so we could test in the routing script before
calling functions that use the DB. It's harder with stuff that happens in the 
background, like ACC and SIPTRACE. I don't know
what happens with them if the database fails.
one option would be to set a config env variable, like db_error, which 
is set by the db modules on error. Then can be checked in the config and 
act accordingly. This will require touching the db modules.


Alternative is to propagate some return codes up to config file, but 
this will require changes in all modules interacting with database, 
including the db modules.


Cheers,
Daniel

--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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] route return value confusion

2011-12-12 Thread Daniel-Constantin Mierla

Hello,

cannot test it for now personally, but what you get if you do:

route(TEST_ROUTE_MINUS_ONE);

$var(r) = $rc;

xlog("returned code by route minus one is: $var(r)\n");

Maybe this will give some leads I can follow in the code...

Cheers,
Daniel


On 12/10/11 3:16 PM, Juha Heinanen wrote:

i have defined two routes:

route [TEST_ROUTE_MINUS_ONE] {
   return (-1);
}

route [TEST_ROUTE_PLUS_ONE] {
   return (1);
}

and then test them with these statements:

 if (route(TEST_ROUTE_MINUS_ONE) == -1) {
 xlog("L_INFO", "TEST_ROUTE returned -1\n");
 }

 if (!route(TEST_ROUTE_MINUS_ONE)) {
 xlog("L_INFO", "TEST_ROUTE returned failure\n");
 }

 if (route(TEST_ROUTE_PLUS_ONE) == 1) {
 xlog("L_INFO", "TEST_ROUTE returned 1\n");
 }

 if (route(TEST_ROUTE_PLUS_ONE)) {
 xlog("L_INFO", "TEST_ROUTE returned success\n");
 }

can someone explain, why i get only three lines to syslog?

Dec 10 16:14:56 sip /usr/sbin/sip-proxy[16099]: INFO: TEST_ROUTE_MINUS_ONE 
returned failure
Dec 10 16:14:56 sip /usr/sbin/sip-proxy[16099]: INFO: TEST_ROUTE_PLUS_ONE 
returned 1
Dec 10 16:14:56 sip /usr/sbin/sip-proxy[16099]: INFO: TEST_ROUTE_PLUS_ONE 
returned success

-- 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://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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] Music on hold with freeswitch as SBC

2011-12-12 Thread Daniel-Constantin Mierla

Hello,

On 12/9/11 9:04 PM, Gautam Batra wrote:

Hello,

I have a kamailio sip proxy server with freeswitch acting as SBC. I 
want to redirect the call to freeswitch when hold is pressed so that i 
can play music on hold. I tried this by using rewritehostport in case 
of a re-invite, but the call drops in that case. Could someone please 
help me with this?
it is not possible to redirect established calls (it breaks the 
RFC3261), you have to route the call through freeswitch from its start. 
Perhaps you can use freeswitch without relaying the media in first place 
and when you have on hold, you set media patch to go through freeswitch.

Cheers,
Daniel

--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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] set host as inactive and probing in dispatcher

2011-12-12 Thread Daniel-Constantin Mierla

Hello,

you have to upgrade to 3.2.1 (or use the latest git branch 3.2). The 
current keepalive mechanism was refactored a bit after the release of 
3.2.0, as they were overlapping cases.


Cheers,
Daniel

On 12/12/11 11:13 AM, Uri Shacked wrote:

version :
version: kamailio 3.2.0 (i386/linux) e19bb8
flags: STATS: Off, USE_IPV6, USE_TCP, USE_TLS, TLS_HOOKS, 
USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, 
SHM_MMAP, PKG_MALLOC, DBG_QM_MALLOC, USE_FUTEX, 
FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, 
USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, 
MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 4MB

poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: e19bb8
compiled on 18:43:11 Oct 24 2011 with gcc 4.1.2
and with log level 3 :
13(11897) ERROR: 

Re: [SR-Users] 503 on DB Error

2011-12-12 Thread Daniel-Constantin Mierla

Hello,

On 12/12/11 10:49 AM, Olle E. Johansson wrote:

12 dec 2011 kl. 10:33 skrev Daniel-Constantin Mierla:


Hello,

On 12/10/11 11:36 AM, Olle E. Johansson wrote:

9 dec 2011 kl. 18:54 skrev Spencer Thomason:


Hello all,
Is it possible to configure Kamailio to reply to a request with a 503 if it 
cannot connect to a necessary database for the operation?

I.e.  Kamailio cannot connect to the database, when a REGISTER comes in and 
userloc can't find the credentials (due to DB failure), respond with a 503.  
The requesting endpoint can then fail over properly.  The same behaviour would 
be desired for other modules as well, i.e. aliasdb.


I noticed using 3.1.5 that it simply does not authorize the user.



I have been thinking about this as well. We could implement a db_ping function 
so we could test in the routing script before
calling functions that use the DB. It's harder with stuff that happens in the 
background, like ACC and SIPTRACE. I don't know
what happens with them if the database fails.

one option would be to set a config env variable, like db_error, which is set 
by the db modules on error. Then can be checked in the config and act 
accordingly. This will require touching the db modules.

Alternative is to propagate some return codes up to config file, but this will 
require changes in all modules interacting with database, including the db 
modules.

Great. I think a db_ping which forces a test, a db_status variable that shows 
the result of the last database operation is a good start.
yes, db_ping() is good for interaction from config file. I thought of 
db_status more for the other functions that use db behind (like auth_db).


I wonder if each sql server has this ping capability -- mysql lib offers 
mysql_ping() (which is used in db_mysql module), iirc, postgress has as 
well although not used in db_postgres (afaik). If all, ping function may 
be exported via db interface and offered to config from sqlops, where is 
easy to provide connection id.


When ping is not offered by library, then maybe never fail query like 
'select count(*) from version' can be used - this should be usable even 
now with sqlops.


Cheers,
Daniel



The return code stuff is a more long term issue. I'll try to allocate time to 
see if I can get somewhere with these two. If I need help, this list will now 
:-)

/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


--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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] route return value confusion

2011-12-12 Thread Daniel-Constantin Mierla

Hello,

On 12/12/11 10:45 AM, Juha Heinanen wrote:

Daniel-Constantin Mierla writes:


cannot test it for now personally, but what you get if you do:

route(TEST_ROUTE_MINUS_ONE);

$var(r) = $rc;

xlog("returned code by route minus one is: $var(r)\n");

Maybe this will give some leads I can follow in the code...

daniel,

i correctly get:

Dec 12 11:42:37 sip /usr/sbin/sip-proxy[1308]: ERROR: returned code by route 
minus one is: -1

so it is only the test

if (route(TEST_ROUTE_MINUS_ONE) == -1) ...

that fails.
ok, so looks like IF with a mod function returning negative needs 
investigation. I will look over it soon.


Cheers,
Daniel



--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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] 503 on DB Error

2011-12-12 Thread Daniel-Constantin Mierla

Hello,

On 12/12/11 10:46 AM, Alex Hermann wrote:

On Monday 12 December 2011, Daniel-Constantin Mierla wrote:

On 12/10/11 11:36 AM, Olle E. Johansson wrote:

I have been thinking about this as well. We could implement a db_ping
function so we could test in the routing script before calling functions
that use the DB. It's harder with stuff that happens in the background,
like ACC and SIPTRACE. I don't know what happens with them if the
database fails.

one option would be to set a config env variable, like db_error, which
is set by the db modules on error. Then can be checked in the config and
act accordingly. This will require touching the db modules.

Alternative is to propagate some return codes up to config file, but
this will require changes in all modules interacting with database,
including the db modules.

How about calling an error_route block when a DB error occurs. Maybe with the
proper return stack setup so the admin is able to return to the statement
following the failed db query if he doesn't want to end the processing with
some failure reply.

this seems to need also lot of review. It may happen that functions do 
db operations inside locks or with some temporary states, so an eventual 
interruption of config file execution has to make sure that the cfg 
function doing the db operation finishes, to avoid deadlocks, leaks ...


Cheers,
Daniel

--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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] Via header branch parameter in ACK message not unique

2011-12-12 Thread Daniel-Constantin Mierla

Hello,

On 12/12/11 12:02 PM, Phillman25 Kyriacou wrote:

Dear Daniel

Thanks, this worked!
I will inform my carrier that they are handling the ACK 200 message wrong.
just one question: the syn_branch=0 is used for only stateless ACK 
messages?
it is used for all stateless forwarded requests. By its nature, ACK is 
always stateless because it does not take any reply, so there is no 
dedicated transaction for it -- in other words, no matter how you send 
the ACK from config (e.g., t_relay() or forward()), it will be done 
stateless.


Cheers,
Daniel



Thanks again for your assistance!
Phillip


On Mon, Dec 12, 2011 at 11:25 AM, Daniel-Constantin Mierla 
mailto:mico...@gmail.com>> wrote:


Hello,



On 12/12/11 8:18 AM, Phillman25 Kyriacou wrote:

Dear List

I'm currently facing an issue with a carrier whereby they are
complaining that the via header branch parameter (sip.Via.branch
== "z9hG4bKcydzigwkX") in the ACK messages is not unique which
results in some calls being successful and some terminating after
20 seconds as their sip proxy determines it as a duplicate
request. Is there a way to make the via header branch parameter
in the ACK message unique across every transaction?

set in your config file the global parameter:

syn_branch=0

On the other hand, the behavior of the devises used by carrier is
completely broken. ACK can have a different path than INVITE, so
there should be no match done on Via branch parameter. Since it is
ACK for 200OK, it has to be matched for dialog. Having the RFC3261
cookie in the branch parameter, it has to be matched with (callid,
from tag, to tag).

Cheers,
    Daniel

-- 
    Daniel-Constantin Mierla --http://www.asipto.com

http://linkedin.com/in/miconda  -- http://twitter.com/miconda




___
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://linkedin.com/in/miconda -- http://twitter.com/miconda

___
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] set host as inactive and probing in dispatcher

2011-12-12 Thread Daniel-Constantin Mierla

Hello,

On 12/12/11 1:35 PM, Uri Shacked wrote:


thanks,
since i am not so good with linux... :-( sorry
after doing GIT like :
  # git clone –depth 1 git://git.sip-router.org/sip-router  
<http://git.sip-router.org/sip-router>  kamailio
  # cd kamailio
  # git checkout -b 3.2 origin/3.2
  # make FLAVOUR=kamailio cfg
what do i do next?
make install?


yes, make install. You can read a tutorial about installing kamailio 3.2 
from git at:


  * http://www.kamailio.org/wiki/install/3.2.x/git

Cheers,
Daniel

On Mon, Dec 12, 2011 at 12:18 PM, Daniel-Constantin Mierla 
mailto:mico...@gmail.com>> wrote:


Hello,

you have to upgrade to 3.2.1 (or use the latest git branch 3.2).
The current keepalive mechanism was refactored a bit after the
release of 3.2.0, as they were overlapping cases.

Cheers,
Daniel


On 12/12/11 11:13 AM, Uri Shacked wrote:

version :
version: kamailio 3.2.0 (i386/linux) e19bb8
flags: STATS: Off, USE_IPV6, USE_TCP, USE_TLS, TLS_HOOKS,
USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM,
SHM_MMAP, PKG_MALLOC, DBG_QM_MALLOC, USE_FUTEX,
FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER,
USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN
16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 4MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: e19bb8
compiled on 18:43:11 Oct 24 2011 with gcc 4.1.2
and with log level 3 :
13(11897) ERROR: 

Re: [SR-Users] commands out of sync you can't run this command now

2011-12-12 Thread Daniel-Constantin Mierla

Hello,

On 12/12/11 4:09 PM, MingHon wrote:

btw im using kamailio 3.1


which one exactly? Just send output of 'kamailio -V'.

Also, watch the log messages with debug=3 and get the one related to the 
error messages to see which module is executing that command.


Cheers,
Daniel,




On Mon, Dec 12, 2011 at 11:08 PM, MingHon <mailto:gming...@gmail.com>> wrote:


Hi List,

im doing a fresh install, everything installed successfully but when

i try to start kamailio with kamctl start i receive this error.

when im using mysql 5.5 rpm version i get this error

if install with mysql 5.0 rpm i dont receive that error it run
perfectly.

is mysql 5.5 incompatible yet?

Thanks,


-- 
Regards,


MingHon




--
Regards,

MingHon


___
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://linkedin.com/in/miconda -- http://twitter.com/miconda

___
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] commands out of sync you can't run this command now

2011-12-13 Thread Daniel-Constantin Mierla

Hello,

are you using any private developed module or extension? There seems to 
be a buffer overflow as well.


if you don't have any private extension, can you send directly to me the 
entire log from start of kamailio with following global parameters:


debug=3
memlog=4
memdbg=4

Cheers,
Daniel

On 12/13/11 8:51 AM, MingHon wrote:

im using version: kamailio 3.1.4 (i386/linux)
after kamctl start it return
INFO: Starting Kamailio :
INFO: started (pid: 3589)

ps aux | grep 3589
root  3609  0.0  0.0   4012   704 pts/0S+   15:48   0:00 grep 3589

here is the log message.

Dec 13 15:43:41 hostname /usr/local/sbin/kamailio[3589]: ERROR: 
db_mysql [km_dbase.c:120]: driver error on query: Commands out of 
sync; you can't run this command now
Dec 13 15:43:41 hostname /usr/local/sbin/kamailio[3589]: ERROR:  
[db_query.c:101]: error while submitting query
Dec 13 15:43:41 hostname /usr/local/sbin/kamailio[3589]: ERROR:  
[db.c:366]: error in db_query
Dec 13 15:43:41 hostname /usr/local/sbin/kamailio[3589]: ERROR:  
[db.c:405]: querying version for table location
Dec 13 15:43:41 hostname /usr/local/sbin/kamailio[3589]: ERROR: usrloc 
[dlist.c:491]: error during table version check.
Dec 13 15:43:41 hostname /usr/local/sbin/kamailio[3589]: :  
[mem/q_malloc.c:146]: BUG: qm_*: fragm. 0x838b11c (address 0x838b134) 
end overwritten(0, 0)!
Dec 13 15:43:41 hostname kamailio: ERROR:  [daemonize.c:307]: 
Main process exited before writing to pipe




On Tue, Dec 13, 2011 at 12:53 AM, Daniel-Constantin Mierla 
mailto:mico...@gmail.com>> wrote:


Hello,


On 12/12/11 4:09 PM, MingHon wrote:

btw im using kamailio 3.1


which one exactly? Just send output of 'kamailio -V'.

Also, watch the log messages with debug=3 and get the one related
to the error messages to see which module is executing that command.

Cheers,
Daniel,




On Mon, Dec 12, 2011 at 11:08 PM, MingHon mailto:gming...@gmail.com>> wrote:

Hi List,

im doing a fresh install, everything installed successfully
but when

i try to start kamailio with kamctl start i receive this error.

when im using mysql 5.5 rpm version i get this error

if install with mysql 5.0 rpm i dont receive that error it
run perfectly.

is mysql 5.5 incompatible yet?

Thanks,


-- 
Regards,


MingHon




-- 
Regards,


MingHon


___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org  <mailto: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://linkedin.com/in/miconda  -- http://twitter.com/miconda




--
Regards,

MingHon


___
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://linkedin.com/in/miconda -- http://twitter.com/miconda

___
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] set host as inactive and probing in dispatcher

2011-12-13 Thread Daniel-Constantin Mierla

Hello,

On 12/12/11 7:38 PM, Uri Shacked wrote:

I installed with those instructions once... from scratch
I thought mayby there is a quicker way (like update in windows 
msi. :-)) when my system is already configured nicely..
it is even better than windo$. For example, if you use debian (or 
ubuntu), just set the apt repository to our debs server where we have 
nighlty builds, see this page:


   * http://www.kamailio.org/wiki/packages/debs

The you do:

apt-get install kamailio kamailio-mysql-modules ...

Whenever you need upgrade, just do:

apt-get update
apt-get upgrade

The better part is that the uninstall really works and you don't get 
trojans/viruses.


Cheers,
Daniel


Thanks,
I must say i think kamailio is great !! a real SIP application server, 
perfect for many implementations.

Cheers!


On Mon, Dec 12, 2011 at 2:51 PM, Daniel-Constantin Mierla 
mailto:mico...@gmail.com>> wrote:


Hello,


On 12/12/11 1:35 PM, Uri Shacked wrote:


thanks,
since i am not so good with linux... :-( sorry
after doing GIT like :
  # git clone --depth 1 git://git.sip-router.org/sip-router  
<http://git.sip-router.org/sip-router>  kamailio
  # cd kamailio
  # git checkout -b 3.2 origin/3.2
  # make FLAVOUR=kamailio cfg
what do i do next?
make install?


yes, make install. You can read a tutorial about installing
kamailio 3.2 from git at:

  * http://www.kamailio.org/wiki/install/3.2.x/git

Cheers,
Daniel



On Mon, Dec 12, 2011 at 12:18 PM, Daniel-Constantin Mierla
mailto:mico...@gmail.com>> wrote:

Hello,

you have to upgrade to 3.2.1 (or use the latest git branch
3.2). The current keepalive mechanism was refactored a bit
after the release of 3.2.0, as they were overlapping cases.

Cheers,
Daniel


On 12/12/11 11:13 AM, Uri Shacked wrote:

version :
version: kamailio 3.2.0 (i386/linux) e19bb8
flags: STATS: Off, USE_IPV6, USE_TCP, USE_TLS, TLS_HOOKS,
USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK,
SHM_MEM, SHM_MMAP, PKG_MALLOC, DBG_QM_MALLOC, USE_FUTEX,
FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER,
USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144,
MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT
PKG_SIZE 4MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: e19bb8
compiled on 18:43:11 Oct 24 2011 with gcc 4.1.2
and with log level 3 :
13(11897) ERROR: 

Re: [SR-Users] commands out of sync you can't run this command now

2011-12-13 Thread Daniel-Constantin Mierla

Hello,

On 12/13/11 9:24 AM, Daniel-Constantin Mierla wrote:

Hello,

are you using any private developed module or extension? There seems 
to be a buffer overflow as well.


if you don't have any private extension, can you send directly to me 
the entire log from start of kamailio with following global parameters:


debug=3
memlog=4
memdbg=4
errata - the values of the global parameters were wrong -- actually the 
above three lines should be:


debug=3
memlog=1
memdbg=1

Cheers,
Daniel



Cheers,
Daniel

On 12/13/11 8:51 AM, MingHon wrote:

im using version: kamailio 3.1.4 (i386/linux)
after kamctl start it return
INFO: Starting Kamailio :
INFO: started (pid: 3589)

ps aux | grep 3589
root  3609  0.0  0.0   4012   704 pts/0S+   15:48   0:00 grep 
3589


here is the log message.

Dec 13 15:43:41 hostname /usr/local/sbin/kamailio[3589]: ERROR: 
db_mysql [km_dbase.c:120]: driver error on query: Commands out of 
sync; you can't run this command now
Dec 13 15:43:41 hostname /usr/local/sbin/kamailio[3589]: ERROR: 
 [db_query.c:101]: error while submitting query
Dec 13 15:43:41 hostname /usr/local/sbin/kamailio[3589]: ERROR: 
 [db.c:366]: error in db_query
Dec 13 15:43:41 hostname /usr/local/sbin/kamailio[3589]: ERROR: 
 [db.c:405]: querying version for table location
Dec 13 15:43:41 hostname /usr/local/sbin/kamailio[3589]: ERROR: 
usrloc [dlist.c:491]: error during table version check.
Dec 13 15:43:41 hostname /usr/local/sbin/kamailio[3589]: :  
[mem/q_malloc.c:146]: BUG: qm_*: fragm. 0x838b11c (address 0x838b134) 
end overwritten(0, 0)!
Dec 13 15:43:41 hostname kamailio: ERROR:  [daemonize.c:307]: 
Main process exited before writing to pipe




On Tue, Dec 13, 2011 at 12:53 AM, Daniel-Constantin Mierla 
mailto:mico...@gmail.com>> wrote:


Hello,


On 12/12/11 4:09 PM, MingHon wrote:

btw im using kamailio 3.1


which one exactly? Just send output of 'kamailio -V'.

Also, watch the log messages with debug=3 and get the one related
to the error messages to see which module is executing that command.

Cheers,
Daniel,




On Mon, Dec 12, 2011 at 11:08 PM, MingHon mailto:gming...@gmail.com>> wrote:

Hi List,

im doing a fresh install, everything installed successfully
but when

i try to start kamailio with kamctl start i receive this error.

when im using mysql 5.5 rpm version i get this error

if install with mysql 5.0 rpm i dont receive that error it
run perfectly.

is mysql 5.5 incompatible yet?

Thanks,


-- 
Regards,


MingHon




-- 
Regards,


MingHon


___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org  <mailto: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://linkedin.com/in/miconda  -- http://twitter.com/miconda




--
Regards,

MingHon


___
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://linkedin.com/in/miconda  -- http://twitter.com/miconda


___
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://linkedin.com/in/miconda -- http://twitter.com/miconda

___
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] commands out of sync you can't run this command now

2011-12-13 Thread Daniel-Constantin Mierla

Hello,

have you sent them to me or to mailing list? On the mailing list I could 
not find an attachment, also I didn't get an email on myself only.


Cheers,
Daniel

On 12/13/11 10:39 AM, MingHon wrote:


Hello,

i attached the log/messages files please take a look...

Cheers,
MingHon


On Tue, Dec 13, 2011 at 4:58 PM, Daniel-Constantin Mierla
mailto:mico...@gmail.com>> wrote:

Hello,


On 12/13/11 9:24 AM, Daniel-Constantin Mierla wrote:

Hello,

are you using any private developed module or extension?
There seems to be a buffer overflow as well.

if you don't have any private extension, can you send
directly to me the entire log from start of kamailio with
following global parameters:

debug=3
memlog=4
memdbg=4

errata - the values of the global parameters were wrong --
actually the above three lines should be:

debug=3
memlog=1
memdbg=1

Cheers,
Daniel




Cheers,
Daniel

On 12/13/11 8:51 AM, MingHon wrote:

im using version: kamailio 3.1.4 (i386/linux)
after kamctl start it return
INFO: Starting Kamailio :
INFO: started (pid: 3589)

ps aux | grep 3589
root  3609  0.0  0.0   4012   704 pts/0S+   15:48  
0:00 grep 3589


here is the log message.

Dec 13 15:43:41 hostname /usr/local/sbin/kamailio[3589]:
ERROR: db_mysql [km_dbase.c:120]: driver error on query:
Commands out of sync; you can't run this command now
Dec 13 15:43:41 hostname /usr/local/sbin/kamailio[3589]:
ERROR:  [db_query.c:101]: error while submitting query
Dec 13 15:43:41 hostname /usr/local/sbin/kamailio[3589]:
ERROR:  [db.c:366]: error in db_query
Dec 13 15:43:41 hostname /usr/local/sbin/kamailio[3589]:
ERROR:  [db.c:405]: querying version for table location
Dec 13 15:43:41 hostname /usr/local/sbin/kamailio[3589]:
ERROR: usrloc [dlist.c:491]: error during table version check.
Dec 13 15:43:41 hostname /usr/local/sbin/kamailio[3589]: :
 [mem/q_malloc.c:146]: BUG: qm_*: fragm. 0x838b11c
(address 0x838b134) end overwritten(0, 0)!
Dec 13 15:43:41 hostname kamailio: ERROR: 
[daemonize.c:307]: Main process exited before writing to pipe



On Tue, Dec 13, 2011 at 12:53 AM, Daniel-Constantin Mierla
mailto:mico...@gmail.com>> wrote:

Hello,


On 12/12/11 4:09 PM, MingHon wrote:

btw im using kamailio 3.1


which one exactly? Just send output of 'kamailio -V'.

Also, watch the log messages with debug=3 and get the
one related to the error messages to see which module is
executing that command.

Cheers,
Daniel,




On Mon, Dec 12, 2011 at 11:08 PM, MingHon
mailto:gming...@gmail.com>> wrote:

Hi List,

im doing a fresh install, everything installed
successfully but when

i try to start kamailio with kamctl start i receive
this error.

when im using mysql 5.5 rpm version i get this
error

if install with mysql 5.0 rpm i dont receive that
error it run perfectly.

is mysql 5.5 incompatible yet?

Thanks,


-- 
Regards,


MingHon




-- 
Regards,


MingHon


___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing 
list
sr-users@lists.sip-router.org  
<mailto: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://linkedin.com/in/miconda  -- http://twitter.com/miconda




-- 
Regards,


MingHon


___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org  <mailto: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://linkedin.com/in/miconda  -- http://twitter.com/miconda


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


-- 
Daniel-Constantin Mierla --

Re: [SR-Users] set host as inactive and probing in dispatcher

2011-12-13 Thread Daniel-Constantin Mierla



On 12/13/11 11:45 AM, Uri Shacked wrote:

thanks,
I work with centos...
rpms for latest stable release of 3.2.x series are generated and 
available for download, details about distros at:


http://www.kamailio.org/wiki/packages/rpms

Cheers,
Daniel


On Tue, Dec 13, 2011 at 10:31 AM, Daniel-Constantin Mierla 
mailto:mico...@gmail.com>> wrote:


Hello,


On 12/12/11 7:38 PM, Uri Shacked wrote:

I installed with those instructions once... from scratch
I thought mayby there is a quicker way (like update in windows
msi. :-)) when my system is already configured nicely..

it is even better than windo$. For example, if you use debian (or
ubuntu), just set the apt repository to our debs server where we
have nighlty builds, see this page:

   * http://www.kamailio.org/wiki/packages/debs

The you do:

apt-get install kamailio kamailio-mysql-modules ...

Whenever you need upgrade, just do:

apt-get update
apt-get upgrade

The better part is that the uninstall really works and you don't
get trojans/viruses.

Cheers,
Daniel



Thanks,
I must say i think kamailio is great !! a real SIP application
server, perfect for many implementations.
Cheers!


On Mon, Dec 12, 2011 at 2:51 PM, Daniel-Constantin Mierla
mailto:mico...@gmail.com>> wrote:

Hello,


On 12/12/11 1:35 PM, Uri Shacked wrote:


thanks,
since i am not so good with linux... :-( sorry
after doing GIT like :
  # git clone –depth 1 git://git.sip-router.org/sip-router  
<http://git.sip-router.org/sip-router>  kamailio
  # cd kamailio
  # git checkout -b 3.2 origin/3.2
  # make FLAVOUR=kamailio cfg
what do i do next?
make install?


yes, make install. You can read a tutorial about installing
kamailio 3.2 from git at:

  * http://www.kamailio.org/wiki/install/3.2.x/git

Cheers,
Daniel



On Mon, Dec 12, 2011 at 12:18 PM, Daniel-Constantin Mierla
mailto:mico...@gmail.com>> wrote:

Hello,

you have to upgrade to 3.2.1 (or use the latest git
branch 3.2). The current keepalive mechanism was
refactored a bit after the release of 3.2.0, as they
were overlapping cases.

Cheers,
Daniel


On 12/12/11 11:13 AM, Uri Shacked wrote:

version :
version: kamailio 3.2.0 (i386/linux) e19bb8
flags: STATS: Off, USE_IPV6, USE_TCP, USE_TLS,
TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST,
DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC,
DBG_QM_MALLOC, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT,
USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR,
USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144,
MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535,
DEFAULT PKG_SIZE 4MB
poll method support: poll, epoll_lt, epoll_et,
sigio_rt, select.
id: e19bb8
compiled on 18:43:11 Oct 24 2011 with gcc 4.1.2
and with log level 3 :
13(11897) ERROR: 

Re: [SR-Users] route return value confusion

2011-12-13 Thread Daniel-Constantin Mierla

Hello,

I checked the code and this behaviour is practically due to special 
meaning of return codes from functions exported to config file, ie,:

- <0 is false
- >0 is true

route(x) call is returning the code from route block itself, but then 
the interpreter converts the codes < 0 to 0 (so the condition is false 
in C) and the codes > 0 to 1 (so the condition is C is true).


Thus, no matter what code you return from a subroute, you have to 
compare against 0 (for negative return code) or 1 (for positive return 
code).


Solutions/alternatives:

 1)
$var(r) = route(x);

.. and then compare $var(r)

2)
route(x);
$var(r) = $rc;

.. and then compare $var(r)

3)
doing it in the if:

if(($var(r) = route(x)) && ($var(r) == -1)) {
  ...
}

The assignment which is done first in the IF expression will return true 
if the assignment operation is successful.


Cheers,
Daniel


just replace -1 with the return code you want to test against
On 12/12/11 11:29 AM, Daniel-Constantin Mierla wrote:

Hello,

On 12/12/11 10:45 AM, Juha Heinanen wrote:

Daniel-Constantin Mierla writes:


cannot test it for now personally, but what you get if you do:

route(TEST_ROUTE_MINUS_ONE);

$var(r) = $rc;

xlog("returned code by route minus one is: $var(r)\n");

Maybe this will give some leads I can follow in the code...

daniel,

i correctly get:

Dec 12 11:42:37 sip /usr/sbin/sip-proxy[1308]: ERROR: returned code 
by route minus one is: -1


so it is only the test

if (route(TEST_ROUTE_MINUS_ONE) == -1) ...

that fails.
ok, so looks like IF with a mod function returning negative needs 
investigation. I will look over it soon.


Cheers,
Daniel





--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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] route return value confusion

2011-12-13 Thread Daniel-Constantin Mierla

Hello,

On 12/12/11 11:15 AM, Morten Isaksen wrote:

I had a similar problem with avp_db_query

if (avp_db_query(...) == -2) {
   xlog("...");
}

did not work, but

$var(r) = avp_db_query();
if ($var(r) == -2) {
   xlog("...");
}

did work.
indeed, this is a solution. As stated in the previous email, inside an 
IF expression, the return code from functions exported to config are 
converted to 0 if return code is < 0  and to 1 if the return code is >0 
to match in C the special meaning of return codes in the config file.


Cheers,
Daniel




/Morten


On Sat, Dec 10, 2011 at 3:16 PM, Juha Heinanen  wrote:

i have defined two routes:

route [TEST_ROUTE_MINUS_ONE] {
  return (-1);
}

route [TEST_ROUTE_PLUS_ONE] {
  return (1);
}

and then test them with these statements:

if (route(TEST_ROUTE_MINUS_ONE) == -1) {
xlog("L_INFO", "TEST_ROUTE returned -1\n");
}

if (!route(TEST_ROUTE_MINUS_ONE)) {
xlog("L_INFO", "TEST_ROUTE returned failure\n");
}

if (route(TEST_ROUTE_PLUS_ONE) == 1) {
xlog("L_INFO", "TEST_ROUTE returned 1\n");
}

if (route(TEST_ROUTE_PLUS_ONE)) {
xlog("L_INFO", "TEST_ROUTE returned success\n");
}

can someone explain, why i get only three lines to syslog?

Dec 10 16:14:56 sip /usr/sbin/sip-proxy[16099]: INFO: TEST_ROUTE_MINUS_ONE 
returned failure
Dec 10 16:14:56 sip /usr/sbin/sip-proxy[16099]: INFO: TEST_ROUTE_PLUS_ONE 
returned 1
Dec 10 16:14:56 sip /usr/sbin/sip-proxy[16099]: INFO: TEST_ROUTE_PLUS_ONE 
returned success

-- 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://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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] route return value confusion

2011-12-13 Thread Daniel-Constantin Mierla



On 12/13/11 1:03 PM, Juha Heinanen wrote:

Daniel-Constantin Mierla writes:


Thus, no matter what code you return from a subroute, you have to
compare against 0 (for negative return code) or 1 (for positive return
code).

Solutions/alternatives:

is it not an alternative to fix to change the current implementation so
that the real return code of route block could be tested?
coding wise might not be a lot, thus I haven't analyzed all the cases 
where functions are evaluated by return code, but it will impact and 
break config file as it used to be so far, for example:


route[x] {
 return -1;
}

if(route(x)) will be true, since if(-1) is true in C
All conditions with functions have to be changed in:

if( f()<0 ) for false cases
if( f(x) > 0) for true cases

At this moment I cannot say for sure if there can be done some 
workaround to get return code and keep old behavior, at first sight 
seems unlikely.


Cheers,
Daniel

--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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] route return value confusion

2011-12-13 Thread Daniel-Constantin Mierla



On 12/13/11 1:25 PM, Juha Heinanen wrote:

Daniel-Constantin Mierla writes:


coding wise might not be a lot, thus I haven't analyzed all the cases
where functions are evaluated by return code, but it will impact and
break config file as it used to be so far, for example:

route[x] {
   return -1;
}

if(route(x)) will be true, since if(-1) is true in C

i meant get rid of C interpretation when if evaluates the condition,
i.e., do not covert condition to anything, but just test if condition is
<  0 for false and>  0 for true.

This is what happens actually:

if(route(x) == 1) is seen by interpreter as:

if(left_expression == 1)

then left_expression is evaluated as you say above:
- < 0 is false => this is 0 is C
- > 0 is true => this is 1 in C

Since left_expression can be complex (include sub expressions), there 
has to be propagation to false/true. For example you can have in the 
left expression (2<1) or variables with such values.


Anyhow, if you have some ideas, you can play with functions in lvalue.c, 
rvalue.c and action.c


Cheers,
Daniel

--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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] commands out of sync you can't run this command now

2011-12-13 Thread Daniel-Constantin Mierla
I cannot see any DEBUG messages, are you sure the debug=3 in your config 
and you dont have other -d command line parameters?


Cheers,
Daniel

On 12/13/11 12:58 PM, MingHon wrote:

Hi,

the attachment was 2mb i remove it from approval. i did sentto ur 
email too..


anyway i attached the file with 7 zip.. reduced to 60k now..

--
Regards,

MingHon


On Tue, Dec 13, 2011 at 7:00 PM, Daniel-Constantin Mierla 
mailto:mico...@gmail.com>> wrote:


Hello,

have you sent them to me or to mailing list? On the mailing list I
could not find an attachment, also I didn't get an email on myself
only.

Cheers,
Daniel


On 12/13/11 10:39 AM, MingHon wrote:


Hello,

i attached the log/messages files please take a look...

Cheers,
MingHon


On Tue, Dec 13, 2011 at 4:58 PM, Daniel-Constantin Mierla
mailto:mico...@gmail.com>> wrote:

Hello,


On 12/13/11 9:24 AM, Daniel-Constantin Mierla wrote:

Hello,

are you using any private developed module or extension?
There seems to be a buffer overflow as well.

if you don't have any private extension, can you send
directly to me the entire log from start of kamailio
with following global parameters:

debug=3
memlog=4
memdbg=4

errata - the values of the global parameters were wrong
-- actually the above three lines should be:

debug=3
memlog=1
memdbg=1

Cheers,
Daniel




Cheers,
Daniel

On 12/13/11 8:51 AM, MingHon wrote:

im using version: kamailio 3.1.4 (i386/linux)
after kamctl start it return
INFO: Starting Kamailio :
INFO: started (pid: 3589)

ps aux | grep 3589
root  3609  0.0  0.0   4012   704 pts/0S+  
15:48   0:00 grep 3589


here is the log message.

Dec 13 15:43:41 hostname
/usr/local/sbin/kamailio[3589]: ERROR: db_mysql
[km_dbase.c:120]: driver error on query: Commands out
of sync; you can't run this command now
Dec 13
15:43:41 hostname /usr/local/sbin/kamailio[3589]:
ERROR:  [db_query.c:101]: error while submitting
query
Dec 13
15:43:41 hostname /usr/local/sbin/kamailio[3589]:
ERROR:  [db.c:366]: error in db_query
Dec 13
15:43:41 hostname /usr/local/sbin/kamailio[3589]:
ERROR:  [db.c:405]: querying version for table
location
Dec 13
15:43:41 hostname /usr/local/sbin/kamailio[3589]:
ERROR: usrloc [dlist.c:491]: error during table version
check.
Dec 13
15:43:41 hostname /usr/local/sbin/kamailio[3589]: :
 [mem/q_malloc.c:146]: BUG: qm_*: fragm.
0x838b11c (address 0x838b134) end overwritten(0, 0)!
Dec 13 15:43:41 hostname kamailio: ERROR: 
[daemonize.c:307]: Main process exited before writing
to pipe



On Tue, Dec 13, 2011 at 12:53 AM, Daniel-Constantin
Mierla mailto:mico...@gmail.com>>
wrote:

Hello,


On 12/12/11 4:09 PM, MingHon wrote:

btw im using kamailio 3.1


which one exactly? Just send output of 'kamailio -V'.

Also, watch the log messages with debug=3 and get
the one related to the error messages to see which
module is executing that command.

Cheers,
Daniel,




On Mon, Dec 12, 2011 at 11:08 PM, MingHon
mailto:gming...@gmail.com>>
wrote:

Hi List,

im doing a fresh install, everything installed
successfully but when

i try to start kamailio with kamctl start i
receive this error.

when im using mysql 5.5 rpm version i get this
error

if install with mysql 5.0 rpm i dont receive
that error it run perfectly.

is mysql 5.5 incompatible yet?

Thanks,


-- 
Regards,


MingHon




-- 
Regards,


MingHon


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


 

Re: [SR-Users] Fwd: commands out of sync you can't run this command now

2011-12-13 Thread Daniel-Constantin Mierla



On 12/13/11 3:33 PM, MingHon wrote:

ya debug is set to 3 already.. also #!define WITH_DEBUG

dont hav any -d command..

Interesting, maybe your syslog is diverting DEBUG level to a different file.

Anyhow, I was hunting the tail overlapping issue which  might be related 
or not to db connection sharing (which is the reason for out of sync) -- 
I wanted to be sure not to have another bug around.


The out of sync issue should be solved by kamailio 3.1.5, you have to 
upgrade to it or to latest git branch 3.1.


If you want to pick the patch in your 3.1 sources, here is the link to 
the commit for this fix:


http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=97f788a3f1e4e993c99fb1225a1fbcbe4ff0ffc8

Cheers,
Daniel




On Tue, Dec 13, 2011 at 9:06 PM, Daniel-Constantin Mierla 
mailto:mico...@gmail.com>> wrote:


I cannot see any DEBUG messages, are you sure the debug=3 in your
config and you dont have other -d command line parameters?

Cheers,
Daniel


On 12/13/11 12:58 PM, MingHon wrote:

Hi,

the attachment was 2mb i remove it from approval. i did sentto ur
email too..

anyway i attached the file with 7 zip.. reduced to 60k now..

-- 
Regards,


MingHon


On Tue, Dec 13, 2011 at 7:00 PM, Daniel-Constantin Mierla
mailto:mico...@gmail.com>> wrote:

Hello,

have you sent them to me or to mailing list? On the mailing
list I could not find an attachment, also I didn't get an
email on myself only.

Cheers,
Daniel


On 12/13/11 10:39 AM, MingHon wrote:


Hello,

i attached the log/messages files please take a look...

Cheers,
MingHon


On Tue, Dec 13, 2011 at 4:58 PM, Daniel-Constantin
    Mierla mailto:mico...@gmail.com>> wrote:

Hello,


    On 12/13/11 9:24 AM, Daniel-Constantin Mierla wrote:

Hello,

are you using any private developed module or
extension? There seems to be a buffer overflow as well.

if you don't have any private extension, can you
send directly to me the entire log from start of
kamailio with following global parameters:

debug=3
memlog=4
memdbg=4

errata - the values of the global parameters were
wrong -- actually the above three lines should be:

debug=3
memlog=1
memdbg=1

Cheers,
Daniel




Cheers,
Daniel

On 12/13/11 8:51 AM, MingHon wrote:

im using version: kamailio 3.1.4 (i386/linux)
after kamctl start it return
INFO: Starting Kamailio :
INFO: started (pid: 3589)

ps aux | grep 3589
root  3609  0.0  0.0   4012   704 pts/0S+
  15:48   0:00 grep 3589

here is the log message.

Dec 13 15:43:41 hostname
/usr/local/sbin/kamailio[3589]: ERROR: db_mysql
[km_dbase.c:120]: driver error on query: Commands
out of sync; you can't run this command now
Dec 13
15:43:41 hostname /usr/local/sbin/kamailio[3589]:
ERROR:  [db_query.c:101]: error while
submitting query
Dec 13
15:43:41 hostname /usr/local/sbin/kamailio[3589]:
ERROR:  [db.c:366]: error in db_query
Dec 13
15:43:41 hostname /usr/local/sbin/kamailio[3589]:
ERROR:  [db.c:405]: querying version for
table location
Dec 13
15:43:41 hostname /usr/local/sbin/kamailio[3589]:
ERROR: usrloc [dlist.c:491]: error during table
version check.
Dec 13
15:43:41 hostname /usr/local/sbin/kamailio[3589]:
:  [mem/q_malloc.c:146]: BUG: qm_*: fragm.
0x838b11c (address 0x838b134) end overwritten(0, 0)!
Dec 13 15:43:41 hostname kamailio: ERROR: 
[daemonize.c:307]: Main process exited before
writing to pipe



On Tue, Dec 13, 2011 at 12:53 AM,
    Daniel-Constantin Mierla mailto:mico...@gmail.com>> wrote:

Hello,


On 12/12/11 4:09 PM, MingHon wrote:

btw im using kamailio 3.1


which one exactly? Just send output of
'kamailio -V'.

Also, watch the log messages with debug=3 and
get the one related to the error messages to
see which module is ex

Re: [SR-Users] problem forking to dbaliase

2011-12-13 Thread Daniel-Constantin Mierla

Hello,

On 12/13/11 2:31 PM, Yufei Tao wrote:

Hi

I'm using Kamailio 3.1.5 and want to fork calls to all members in the
same group defined in dbaliase. e.g. alias_username is 'clients' for 3
usernames: 'clientone', 'clienttwo', 'clientthree'.

If any of the 3 users are online, call to the alias_username 'clients'
looks fine: INVITE is forked to all online users etc.

But problem comes when none of the users are online: in this case,
t_relay will cause a server error 500, as server tries to relay to the
user on trunk, e.g. client...@domain.com, for which failed to find a
location entry and uri remaied client...@domain.com rather than an IP
address.

I expected server to send a 404 if non of the users for alias_username
'clients' is online. How should I fix it please?
500 is caused by doing drop to all branches, so tm creates the 
transaction, but there is no outgoing branch sent to network.


A nice solution for the future will be to add kind of 
t_reply_branch(...) which will set the reply code for the branch. 
t_reply() is working at transaction level.


Right now an option you can do is to set r-uri in branch route to 
something like 'sip:notfound@yourserverip' instead of drop and let the 
branch go out.


$ru = "sip:notfound@yourserverip";

The at the beginning of request route block you can test:

if(src_ip==yourserverip && $rU="notfound") {
 sl_send_reply("404", "not found");
 exit;
}

Cheers,
Daniel



Following is relevant parts from my config file:

#
route[LOCATION]
{
   if ( alias_db_lookup("dbaliases") )
   {
 t_on_branch("BRANCH_ALIASDB"); # in branch_route[BRANCH_ALIASDB],
# call another route that looks up
location,
# if not existent, call drop()

   }
   else
   {
 xlog("L_DBG","LOCATION: not alias - go to lookup location trunk\n");
 route(LOCATION_TRUNK); # normal look up location and sending of 404 etc
   }

... ...
}
#
branch_route[BRANCH_ALIASDB]
{
   xlog("L_DBG", "BRANCH_ALIASDB: $fU@$fd ->  $rU@$rd; Method:$rm\n");
   route(LOCATION_BRANCH);
}

route[LOCATION_BRANCH]
{
   if (!lookup("location"))
   {
 # Drop this branch - it's going nowhere
 drop();
   }
}
#
route[RELAY] {
   xlog("L_DBG","RELAY: method=$rm, callid=$ci, cseq=$cs\n");


#!ifdef WITH_NAT
   if (check_route_param("nat=yes")) {
 setbflag(FLB_NATB);
   }
   if (isflagset(FLT_NATS) || isbflagset(FLB_NATB)) {
 xlog("L_DBG", "RELAY: about to call RTPPROXY\n");
 route(RTPPROXY);
   }
#!endif

   /* example how to enable some additional event routes */
   if (is_method("INVITE")) {
 t_on_reply("REPLY_ONE");
 t_on_failure("FAIL_ONE");
   }

   if (!t_relay()) {
 sl_reply_error();
   }

   exit;
}

#
And in the main route, route LOCATION and RELAY are the last two routes:
route {
...

   # user location service
   route(LOCATION);

   route(RELAY);
}

Thanks very much!

Yufei
--
Yufei Tao
Red Embedded

This E-mail and any attachments hereto are strictly confidential and intended 
solely for the addressee. If you are not the intended addressee please notify 
the sender by return and delete the message.

You must not disclose, forward or copy this E-mail or attachments to any third 
party without the prior consent of the sender.

Red Embedded Design, Company Number 06688253 Registered in England: The 
Waterfront, Salts Mill Rd, Saltaire, BD17 7EZ

___
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://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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] syncing db_text acc table

2011-12-13 Thread Daniel-Constantin Mierla
 información personal y 
confidencial cuyo uso, reproducción o distribución no autorizados 
están legalmente prohibidos. Por lo tanto, si Vd. no fuera su 
destinatario y, erróneamente, lo hubiera recibido, le rogamos que 
informe al remitente y lo borre de inmediato.


En cumplimiento de la Ley Orgánica 15/1999, de Protección de Datos de 
Carácter Personal le informamos de que su dirección de correo 
electrónico, así como sus datos personales y de empresa pasarán a 
formar parte de nuestro fichero de Gestión, y serán tratados con la 
única finalidad de mantenimiento de la relación adquirida con usted. 
Los datos personales que existen en nuestro poder están protegidos por 
nuestra Política de Seguridad, y no serán compartidos con ninguna otra 
empresa. Usted puede ejercitar los derechos de acceso, rectificación, 
cancelación y oposición dirigiéndose por escrito a la dirección arriba 
indicada.


This e-mail and its attachments may include confidential personal 
information which may be protected by any legal rules and cannot be 
used, copied, distributed or disclosed to any person without 
authorisation. If you are not the intended recipient and have received 
this e-mail by mistake, please advise the sender and erase it.


In compliance with the Spanish Organic Act 15/1999 on Personal Data 
Protection, we hereby inform you that your email address, as well as 
your personal and business information, will be included in our 
Management files and used solely for purposes corresponding to our 
commercial relationship. All personal data in our possession is 
protected by our Data Safety Policy and thus shall not be released to 
any other third party whatsoever. You may exercise your right to 
access, rectify, cancel and contest by writing to the address provided 
above.



_______
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://linkedin.com/in/miconda -- http://twitter.com/miconda

___
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] Double Invite / Issue

2011-12-14 Thread Daniel-Constantin Mierla

Hello,

On 12/14/11 1:14 AM, Brandon Armstead wrote:

Hello,

I am running into a problem where I am experiencing duplicated 
INVITE's being originated from Kamailio proxy.


U 2011/12/13 23:58:17.543802 KAMAILIO:5060 -> PSTN:5060
INVITE sip:URI@PSTN SIP/2.0.

U 2011/12/13 23:58:17.543840 KAMAILIO:5060 -> PSTN:5060
INVITE sip:URI@PSTN SIP/2.0.

As you can see that the timestamp between the two invites is literally 
a fraction of seconds.


There is no failure condition that is causing this with append_branch

There is no retransmission timer issue that is causing this (using 
default timing):


modparam("tm", "retr_timer1", 500)
modparam("tm", "retr_timer2", 4000)

Any thoughts / ideas - as this is causing a race condition in which 
there is a 200 OK that is being sent back from upstream -- and we are 
then CANCELING the 2nd INVITE which is essentially causing on overall 
problem with the call.


Thanks for all help / thoughts / input in advance, thanks!
if there is a CANCEL for second INVITE, then it is parallel forking with 
two branches. If you can provide ngrep with the INVITEs, I can confirm 
it properly. Can you check there are not two contacts in usrloc?


Cheers,
Daniel

--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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] force_send_socket and IPv6

2011-12-14 Thread Daniel-Constantin Mierla

Hello,

is the ipv6 address in between square brackets (can you give exact usage 
of the foce_send_socket())? It should work as the bridging ipv4-ipv6 is 
using the same mechanism -- may be an issue with the exported function 
to config, though. Can you try to set $fs as alternative to 
force_send_socket()?


Cheers,
Daniel

On 12/14/11 5:19 PM, Andreas Granig wrote:

On 12/14/2011 05:16 PM, Andreas Granig wrote:

Is it possible to use force_send_socket() with an IPv6 address in
Kamailio 3.1? I get the error

ERROR: fix_actions: force_send_socket: could not resolve
X:X:X:X:X:X:X:X:5060

Actually it doesn't include the 5060, so it really says:

ERROR: fix_actions: force_send_socket: could not resolve X:X:X:X:X:X:X:X

Sorry if that caused a confusion, my mistake when copy/pasting it.

Andreas


___
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://linkedin.com/in/miconda -- http://twitter.com/miconda

___
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] force_send_socket and IPv6

2011-12-15 Thread Daniel-Constantin Mierla

Hello,

On 12/14/11 6:28 PM, Andreas Granig wrote:

Hey Daniel,

On 12/14/2011 06:00 PM, Daniel-Constantin Mierla wrote:

is the ipv6 address in between square brackets (can you give exact usage
of the foce_send_socket())? It should work as the bridging ipv4-ipv6 is
using the same mechanism -- may be an issue with the exported function
to config, though. Can you try to set $fs as alternative to
force_send_socket()?

I tried both ways, like force_send_socket(x::x:5060); and
force_send_socket([x::x]:5060); - both resulting in the same error.

However, doing $fs="[x::x]:5060"; works perfectly fine, thanks for the hint!

ok.


A fix for force_send_socket would maybe still be good to not confuse people.

I will look over it soon.

Cheers,
Daniel



Thanks,
Andreas


___
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://linkedin.com/in/miconda -- http://twitter.com/miconda

___
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] force_send_socket and IPv6

2011-12-15 Thread Daniel-Constantin Mierla

Hello,

On 12/14/11 7:12 PM, Andreas Granig wrote:

Hey,

One more thing related to outbound routing. Maybe this question is
stupid, but I still have to learn a lot regarding IPv6 :)

So my Jitsi registered fine, the contact in location table looks like this:

contact:
sip:testuser1@[x::x]:5060;transport=udp;registering_acc=192_168_51_133

When I call this AoR (from an IPv4 subscriber, but that shouldn't
matter), it's being loaded into R-URI, I select my IPv6 socket using
$fs, then do the relay. However, I get this error in my logs (first line
is my log message before t_relay):

INFO:

Re: [SR-Users] Bug: Dialog State=*Teminated* even when the call is active

2011-12-15 Thread Daniel-Constantin Mierla

Hello,


On 12/15/11 1:32 AM, Gnaneshwar Gatla wrote:


Hello,

I have come across this behavior in Kamailio 3.1.5 version.

The proxy is behind a Firewall and uses the advertised IP to 
communicate to sipclients.


I have used the "dlg_match_mode", as the record_route_preset() does 
not include the DID during call initiation.


modparam("dialog", "dlg_match_mode", 2)

I'm also using pua_dialoginfo to notify users about the 
"Event:dialog". I have used the attached patch to make pua_dialog info 
aware of the dialog


I see that the dialog is being created, and the pua_dialoginfo 
publishes with state "trying" and "confirmed".


When the call is cancelled/408 request is generated, the 
pua_dialoginfo generates the xml with state=terminated.


But when the call is answered, the dialog module updates the dialog to 
state=4, according to the documentation mentioned below state=4 --> 
Terminated.


in which documentation says state=4 is terminated? The one for the new 
dialog design? If yes, that is not yet implemented. In current dialog 
module, the state=4 is CONFIRMED.


I checked the logs and the bye is processed by the dialog module, but 
there is no callback to pua_dialoginfo executed. You mention above about 
a patch to pua_dialogninfo, but it is not attached, only test.zip which 
has the debug logs. Can you send the patch or be sure it does not break 
registering the callbacks for pua_dialoginfo?


Cheers,
Daniel

I'm not aware of the event types that fires the state to termination 
(I have not found the documentation about events in the dialog module).


When a BYE is received to the same call, the BYE is processed and the 
dialog is cleared from the memory. But the pua_dialoginfo never gets 
the callback for the  termination and the xml is never updated.


I have attached a log for a call, please find the attached document.

I have come across a documentation about dialog module:

http://www.kamailio.org/dokuwiki/doku.php/modules-new-design:dialog-module-design

Regards

Gnaneshwar



___
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://linkedin.com/in/miconda -- http://twitter.com/miconda

___
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] How to enable rtp repacketization

2011-12-15 Thread Daniel-Constantin Mierla

Hello,

On 12/14/11 11:52 AM, Arif Tuhin wrote:
I want to enable the rtp repacketization feature of the rtpproxy. I 
have set force_rtp_proxy("z150"). But the repacketization is not 
happening. in the log it does show that rtp will be repacketizes but 
when i see the wireshark capture, its the same.
I havent used this feature so far, thus I cannot help, but if nobody 
else here can help with this issue, maybe it is better to ask on 
rtpproxy mainling list:

http://lists.rtpproxy.org/mailman/listinfo/users

Cheers,
Daniel



With Best Regards
Ariful Hossain Tuhin
email: 1. etothepowe...@gmail.com <mailto:etothepowe...@gmail.com> 2. 
etothepowe...@hotmail.com <mailto:etothepowe...@hotmail.com> 
3.etothepowe...@yahoo.com <mailto:3.etothepowe...@yahoo.com>

skype: freeburn1986


___
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://linkedin.com/in/miconda -- http://twitter.com/miconda

___
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] force_send_socket and IPv6

2011-12-15 Thread Daniel-Constantin Mierla

Hello,

On 12/15/11 11:26 AM, Andreas Granig wrote:


On 12/15/2011 11:10 AM, Andreas Granig wrote:

On 12/15/2011 10:19 AM, Daniel-Constantin Mierla wrote:

ERROR: tm [ut.h:295]: ERROR: uri2dst: failed to resolve "[x::x]"
:unresolvable A or  request (-7)

Is there something I haven't considered yet? Why would it try a DNS
lookup for this R-URI?

is it failing over all or is the request forwarded?

It's failing overall with "478 Unresolvable destination (478/TM)".

Actually I get two messages back from the outbound load-balancer
towards the proxy for the same INVITE, one right after the other:

U 127.0.0.1:5060 ->  127.0.0.1:5080
SIP/2.0 500 I'm terribly sorry, server error occurred (1/SL).

U 127.0.0.1:5060 ->  127.0.0.1:5080
SIP/2.0 478 Unresolvable destination (478/TM).

The scenario is this:

[v4user]-(ipv4)->[lb]-(ipv4)->[proxy]-(ipv4)->[lb]-(ipv6)->[v6user]

The problem appears on the last lb hop, so it never sends anything over
IPv6 to the v6user, but passes back the two errors from above to the
proxy. I'm trying to dig deeper later today.
trying to figure out the modules involved -- does the INVITE arrive with 
double Route headers on second [lb] or is the [lb] selecting an ipv6 
destination?


Cheers,
Daniel

--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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] How to get dispatcher list with sercmd command

2011-12-15 Thread Daniel-Constantin Mierla

Hello,

On 12/15/11 2:50 PM, Timo Klecker wrote:


Hi Mino

Try

Sercmd dispatcher list

Without the dot. This works with kamctl, haven't used sercmd.

in sercmd should be dispatcher.list with dot, but the command is 
available starting with v3.2.0. What is your kamailio version?


Cheers,
Daniel


Greetings

Timo

*Von:*sr-users-boun...@lists.sip-router.org 
[mailto:sr-users-boun...@lists.sip-router.org] *Im Auftrag von *Mino Haluz

*Gesendet:* Donnerstag, 15. Dezember 2011 14:31
*An:* SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - 
Users Mailing List

*Betreff:* [SR-Users] How to get dispatcher list with sercmd command

Hi,

# sercmd dispatcher.list
error: 500 - command dispatcher.list not found

The module is loaded, dispatcher.list file exists. Am I doing 
something wrong ? Thanks.


Mino.



___
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://linkedin.com/in/miconda -- http://twitter.com/miconda

___
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] force_send_socket and IPv6

2011-12-15 Thread Daniel-Constantin Mierla

Hello,

On 12/15/11 1:18 PM, marius zbihlei wrote:

On 12/14/2011 07:28 PM, Andreas Granig wrote:

Hey Daniel,

On 12/14/2011 06:00 PM, Daniel-Constantin Mierla wrote:
is the ipv6 address in between square brackets (can you give exact 
usage

of the foce_send_socket())? It should work as the bridging ipv4-ipv6 is
using the same mechanism -- may be an issue with the exported function
to config, though. Can you try to set $fs as alternative to
force_send_socket()?

I tried both ways, like force_send_socket(x::x:5060); and
force_send_socket([x::x]:5060); - both resulting in the same error.

However, doing $fs="[x::x]:5060"; works perfectly fine, thanks for 
the hint!


A fix for force_send_socket would maybe still be good to not confuse 
people.


Thanks,
Andreas



Hello,

Actually, looking at the code I've observed some weird behavior :  for 
example to fix the force_send_socket IPv6 address, a call to str2ip6() 
(from resolve.h) is done (via resolvehost()). The function tries to 
manually parse the IP address, so it makes me wonder why not use a 
library function like inet_pton(AF_INET6... to get the correct structure.


A possible bug is that with the current code, IPv4 mapped to IPv6 
(x:x:x:x:x:x:d.d.d.d) will not be parsed correctly.


Why don't we use inet_pton(AF_INET6 ... . Any reasons?


have you checked if inet_pton() doesn't break the internal ip_addr 
structure and the use of it? If all is ok, I guess inet_pton() is 
portable enough through most unix/linux distro's to make use of it.


Cheers,
Daniel

--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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] How to get dispatcher list with sercmd command

2011-12-15 Thread Daniel-Constantin Mierla



On 12/15/11 3:45 PM, Mino Haluz wrote:

kamctl dispatcher dump

did the thing.

that is using fifo file and MI command.

sercmd is doing the RPC command. Can you give the output of:

sercmd system.listMethods

Cheers,
Daniel



kamailio 3.2.0.

On Thu, Dec 15, 2011 at 3:38 PM, Daniel-Constantin Mierla 
mailto:mico...@gmail.com>> wrote:


Hello,


On 12/15/11 2:50 PM, Timo Klecker wrote:


Hi Mino

Try

Sercmd dispatcher list

Without the dot. This works with kamctl, haven’t used sercmd.


in sercmd should be dispatcher.list with dot, but the command is
available starting with v3.2.0. What is your kamailio version?

Cheers,
Daniel


Greetings

Timo

*Von:*sr-users-boun...@lists.sip-router.org
<mailto:sr-users-boun...@lists.sip-router.org>
[mailto:sr-users-boun...@lists.sip-router.org] *Im Auftrag von
*Mino Haluz
*Gesendet:* Donnerstag, 15. Dezember 2011 14:31
*An:* SIP Router - Kamailio (OpenSER) and SIP Express Router
(SER) - Users Mailing List
*Betreff:* [SR-Users] How to get dispatcher list with sercmd command

Hi,

# sercmd dispatcher.list
error: 500 - command dispatcher.list not found

The module is loaded, dispatcher.list file exists. Am I doing
something wrong ? Thanks.

Mino.



___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org  <mailto: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://linkedin.com/in/miconda  -- http://twitter.com/miconda




--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda

___
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] Sending SIP request from mi_fifo using TMX module

2011-12-16 Thread Daniel-Constantin Mierla

Hello,

the headers have to be terminated in \r\n. In a shell script for click 
to dial, here is the used form:


cat > $FIFO <"`printf "${FIXED_DLG}To: <$URI>\r\nCSeq: $CSEQ INVITE\r\nContent-Type: 
application/sdp\r\n"`

"
"`printf "v=0\r\no=click-to-dial 0 0 IN IP4 0.0.0.0\r\ns=session\r\nc=IN 
IP4 0.0.0.0\r\nb=CT:1000\r\nt=0 0\r\nm=audio 9 RTP/AVP 8 0\r\na=rtpmap:8 
PCMA/8000\r\na=rtpmap:0 PCMU/8000\r\n"`

"

EOF

Cheers,
Daniel


On 12/16/11 10:02 AM, Sammy Govind wrote:

Hello list,

I'm using Kamailio 3.2 and am trying to send a SIP request from fifo 
to kamailio using below format.


#kamctl fifo t_uac_dlg MESSAGE sip:103@ mydomain.org 
<http://mydomain.org>  . . "From: 1...@mydomain.org 
<mailto:1...@mydomain.org> To: 1...@mydomain.org 
<mailto:1...@mydomain.org> Contact: mydomain.org <http://mydomain.org> 
Content-Type: text/plain; charset=UTF-8" "INVITE"


But I see this reply from Kamctl

*database engine 'MYSQL' loaded*
*Control engine 'FIFO' loaded*
*entering fifo_cmd t_uac_dlg INVITE sip:103@ mydomain.org 
<http://mydomain.org>  . . From: 101@ mydomain.org 
<http://mydomain.org>  To: 103@ mydomain.org 
<http://mydomain.org>  Contact: mydomain.org 
<http://mydomain.org>  Content-Type: text/plain; charset=UTF-8 INVITE*

*400 Bad headers*
*FIFO command was:*
*:t_uac_dlg:openser_receiver_25561*
*INVITE*
*sip:1...@mydomain.org <mailto:sip%3a...@mydomain.org>*
*.*
*.*
*From: 101@ mydomain.org <http://mydomain.org>  To: 103@ mydomain.org 
<http://mydomain.org>  Contact: mydomain.org 
<http://mydomain.org>  Content-Type: text/plain; charset=UTF-8*

*INVITE*



And in log file I see this output:

Dec 16 00:57:46 Kamailio3 /usr/local/sbin/kamailio[24541]: ERROR: 
 [parser/msg_parser.c:275]: ERROR: get_hdr_field: bad body for 
mailto:1...@mydomain.org>  To: 103@ 
mydomain.org <http://mydomain.org>  Contact: mydomain.org 
<http://mydomain.org>  Content-Type: text/plain; 
charset=UTF-8INVITE#012>(4)
Dec 16 00:57:46 Kamailio3 /usr/local/sbin/kamailio[24541]: INFO: 
 [parser/msg_parser.c:353]: ERROR: bad header field [From: 
101@mydomain.o]



Can anyone help..


Regards,
Sammy




_______
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://linkedin.com/in/miconda -- http://twitter.com/miconda

___
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] How to get dispatcher list with sercmd command

2011-12-16 Thread Daniel-Constantin Mierla

Hello,

On 12/15/11 4:17 PM, Mino Haluz wrote:

Only this worked:

sercmd -s unixs:/tmp/kamailio_ctl system.listMethods
for 3.2.0, sercmd used a different default control socket, so the one 
used by kamailio has to be given as parameter. in 3.2.1 that is fixed.


So, now if you do:

sercmd -s unixs:/tmp/kamailio_ctl dispatcher.list

it should work.

Cheers,
Daniel



core.arg
core.echo
core.flags
core.info <http://core.info>
core.kill
core.printi
core.prints
core.ps <http://core.ps>
core.psx
core.pwd
core.sctp_info
core.sctp_options
core.shmmem
core.tcp_info
core.tcp_options
core.udp4_raw_info
core.uptime
core.version
ctl.connections
ctl.listen
ctl.who
dispatcher.list
dispatcher.reload
dispatcher.set_state
dns.add_a
dns.add_
dns.add_srv
dns.debug
dns.debug_all
dns.delete_a
dns.delete_
dns.delete_all
dns.delete_all_force
dns.delete_cname
dns.delete_ebl
dns.delete_naptr
dns.delete_ptr
dns.delete_srv
dns.delete_txt
dns.lookup
dns.mem_info
dns.view
dst_blacklist.add
dst_blacklist.debug
dst_blacklist.delete_all
dst_blacklist.mem_info
dst_blacklist.view
mi
mi_dg
mi_fifo
mi_xmlrpc
pkg.stats
sl.stats
system.listMethods
system.methodHelp
system.methodSignature
tm.cancel
tm.hash_stats
tm.reply
tm.stats
tm.t_uac_start
tm.t_uac_wait



On Thu, Dec 15, 2011 at 4:14 PM, Mino Haluz <mailto:mino.ha...@gmail.com>> wrote:


Do I have to load some specific module ?

ERROR: connect_unix_sock: connect(/tmp/sercmd_ctl): No such file
or directory [2]



On Thu, Dec 15, 2011 at 3:55 PM, Daniel-Constantin Mierla
mailto:mico...@gmail.com>> wrote:



On 12/15/11 3:45 PM, Mino Haluz wrote:

kamctl dispatcher dump

did the thing.

that is using fifo file and MI command.

sercmd is doing the RPC command. Can you give the output of:

sercmd system.listMethods

Cheers,
Daniel




kamailio 3.2.0.

On Thu, Dec 15, 2011 at 3:38 PM, Daniel-Constantin Mierla
mailto:mico...@gmail.com>> wrote:

Hello,


On 12/15/11 2:50 PM, Timo Klecker wrote:


Hi Mino

Try

Sercmd dispatcher list

Without the dot. This works with kamctl, haven't used
sercmd.


in sercmd should be dispatcher.list with dot, but the
command is available starting with v3.2.0. What is your
kamailio version?

Cheers,
Daniel


Greetings

Timo

*Von:*sr-users-boun...@lists.sip-router.org
<mailto:sr-users-boun...@lists.sip-router.org>
[mailto:sr-users-boun...@lists.sip-router.org] *Im
Auftrag von *Mino Haluz
*Gesendet:* Donnerstag, 15. Dezember 2011 14:31
*An:* SIP Router - Kamailio (OpenSER) and SIP Express
Router (SER) - Users Mailing List
*Betreff:* [SR-Users] How to get dispatcher list with
sercmd command

Hi,

# sercmd dispatcher.list
error: 500 - command dispatcher.list not found

The module is loaded, dispatcher.list file exists. Am I
doing something wrong ? Thanks.

Mino.



___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing 
list
sr-users@lists.sip-router.org  
<mailto: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://linkedin.com/in/miconda  -- http://twitter.com/miconda




-- 
Daniel-Constantin Mierla --http://www.asipto.com

http://linkedin.com/in/miconda  -- http://twitter.com/miconda





___
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://linkedin.com/in/miconda -- http://twitter.com/miconda

___
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] source port used for forwarded requests

2011-12-16 Thread Daniel-Constantin Mierla



On 12/16/11 5:17 AM, Alex Balashov wrote:

Maybe, if I understand you correctly, the 'advertised_address' and/or 
'advertised_port' settings are the thing for you?
No, these parameters are not used for selection of socket, not even for 
routing. They are the values to be used to build Via headers, instead of 
using the values from sending socket.


mhomed helps also in selection of the right outgoing socket, when the 
route to destination is possible only from specific sockets.


Cheers,
Daniel



--
This message was painstakingly thumbed out on my mobile, so apologies for 
brevity, errors, and general sloppiness.

Alex Balashov - Principal
Evariste Systems LLC
260 Peachtree Street NW
Suite 2200
Atlanta, GA 30303
Tel: +1-678-954-0670
Fax: +1-404-961-1892
Web: http://www.evaristesys.com/

On Dec 15, 2011, at 9:42 PM, Ben WIlliams  wrote:


On Fri, Dec 16, 2011 at 12:26 PM, Alex Balashov
  wrote:

On 12/15/2011 06:25 PM, Ben WIlliams wrote:


Hi,
My Kamailio server listens on multiple IPs - say IP1, IP2. If a
request arrives on one IP, Kamailio uses the same IP as the source
address when forwarding, which is good. But is there any way a UA
could generate a request to IP1 that gets forwarded by Kamailio with
source address IP2 ? The reason I ask is because Asterisk is setup to
trust all calls arriving from IP2 but not IP1.


Yes, this is the function of force_send_socket() and/or $fs.

Thanks Alex. I didn't actually want to change the socket in my
kamailio script. Just checking that there is no way the SIP message
itself can specify which source IP is used when forwarding.

Ben

___
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


--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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] Sending SIP request from mi_fifo using TMX module

2011-12-16 Thread Daniel-Constantin Mierla

Hello,

if you look to do something like click to dial (ringing user A first, 
when answering, then refer it to user B (or media server)), then maybe 
you just use dialog module with dlg_bridge command:


http://kamailio.org/docs/modules/stable/modules_k/dialog.html#id2554844

Cheers,
Daniel

On 12/16/11 1:35 PM, Sammy Govind wrote:

Hi,
Thanks alot, I found the same stuff inside the 
*kamailio-3.2/kamailio/examples/kamailio* folder and now trying to 
implement some changes. Do you think It'll be difficult to originate 
call using this script and then later once call is Answered bridge it 
to a Media-Server to do its part !?


Thanks alot,
Regard,
Sammy.


On Fri, Dec 16, 2011 at 4:42 PM, Daniel-Constantin Mierla 
mailto:mico...@gmail.com>> wrote:


Hello,

the headers have to be terminated in \r\n. In a shell script for
click to dial, here is the used form:

cat > $FIFO <\r\nCSeq: $CSEQ
INVITE\r\nContent-Type: application/sdp\r\n"`
"
"`printf "v=0\r\no=click-to-dial 0 0 IN IP4
0.0.0.0\r\ns=session\r\nc=IN IP4 0.0.0.0\r\nb=CT:1000\r\nt=0
0\r\nm=audio 9 RTP/AVP 8 0\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:0
PCMU/8000\r\n"`
"

EOF

Cheers,
Daniel



On 12/16/11 10:02 AM, Sammy Govind wrote:

Hello list,

I'm using Kamailio 3.2 and am trying to send a SIP request from
fifo to kamailio using below format.

#kamctl fifo t_uac_dlg MESSAGE sip:103@ mydomain.org
<http://mydomain.org>  . . "From: 1...@mydomain.org
<mailto:1...@mydomain.org> To: 1...@mydomain.org
<mailto:1...@mydomain.org> Contact: mydomain.org
<http://mydomain.org> Content-Type: text/plain; charset=UTF-8"
"INVITE"

But I see this reply from Kamctl

*database engine 'MYSQL' loaded*
*Control engine 'FIFO' loaded*
*entering fifo_cmd t_uac_dlg INVITE sip:103@ mydomain.org
<http://mydomain.org>  . . From: 101@ mydomain.org
<http://mydomain.org>  To: 103@ mydomain.org
<http://mydomain.org>  Contact: mydomain.org
<http://mydomain.org>  Content-Type: text/plain; charset=UTF-8
INVITE*
*400 Bad headers*
*FIFO command was:*
*:t_uac_dlg:openser_receiver_25561*
*INVITE*
*sip:1...@mydomain.org <mailto:sip%3a...@mydomain.org>*
*.*
*.*
*From: 101@ mydomain.org <http://mydomain.org>  To: 103@
mydomain.org <http://mydomain.org>  Contact: mydomain.org
<http://mydomain.org>  Content-Type: text/plain; charset=UTF-8*
*INVITE*



And in log file I see this output:

Dec 16 00:57:46 Kamailio3 /usr/local/sbin/kamailio[24541]: ERROR:
 [parser/msg_parser.c:275]: ERROR: get_hdr_field: bad body
for mailto:1...@mydomain.org>  To: 103@
mydomain.org <http://mydomain.org>  Contact: mydomain.org
<http://mydomain.org>  Content-Type: text/plain;
charset=UTF-8INVITE#012>(4)
Dec 16 00:57:46 Kamailio3 /usr/local/sbin/kamailio[24541]: INFO:
 [parser/msg_parser.c:353]: ERROR: bad header field [From:
101@mydomain.o <mailto:101@mydomain.o>]


Can anyone help..


Regards,
Sammy




___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org  <mailto: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://linkedin.com/in/miconda  -- http://twitter.com/miconda




___________
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://linkedin.com/in/miconda -- http://twitter.com/miconda

___
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] using xhttp_rpc to send MESSAGE to SIP user from web server

2011-12-19 Thread Daniel-Constantin Mierla

Hello,

On 12/17/11 6:08 PM, Ovidiu Sas wrote:

It is rather difficult to properly craft SIP messages in a single line
(to properly pass all parameters).
Therefore, the xhttp_rpc module does not support this kind of functionality.
Asynchronous commands are not implemented by the xhttp_rpc module:
http://kamailio.org/docs/modules/devel/modules/xhttp_rpc.html#id2521422

It is better to use the xmlrpc module for this kind of functionality.
http://kamailio.org/docs/modules/stable/modules/xmlrpc.html
just to add a bit and make clear that xmlrpc module is different that 
mi_xmlrpc. Practically xmlrpc uses internally the same mechanism as 
xhttp, so no dependencies on http libs. You need libxml2, but since you 
deal with presence, you should have it.


Cheers,
Daniel

--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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 does not send pings

2011-12-19 Thread Daniel-Constantin Mierla

Hello,

is this at least version 3.2.1 (or the latest branch 3.2)?

What do you get with: kamctl fifo ds_list?

Cheers,
Daniel

On 12/19/11 12:49 PM, Mino Haluz wrote:

Hi,

please, could someone specify the conditions when the dispatcher 
module sends the INFO pings to the gateways ?


modparam("dispatcher", "flags", 2)
modparam("dispatcher", "dstid_avp", "$avp(s:test)")
modparam("dispatcher", "dst_avp", "$avp(AVP_DST)")
modparam("dispatcher", "grp_avp", "$avp(AVP_GRP)")
modparam("dispatcher", "cnt_avp", "$avp(AVP_CNT)")
modparam("dispatcher", "ds_ping_interval", 30)
modparam("dispatcher", "ds_probing_mode", 1)
modparam("dispatcher", "ds_ping_method", "INFO")
modparam("dispatcher", "ds_ping_from", "sip:001122@test")

And my dispatcher.list is:

1 sip:IP1:5060
1 sip:IP2:5060

Am I missing something? I dumped all the communication and the 
kamailio(dispatcher) does not send anything..


Thanks,
Mino


___
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://linkedin.com/in/miconda -- http://twitter.com/miconda

___
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] using xhttp_rpc to send MESSAGE to SIP user from web server

2011-12-19 Thread Daniel-Constantin Mierla

Hello,

On 12/19/11 1:39 PM, Krishna Kurapati wrote:

Daniel,

Thanks for the clarification. Since mi_xmlrpc is equivalent to 
mi_fifo, I could use this module

to send MESSAGE and INVITE from a remote server.
mi_xmlrpc depends on specific versions of libxmlrpc client, on some 
distros it cannot be found. Also, it has some weaks in security (you 
have to use the firewall, there is no interaction from config file).


You can run any mi command via rpc interface (e.g., sercmd or xmlrpc) if 
you load the mi_rpc modulem then use mi* RPC command:


http://www.kamailio.org/docs/docbooks/3.2.x/rpc_list/rpc_list.html#rpc_exports.mi_rpc

For example, running same mi command as done by 'kamctl fifo ds_list' is 
via sercmd: 'sercmd mi ds_list'.


For instant messaging, you can use directly the rpc command 
tm.t_uac_start or tm.t_uac_wait. If you connect using sercmd, you can 
use 'help cmd' to read a bit about each rpc command.


Cheers,
Daniel



Krish Kura

On Mon, Dec 19, 2011 at 6:27 AM, Daniel-Constantin Mierla 
mailto:mico...@gmail.com>> wrote:


Hello,

On 12/17/11 6:08 PM, Ovidiu Sas wrote:

It is rather difficult to properly craft SIP messages in a
single line
(to properly pass all parameters).
Therefore, the xhttp_rpc module does not support this kind of
functionality.
Asynchronous commands are not implemented by the xhttp_rpc module:
http://kamailio.org/docs/modules/devel/modules/xhttp_rpc.html#id2521422

It is better to use the xmlrpc module for this kind of
functionality.
http://kamailio.org/docs/modules/stable/modules/xmlrpc.html

just to add a bit and make clear that xmlrpc module is different
that mi_xmlrpc. Practically xmlrpc uses internally the same
mechanism as xhttp, so no dependencies on http libs. You need
libxml2, but since you deal with presence, you should have it.

Cheers,
Daniel

-- 
Daniel-Constantin Mierla -- http://www.asipto.com

http://linkedin.com/in/miconda -- http://twitter.com/miconda




___
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://linkedin.com/in/miconda -- http://twitter.com/miconda

___
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 does not send pings

2011-12-19 Thread Daniel-Constantin Mierla

Hello,

On 12/19/11 1:35 PM, Mino Haluz wrote:

This is in the log file:
ERROR: dispatcher [dispatcher.c:640]: failover functions used, but 
AVPs paraamters required are NULL -- feature disabled


it is not related to ping options. You have to upgrade first to 3.2.1 to 
get the ping functionality as written in the readme. 3.2.0 uses old 
states where there were overlapping cases and you have to set probing 
mode to the gateways to be pinged.


Cheers,
Daniel



and the output of kamctl fifo ds_list:
SET_NO:: 1
SET:: 1
URI:: sip:IP1:5060 flags=AX priority=0 attrs=
URI:: sip:IP2:5060 flags=AX priority=0 attrs=

version: kamailio 3.2.0 (i386/linux)

On Mon, Dec 19, 2011 at 1:29 PM, Daniel-Constantin Mierla 
mailto:mico...@gmail.com>> wrote:


Hello,

is this at least version 3.2.1 (or the latest branch 3.2)?

What do you get with: kamctl fifo ds_list?

Cheers,
Daniel


On 12/19/11 12:49 PM, Mino Haluz wrote:

Hi,

please, could someone specify the conditions when the dispatcher
module sends the INFO pings to the gateways ?

modparam("dispatcher", "flags", 2)
modparam("dispatcher", "dstid_avp", "$avp(s:test)")
modparam("dispatcher", "dst_avp", "$avp(AVP_DST)")
modparam("dispatcher", "grp_avp", "$avp(AVP_GRP)")
modparam("dispatcher", "cnt_avp", "$avp(AVP_CNT)")
modparam("dispatcher", "ds_ping_interval", 30)
modparam("dispatcher", "ds_probing_mode", 1)
modparam("dispatcher", "ds_ping_method", "INFO")
modparam("dispatcher", "ds_ping_from", "sip:001122@test")

And my dispatcher.list is:

1 sip:IP1:5060
1 sip:IP2:5060

Am I missing something? I dumped all the communication and the
kamailio(dispatcher) does not send anything..

Thanks,
Mino


___
    SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org  <mailto: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://linkedin.com/in/miconda  -- http://twitter.com/miconda




___
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://linkedin.com/in/miconda -- http://twitter.com/miconda

___
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] Suggestions for time utils

2011-12-19 Thread Daniel-Constantin Mierla

Hello,

On 12/19/11 1:58 PM, Andreas Granig wrote:

Hi,

I'd like to implement a couple of helper functions for time handling,
e.g. checking day of week, day of month etc. from within the kamailio
config file. What would you prefer, a new module ("timeutils" maybe?) or
adding it to cfgutils (there are already time-based functions there like
sleep and usleep)?

The idea is to implement time based call-forwards, and an approach could
be to provision various time-related values in usr_preferences table,
and then check it in the config. For example, when doing call-forwards
from Monday to Friday only, I could put this into usr_preferences:

attribute: cf_weekday
value: [1, 2, 3, 4, 5] (each entry is a separate row in usr_preferences)

And in kamailio config, I'd call this:

avp_db_load(...);
if(is_weekday("$avp(s:cf_weekday)")) { do CF }

So is_weekday would iterate over the entries in the avp list and return
true if the weekday at the time of routing matches an entry in the list.
A module config param could control whether to use gmtime or localtime
for matching.

Does this make sense? Suggestions for other approaches? I'd rather
prefer to do it directly in config instead of using some external
interpreter like lua, python etc.
I don't know what are all the functions you think of, but for the 
example provided above, config file does it easy right now. There is a 
pseudo-variable that gives broken-time attribute that can be used with 
avp_check(), iirc, should be:


avp_db_load(...);
if(avp_check("$time(wday)", "eq/$avp(s:cf_weekday)/g")) { do CF }

Of course there is the option of doing while loop, but maybe gets to large for 
desired config file.

For me does not matter if it is new module or not, it is up to developer 
convenience. The only thing here I would comment a bit about, is the 
plan to apply on avp lists always? The maybe its better in avpops (if 
you want to do it in an old module), also use avp somehow in the name, 
e.g., is_avp_weekday().


Cheers,
Daniel

--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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] Suggestions for time utils

2011-12-19 Thread Daniel-Constantin Mierla

Hello,

On 12/19/11 7:50 PM, Andreas Granig wrote:

Hi Daniel,

On 12/19/2011 07:29 PM, Daniel-Constantin Mierla wrote:

I don't know what are all the functions you think of, but for the
example provided above, config file does it easy right now. There is a
pseudo-variable that gives broken-time attribute that can be used with
avp_check(), iirc, should be:

avp_db_load(...);
if(avp_check("$time(wday)", "eq/$avp(s:cf_weekday)/g")) { do CF }

Of course there is the option of doing while loop, but maybe gets to
large for desired config file.

This is pretty much what I had in mind with my new functions/module, but
I've completely overlooked that PV when searching the docs for this
feature. Thank you very much for pointing that out!
for sake of public knowledge, just to add on time specific features: 
there is also $timef(format) which returns current time attributes based 
on strftime specifiers -- its documentation was missing, I just added 
it. Also, there is a transformation {s.ftime,format) which can take any 
integer variable holding timestamp and return value based on strftime 
format.


Cheers,
Daniel

--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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 module with call load balancing

2011-12-20 Thread Daniel-Constantin Mierla

Hello,

On 12/15/11 12:06 PM, Mino Haluz wrote:

Hi,

I would like to use the dispatcher module with algorithm 10 - call 
load balancing. But there are multiple things that are a bit unclear 
to me. I have multiple gateways that can serve different maximum 
number of calls.


1) Can I somehow set the maximum calls count for each dispatcher 
gateway, so that it can fairly distribute the calls? I know it is 
stateless module, but how could I solve this?
it is not stateless module - dispatcher has nothing to do with the 
states, it just selects the destinations. Then, if you relay with tm you 
make the routing transaction stateful and if you forward() then it is 
stateless routing.


The algorithm does selection of the least loaded destination. There is 
another algorithm for weight based distribution (iirc 9), might suit 
better your need.
2) Is there any method how can I get the current number of calls for 
each gateway from the dispatcher module?


Not yet.

3) What is the expiration timer in the dispatcher module for dialogs 
if the dialog is canceled uncleanly ?


http://kamailio.org/docs/modules/stable/modules_k/dispatcher.html#id2498263

4) Imagine I will restart kamailio, it will lose the call count and 
the distribution will be incorrect. Maybe it could nice, that kamailio 
would offer MI command to set these values.
Some enhancements can be done, of course, it is a matter of time and 
interest for developers, the fastest way to get something is to 
contribute, it is open source greatest benefit.


Personally I haven;t invested much in enhancing this algorithm lately 
because it does not bring relevant benefits comparing with round robin. 
The actual load on a server is not a matter only of the number of active 
calls, but also the content of the media stream and its processing 
(e.g., 10 calls on hold consume less resources than 3 active and verbose 
conversations). The most of the calls are in the average duration of a 
business type, thus simple round-robin is keeping pretty fair load 
balancing of the active calls -- from experience, with round-robin none 
of the destinations got more than 10% load than the average.


Regarding the restart, yes, there can be coding to make it more 
accurate, but if it is call load balancing, practically a restart cannot 
get a destination to have more than 1 call than it should have, which I 
think it is not something critical.


But again, any contributions in this regard will be considered and 
accepted when they bring benefits.


Cheers,
Daniel

--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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] Database connections

2011-12-20 Thread Daniel-Constantin Mierla

Hello,

On 12/20/11 12:52 PM, Mariana Arduini wrote:

Hello all,

I'm running some performance tests and need to know how does the 
database connections work. Are they open when we start OpenSER and are 
kept open for each process or they just open before a query and closed 
afterwards? Does anyone know where I can find such info?
most of them are open at startup and kept alive for runtime duration, 
being closed at shutdown. There is a connection pool per process, so 
there is only one connection to a database from the same process.


In vary rare occasions, when Kamailio is not processing SIP traffic but 
MI/RPC commands, it may happen to have the connection open, query done 
and then connection closed.


If you want to learn more about DB API, then look at devel guide:

http://www.asipto.com/pub/kamailio-devel-guide/#c09database

and sources in lib/srdb1 (the one mainly used in kamailio (thus former 
openser) modules).


Cheers,
Daniel

--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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] TLS performance testing

2011-12-20 Thread Daniel-Constantin Mierla

Hello,

On 12/20/11 10:27 PM, Kristian Kielhofner wrote:

Hello everyone,

   I'm doing some TLS performance testing on Kamailio 3.2.1.  Here's my setup:

kamailio -V
version: kamailio 3.2.1 (x86_64/linux) 31c991
flags: STATS: Off, USE_IPV6, USE_TCP, USE_TLS, TLS_HOOKS,
USE_RAW_SOCKS, USE_STUN, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK,
SHM_MEM, SHM_MMAP, PKG_MALLOC, DBG_QM_MALLOC, USE_FUTEX,
FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR,
USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16,
MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 4MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: 31c991
compiled on 19:38:03 Dec 20 2011 with gcc 4.4.6

uname -a
Linux null.null.com 2.6.32-220.el6.x86_64 #1 SMP Tue Dec 6 19:48:22
GMT 2011 x86_64 x86_64 x86_64 GNU/Linux

CentOS 6.2 on a Dell PowerEdge R610 with 24 Intel X5650 Cores at
2.67GHz and 12GB of RAM (I could use more).

   Kamailio is the default config with a few changes:

- WITH_TLS defined
- TLS is using self-generated CAs/certs (essentially openvpn easy-rsa)
with 1024 bit key size
- TLS is *not* configured to verify client OR server certs by default
- I'm using TLS v1 (SSL 3.1)
- TLS cipher suites are set to any (although my simulated UAs only
offer AES 256+SHA)
- Various changes to Kamailio children (up to 256 at times) and memory
sizes (up to 2048mb and even 4096mb at times)
- One DNS based alias added
- Maximum TCP connections increased to 65000
- Kamailio is configured to only listen on tested IP (UDP, TCP, TLS
sockets active)
- Syslog has been configured to log local0 (Kamailio) asynchronously

   My test rig/call generator is an Ixia Xcellon-Ultra NP load module
with IXLoad.  My call scenario does the following:

- Registers two simulated user agents (10, 20) to Kamailio with TLS
- Places call from 10 to 20 via Kamailio with TLS
- Increments both user agents by 1 and continues as quickly (cps) as I
like up to a channel limit (also configurable)
- The Ixia generates a valid SDP but no RTP is generated (although
that's certainly possible at these call levels)

   Two 1 gig ports on the Ixia are connected to the Broadcom NICs on
the Dell R610 via a Cisco Catalyst 4948 switch.  One port on the Ixia
emulates the 10 agents (A leg) and the other emulates the 20
agents (B leg).  Of course I can provide more information if needed.

   Here are some test numbers:

   With TLS at 20cps, 120 sec calls, up to a total of 2470 calls (4940
registrations) life is good.  Very good - call setup time averages
23ms, the cps rate holds indefinitely, and not a single call or
registration fails over long term tests.

   UDP and TCP numbers are excellent (bordering ridiculous) - usually
around 500cps with practically no reasonable upper limit on
simultaneous calls.  This doesn't need any further discussion :).

   The TLS numbers start falling apart pretty quickly after 20cps,
however.  If I change the TLS test to 40cps, 120 sec calls, up to a
total of 4940 calls (9,880 registrations) Kamailio starts to
(seriously) struggle.  The rate starts fluctuating all over the place,
call setup time averages jump to 8000ms (or more) and things just
generally get ugly.  Interestingly enough all of the user agents are
able to register, the logs look fine (to my eye at this log level) and
the system (CPU, network, etc) doesn't appear to be under stress at
all.

   I have a few questions:

1)  Is there something obviously wrong or stupid I'm doing here?
2)  Why are the TLS tests so much worse than TCP and UDP?  Am I
missing something here?


with tls the limit is usually the cpu or memory, due to 
encryption/decryption, but you say they look ok.


What log level are you using in config?

Is the test tool keeping the tls connections open or they are closed and 
have to be open for each call? Can you spot if the delay is on incoming 
side or on outgoing? Wireshark can decrypt the traffic if you provide 
the certificate and start the sniffing before starting tls connections. 
Alternative, set:


modparam("tls", "cipher_list", "NULL")

and the traffic should be no longer encrypted, but this will not show if 
the bottleneck is the encryption process.


Also, benchmark module can help to see if execution of config file takes 
longer than usual.


Jan Janak did tls tests some time ago, the summary is part of:

http://sip-router.org/wiki/performance/v3.0-capacity

I have some results from a test with 6000 SIP messages/sec over tls, 
where CPU usage got about 60%. I guess something is becoming a 
bottleneck in your case, very likely a blocking operation since cpu is 
ok, just has to be discovered.


Cheers,
Daniel

--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
SIP Express Router (SER) and Kamaili

Re: [SR-Users] TLS performance testing

2011-12-20 Thread Daniel-Constantin Mierla



On 12/20/11 11:55 PM, Kristian Kielhofner wrote:

On Tue, Dec 20, 2011 at 5:20 PM, Daniel-Constantin Mierla
  wrote:

Hello,

with tls the limit is usually the cpu or memory, due to
encryption/decryption, but you say they look ok.

What log level are you using in config?

Is the test tool keeping the tls connections open or they are closed and
have to be open for each call? Can you spot if the delay is on incoming side
or on outgoing? Wireshark can decrypt the traffic if you provide the
certificate and start the sniffing before starting tls connections.
Alternative, set:

modparam("tls", "cipher_list", "NULL")

and the traffic should be no longer encrypted, but this will not show if the
bottleneck is the encryption process.

Also, benchmark module can help to see if execution of config file takes
longer than usual.

Jan Janak did tls tests some time ago, the summary is part of:

http://sip-router.org/wiki/performance/v3.0-capacity

I have some results from a test with 6000 SIP messages/sec over tls, where
CPU usage got about 60%. I guess something is becoming a bottleneck in your
case, very likely a blocking operation since cpu is ok, just has to be
discovered.

Cheers,
Daniel

--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda


Daniel,

   Thank you for getting back to me so quickly.

   The log level is the default (debug=2).  I tried setting cipher_list
to NULL on client and server and now Kamailio has crashed (producing
core file) during the last seven tests.  It seems I can get to about
1000 registered users before this happens.  How should I provide a
backtrace?

   Once I get past this issue I will try your other suggestions.

interesting, let's see who is fault of that -- backtrace:

gdb /path/to/kamailio /path/to/corefile

- for short backtrace:

bt

- for full backtrace:

bt full

Provide both of them.

Cheers,
Daniel
--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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] TLS performance testing

2011-12-21 Thread Daniel-Constantin Mierla

Hello,

can you send also the last log messages (especially the ones before the 
crash, printed by the same pid that wrote the core, there should be a 
'BUG...' message)?


Looks like a double free in the libssl, what is your libssl version?

Cheers,
Daniel

On 12/21/11 2:58 AM, Kristian Kielhofner wrote:

On Tue, Dec 20, 2011 at 6:08 PM, Daniel-Constantin Mierla
  wrote:


interesting, let's see who is fault of that -- backtrace:

gdb /path/to/kamailio /path/to/corefile

- for short backtrace:

bt

- for full backtrace:

bt full

Provide both of them.


Cheers,
Daniel
--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda


Hi Daniel,

   I've collected all of them and attached them to this message.

   Let me know if there is anything else I can do.

Thanks!




--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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] Issue when SRTP enabled in the SIP clients

2011-12-21 Thread Daniel-Constantin Mierla

Hello,

have you enabled the nat traversal in kamailio's config file? From the 
respective tutorial, the config file should contain:


#!KAMAILIO
#!define WITH_MYSQL
#!define WITH_AUTH
#!define WITH_USRLOCDB
#!define WITH_NAT
#!define WITH_TLS

plus update to rtpproxy module parameter:

modparam("rtpproxy", "rtpproxy_sock", "unix:/var/run/rtpproxy/rtpproxy.sock")

If you did all above, can you use tcp instead of tls for sip and send 
the output of ngrep taken on kamailio server for a call that does not work:


ngrep -d any -qt -W byline port 5060

Cheers,
Daniel


On 12/21/11 6:49 AM, Jonathan Martin wrote:

Hi,

I followed this web article to install Kamailio 3.2 and RTPProxy on 
Debian Squeeze x64:


http://kb.asipto.com/kamailio:skype-like-service-in-less-than-one-hour

The system is running on a public IP address outside of our corporate 
LAN.  I have been testing it using pjsua v2 alpha 2 from the pjsip.org 
project.


I am having an issue when I enable srtp in the pjsua clients.  If both 
pjsua clients are running on machines on our corporate LAN (symmetric 
NAT), the call succeeds and I get audio and video.  If one of the 
clients is running outside of the corporate LAN, the call connects but 
I do not get any audio or video.  If I turn off srtp in both clients 
and try the call again, audio and video starts working.  Is there any 
additional configuration I need to make in the kamailio.cfg file when 
I intend to use srtp in the clients?


RTPProxy info:
Basic version: 20040107
Extension 20050322: Support for multiple RTP streams and MOH
Extension 20060704: Support for extra parameter in the V command
Extension 20071116: Support for RTP re-packetization
Extension 20071218: Support for forking (copying) RTP stream
Extension 20080403: Support for RTP statistics querying
Extension 20081102: Support for setting codecs in the update/lookup 
command

Extension 20081224: Support for session timeout notifications

Kamailio info:
version: kamailio 3.2.0 (x86_64/linux)
flags: STATS: Off, USE_IPV6, USE_TCP, USE_TLS, TLS_HOOKS, 
USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, 
SHM_MMAP, PKG_MALLOC, DBG_QM_MALLOC, USE_FUTEX, 
FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, 
USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, 
MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 4MB

poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown
compiled on 10:23:25 Nov  2 2011 with gcc 4.4.5

Regards,
--Jonathan


___
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://linkedin.com/in/miconda -- http://twitter.com/miconda

___
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] Music on hold with freeswitch as SBC

2011-12-21 Thread Daniel-Constantin Mierla

Hello,

On 12/21/11 7:49 AM, Olle E. Johansson wrote:

20 dec 2011 kl. 22:40 skrev Gautam Batra:


Hi,

Thanks for your replies. Is it possible to play an audio file in the case of a 
re-invite directly from kamailio instead of freeswitch by using 
rtpproxy_stream2uac() or something similar?

Kamailioi is still a proxy and from the endpoint point of view is not involved 
in the media plane. If you managed to do that many
endpoints would ignore the packets or see them as a DOS attack attempt. Other 
endpoints might just play them.
In later releases of Asterisk, we lock to the IP address of the peer and would 
ignore these. Asterisk used to send music-on-hold
like this before, but we considered it a security issue and started reinviting 
to make Asterisk involved in the call again to play
music on hold. Asterisk can do that, because it's a b2bua and is an endpoint in 
the call. Kamailio can't initiate a reinvite in the
call.
indeed, kamailio cannot initiate re-invites. You can play an audio file 
via rtpproxy and rtpproxy_stream2uac() if you use rtpproxy relaying from 
the beginning of the call. Otherwise, use a sip b2bua which does 
signaling only until you need to play audio and do re-invites so it gets 
in media path.


Besides Asterisk or FreeSWITCH, a lightweight b2bua that probably offers 
such functionality is sems (sip express media server) -- I CC-ed Stefan, 
he can confirm and even give some leads of how to do it.


Cheers,
Daniel


/O

Gautam

On Mon, Dec 12, 2011 at 4:50 AM, Olle E. Johansson  wrote:

12 dec 2011 kl. 10:45 skrev Daniel-Constantin Mierla:


Hello,

On 12/9/11 9:04 PM, Gautam Batra wrote:

Hello,

I have a kamailio sip proxy server with freeswitch acting as SBC. I want to 
redirect the call to freeswitch when hold is pressed so that i can play music 
on hold. I tried this by using rewritehostport in case of a re-invite, but the 
call drops in that case. Could someone please help me with this?

it is not possible to redirect established calls (it breaks the RFC3261), you 
have to route the call through freeswitch from its start. Perhaps you can use 
freeswitch without relaying the media in first place and when you have on hold, 
you set media patch to go through freeswitch.

The only solution is having FreeSwitch send an invite with replaces to grab the 
call. The question is how to get it back.

/O



---
* Olle E Johansson - o...@edvina.net
* Cell phone +46 70 593 68 51, Office +46 8 96 40 20, Sweden




___
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://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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] No memory left in send_subscribe (PUA) from update_pua while building the tm dlg_t structure

2011-12-21 Thread Daniel-Constantin Mierla

Hello,

you can see the available pkg via sercmd, sending command pkg.stats 
(match the entry for the pid printing the error). If there is no free 
memory, then might be a leak.


You can attach with gdb to the pid printing these errors and walk to 
pkg, you see the commands for gdb at:


http://www.asipto.com/pub/kamailio-devel-guide/#c04troubleshooting

See if you have lot of allocated chunks from same place in source code 
(ignore those at the beginning, mainly related to cfg parsing) and send 
the details here.


Cheers,
Daniel

On 12/21/11 10:44 AM, laura testi wrote:

Hi,
we are using the PUA_XMPP and PUA modules from the master branch. When
the modules are started, everything are ok, the presence events from
XMPP are sent to kamailio SIP servers (PUBLISH/SUBSCRIBE) and cached
in the hash. But when there are several thousands records in the hash
tabel, the update_pua function called in the hashT_clean gives a lot
of "No memory left" error when the hashT_clean is waked up from the
time:

ERROR: pua [send_subscribe.c]: No memory left
ERROR: pua [pua.c]: while building tm dlg_t structure

The failed call is:
td = (dlg_t*)pkg_malloc(size);
if(td == NULL)
{
LM_ERR("No memory left\n");
return NULL;
}

in dlg_t* pua_build_dlg_t(ua_pres_t* presentity) function in
send_subscribe.c. The size is about 400 and something... It's
strange.

Is it the memory leak in the PUA module?



I also try to increase the pkg_memory from 4MB default to 16MB, but it
doesn't help.


Any Idea?

Thanks in advanced

Laura

___
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://linkedin.com/in/miconda -- http://twitter.com/miconda

___
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] No memory left in send_subscribe (PUA) from update_pua while building the tm dlg_t structure

2011-12-21 Thread Daniel-Constantin Mierla

Hello,

pkg.stats was added in 3.2.0, iirc. For 3.1, you can walk the packets in 
memory with gdb -- 3.1 has memory debug on, so you don't need to 
recompile (unless you turned it off).


Just attach to the pid of a sip worker  (gdb /path/to/kamailio 
_pid_value_) and run the gdb script.


Cheers,
Daniel

On 12/21/11 11:58 AM, laura testi wrote:

Hi Daniel,
I try the sercmd for pkg memory but it return 500 error:


# sercmd
sercmd 0.2
Copyright 2006 iptelorg GmbH
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
sercmd>  pkg.stats
error: 500 - command pkg.stats not found
sercmd>



Is it available only for 3.2.x and master branch? Because we are using
3.1.5. But take the PUA module from master branch for the fetch_row
parameter you have patched ;-)


core.shmmem is ok.



Thanks a lot

Laura

On Wed, Dec 21, 2011 at 10:58 AM, Daniel-Constantin Mierla
  wrote:

Hello,

you can see the available pkg via sercmd, sending command pkg.stats (match
the entry for the pid printing the error). If there is no free memory, then
might be a leak.

You can attach with gdb to the pid printing these errors and walk to pkg,
you see the commands for gdb at:

http://www.asipto.com/pub/kamailio-devel-guide/#c04troubleshooting

See if you have lot of allocated chunks from same place in source code
(ignore those at the beginning, mainly related to cfg parsing) and send the
details here.

Cheers,
Daniel


On 12/21/11 10:44 AM, laura testi wrote:

Hi,
we are using the PUA_XMPP and PUA modules from the master branch. When
the modules are started, everything are ok, the presence events from
XMPP are sent to kamailio SIP servers (PUBLISH/SUBSCRIBE) and cached
in the hash. But when there are several thousands records in the hash
tabel, the update_pua function called in the hashT_clean gives a lot
of "No memory left" error when the hashT_clean is waked up from the
time:

ERROR: pua [send_subscribe.c]: No memory left
ERROR: pua [pua.c]: while building tm dlg_t structure

The failed call is:
td = (dlg_t*)pkg_malloc(size);
if(td == NULL)
{
LM_ERR("No memory left\n");
return NULL;
}

in dlg_t* pua_build_dlg_t(ua_pres_t* presentity) function in
send_subscribe.c. The size is about 400 and something... It's
strange.

Is it the memory leak in the PUA module?



I also try to increase the pkg_memory from 4MB default to 16MB, but it
doesn't help.


Any Idea?

Thanks in advanced

Laura

___
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://linkedin.com/in/miconda -- http://twitter.com/miconda

___
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://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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] TLS performance testing

2011-12-21 Thread Daniel-Constantin Mierla

Hello,

On 12/21/11 8:26 PM, Kristian Kielhofner wrote:

On Wed, Dec 21, 2011 at 4:36 AM, Daniel-Constantin Mierla
  wrote:

Hello,

can you send also the last log messages (especially the ones before the
crash, printed by the same pid that wrote the core, there should be a
'BUG...' message)?

Looks like a double free in the libssl, what is your libssl version?

Cheers,
Daniel

Hi Daniel,

   I don't see relevant lines in the log (surprisingly).  The strange
part is there is always at least one kamailio process running when
this happens (or maybe not so strange).

   This is an up to date CentOS 6 with openssl-1.0.0-20.el6.x86_64
installed.  I do get this warning on startup (same on CentOS 5.x):

WARNING: tls [tls_init.c:587]: tls: openssl bug #1491 (crash/mem leaks
on low memory) workaround enabled (on low memory tls operations will
fail preemptively) with free memory thresholds 271581184 and 135790592
bytes

it has to be at least the message printed by:

LOG(L_CRIT, "BUG: qm_free: freeing already freed pointer,"
" first free: %s: %s(%ld) - aborting\n",
f->file, f->func, f->line);

Can you grep for it in logs?

The abort in frame #1 of bracktrace is triggered on purpose, at 
mem/q_malloc.c line 458

Cheers,
Daniel

--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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] Music on hold with freeswitch as SBC

2011-12-22 Thread Daniel-Constantin Mierla

Can you give the output of:

ps auxw | grep -i rtpproxy

That will show if rtpproxy is running and what is its control socket.

Cheers,
Daniel

On 12/21/11 11:25 PM, Gautam Batra wrote:

I'm not able to set up the rtp proxy module. I have entered the following:

loadmodule "rtpproxy.so"
modparam ("rtpproxy", "rtpproxy_sock", "udp:X.Y.Z.W:2");

Where X.Y.Z.W is the IP address of my machine (same as that of my SIP 
server). But the log shows the following errors:


Dec 21 13:11:12 abc daemon.err /usr/sbin/kamailio[9984]: ERROR: 
rtpproxy [rtpproxy.c:1503]: can't send command to a RTP proxy
Dec 21 13:11:12 abc daemon.err /usr/sbin/kamailio[9984]: ERROR: 
rtpproxy [rtpproxy.c:1538]: proxy  does not 
respond, disable it
Dec 21 13:11:12 abc daemon.warn /usr/sbin/kamailio[9984]: WARNING: 
rtpproxy [rtpproxy.c:1395]: can't get version of the RTP proxy
Dec 21 13:11:12 abc daemon.warn /usr/sbin/kamailio[9984]: WARNING: 
rtpproxy [rtpproxy.c:1432]: support for RTP proxy  
has been disabled temporarily


Could anyone tell what I'm doing wrong? I tried to run rtpproxy 
separately on the given port before starting kamailio (rtpproxy -s 
udp:X.Y.Z.W:2), but it didn't work.




On Wed, Dec 21, 2011 at 2:36 PM, Gautam Batra <mailto:gautambatr...@gmail.com>> wrote:


I am using Freeswitch as an SBC behind Kamailio, and my external
calls are routed via freeswitch. In those calls the music on hold
works as it is handled by freeswitch. Ideally I would like to
somehow redirect when a call is put on hold to the MOH extension.
The other option is by using rtpproxy. I could not find any
documentation on rtpproxy and would really appreciate it if
someone could lead me to it or give me a brief overview on how to
go about using rtpproxy_stream2uac to play music whenever a call
    is put on hold.

On Wed, Dec 21, 2011 at 4:50 AM, Daniel-Constantin Mierla
mailto:mico...@gmail.com>> wrote:

Hello,


On 12/21/11 7:49 AM, Olle E. Johansson wrote:

20 dec 2011 kl. 22:40 skrev Gautam Batra:

Hi,

Thanks for your replies. Is it possible to play an
audio file in the case of a re-invite directly from
kamailio instead of freeswitch by using
rtpproxy_stream2uac() or something similar?

Kamailioi is still a proxy and from the endpoint point of
view is not involved in the media plane. If you managed to
do that many
endpoints would ignore the packets or see them as a DOS
attack attempt. Other endpoints might just play them.
In later releases of Asterisk, we lock to the IP address
of the peer and would ignore these. Asterisk used to send
music-on-hold
like this before, but we considered it a security issue
and started reinviting to make Asterisk involved in the
call again to play
music on hold. Asterisk can do that, because it's a b2bua
and is an endpoint in the call. Kamailio can't initiate a
reinvite in the
call.

indeed, kamailio cannot initiate re-invites. You can play an
audio file via rtpproxy and rtpproxy_stream2uac() if you use
rtpproxy relaying from the beginning of the call. Otherwise,
use a sip b2bua which does signaling only until you need to
play audio and do re-invites so it gets in media path.

Besides Asterisk or FreeSWITCH, a lightweight b2bua that
probably offers such functionality is sems (sip express media
server) -- I CC-ed Stefan, he can confirm and even give some
leads of how to do it.

Cheers,
Daniel


/O

Gautam

On Mon, Dec 12, 2011 at 4:50 AM, Olle E.
    Johanssonmailto:o...@edvina.net>>  wrote:

12 dec 2011 kl. 10:45 skrev Daniel-Constantin Mierla:

Hello,

On 12/9/11 9:04 PM, Gautam Batra wrote:

Hello,

I have a kamailio sip proxy server with
freeswitch acting as SBC. I want to redirect
the call to freeswitch when hold is pressed so
that i can play music on hold. I tried this by
using rewritehostport in case of a re-invite,
but the call drops in that case. Could someone
please help me with this?

it is not possible to redirect established calls
(it breaks the RFC3261), you have to route the
call through freeswitch from its start. Perhaps
you can use freeswitch without relaying the media
in first p

Re: [SR-Users] ERROR: slow timer too slow: overflow (1048 - 25 = 1023) repeat a lot

2011-12-22 Thread Daniel-Constantin Mierla

Hello,

On 12/21/11 12:12 PM, laura testi wrote:

Hi,
sometime we get the following error after we restart the kamailio for a while:

ERROR:  [timer.c:972]: ERROR: slow timer too slow: overflow
(1048 - 25 = 1023)
... last message repeated 138times



  ERROR:  [timer.c:972]: ERROR: slow timer too slow: overflow
(1048 - 25 = 1023)
last message repeated 49 times


it print them continuously



is it normal?


there is some long task executed on timer, maybe on failure route. The 
timer should recover itself if the task is not executed every time.




How I can fix it?


You need to figure out what it takes long to execute and improve that. 
It is not a critical error, it keeps working. I am going to make that 
message a warning instead of error.


Cheers,
Daniel



Thank you very much!

Best Regards,
Laura

___
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://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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] new in devel wiki page

2011-12-22 Thread Daniel-Constantin Mierla

Hello,

short reminder for everyone to update the wiki page with short 
description of the new stuff/enhancements added to GIT repository -- 
here it is:


  * http://www.kamailio.org/wiki/features/new-in-devel

Also, if you do changes to existing parts that require upgrade of config 
file or database schema from v3.2.x to devel, please write short 
guidelines at:


  * http://www.kamailio.org/wiki/install/upgrade/3.2.x-to-3.3.0

Thanks,
Daniel

--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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] anyone with opensuse around?

2011-12-22 Thread Daniel-Constantin Mierla

Hello,

is anyone here having an opensuse available for using to do some tests? 
It is about the radius modules, it seems opensuse does now have 
radiusclient-ng, but the client library from freeradius. They should be 
quite similar and we should be able to compile with freeradius client 
library, like


make FREERADIUS=1 ...

I tried on opensuse build service and it fails due to some conflict on 
DBG definition. It is hard to troubleshoot on OBS, so maybe someone can 
give a hand and find the fix faster -- I can provide guidelines or if I 
can get shell access (just simple user) would be better (write me 
directly in this case). The goal is to get the radius modules packaged 
as rpm on opensuse.


Thanks,
Daniel

--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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] usrloc, timer process and cache cleanup

2011-12-22 Thread Daniel-Constantin Mierla

Hello,

On 12/22/11 6:19 PM, Andreas Granig wrote:

Got the cause of the issue.

What happens is that there's an AOR which registers ever 120 seconds.
For some reason, the location entry is in usrloc cache, but not in db.
What happens now is that usrloc tries an "update" query in the db,
because it still assumes that the entry is there, which obviously fails.

If you remove the entry from usrloc (kamctl ul rm), then on the
next re-registration it's both inserted into the cache and into the db.

Wondering how it could happen to get out of sync, and how we could
improve this. Maybe using a "replace into" instead of "update", at least
for mysql? Suggestions?

is the timer interval parameter of usrloc higher than 120sec?

http://kamailio.org/docs/modules/3.2.x/modules_k/usrloc.html#id2494575

IIRC, there should be anyhow a flag to mark if the record is in db or 
not, and based on that do insert or update, maybe something is lost 
there. If you do 'kamctl ul show __aor__', what are the values for flags 
fields?


Another option, perhaps more portable, but with two db hits is: update 
and if fails then insert -- considering that these should be corner 
cases, maybe the performance is not affected much. A blended version is 
even better, if the db driver supports replace, do replace instead of 
update (I don't know if replace is faster/slower than update).


Cheers,
Daniel


Andreas

On 12/22/2011 05:12 PM, Andreas Granig wrote:

Hi,

Could you please tell me which of the three timer processes ("timer",
"slow timer" or "timer nh") is responsible for cleaning up the internal
usrloc cache?

Looks like every now and then the cleanup of the internal location cache
is starting to fail. Funny thing is that expired locations are removed
from the mysql backend, but not from the internal cache. We're running
kamailio 3.1.5, are there any known issues fixed since that version?

In the meanwhile we're trying to pin the issue down, but maybe someone
has a clue...

Andreas




___
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


--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda

___
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] usrloc, timer process and cache cleanup

2011-12-22 Thread Daniel-Constantin Mierla



On 12/22/11 7:40 PM, Ovidiu Sas wrote:

The replace solution will mask the real issue.
The flag that is in the usrloc should switch between update or insert
and that is the real fix.
Right, that has to be done, but there are some cases when db can become 
inconsistent, due to database unavailability, and then some trick have 
to be done at db layer, example:


- db is unavailable, phone unregisters, contact deleted from memory but 
not from database
- phone register again, usrloc will try insert and will fail - in this 
case it should be update if insert fails (or replace)


The other way around could happen when mistakenly deleting/changing 
records in db, which should not happen, but Murphy says opposite.


Cheers,
Daniel



Regards,
Ovidiu Sas

-- VoIP Embedded, Inc.http://www.voipembedded.com

On Thu, Dec 22, 2011 at 12:58 PM, Daniel-Constantin Mierla
  wrote:

Hello,


On 12/22/11 6:19 PM, Andreas Granig wrote:

Got the cause of the issue.

What happens is that there's an AOR which registers ever 120 seconds.
For some reason, the location entry is in usrloc cache, but not in db.
What happens now is that usrloc tries an "update" query in the db,
because it still assumes that the entry is there, which obviously fails.

If you remove the entry from usrloc (kamctl ul rm), then on the
next re-registration it's both inserted into the cache and into the db.

Wondering how it could happen to get out of sync, and how we could
improve this. Maybe using a "replace into" instead of "update", at least
for mysql? Suggestions?

is the timer interval parameter of usrloc higher than 120sec?

http://kamailio.org/docs/modules/3.2.x/modules_k/usrloc.html#id2494575

IIRC, there should be anyhow a flag to mark if the record is in db or not,
and based on that do insert or update, maybe something is lost there. If you
do 'kamctl ul show __aor__', what are the values for flags fields?

Another option, perhaps more portable, but with two db hits is: update and
if fails then insert -- considering that these should be corner cases, maybe
the performance is not affected much. A blended version is even better, if
the db driver supports replace, do replace instead of update (I don't know
if replace is faster/slower than update).

Cheers,
Daniel


Andreas

On 12/22/2011 05:12 PM, Andreas Granig wrote:

Hi,

Could you please tell me which of the three timer processes ("timer",
"slow timer" or "timer nh") is responsible for cleaning up the internal
usrloc cache?

Looks like every now and then the cleanup of the internal location cache
is starting to fail. Funny thing is that expired locations are removed
from the mysql backend, but not from the internal cache. We're running
kamailio 3.1.5, are there any known issues fixed since that version?

In the meanwhile we're trying to pin the issue down, but maybe someone
has a clue...

Andreas

___
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://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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] usrloc, timer process and cache cleanup

2011-12-22 Thread Daniel-Constantin Mierla



On 12/22/11 8:02 PM, Ovidiu Sas wrote:

Right, that has to be done, but there are some cases when db can become
inconsistent, due to database unavailability, and then some trick have to be
done at db layer, example:

- db is unavailable, phone unregisters, contact deleted from memory but not
from database
- phone register again, usrloc will try insert and will fail - in this case
it should be update if insert fails (or replace)

If the phone registers again, it should be a brand new entry
(different Call-ID, CSeq and so on).
The leftover entry on the db will be cleanup on a server restart.


According to sip specs, the key is the contact address, thus operations 
are done on (aor, contact). In kamailio you can configure to match using 
call id (plus path) as well, but is not the default since it breaks the 
specs.



The other way around could happen when mistakenly deleting/changing records in 
db, which should not happen, but Murphy says opposite.

If someone is messing with the db, kamailio shouldn't try to correct
admin mistakes.


It was just an example, I haven't gone to all corner cases that can 
happen from human or (self or different) application errors. There were 
couple of similar reports in the past, related to conflicts of 
insert/update, update/insert, delete/update a.s.o. cases, so I proposed 
to go for a portable solution, not for one which valid to a db driver 
only -- configurable or not, is different thing than the specific topic.




I think that the replace solution should be a last resort.
If implemented, should be configurable.  I would rather see the
original issue instead of being masked and let it trigger other issues
later on which would be more difficult to debug.
I think the goal is to have coherent, consistent and persistent records 
in location table, so that lookup is always valid and restarts don't 
lose records. In no case you get any feedback implicitly, this is either 
about logging or malfunctioning. Perhaps is better to get a log message 
to investigate and have all keep going, than the second.


Cheers,
Daniel


--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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] How to get Reason code from reply in failure_route

2011-12-23 Thread Daniel-Constantin Mierla

Hello,

On 12/23/11 11:44 AM, Mino Haluz wrote:

Hi,

how can I get the reason code from reply in failure_route ? 
$hdr(reason) points to the INVITE request..
you can test it with a regular expression via t_check_status(...) from 
tm module or get it in a config variable:


http://www.kamailio.org/wiki/cookbooks/3.2.x/pseudovariables#t_reply_code

Cheers,
Daniel

--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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] No memory left in send_subscribe (PUA) from update_pua while building the tm dlg_t structure

2011-12-23 Thread Daniel-Constantin Mierla

Hello,

looks like a leak in a module that is storing record-routes and use them 
later, perhaps pua module, I will check it soon.


Cheers,
Daniel

On 12/23/11 11:31 AM, laura testi wrote:

Hi Daniel,
I just follow the instruction in the link you sent
(http://www.asipto.com/pub/kamailio-devel-guide/#c04troubleshooting)
to use gdb to print PKG fragments. When I got the error in PUA:

Dec 23 11:10:53 /.../sbin/kamailio[23276]: ERROR: pua
[send_subscribe.c:158]: No memory left for size:439
Dec 23 11:10:53 /.../sbin/kamailio[23276]: ERROR: pua [pua.c:747]:
while building tm dlg_t structure
Dec 23 11:10:53 /.../sbin/kamailio[23276]: ERROR: pua [pua.c:652]:
while updating record


The I run the command
gdb /.../sbin/kamailio 23276
and write the following commands in the gdb:

set $i=0
set $a = mem_block->first_frag
while($i<1)
   if($i>2000)
 if($a->u.is_free==0)
   p *$a
 end
   end
   set $a = ((struct qm_frag*)((char*)($a)+sizeof(struct
qm_frag)+((struct qm_frag*)$a)->size+sizeof(struct qm_frag_end)))
   set $i = $i + 1
end
...

after a while I got a lot of prints on the screen like these:

   func = 0x5d7b00 "do_parse_rr_body", line = 74, check = 4042322160}
$1348 = {size = 72, u = {nxt_free = 0x0, is_free = 0},
   file = 0x5d76c9 ": parser/parse_rr.c",
   func = 0x5d7b00 "do_parse_rr_body", line = 74, check = 4042322160}
$1349 = {size = 72, u = {nxt_free = 0x0, is_free = 0},
   file = 0x5d76c9 ": parser/parse_rr.c",
   func = 0x5d7b00 "do_parse_rr_body", line = 74, check = 4042322160}
$1350 = {size = 72, u = {nxt_free = 0x0, is_free = 0},
   file = 0x5d76c9 ": parser/parse_rr.c",
   func = 0x5d7b00 "do_parse_rr_body", line = 74, check = 4042322160}
$1351 = {size = 104, u = {nxt_free = 0x0, is_free = 0},
   file = 0x5d76c9 ": parser/parse_rr.c",
   func = 0x5d7b00 "do_parse_rr_body", line = 74, check = 4042322160}
$1352 = {size = 104, u = {nxt_free = 0x0, is_free = 0},
   file = 0x5d76c9 ": parser/parse_rr.c",
   func = 0x5d7b00 "do_parse_rr_body", line = 74, check = 4042322160}
$1353 = {size = 72, u = {nxt_free = 0x0, is_free = 0},
   file = 0x5d76c9 ": parser/parse_rr.c",
   func = 0x5d7b00 "do_parse_rr_body", line = 74, check = 4042322160}
$1354 = {size = 72, u = {nxt_free = 0x0, is_free = 0},
---Type  to continue, or q  to quit---

...


But I don't understand if these are normal or something goes wrong

Can you help


Best Regards,
Laura

On Wed, Dec 21, 2011 at 12:18 PM, Daniel-Constantin Mierla
  wrote:

Hello,

pkg.stats was added in 3.2.0, iirc. For 3.1, you can walk the packets in
memory with gdb -- 3.1 has memory debug on, so you don't need to recompile
(unless you turned it off).

Just attach to the pid of a sip worker  (gdb /path/to/kamailio _pid_value_)
and run the gdb script.

Cheers,
Daniel


On 12/21/11 11:58 AM, laura testi wrote:

Hi Daniel,
I try the sercmd for pkg memory but it return 500 error:


# sercmd
sercmd 0.2
Copyright 2006 iptelorg GmbH
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
sercmd>pkg.stats
error: 500 - command pkg.stats not found
sercmd>



Is it available only for 3.2.x and master branch? Because we are using
3.1.5. But take the PUA module from master branch for the fetch_row
parameter you have patched ;-)


core.shmmem is ok.



Thanks a lot

Laura

On Wed, Dec 21, 2011 at 10:58 AM, Daniel-Constantin Mierla
wrote:

Hello,

you can see the available pkg via sercmd, sending command pkg.stats
(match
the entry for the pid printing the error). If there is no free memory,
then
might be a leak.

You can attach with gdb to the pid printing these errors and walk to pkg,
you see the commands for gdb at:

http://www.asipto.com/pub/kamailio-devel-guide/#c04troubleshooting

See if you have lot of allocated chunks from same place in source code
(ignore those at the beginning, mainly related to cfg parsing) and send
the
details here.

Cheers,
Daniel


On 12/21/11 10:44 AM, laura testi wrote:

Hi,
we are using the PUA_XMPP and PUA modules from the master branch. When
the modules are started, everything are ok, the presence events from
XMPP are sent to kamailio SIP servers (PUBLISH/SUBSCRIBE) and cached
in the hash. But when there are several thousands records in the hash
tabel, the update_pua function called in the hashT_clean gives a lot
of "No memory left" error when the hashT_clean is waked up from the
time:

ERROR: pua [send_subscribe.c]: No memory left
ERROR: pua [pua.c]: while building tm dlg_t structure

The failed call is:
td = (dlg_t*)pkg_malloc(size);
if(td == NULL)
{
LM_ERR("No memory left\n");
return NULL;
}

in dlg_t* pua_build_dlg_t(ua_pres_t* presentity) function in
send_subscribe.c. The size is about 400 and something... 

Re: [SR-Users] No memory left in send_subscribe (PUA) from update_pua while building the tm dlg_t structure

2011-12-23 Thread Daniel-Constantin Mierla

Hello,

can you try with this patch:

http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=1b3cfa60a5b5c7d435704d44b7c495b7e6aa84c8

Cheers,
Daniel

On 12/23/11 12:36 PM, Daniel-Constantin Mierla wrote:

Hello,

looks like a leak in a module that is storing record-routes and use 
them later, perhaps pua module, I will check it soon.


Cheers,
Daniel

On 12/23/11 11:31 AM, laura testi wrote:

Hi Daniel,
I just follow the instruction in the link you sent
(http://www.asipto.com/pub/kamailio-devel-guide/#c04troubleshooting)
to use gdb to print PKG fragments. When I got the error in PUA:

Dec 23 11:10:53 /.../sbin/kamailio[23276]: ERROR: pua
[send_subscribe.c:158]: No memory left for size:439
Dec 23 11:10:53 /.../sbin/kamailio[23276]: ERROR: pua [pua.c:747]:
while building tm dlg_t structure
Dec 23 11:10:53 /.../sbin/kamailio[23276]: ERROR: pua [pua.c:652]:
while updating record


The I run the command
gdb /.../sbin/kamailio 23276
and write the following commands in the gdb:

set $i=0
set $a = mem_block->first_frag
while($i<1)
   if($i>2000)
 if($a->u.is_free==0)
   p *$a
 end
   end
   set $a = ((struct qm_frag*)((char*)($a)+sizeof(struct
qm_frag)+((struct qm_frag*)$a)->size+sizeof(struct qm_frag_end)))
   set $i = $i + 1
end
...

after a while I got a lot of prints on the screen like these:

   func = 0x5d7b00 "do_parse_rr_body", line = 74, check = 4042322160}
$1348 = {size = 72, u = {nxt_free = 0x0, is_free = 0},
   file = 0x5d76c9 ": parser/parse_rr.c",
   func = 0x5d7b00 "do_parse_rr_body", line = 74, check = 4042322160}
$1349 = {size = 72, u = {nxt_free = 0x0, is_free = 0},
   file = 0x5d76c9 ": parser/parse_rr.c",
   func = 0x5d7b00 "do_parse_rr_body", line = 74, check = 4042322160}
$1350 = {size = 72, u = {nxt_free = 0x0, is_free = 0},
   file = 0x5d76c9 ": parser/parse_rr.c",
   func = 0x5d7b00 "do_parse_rr_body", line = 74, check = 4042322160}
$1351 = {size = 104, u = {nxt_free = 0x0, is_free = 0},
   file = 0x5d76c9 ": parser/parse_rr.c",
   func = 0x5d7b00 "do_parse_rr_body", line = 74, check = 4042322160}
$1352 = {size = 104, u = {nxt_free = 0x0, is_free = 0},
   file = 0x5d76c9 ": parser/parse_rr.c",
   func = 0x5d7b00 "do_parse_rr_body", line = 74, check = 4042322160}
$1353 = {size = 72, u = {nxt_free = 0x0, is_free = 0},
   file = 0x5d76c9 ": parser/parse_rr.c",
   func = 0x5d7b00 "do_parse_rr_body", line = 74, check = 4042322160}
$1354 = {size = 72, u = {nxt_free = 0x0, is_free = 0},
---Type  to continue, or q  to quit---

...


But I don't understand if these are normal or something goes wrong

Can you help


Best Regards,
Laura

On Wed, Dec 21, 2011 at 12:18 PM, Daniel-Constantin Mierla
  wrote:

Hello,

pkg.stats was added in 3.2.0, iirc. For 3.1, you can walk the 
packets in
memory with gdb -- 3.1 has memory debug on, so you don't need to 
recompile

(unless you turned it off).

Just attach to the pid of a sip worker  (gdb /path/to/kamailio 
_pid_value_)

and run the gdb script.

Cheers,
Daniel


On 12/21/11 11:58 AM, laura testi wrote:

Hi Daniel,
I try the sercmd for pkg memory but it return 500 error:


# sercmd
sercmd 0.2
Copyright 2006 iptelorg GmbH
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
sercmd>pkg.stats
error: 500 - command pkg.stats not found
sercmd>



Is it available only for 3.2.x and master branch? Because we are using
3.1.5. But take the PUA module from master branch for the fetch_row
parameter you have patched ;-)


core.shmmem is ok.



Thanks a lot

Laura

On Wed, Dec 21, 2011 at 10:58 AM, Daniel-Constantin Mierla
wrote:

Hello,

you can see the available pkg via sercmd, sending command pkg.stats
(match
the entry for the pid printing the error). If there is no free 
memory,

then
might be a leak.

You can attach with gdb to the pid printing these errors and walk 
to pkg,

you see the commands for gdb at:

http://www.asipto.com/pub/kamailio-devel-guide/#c04troubleshooting

See if you have lot of allocated chunks from same place in source 
code
(ignore those at the beginning, mainly related to cfg parsing) and 
send

the
details here.

Cheers,
Daniel


On 12/21/11 10:44 AM, laura testi wrote:

Hi,
we are using the PUA_XMPP and PUA modules from the master branch. 
When

the modules are started, everything are ok, the presence events from
XMPP are sent to kamailio SIP servers (PUBLISH/SUBSCRIBE) and cached
in the hash. But when there are several thousands records in the hash
tabel, the update_pua function called in the hashT_clean gives a lot
of "No memory left" error when the hashT_clean is waked up from the
time:

ERROR: pua [send_subscribe.c]: No memory left
ERROR: pua [pua.c]: while building tm dlg_t structure

The failed call is:
td = (dlg_t*)pkg_malloc(size);
if(td == NULL)
{

[SR-Users] Merry Christmas!

2011-12-24 Thread Daniel-Constantin Mierla
I want to take the opportunity and give proper credits to everyone 
around the project, any bit of contribution makes it evolve better and 
better year by year. This includes also the involvement in community, we 
don't need only developers to improve. There is no reason to stay aside 
in an open source project, become active and play a role in its evolution.


We've just started the second decade of development, but there is always 
space to innovate communications. With SER and Kamailio, we pioneered 
over the years many solutions in unified communication systems, the 
plans are the same, be ahead of the market with new features while 
preserving the robustness.


Merry Christmas and great winter holidays to all Kamailians and SERians!!!

Cheers,
Daniel

--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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] ACK From an OK it's being discarded

2011-12-27 Thread Daniel-Constantin Mierla

Hello,

if the ACK goes through the proxy, then means record routing is used, 
but I see no Record-Route in 200 reply and no Route in ACK. Since there 
is no Record-Route in 200 ok, the ACK has to be sent to the contact 
address from the 200 ok.


Your config snippet from kamailio shows the part of default config where 
record routing is handling -- based on the comments -- since it no 
Route, it is dropped.


Cheers,
Daniel

On 12/26/11 11:03 PM, Lucas Alvarez wrote:
I have Kamailio 3.2.0 between two asterisk servers, after the call 
set, one of the kamailio send the OK from the INVITE and the return 
ACK of that message was discarded. This makes asterisk hangup the call 
after 5 secs. It's that right?


OK message:

U 172.25.249.15:5060 <http://172.25.249.15:5060> -> 172.25.249.14:5060 
<http://172.25.249.14:5060>

SIP/2.0 200 OK.
Via: SIP/2.0/UDP 172.25.249.14:5060;branch=z9hG4bK09fc3de6;rport=5060.
From: "asterisk" <mailto:sip%3Aasterisk@172.25.249.14>>;tag=as6411602a.
To: <http://sip:775008@172.25.249.15:5060>>;tag=as55ab3180.
Call-ID: 547225391b7828402ecaa03e1dab5a86@172.25.249.14 
<mailto:547225391b7828402ecaa03e1dab5a86@172.25.249.14>.

CSeq: 102 INVITE.
Server: Asterisk PBX 1.8.7.1.
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, 
INFO, PUBLISH.

Supported: replaces, timer.
Contact: <http://sip:775008@172.25.249.15:5080>>.
Remote-Party-ID: "Eus Test" <mailto:sip%3A3999@172.25.249.14>>;party=called;privacy=off;screen=no.

Content-Type: application/sdp.
Content-Length: 285.
.
v=0.
o=root 2045590031 2045590031 IN IP4 172.25.249.15.
s=Asterisk PBX 1.8.7.1.
c=IN IP4 172.25.249.15.
t=0 0.
m=audio 11922 RTP/AVP 0 3 8 101.
a=rtpmap:0 PCMU/8000.
a=rtpmap:3 GSM/8000.
a=rtpmap:8 PCMA/8000.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-16.
a=ptime:20.
a=sendrecv.


Discarded ACK:

U 172.25.249.14:5060 <http://172.25.249.14:5060> -> 172.25.249.15:5060 
<http://172.25.249.15:5060>
ACK sip:775008@172.25.249.15:5080 
<http://sip:775008@172.25.249.15:5080> SIP/2.0.

Via: SIP/2.0/UDP 172.25.249.14:5060;branch=z9hG4bK6ea5aff6;rport.
From: "asterisk" <mailto:sip%3Aasterisk@172.25.249.14>>;tag=as6411602a.
To: <http://sip:775008@172.25.249.15:5060>>;tag=as55ab3180.
Contact: <mailto:sip%3Aasterisk@172.25.249.14>>.
Call-ID: 547225391b7828402ecaa03e1dab5a86@172.25.249.14 
<mailto:547225391b7828402ecaa03e1dab5a86@172.25.249.14>.

CSeq: 102 ACK.
User-Agent: Asterisk PBX.
Max-Forwards: 70.
Remote-Party-ID: "asterisk" <mailto:sip%3Aasterisk@172.25.249.14>>.

Content-Length: 0.
.

Kamailio's configuration where the ACK message it's being discarded:


  if ( is_method("ACK") ) {
if ( t_check_trans() ) {
# no loose-route, but stateful 
ACK;

# must be an ACK after a 487
# or e.g. 404 from upstream server
t_relay();
exit;
} else {
# ACK without matching 
transaction ... ignore and discard

exit;
}
}


It would be ok if I relay the ack even if it didn't match any 
transaction??

Any help would be appreciated.
Regards,

Lucas



___________
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://linkedin.com/in/miconda -- http://twitter.com/miconda

___
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

2011-12-28 Thread Daniel-Constantin Mierla

Hello,

adding more info here.

I guess the dispatcher from the forked project didn't evolve from the 
moment of the fork if they added a different module, so I assume it is 
more or less dispatcher as it was in kamailio 1.4.


Meanwhile in kamailio (as we are at version 3.2.1), dispatcher got lot 
of new features, including calls load distribution, algorithm 10:


http://kamailio.org/docs/modules/stable/modules_k/dispatcher.html#id2498405

Call load distribution counts the number of active calls per destination 
address, dispatcher selecting the least loaded. It uses script functions 
to manage the load (see the readme), since dispatcher can work event in 
stateless mode (so no tm or dialog modules are needed for such feature), 
thus is very lightweight, which is really important for scalable load 
balancing implementation.


Among new features since dispatcher for kamailio 1.4:
- weight based load balancing
- priority based gateway selection
- refactored keepalive mechanism for detecting when a gateway is down/up
- execution of event_route blocks in config when a gateway is down/up
- management through RPC commands

Cheers,
Daniel

On 12/28/11 1:43 PM, Alex Balashov wrote:

On 12/28/2011 07:21 AM, Ronald Kiel wrote:


I understand Kamailio has the Dispatcher-module for load-balancing.
 OpenSIPS has both a Dispatcher-module and a LB-module, which seems
to offer improved functionality. Is there also something like the
LB-module in Kamailio?


No, there's nothing in Kamailio that implements what the LB module 
does, exactly.  However, I wouldn't call the LB module 'improved' 
functionality;  it extends a particular subset of 'dispatcher' in a 
specific way, nothing more.


Furthermore, with Kamailio it is relatively trivial to come up with 
your own load-aware routing process in route script.  I think that's 
one reason it doesn't get wrapped in a module.  If you want to 
periodically poll some outside source for load information, define a 
periodic 'rtimer' process that can go out and do that:


   http://www.kamailio.org/docs/modules/3.2.x/modules_k/rtimer.html

Store the results in 'htable' or some other data structure, and then 
check it when routing calls.  And that's all there is to it.  :-)  Now 
you can implement skills-based routing or anything else esoteric, 
because the algorithm is 100% yours to override.


-- Alex



--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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] No memory left in send_subscribe (PUA) from update_pua while building the tm dlg_t structure

2011-12-28 Thread Daniel-Constantin Mierla
, (void*)cb_param);
-
-   result= tmb.t_request_within(&uac_r);
-   if(result<  0)
-   {
-   LM_ERR("in t_request function\n");
-   shm_free(cb_param);
-   pkg_free(td);
-   goto error;
-   }
-
-   pkg_free(td);
-   td= NULL;
-   }
-
-   pkg_free(str_hdr);
-   return 0;
-
-error:
-   if(str_hdr)
-   pkg_free(str_hdr);
-   return -1;
+  int expires;
+  int result = 0;
+  uac_req_t uac_r;
+  str met = {NULL, 0};
+  int ret_code = 0;
+  dlg_t* td = NULL;
+
+
+  if(p->desired_expires== 0)
+expires= default_expires;
+  else
+expires= p->desired_expires- (int)time(NULL);
+
+  if(p->watcher_uri== NULL)
+  {
+
+str_hdr = publ_build_hdr(expires, get_event(p->event), NULL,
+&p->etag, p->extra_headers, 0);
+
+if(str_hdr == NULL)
+{
+  LM_ERR("while building extra_headers\n");
+  ret_code = -1;
+  goto done;
+}
+LM_DBG("str_hdr:\n%.*s\n ", str_hdr->len, str_hdr->s);
+
+cb_param= build_uppubl_cbparam(p);
+if(cb_param== NULL)
+{
+  LM_ERR("while constructing publ callback param\n");
+  ret_code = -1;
+  goto done;
+}
+
+met.s =  (char*)pkg_malloc(8*sizeof(char));
+if(met.s == NULL) {
+  LM_ERR("no memory for met.s(PUBLISH)\n");
+  ret_code = -1;
+  goto done;
+}
+memset(met.s, 0, 8);
+memcpy(met.s, "PUBLISH", 7);
+met.len = 7;
+set_uac_req(&uac_r,&met, str_hdr, 0, 0, TMCB_LOCAL_COMPLETED,
+publ_cback_func, (void*)cb_param);
+
+result= tmb.t_request(&uac_r,
+p->pres_uri,  /* Request-URI */
+p->pres_uri,  /* To */
+p->pres_uri,  /* From */
+&outbound_proxy /* Outbound proxy*/
+);
+if(result<  0)
+{
+  LM_ERR("in t_request function\n");
+  shm_free(cb_param);
+  cb_param = NULL;
+  ret_code = -1;
+  goto done;
+}
+  }
+  else
+  {
+td= pua_build_dlg_t(p);
+if(td== NULL)
+{
+  LM_ERR("while building tm dlg_t structure");
+  ret_code = -1;
+  goto done;
+};
+
+str_hdr= subs_build_hdr(&p->contact, expires,p->event,p->extra_headers);
+if(str_hdr== NULL || str_hdr->s== NULL)
+{
+  if(p->event!=0)
+LM_ERR("while building extra headers\n");
+
+  ret_code = -1;
+  goto done;
+}
+
+cb_param= subs_cbparam_indlg(p, expires, REQ_ME);
+if(cb_param== NULL)
+{
+  LM_ERR("while constructing subs callback param\n");
+  ret_code = -1;
+  goto done;
+}
+
+met.s =  (char*)pkg_malloc(10*sizeof(char));
+if(met.s == NULL) {
+  LM_ERR("no memory for met.s(SUBSCRIBE)\n");
+  ret_code = -1;
+  goto done;
+}
+memset(met.s, 0, 10);
+memcpy(met.s, "SUBSCRIBE", 9);
+met.len = 9;
+set_uac_req(&uac_r,&met, str_hdr, 0, td, TMCB_LOCAL_COMPLETED,
+subs_cback_func, (void*)cb_param);
+
+result= tmb.t_request_within(&uac_r);
+if(result<  0)
+{
+  LM_ERR("in t_request function\n");
+  ret_code = -1;
+  shm_free(cb_param);
+  cb_param = NULL;
+  goto done;
+}
+  }
+
+
+done:
+  if(td!=NULL)
+  {
+   if(td->route_set)
+  free_rr(&td->route_set);
+
+pkg_free(td);
+td= NULL;
+  }
+
+  if(met.s != NULL) {
+pkg_free(met.s);
+met.s = NULL;
+met.len = 0;
+  }
+
+  if(str_hdr != NULL) {
+pkg_free(str_hdr);
+str_hdr = NULL;
+  }

+  return ret_code;
  }

  static void db_update(unsigned int ticks,void *param)


It seems a lot of change, but there are only a few lines changed,
probably in the file I modify I have convert the TAB to Space and the
diff does not recognize them. Another thing is I use dynamic memory
for the str SUBSCRIBE and PUBLISH.




Another thing for the management of NOTIFY arrives before the 202/200
OK of SUBSCRIBE, in addition to the patches done previously, maybe the
hash.c need to patch for the is_dialog function which is called for
the NOTIFY in PUA_XMPP module:

# diff -u hash.c.orig hash.c
--- hash.c.orig 2011-12-27 13:38:06.0 +0100
+++ hash.c  2011-12-27 13:38:38.0 +0100
@@ -487,10 +487,11 @@
 hash_code= core_hash(dialog->pres_uri, dialog->watcher_uri, HASH_SIZE);
 lock_get(&HashT->p_records[hash_code].lock);

-   if(get_dialog(dialog, hash_code)== NULL)
-   ret_code= -1;
-   else
+   if(get_dialog(dialog, hash_code) ||
get_temporary_dialog(dialog, hash_code))
 ret_code= 0;
+   else
+   ret_code= -1;
+
 lock_release(&HashT->p_records[hash_code].lock);

 return ret_code;


Best Regards,
Laura

On Fri, Dec 23, 2011 at 5:10

Re: [SR-Users] problem with create and release tcp connections

2011-12-29 Thread Daniel-Constantin Mierla

Hello,

On 12/28/11 2:41 PM, Bruno Bresciani wrote:

Hi all,

Someone know if the kamailio 1.5.0 has problem to create and release 
tcp connetctions after some time running? In my SIP network I have six 
IP telephones and one gateway registered over TLS, after some time 
(one day) this devices have problems to register and make calls. I 
noticed through the log a freezing of kamailio when it try release the 
tcp connections. Below is part of the log where I notice this behavior:


*Dec 28 09:46:46 vts74 /home2/local/kamailio/sbin/kamailio[8951]: 
DBG:core:io_watch_add: io_watch_add(0x816cc80, 25, 2, 0xb61e6558), 
fd_no=20
Dec 28 09:46:46 vts74 /home2/local/kamailio/sbin/kamailio[8951]: 
DBG:core:handle_tcp_child: cmd CONN_RELEASE  0xb61e6558 refcnt= 0
Dec 28 09:47:11 vts74 /home2/local/kamailio/sbin/kamailio[8940]: 
DBG:usrloc:nodb_timer: Binding '2503','sips:2503@192.168.174.178 
<mailto:sips%3A2503@192.168.174.178>;transport=tls' has expired
Dec 28 09:47:26 vts74 /home2/local/kamailio/sbin/kamailio[8951]: 
DBG:core:handle_tcpconn_ev: data available on 0xb621d710 30
Dec 28 09:47:26 vts74 /home2/local/kamailio/sbin/kamailio[8951]: 
DBG:core:io_watch_del: io_watch_del (0x816cc80, 30, -1, 0x0) fd_no=21 
called*


I know that upgrade to kamailio 3xx is recommended and I'm working to 
do it, but before, I have to understand this behavior.
TLS was really experimental in 1.x, I don't think anyone here among 
developers is going to sped time troubleshooting it.


General hints, attach with gdb to the pid and do a backtrace to see what 
is doing. Check with netstat the state of the connection, too.


Cheers,
Daniel


--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda

___
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 for "Status-Line"

2011-12-29 Thread Daniel-Constantin Mierla



On 12/29/11 3:42 PM, Andrew Pogrebennyk wrote:

On 12/29/2011 03:36 PM, Robert R wrote:

Thank a lot. $T_reply_code works.
I tried all variables in pv doc ($rc, $err.rcode, $rs ... ) and none of
them works,

Actually the $rs pseudo-variable should also work as described here:
http://sip-router.org/wiki/cookbooks/pseudo-variables/devel#sip_reply_s_status_status-code_response-code_reply-code

Good that it helps.
$rs works in onreply_routes, but I guess Robert needed it in 
failure_route, where the $T_reply_code is the right option.


Cheers,
Daniel

--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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 does not trigger the event_route

2011-12-29 Thread Daniel-Constantin Mierla

Hello,

it proved that the msg parameter for event_route execution due to 
keepalives was not set to the faked structure. The event route was 
executed but many functions don't do anything as the sip message was 
missing.


Try with latest git branch 3.2, I just pushed the fix for it.

Cheers,
Daniel

On 12/29/11 11:19 AM, Mino Haluz wrote:
No, I do not see anything related in messages nor in syslog. Otherwise 
dispatcher is working fine, but that event-route is still not 
triggered and I really need the information about failure...


The output of kamctl fifo ds_list is ok, one gw is marked as IP and 
another one as AP. When I flush the firewall the both are AP, so the 
mechanism is working ..


Is there any debugging procedure of event-routes?

On Tue, Dec 20, 2011 at 11:13 AM, Peter Dunkley 
<mailto:peter.dunk...@crocodile-rcs.com>> wrote:


Once your destination has failed (and after you expect to see the
output from the event_route), what is the output of kamctl fifo
ds_list?

Do you see anything else in /var/log/messages at this point?

Peter


On Tue, 2011-12-20 at 11:05 +0100, Mino Haluz wrote:

nightly build 3.2.1.

compiled on 05:08:17 Dec 19 2011 with gcc 4.4.5

On Tue, Dec 20, 2011 at 10:49 AM, Peter Dunkley
<mailto:peter.dunk...@crocodile-rcs.com>> wrote: 


Hello,

What version of Kamailio are you using?

The dispatcher "event_route"s were added in Kamailio 3.2.0 so
this will only work in Kamailio 3.2.0 and later.

Regards,

Peter 





On Tue, 2011-12-20 at 10:06 +0100, Mino Haluz wrote:



Hi,

I have two gateways pinged by kamailio. The both are AP
(active/probing), when I cut the one gateway off, it becomes
IP(inactive/probing) but the event_route is not fired up. Am
I missing something ?

event_route[dispatcher:dst-down] {
xlog("L_ERR", "Destination down: $rm $ru ($du)\n");
}

Mino 



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


-- 
Peter Dunkley

Technical Director
Crocodile RCS Ltd


___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users
mailing list
sr-users@lists.sip-router.org
<mailto: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  <mailto:sr-users@lists.sip-router.org>
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


-- 
Peter Dunkley

Technical Director
Crocodile RCS Ltd


___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing
list
sr-users@lists.sip-router.org <mailto: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


--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda

___
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] No memory left in send_subscribe (PUA) from update_pua while building the tm dlg_t structure

2011-12-29 Thread Daniel-Constantin Mierla

Hello Laura,

I applied most of the patches, apart the second one for hash.c, related 
to checking for temporary dialog. I need to look a bit more at it, since 
there was some work in this regard:


http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=b93149c756d3e983c70608938f1142ed43ee1834

If I understood right, it is about NOTIFY getting processed faster than 
200OK for SUBSCRIBE. Do I remember correctly, you are running 3.1.x? It 
might not be in branch 3.1.


Cheers,
Daniel

On 12/28/11 6:15 PM, laura testi wrote:

Hi Daniel,
Yes, all patches are related to the PUA module. Please find the
attachments for both diff files and new files with applied patches If
you thinks they are useful. Now the old files should be the latest
version of the master branch ;-) Unfortunately I can not use git here.
We have tested the patches, now no memory leak any more; and no more
error for NOTIFY (dialog not found)...Please note, our use case is the
pua_xmpp, now it works fine. I don't know if rls has the same problem.
Thank you veru much for your helps again.

Some explanations:

In the send_subscribe.c,
   - I just comment out the line 1172 so that the pua_free_tm_dlg(td)
do the right job later as you done also in this case.

In the hash.c,
   - in the get_dialog function, I add the check of "p->to_tag.len>  0"
in the string compare conditions;

   - in the is_dialog function, instead of check only the real dialog,
the check of also the temporary dialog is added, this also helps to
avoid the error of no dialog found for the NOTIFY if the NOTIFY is
received before the 202/200 OK of the SUBSCRIBE.

in the pua.c,
   -   a few changes in  the update_pua function:
  - apply the same kind of free td and td->route_set, unfortunately
I can not re-use pua_free_tm_dlg which is local for send_subscribe.c.
  - change from goto error to goto done


Best Regards,
Laura



On Wed, Dec 28, 2011 at 2:39 PM, Daniel-Constantin Mierla
  wrote:

Hello,


On 12/27/11 1:51 PM, laura testi wrote:

Hi Daniel,
I tried the patch, it works partially. There are stil memory leak.
Based on your patch, I did find different places need the same kind of
patch both in send_subscribe,c and in pua,c


ok, thanks, I will look over. But how did you do the patches, since it does
not take my latest patch, seems to be against an older version, because the
indentation is not there?

I cannot apply it like this, maybe you can tell the files and lines you
changed, otherwise is hard to track.

Are both patches to the pua module? You are doing the patch with files only,
it is more convenient to call the diff with path to the module, in this way
is easy to spot in which module to apply the path -- i.e., use diff from
root folder of kamailio, like:

diff -u modules/abc/oldfile modules/abc/newfile

Since you are sending a lot of patches, maybe it will work better if you
just clone the git, make the patch against the master branch -- change the
file in the master branch and then just do:

git diff>  path/to/save/patch.file

Some info that could be useful for working with git and patches, including
backporting, at:

http://www.kamailio.org/wiki/devel/backporting-to-3.2.x

Cheers,
Daniel




Please find the modified version of these files.

Following are the differences:
# diff -u send_subscribe.c.orig send_subscribe.c
--- send_subscribe.c.orig   2011-12-27 13:31:06.0 +0100
+++ send_subscribe.c2011-12-27 13:31:51.0 +0100
@@ -1151,7 +1151,6 @@
 if (dbmode!=PUA_DB_ONLY)

lock_release(&HashT->p_records[hash_code].lock);
 ret= -1;
-   pkg_free(td);
 goto done;
 }
 if (dbmode!=PUA_DB_ONLY)





# diff -u pua.c.orig pua.c
--- pua.c.orig  2011-12-27 13:15:47.0 +0100
+++ pua.c   2011-12-27 13:26:33.0 +0100
@@ -673,106 +673,145 @@

  int update_pua(ua_pres_t* p)
  {
-   str* str_hdr= NULL;
-   int expires;
-   int result;
-   uac_req_t uac_r;
-
-   if(p->desired_expires== 0)
-   expires= 3600;
-   else
-   expires= p->desired_expires- (int)time(NULL);
+  str* str_hdr= NULL;
+  ua_pres_t* cb_param = NULL;

-   if(p->watcher_uri== NULL)
-   {
-   str met= {"PUBLISH", 7};
-   ua_pres_t* cb_param;
-
-   str_hdr = publ_build_hdr(expires, get_event(p->event), NULL,
-&p->etag, p->extra_headers, 0);
-   if(str_hdr == NULL)
-   {
-   LM_ERR("while building extra_headers\n");
-   goto error;
-   }
-   LM_DBG("str_hdr:\n%.*s\n ", str_hdr->len, str_hdr->s);
-
-   cb_param= build_uppubl_cbparam(p);
-   if(cb_param== NULL)
-   {
-   LM_ERR("while constructing publ callba

[SR-Users] Happy New Year!

2011-12-31 Thread Daniel-Constantin Mierla
This was it for 2011, final timeout for a fruitful year! Many thanks to 
the community for keeping things moving forward!


A happy and prosperous 2012 to all Kamailio and SER friends!!!

Cheers,
Daniel

--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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] Intermittent start up issue

2012-01-02 Thread Daniel-Constantin Mierla

Hello,

check also for limits in the system/firewall, maybe there are limits on 
new connections per second. Try with children=1 and see if it happens 
again, if not, then it is something that blocks many new connections in 
short time.


Cheers,
Daniel

On 1/2/12 5:31 AM, Sammy Govind wrote:

Hi,
Its all upto you then, that's an intermittent issue and information is 
not complete to trace the issue. Did you see the same Errors every 
time it fails !?


--
Regards
Sammy

On Sun, Jan 1, 2012 at 10:06 PM, Ali Jawad <mailto:ali.ja...@splendor.net>> wrote:


Hi
Thanks for your input, but as said this works at times yes and times
now so I am not sure it is a definite DB issue, the servers are in the
same LAN, and there are other modules that use the DB string that work
when launched before this one while this one does not work.
Regards

On Sun, Jan 1, 2012 at 4:13 PM, Sammy Govind mailto:govoi...@gmail.com>> wrote:
> Hi,
> forget the whole list of errors and just resolve the DB
connectivity between
> the Kamailio server and DB server first .
>
>> 27(24762) ERROR: db_mysql [km_my_con.c:109]: driver error: Can't
>> connect to MySQL server on 'x' (4)
>
>
> try connecting to the remote DB server 'x' from linux
shell i.e
>
> # mysql -u -p -h 'x'
>
> Regards,
> Sammy
>
>
> On Fri, Dec 30, 2011 at 3:33 PM, Ali Jawad
mailto:ali.ja...@splendor.net>> wrote:
>>
>> Hi All
>> I have tried the below with Kamailio 3.1.0 and 3.2.1. the
problem is
>> that Kamailio at times fails to start up for no obvious
reasons, I.e.
>> in 10 restarts Kamailio might fail to start 3,0 or 5 times. Te
debug
>> log "level 2 " shows the following :
>>
>> 27(24762) ERROR: db_mysql [km_my_con.c:109]: driver error: Can't
>> connect to MySQL server on 'x' (4)
>> 27(24762) ERROR:  [db.c:303]: could not add connection to the
>> pool27(24762) ERROR: group [group.c:211]: unable to connect to the
>> database
>> 27(24762) ERROR:  [sr_module.c:889]: init_mod_child(): Error
>> while initializing module group
>> (/usr/local/kamailio/lib/kamailio/modules_k/group.so)
>> 27(24762) ERROR:  [pt.c:481]: ERROR: fork_tcp_process():
>> init_child failed for process 27, pid 24762, "tcp receiver child=1"
>>
>> and then
>>
>>
>> 30(24765) :  [pass_fd.c:293]: ERROR: receive_fd: EOF on 45
>>  0(24735) ALERT:  [main.c:748]: child process 24762 exited
>> normally, status=255
>>  0(24735) INFO:  [main.c:766]: INFO: terminating due to
SIGCHLD
>>
>> The problem happens on 4 different servers, I did try to
compile more
>> than once, the servers are 32 Bit CentOS 5.6. The connection to the
>> database is monitored and there are no issues with connecting
to the
>> DB "it works at times and times not for Kamailio so a user/pwd
issue
>> is not likely to cause this, manual cnnect worked", config file
errors
>> are not found.
>>
>> I did also check max no of connections on MySQL server which is
set to
>> 500 on the server and only 100 cons are used. The group module uses
>> the same connection string as other modules  which is
predefined  and
>> there are other modules that access the db before the group
module and
>> those do not have a problem.
>>
>> Please advice.
>>
>> Regards
>>
>> ___
>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users
mailing list
>> sr-users@lists.sip-router.org
<mailto: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 <mailto:sr-users@lists.sip-router.org>
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>



--
Ali Jawad
Information Systems Manager
Splendor Telecom (www.splendor.net <http://www.splendor.net>)
Beirut, Lebanon
Phone: +9611373725 /ext 116
FAX: +9611375554 

___________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing
list
sr-users@lists.sip-router.org <mailto:sr-users@lists.sip-router

Re: [SR-Users] No memory left in send_subscribe (PUA) from update_pua while building the tm dlg_t structure

2012-01-02 Thread Daniel-Constantin Mierla

Hello,

On 12/29/11 7:06 PM, laura testi wrote:

Hi Daniel,
yes we are running 3.1.5, but we have back ported the whole pua module
from the master branch that included also the patches in your link. In
fact, the second patch use the patches from the link you have
mentioned to solve the same problem. Because the patches themselves
from the link  
(http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=b93149c756d3e983c70608938f1142ed43ee1834)
are not enough for the PUA_XMPP module.
ok, checking for side effects was the reason not to go ahead with the 
patch immediately. I was looking and the is_dialog function seems to be 
used just by other modules, not by pua itself: pua_bla, pua_xmpp and 
purple. I think it is safe to go ahead with it, maybe in a different 
form, like returning different values when it is established or 
temporary dialog, eventually with an extra parameter to specify which 
kind of dialogs should be searched -- this needs a bit of analyze to 
choose the best.


Cheers,
Daniel



The same problem is true both for RLS and for PUA_XMPP. The real
problem is that for some strange reason (I don't know why), the
PUA_XMPP receive/process the NOTIFY message received from kamailio
presence server before the 200OK of the SUBSCRIBE. That's why the
previous patched implement the temporary dialog to avoid it. But it's
not enough, at least for PUA_XMPP.

If you have a look at the line 196 inside the function
Notify2Xmpp(struct sip_msg* msg, char* s1, char* s2) in the file
modules_k/pua_xmpp/simple2xmpp.c:

  196 if(pua_is_dialog(&dialog)<  0) // verify if within a stored dialog
  197 {
  198 LM_ERR("Notify in a non existing dialog\n");
  199 goto error;
  200 }

In this case, the PUA_XMPP will print the Error and does not process
the NOTIFY message (convert it to XMPP and send it out to the XMPP
domain). And we got a lot of error "Notify in a non existing dialog"
in the log file. After we applied the patches from the link, the
errors are still there, because the pua_is_dialog call the function
is_dialog defined in the hash.c in the pua module, without the second
patch of hash.c, it will still return -1 because is_dialog checks the
dialog only against the real dialog in the hash, but not the temporary
one. After we have applied the patch in the is_dialog function. The
error is gone ;-) But I don't know if this may have impact on other
modules. I means I don't know if there are some modules use this
function to check if the only real dialog (but not temporary dialog)
is existing in the hash. In this case maybe is better to have 2 check
functions, one for real, another for both or temporary. What do you
think?


Best Regards,
Laura







But the patches

Yes, the second



On Thu, Dec 29, 2011 at 4:41 PM, Daniel-Constantin Mierla
  wrote:

Hello Laura,

I applied most of the patches, apart the second one for hash.c, related to
checking for temporary dialog. I need to look a bit more at it, since there
was some work in this regard:

http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=b93149c756d3e983c70608938f1142ed43ee1834

If I understood right, it is about NOTIFY getting processed faster than
200OK for SUBSCRIBE. Do I remember correctly, you are running 3.1.x? It
might not be in branch 3.1.

Cheers,
Daniel


On 12/28/11 6:15 PM, laura testi wrote:

Hi Daniel,
Yes, all patches are related to the PUA module. Please find the
attachments for both diff files and new files with applied patches If
you thinks they are useful. Now the old files should be the latest
version of the master branch ;-) Unfortunately I can not use git here.
We have tested the patches, now no memory leak any more; and no more
error for NOTIFY (dialog not found)...Please note, our use case is the
pua_xmpp, now it works fine. I don't know if rls has the same problem.
Thank you veru much for your helps again.

Some explanations:

In the send_subscribe.c,
   - I just comment out the line 1172 so that the pua_free_tm_dlg(td)
do the right job later as you done also in this case.

In the hash.c,
   - in the get_dialog function, I add the check of "p->to_tag.len>  0"
in the string compare conditions;

   - in the is_dialog function, instead of check only the real dialog,
the check of also the temporary dialog is added, this also helps to
avoid the error of no dialog found for the NOTIFY if the NOTIFY is
received before the 202/200 OK of the SUBSCRIBE.

in the pua.c,
   -   a few changes in  the update_pua function:
  - apply the same kind of free td and td->route_set, unfortunately
I can not re-use pua_free_tm_dlg which is local for send_subscribe.c.
  - change from goto error to goto done


Best Regards,
Laura



On Wed, Dec 28, 2011 at 2:39 PM, Daniel-Constantin Mierla
  wrote:

Hello,


On 12/27/11 1:51 PM, laura testi wrote:

Hi Daniel,
I tried the patch, it 

Re: [SR-Users] usrloc, timer process and cache cleanup

2012-01-02 Thread Daniel-Constantin Mierla

Hello,

On 12/23/11 1:39 PM, Andreas Granig wrote:

Hi,

On 12/23/2011 12:28 AM, Daniel-Constantin Mierla wrote:

If someone is messing with the db, kamailio shouldn't try to correct
admin mistakes.

It was just an example, I haven't gone to all corner cases that can
happen from human or (self or different) application errors. There were
couple of similar reports in the past, related to conflicts of
insert/update, update/insert, delete/update a.s.o. cases, so I proposed
to go for a portable solution, not for one which valid to a db driver
only -- configurable or not, is different thing than the specific topic.

Of course you can never rule out admin errors or application errors, but
anyways I'll highly favor a more resilient approach.


I encountered several cases when things can go bad at database layer 
while doing cross replication along with t_replicate(). Finding a 
solution would be a good thing. The fact is that these situations should 
be corner cases, so there has to be a solution not impact the normal 
operation mode.


I've tried to reproduce the most obvious scenario, which is registering
a subscriber, delete it from the underlying db table, then re-register
again. The expiry value in the cache is refreshed, but it's never
written back to the db table. There are most likely other, more subtle
scenarios, and our customers approved that they didn't mess with the db
manually. The state was always CS_SYNC and Flags was 0.

I don't know the details of the srdb layer, but probably it's possible
to find a way to return the "rows affected" after an update in order to
know whether to try an insert afterwards. Would be possible with mysql,
not sure about pgsql, oracle, dbtext etc. We'll take a look how we could
tackle that.
Mysql has affected row and it is exported by db_mysql module, not sure 
about the other drivers.




I don't think that a log message would help very much, because kamailio
won't know about the missing entry in the db (unless you evaluate the
result of the update), at least in this particular case.
Yes, kamailio does not know, I know, seems it is what we try to solve -- 
first how to make it aware and then do some actions (like writing a log 
message).


Perhaps the best for the moment is to detect at startup and rely on db 
api capabilities and use replace/affected_rows a.s.o. when they are 
available, in the best efficient order -- a module parameter can give 
admins the power to decide over the auto-detect.


Cheers,
Daniel

--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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] usrloc, timer process and cache cleanup

2012-01-02 Thread Daniel-Constantin Mierla



On 12/23/11 8:43 PM, Andrew Pogrebennyk wrote:

On 12/23/2011 08:18 PM, Stefan Sayer wrote:

shouldn't the db layer and driver be smart enough to do insert ... on
duplicate key update at least where it's supported?

my fear is that such "first insert then update" policy will affect the
performance. can create noise in the log on some db backends too..
this one is also a bit tricky to do, as it will require to change the 
database table definition depending on matching mode from 
registrar/usrloc. By RFC, the primary key per aor should be contact 
address for the location records. As we know that lot of phones are 
behind the nat, many users having same environment for home/work phones, 
kamailio can be configured to do the matching also with call id and path 
stack. Because of that, these checks are done inside the modules, there 
is no constraint at location table sql level.


Such approach as suggested in this discussion, will require to add 
proper unique keys depending on configuration from kamailio.cfg.


Cheers,
Daniel

--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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] Intermittent start up issue

2012-01-02 Thread Daniel-Constantin Mierla

Hello,

On 1/2/12 12:24 PM, Ali Jawad wrote:

Hi Daniel
Running on a LAN with no firewalls enabled,


limits can be from kernel, selinix, mysql server  a.s.o. not only from 
firewalls.



  will try you suggestion
though first thing tomorrow morning, what are the implications of
running children=1 ?


This will create only one worker process (not advisable for production 
in long term, just for testing) -- in this way there should be very few 
mysql connections opened, revealing if there is a problem or not with 
the number of connections and the short period to create them.


Cheers,
Daniel

Thanks

On Mon, Jan 2, 2012 at 2:03 PM, Daniel-Constantin Mierla
  wrote:

Hello,

check also for limits in the system/firewall, maybe there are limits on new
connections per second. Try with children=1 and see if it happens again, if
not, then it is something that blocks many new connections in short time.

Cheers,
Daniel


On 1/2/12 5:31 AM, Sammy Govind wrote:

Hi,
Its all upto you then, that's an intermittent issue and information is not
complete to trace the issue. Did you see the same Errors every time it fails
!?

--
Regards
Sammy

On Sun, Jan 1, 2012 at 10:06 PM, Ali Jawad  wrote:

Hi
Thanks for your input, but as said this works at times yes and times
now so I am not sure it is a definite DB issue, the servers are in the
same LAN, and there are other modules that use the DB string that work
when launched before this one while this one does not work.
Regards

On Sun, Jan 1, 2012 at 4:13 PM, Sammy Govind  wrote:

Hi,
forget the whole list of errors and just resolve the DB connectivity
between
the Kamailio server and DB server first .


27(24762) ERROR: db_mysql [km_my_con.c:109]: driver error: Can't
connect to MySQL server on 'x' (4)


try connecting to the remote DB server 'x' from linux shell i.e

# mysql -u  -p  -h 'x'

Regards,
Sammy


On Fri, Dec 30, 2011 at 3:33 PM, Ali Jawad
wrote:

Hi All
I have tried the below with Kamailio 3.1.0 and 3.2.1. the problem is
that Kamailio at times fails to start up for no obvious reasons, I.e.
in 10 restarts Kamailio might fail to start 3,0 or 5 times. Te debug
log "level 2 " shows the following :

27(24762) ERROR: db_mysql [km_my_con.c:109]: driver error: Can't
connect to MySQL server on 'x' (4)
27(24762) ERROR:  [db.c:303]: could not add connection to the
pool27(24762) ERROR: group [group.c:211]: unable to connect to the
database
27(24762) ERROR:  [sr_module.c:889]: init_mod_child(): Error
while initializing module group
(/usr/local/kamailio/lib/kamailio/modules_k/group.so)
27(24762) ERROR:  [pt.c:481]: ERROR: fork_tcp_process():
init_child failed for process 27, pid 24762, "tcp receiver child=1"

and then


30(24765) :  [pass_fd.c:293]: ERROR: receive_fd: EOF on 45
  0(24735) ALERT:  [main.c:748]: child process 24762 exited
normally, status=255
  0(24735) INFO:  [main.c:766]: INFO: terminating due to SIGCHLD

The problem happens on 4 different servers, I did try to compile more
than once, the servers are 32 Bit CentOS 5.6. The connection to the
database is monitored and there are no issues with connecting to the
DB "it works at times and times not for Kamailio so a user/pwd issue
is not likely to cause this, manual cnnect worked", config file errors
are not found.

I did also check max no of connections on MySQL server which is set to
500 on the server and only 100 cons are used. The group module uses
the same connection string as other modules  which is predefined  and
there are other modules that access the db before the group module and
those do not have a problem.

Please advice.

Regards

___
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




--
Ali Jawad
Information Systems Manager
Splendor Telecom (www.splendor.net)
Beirut, Lebanon
Phone: +9611373725/ext 116
FAX: +9611375554

___
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


--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda


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

Re: [SR-Users] RTPproxy on Kamailio 3.2.1 difficulty.

2012-01-03 Thread Daniel-Constantin Mierla

Hello,

the ADDR_IPV4 and ADDR_IPV6 have to be replaced with real IP addresses 
that you have on the system runnin RTPProxy.


Cheers,
Daniel

On 1/3/12 8:56 AM, nunu abe wrote:

Dear Daniel,
Greetings and Happy New year to you all! I would like to thank you 
very much for your detailed and well structured tutorials on Kamailio. 
I am resending this email as I sent the earlier one before I was a 
member of the mailing list and I thought it may have been sent to the 
spam folder. If not then, I apologize for double posting.
I was trying to design a similar scenario like the one " Run your own 
SIP VoIP service on both IPv4 and IPv6 " as explained on Asipto 
web-page(http://kb.asipto.com/kamailio:kamailio-mixed-ipv4-ipv6). 
However I ran into difficulties with rtpproxy. The proxy is not 
routing media packets as it should. I followed the instruction 
regarding the kamailio.cfg file and edited the necessary lines 
according to my settings. I think my problem comes from setting up the 
rtpproxy.
1. I edited the /etc/default/rtpproxy file. i.e. I uncommented the 
line - CONTROL_SOCK="unix:/var/run/rtpproxy/rtpproxy.sock"
2. I started the rtpproxy with this command: rtpproxy -F -l ADDR_IPV4 
-6 /ADDR_IPV6 . However, after this command the system returns the 
message : rtpproxy: setbindhost: No address associated with hostname
It displays the same message even when I replace ADDR_IPV4 and 
ADDR_IPV6 with IP addresses.
3. I have also tried using the udp socket:- 
CONTROL_SOCK=udp:127.0.0.1:2, of course I have replaced the unix 
socket by this udp socket in the kamilio.cfg file.
So my question is, what did I do wrong with the settings that SIP 
messages are traversing normal from IPv4 client to IPv6 client and 
vice versa but media files(RTP packets) are not? The rtpproxy receives 
the media files from one client but fails to forward them to the other 
client.

Thanks for your help.
Maedot


___
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://linkedin.com/in/miconda -- http://twitter.com/miconda

___
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] Intermittent start up issue

2012-01-03 Thread Daniel-Constantin Mierla

Hello,

On 1/3/12 9:14 AM, Ali Jawad wrote:

Hi Daniel

SeLinux is disabled, as I have played around with Children and got a
stable startup at CHILDREN=3, at 4 and up I get the problem described
earlier right away, so it seems that MySQL is throttling Kamailio ?

1- What is the effect of running 3 children only ?
the capacity of handling sip traffic is lowered. You should still be 
able to handle couple of hundred messages per second if you don't have 
slow sql/dns operations. For production, it is recommended to have at 
least 8 to be in safe side.



2- I know this is not a Kamailio thing, but any idea about what needs
to be changed on MySQL server to accommodate more children ? No of
connections is 500 conns out of which max 120 are utilized
So mysql is on a different server, right? Are you sure there is no other 
switch/router doing such throttling? Can you watch on both kamailio and 
mysql server to see if the connections are initiated from kamailio and 
reaching mysql? Maybe you can discover if mysql server get the tcp 
connection but refuses it -- not sure if mysql server can run in 
debug/verbose mode to get some log messages with hints about what is the 
problem.


If the tcp connection does not get to mysql server, then it is a 
throttling in mysql client library or on a device in between the servers.


If you do 'kamctl ps' when having children=3, how many kamailio 
processes are there (extra should be timers, ...)? Each should have one 
mysql connection, so it helps to see at which number the limit starts.


Cheers,
Daniel


Regards

On Mon, Jan 2, 2012 at 1:31 PM, Daniel-Constantin Mierla
  wrote:

Hello,


On 1/2/12 12:24 PM, Ali Jawad wrote:

Hi Daniel
Running on a LAN with no firewalls enabled,


limits can be from kernel, selinix, mysql server  a.s.o. not only from
firewalls.



  will try you suggestion
though first thing tomorrow morning, what are the implications of
running children=1 ?


This will create only one worker process (not advisable for production in
long term, just for testing) -- in this way there should be very few mysql
connections opened, revealing if there is a problem or not with the number
of connections and the short period to create them.

Cheers,
Daniel


Thanks

On Mon, Jan 2, 2012 at 2:03 PM, Daniel-Constantin Mierla
wrote:

Hello,

check also for limits in the system/firewall, maybe there are limits on
new
connections per second. Try with children=1 and see if it happens again,
if
not, then it is something that blocks many new connections in short time.

Cheers,
Daniel


On 1/2/12 5:31 AM, Sammy Govind wrote:

Hi,
Its all upto you then, that's an intermittent issue and information is
not
complete to trace the issue. Did you see the same Errors every time it
fails
!?

--
Regards
Sammy

On Sun, Jan 1, 2012 at 10:06 PM, Ali Jawad
  wrote:

Hi
Thanks for your input, but as said this works at times yes and times
now so I am not sure it is a definite DB issue, the servers are in the
same LAN, and there are other modules that use the DB string that work
when launched before this one while this one does not work.
Regards

On Sun, Jan 1, 2012 at 4:13 PM, Sammy Govindwrote:

Hi,
forget the whole list of errors and just resolve the DB connectivity
between
the Kamailio server and DB server first .


27(24762) ERROR: db_mysql [km_my_con.c:109]: driver error: Can't
connect to MySQL server on 'x' (4)


try connecting to the remote DB server 'x' from linux shell i.e

# mysql -u-p-h 'x'

Regards,
Sammy


On Fri, Dec 30, 2011 at 3:33 PM, Ali Jawad
wrote:

Hi All
I have tried the below with Kamailio 3.1.0 and 3.2.1. the problem is
that Kamailio at times fails to start up for no obvious reasons, I.e.
in 10 restarts Kamailio might fail to start 3,0 or 5 times. Te debug
log "level 2 " shows the following :

27(24762) ERROR: db_mysql [km_my_con.c:109]: driver error: Can't
connect to MySQL server on 'x' (4)
27(24762) ERROR:[db.c:303]: could not add connection to the
pool27(24762) ERROR: group [group.c:211]: unable to connect to the
database
27(24762) ERROR:[sr_module.c:889]: init_mod_child(): Error
while initializing module group
(/usr/local/kamailio/lib/kamailio/modules_k/group.so)
27(24762) ERROR:[pt.c:481]: ERROR: fork_tcp_process():
init_child failed for process 27, pid 24762, "tcp receiver child=1"

and then


30(24765) :[pass_fd.c:293]: ERROR: receive_fd: EOF on 45
  0(24735) ALERT:[main.c:748]: child process 24762 exited
normally, status=255
  0(24735) INFO:[main.c:766]: INFO: terminating due to SIGCHLD

The problem happens on 4 different servers, I did try to compile more
than once, the servers are 32 Bit CentOS 5.6. The connection to the
database is monitored and there are no issues with connecting to the
DB "it works at times and times not for Kamailio so a user/pwd issue
is not likely to cause this, manu

Re: [SR-Users] Intermittent start up issue

2012-01-03 Thread Daniel-Constantin Mierla

Hello,

all it is fine with the output. So it looks like the limit is somewhere 
above 25 connections.


As a try of making a workaround in kamailio side, could be a patch to 
add a global parameter to introduce some latency before forking a 
worker, so these processes won't be created all at a time, but one after 
the other.


However, would be good to find the real reason for such behavior. If the 
tcp connection gets to mysql server, maybe the question should be 
addressed to mysql forums/mailing lists.


Cheers,
Daniel



On 1/3/12 10:48 AM, Ali Jawad wrote:

Hi
I dont think a few hundred per second is enough I need to find out
what is wrong and bring up no of children to 8. The MySQL server is at
another host on the same LAN, as for the command kamctl ps see below

Process::  ID=0 PID=13949 Type=attendant
Process::  ID=1 PID=13950 Type=udp receiver child=0 sock=xx.xx.xx.xx:5060
Process::  ID=2 PID=13951 Type=udp receiver child=1 sock=xx.xx.xx.xx:5060
Process::  ID=3 PID=13952 Type=udp receiver child=2 sock=xx.xx.xx.xx:5060
Process::  ID=4 PID=13953 Type=udp receiver child=0 sock=xx.xx.xx.xx:5061
Process::  ID=5 PID=13954 Type=udp receiver child=1 sock=xx.xx.xx.xx:5061
Process::  ID=6 PID=13955 Type=udp receiver child=2 sock=xx.xx.xx.xx:5061
Process::  ID=7 PID=13956 Type=udp receiver child=0 sock=xx.xx.xx.xx:443
Process::  ID=8 PID=13957 Type=udp receiver child=1 sock=xx.xx.xx.xx:443
Process::  ID=9 PID=13958 Type=udp receiver child=2 sock=xx.xx.xx.xx:443
Process::  ID=10 PID=13959 Type=udp receiver child=0 sock=xx.xx.xx.xx:8080
Process::  ID=11 PID=13960 Type=udp receiver child=1 sock=xx.xx.xx.xx:8080
Process::  ID=12 PID=13961 Type=udp receiver child=2 sock=xx.xx.xx.xx:8080
Process::  ID=13 PID=13962 Type=udp receiver child=0 sock=xx.xx.xx.xx:123
Process::  ID=14 PID=13963 Type=udp receiver child=1 sock=xx.xx.xx.xx:123
Process::  ID=15 PID=13964 Type=udp receiver child=2 sock=xx.xx.xx.xx:123
Process::  ID=16 PID=13965 Type=slow timer
Process::  ID=17 PID=13966 Type=timer
Process::  ID=18 PID=13967 Type=MI FIFO
Process::  ID=19 PID=13968 Type=ctl handler
Process::  ID=20 PID=13969 Type=TIMER NH
Process::  ID=21 PID=13970 Type=tcp receiver child=0
Process::  ID=22 PID=13971 Type=tcp receiver child=1
Process::  ID=23 PID=13972 Type=tcp receiver child=2
Process::  ID=24 PID=13973 Type=tcp main process

I use a few different ports as you can see.


All fine with that output at 3 ?

Regards

On Tue, Jan 3, 2012 at 11:29 AM, Daniel-Constantin Mierla
  wrote:

Hello,


On 1/3/12 9:14 AM, Ali Jawad wrote:

Hi Daniel

SeLinux is disabled, as I have played around with Children and got a
stable startup at CHILDREN=3, at 4 and up I get the problem described
earlier right away, so it seems that MySQL is throttling Kamailio ?

1- What is the effect of running 3 children only ?

the capacity of handling sip traffic is lowered. You should still be able to
handle couple of hundred messages per second if you don't have slow sql/dns
operations. For production, it is recommended to have at least 8 to be in
safe side.



2- I know this is not a Kamailio thing, but any idea about what needs
to be changed on MySQL server to accommodate more children ? No of
connections is 500 conns out of which max 120 are utilized

So mysql is on a different server, right? Are you sure there is no other
switch/router doing such throttling? Can you watch on both kamailio and
mysql server to see if the connections are initiated from kamailio and
reaching mysql? Maybe you can discover if mysql server get the tcp
connection but refuses it -- not sure if mysql server can run in
debug/verbose mode to get some log messages with hints about what is the
problem.

If the tcp connection does not get to mysql server, then it is a throttling
in mysql client library or on a device in between the servers.

If you do 'kamctl ps' when having children=3, how many kamailio processes
are there (extra should be timers, ...)? Each should have one mysql
connection, so it helps to see at which number the limit starts.

Cheers,
Daniel


Regards

On Mon, Jan 2, 2012 at 1:31 PM, Daniel-Constantin Mierla
wrote:

Hello,


On 1/2/12 12:24 PM, Ali Jawad wrote:

Hi Daniel
Running on a LAN with no firewalls enabled,


limits can be from kernel, selinix, mysql server  a.s.o. not only from
firewalls.



  will try you suggestion
though first thing tomorrow morning, what are the implications of
running children=1 ?


This will create only one worker process (not advisable for production in
long term, just for testing) -- in this way there should be very few
mysql
connections opened, revealing if there is a problem or not with the
number
of connections and the short period to create them.

Cheers,
Daniel


Thanks

On Mon, Jan 2, 2012 at 2:03 PM, Daniel-Constantin Mierla
  wrote:

Hello,

check also for limits in the system/firewall, maybe there are limits on
new
connections per second. Try with children=1 and see if it happens
again,
if
not, 

Re: [SR-Users] Intermittent start up issue

2012-01-03 Thread Daniel-Constantin Mierla

Hello,

just another idea to try, not sure if it is convenient -- can you 
install and use different version of mysql server and client library? 
This should reveal whether is an issue specific to mysql version.


Cheers,
Daniel

On 1/3/12 11:35 AM, Daniel-Constantin Mierla wrote:

Hello,

all it is fine with the output. So it looks like the limit is 
somewhere above 25 connections.


As a try of making a workaround in kamailio side, could be a patch to 
add a global parameter to introduce some latency before forking a 
worker, so these processes won't be created all at a time, but one 
after the other.


However, would be good to find the real reason for such behavior. If 
the tcp connection gets to mysql server, maybe the question should be 
addressed to mysql forums/mailing lists.


Cheers,
Daniel



On 1/3/12 10:48 AM, Ali Jawad wrote:

Hi
I dont think a few hundred per second is enough I need to find out
what is wrong and bring up no of children to 8. The MySQL server is at
another host on the same LAN, as for the command kamctl ps see below

Process::  ID=0 PID=13949 Type=attendant
Process::  ID=1 PID=13950 Type=udp receiver child=0 
sock=xx.xx.xx.xx:5060
Process::  ID=2 PID=13951 Type=udp receiver child=1 
sock=xx.xx.xx.xx:5060
Process::  ID=3 PID=13952 Type=udp receiver child=2 
sock=xx.xx.xx.xx:5060
Process::  ID=4 PID=13953 Type=udp receiver child=0 
sock=xx.xx.xx.xx:5061
Process::  ID=5 PID=13954 Type=udp receiver child=1 
sock=xx.xx.xx.xx:5061
Process::  ID=6 PID=13955 Type=udp receiver child=2 
sock=xx.xx.xx.xx:5061

Process::  ID=7 PID=13956 Type=udp receiver child=0 sock=xx.xx.xx.xx:443
Process::  ID=8 PID=13957 Type=udp receiver child=1 sock=xx.xx.xx.xx:443
Process::  ID=9 PID=13958 Type=udp receiver child=2 sock=xx.xx.xx.xx:443
Process::  ID=10 PID=13959 Type=udp receiver child=0 
sock=xx.xx.xx.xx:8080
Process::  ID=11 PID=13960 Type=udp receiver child=1 
sock=xx.xx.xx.xx:8080
Process::  ID=12 PID=13961 Type=udp receiver child=2 
sock=xx.xx.xx.xx:8080
Process::  ID=13 PID=13962 Type=udp receiver child=0 
sock=xx.xx.xx.xx:123
Process::  ID=14 PID=13963 Type=udp receiver child=1 
sock=xx.xx.xx.xx:123
Process::  ID=15 PID=13964 Type=udp receiver child=2 
sock=xx.xx.xx.xx:123

Process::  ID=16 PID=13965 Type=slow timer
Process::  ID=17 PID=13966 Type=timer
Process::  ID=18 PID=13967 Type=MI FIFO
Process::  ID=19 PID=13968 Type=ctl handler
Process::  ID=20 PID=13969 Type=TIMER NH
Process::  ID=21 PID=13970 Type=tcp receiver child=0
Process::  ID=22 PID=13971 Type=tcp receiver child=1
Process::  ID=23 PID=13972 Type=tcp receiver child=2
Process::  ID=24 PID=13973 Type=tcp main process

I use a few different ports as you can see.


All fine with that output at 3 ?

Regards

On Tue, Jan 3, 2012 at 11:29 AM, Daniel-Constantin Mierla
  wrote:

Hello,


On 1/3/12 9:14 AM, Ali Jawad wrote:

Hi Daniel

SeLinux is disabled, as I have played around with Children and got a
stable startup at CHILDREN=3, at 4 and up I get the problem described
earlier right away, so it seems that MySQL is throttling Kamailio ?

1- What is the effect of running 3 children only ?
the capacity of handling sip traffic is lowered. You should still be 
able to
handle couple of hundred messages per second if you don't have slow 
sql/dns
operations. For production, it is recommended to have at least 8 to 
be in

safe side.



2- I know this is not a Kamailio thing, but any idea about what needs
to be changed on MySQL server to accommodate more children ? No of
connections is 500 conns out of which max 120 are utilized
So mysql is on a different server, right? Are you sure there is no 
other

switch/router doing such throttling? Can you watch on both kamailio and
mysql server to see if the connections are initiated from kamailio and
reaching mysql? Maybe you can discover if mysql server get the tcp
connection but refuses it -- not sure if mysql server can run in
debug/verbose mode to get some log messages with hints about what is 
the

problem.

If the tcp connection does not get to mysql server, then it is a 
throttling

in mysql client library or on a device in between the servers.

If you do 'kamctl ps' when having children=3, how many kamailio 
processes

are there (extra should be timers, ...)? Each should have one mysql
connection, so it helps to see at which number the limit starts.

Cheers,
Daniel


Regards

On Mon, Jan 2, 2012 at 1:31 PM, Daniel-Constantin Mierla
wrote:

Hello,


On 1/2/12 12:24 PM, Ali Jawad wrote:

Hi Daniel
Running on a LAN with no firewalls enabled,


limits can be from kernel, selinix, mysql server  a.s.o. not only 
from

firewalls.



  will try you suggestion
though first thing tomorrow morning, what are the implications of
running children=1 ?


This will create only one worker process (not advisable for 
production in

long term, just for testing) -- in this way there should be very few
mysql
connections opened, revealing if there is a problem or not with the
number
of

[SR-Users] New Year, New Module: app_mono - embedded execution of managed code

2012-01-03 Thread Daniel-Constantin Mierla

Hello,

the first committed module in 2012 is app_mono, which offers embedded 
execution of manage code (e.g., C#/.NET) via Mono project 
(http://www.mono-project.com/).


The readme of the new module is available at:

  * http://kamailio.org/docs/modules/devel/modules/app_mono.html

Current API which exported by SIP server for usage in C# application is 
documented at:


  * http://www.kamailio.org/wiki/embeddedapi/devel/mono

Besides C#, app_mono should be able to run managed code compiled from 
applications written in other languages such as VisualBasic.NET, Java, 
Java Script, Python, ... more are listed at:


  * http://www.mono-project.com/Languages

A primary use is integration with several widely used Microsoft 
technologies and APIs, for example C# having up-to-date libraries to 
connect to Active Directory LDAP service or MS SQL Server.


Happy 2012,
Daniel

--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda

___
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] Authentication Feature Question

2012-01-03 Thread Daniel-Constantin Mierla

Hello,

you can simply use 'domain.com' as realm parameter to authentication 
function instead of $fd. Also build ha1 and ha1b with domain.com and 
then you are safe no matter which sip server is used.


Of course you can build the realm by striping first token before '.' in 
$fd and pass it to authentication functions, but not sure if makes sense 
since it should be always domain.com


Cheers,
Daniel

On 1/3/12 3:15 PM, Ali Jawad wrote:

Hi
After some research it seems to me that the only way to achieve this
is to "try" and change how hashing is done in the source code, a
little bit too ambitious for me, and it means I will have loads of
problems each time an upgrade is released.

Or

Use pseudovariables to fix the value of the $fd value to something
constant, while this worked for values like $var(y) I was not able to
assign/strip $fd to remove the subdomain part.

Any input please ?

Regards

On Tue, Jan 3, 2012 at 2:06 PM, Ali Jawad  wrote:

Hi
I do have 3 Kamailio servers, one for mobile phone registrations, one
for softphone registrations and one for SIP device registrations. Each
of those devices connects to it's perspective kamailio server

sip1.domain.com
sip2.domain.com
sip3.domain.com

All 3 Kamailio servers share the same database, and users can use
their kamailio user/pwd on any of the devices, now I want to use
encrypted passwords and remove clear text passwords from the database.
I did test with one server and all is fine,however if a user want to
register from the second kamailio server it does not work, basically
because the db domain entry from which the hash is created is
sip1.domain.com and stored in the db, while the user connects from to
sip2.domain.com this eventually generates a different hash.

Is there anyway to overcome this ? Can I exclude Domain from Hash
generation ? Any other option that allows me to do the above ?

Thanks





--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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] Intermittent start up issue

2012-01-03 Thread Daniel-Constantin Mierla

Hello,

On 1/3/12 11:58 AM, Ali Jawad wrote:

Same client library different server version working fine !

ok, good to know. What was the version of mysql sever giving troubles?


  Any chance
the patch can be released anytime soon ?
That was an idea, but it is not sure it will fix, it has to be tried. I 
will see when I have time for it and notify you to try it once is committed.


Cheers,
Daniel


  I will migrate to the newer
MySQL server in the next few mos though, I can wait if needed.
Regards

On Tue, Jan 3, 2012 at 12:44 PM, Daniel-Constantin Mierla
  wrote:

Hello,

just another idea to try, not sure if it is convenient -- can you install
and use different version of mysql server and client library? This should
reveal whether is an issue specific to mysql version.

Cheers,
Daniel


On 1/3/12 11:35 AM, Daniel-Constantin Mierla wrote:

Hello,

all it is fine with the output. So it looks like the limit is somewhere
above 25 connections.

As a try of making a workaround in kamailio side, could be a patch to add
a global parameter to introduce some latency before forking a worker, so
these processes won't be created all at a time, but one after the other.

However, would be good to find the real reason for such behavior. If the
tcp connection gets to mysql server, maybe the question should be addressed
to mysql forums/mailing lists.

Cheers,
Daniel



On 1/3/12 10:48 AM, Ali Jawad wrote:

Hi
I dont think a few hundred per second is enough I need to find out
what is wrong and bring up no of children to 8. The MySQL server is at
another host on the same LAN, as for the command kamctl ps see below

Process::  ID=0 PID=13949 Type=attendant
Process::  ID=1 PID=13950 Type=udp receiver child=0 sock=xx.xx.xx.xx:5060
Process::  ID=2 PID=13951 Type=udp receiver child=1 sock=xx.xx.xx.xx:5060
Process::  ID=3 PID=13952 Type=udp receiver child=2 sock=xx.xx.xx.xx:5060
Process::  ID=4 PID=13953 Type=udp receiver child=0 sock=xx.xx.xx.xx:5061
Process::  ID=5 PID=13954 Type=udp receiver child=1 sock=xx.xx.xx.xx:5061
Process::  ID=6 PID=13955 Type=udp receiver child=2 sock=xx.xx.xx.xx:5061
Process::  ID=7 PID=13956 Type=udp receiver child=0 sock=xx.xx.xx.xx:443
Process::  ID=8 PID=13957 Type=udp receiver child=1 sock=xx.xx.xx.xx:443
Process::  ID=9 PID=13958 Type=udp receiver child=2 sock=xx.xx.xx.xx:443
Process::  ID=10 PID=13959 Type=udp receiver child=0
sock=xx.xx.xx.xx:8080
Process::  ID=11 PID=13960 Type=udp receiver child=1
sock=xx.xx.xx.xx:8080
Process::  ID=12 PID=13961 Type=udp receiver child=2
sock=xx.xx.xx.xx:8080
Process::  ID=13 PID=13962 Type=udp receiver child=0 sock=xx.xx.xx.xx:123
Process::  ID=14 PID=13963 Type=udp receiver child=1 sock=xx.xx.xx.xx:123
Process::  ID=15 PID=13964 Type=udp receiver child=2 sock=xx.xx.xx.xx:123
Process::  ID=16 PID=13965 Type=slow timer
Process::  ID=17 PID=13966 Type=timer
Process::  ID=18 PID=13967 Type=MI FIFO
Process::  ID=19 PID=13968 Type=ctl handler
Process::  ID=20 PID=13969 Type=TIMER NH
Process::  ID=21 PID=13970 Type=tcp receiver child=0
Process::  ID=22 PID=13971 Type=tcp receiver child=1
Process::  ID=23 PID=13972 Type=tcp receiver child=2
Process::  ID=24 PID=13973 Type=tcp main process

I use a few different ports as you can see.


All fine with that output at 3 ?

Regards

On Tue, Jan 3, 2012 at 11:29 AM, Daniel-Constantin Mierla
wrote:

Hello,


On 1/3/12 9:14 AM, Ali Jawad wrote:

Hi Daniel

SeLinux is disabled, as I have played around with Children and got a
stable startup at CHILDREN=3, at 4 and up I get the problem described
earlier right away, so it seems that MySQL is throttling Kamailio ?

1- What is the effect of running 3 children only ?

the capacity of handling sip traffic is lowered. You should still be
able to
handle couple of hundred messages per second if you don't have slow
sql/dns
operations. For production, it is recommended to have at least 8 to be
in
safe side.



2- I know this is not a Kamailio thing, but any idea about what needs
to be changed on MySQL server to accommodate more children ? No of
connections is 500 conns out of which max 120 are utilized

So mysql is on a different server, right? Are you sure there is no other
switch/router doing such throttling? Can you watch on both kamailio and
mysql server to see if the connections are initiated from kamailio and
reaching mysql? Maybe you can discover if mysql server get the tcp
connection but refuses it -- not sure if mysql server can run in
debug/verbose mode to get some log messages with hints about what is the
problem.

If the tcp connection does not get to mysql server, then it is a
throttling
in mysql client library or on a device in between the servers.

If you do 'kamctl ps' when having children=3, how many kamailio
processes
are there (extra should be timers, ...)? Each should have one mysql
connection, so it helps to see at which number the limit starts.

Cheers,
Daniel


Regards

On Mon, Jan 2, 2012 at 1:31 PM, Daniel-Constantin Mierla
  wro

Re: [SR-Users] Authentication Feature Question

2012-01-03 Thread Daniel-Constantin Mierla

Hello,

On 1/3/12 4:12 PM, Ali Jawad wrote:

Hi Daniel
This certainly makes sense, I will try it in a few mins, but what I
observed at Debug Level 3 is that Hash is calculated before
www_authenticate is executed and it shows HA comparison failed, if I
do use domain.com instead of $fd and use $domain.com in db domain
field and build HA1 filed based on that, wont Kamailio still try to
build the HA1 hash which it will compare form user:domain:pwd where
domain is fed in to the hash function from the header of the SIP
packet ?


the ha1 is actually hash over 'user:realm:pwd' -- it is just common 
practice to use the domain as realm, since realm should be a unique 
token to identify the service, but it can  be any random string. realm 
is given as parameter to auth functions in kamailio.cfg


Cheers,
Daniel


Regards

On Tue, Jan 3, 2012 at 5:07 PM, Daniel-Constantin Mierla
  wrote:

Hello,

you can simply use 'domain.com' as realm parameter to authentication
function instead of $fd. Also build ha1 and ha1b with domain.com and then
you are safe no matter which sip server is used.

Of course you can build the realm by striping first token before '.' in $fd
and pass it to authentication functions, but not sure if makes sense since
it should be always domain.com

Cheers,
Daniel


On 1/3/12 3:15 PM, Ali Jawad wrote:

Hi
After some research it seems to me that the only way to achieve this
is to "try" and change how hashing is done in the source code, a
little bit too ambitious for me, and it means I will have loads of
problems each time an upgrade is released.

Or

Use pseudovariables to fix the value of the $fd value to something
constant, while this worked for values like $var(y) I was not able to
assign/strip $fd to remove the subdomain part.

Any input please ?

Regards

On Tue, Jan 3, 2012 at 2:06 PM, Ali Jawadwrote:

Hi
I do have 3 Kamailio servers, one for mobile phone registrations, one
for softphone registrations and one for SIP device registrations. Each
of those devices connects to it's perspective kamailio server

sip1.domain.com
sip2.domain.com
sip3.domain.com

All 3 Kamailio servers share the same database, and users can use
their kamailio user/pwd on any of the devices, now I want to use
encrypted passwords and remove clear text passwords from the database.
I did test with one server and all is fine,however if a user want to
register from the second kamailio server it does not work, basically
because the db domain entry from which the hash is created is
sip1.domain.com and stored in the db, while the user connects from to
sip2.domain.com this eventually generates a different hash.

Is there anyway to overcome this ? Can I exclude Domain from Hash
generation ? Any other option that allows me to do the above ?

Thanks




--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda





--
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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] Authentication Feature Question

2012-01-03 Thread Daniel-Constantin Mierla

Hello,

On 1/3/12 4:48 PM, Ali Jawad wrote:

Hi Daniel

Please see

  5(18649) DEBUG:  [db_res.c:184]: allocate 8 bytes for rows at 0xb7b78d74
  5(18649) DEBUG:  [db_row.c:119]: allocate 20 bytes for row
values at 0xb7b78dac
  5(18649) DEBUG:  [db_val.c:117]: converting STRING
[6f966cd9c628f14cdc20172f96a4d065]
  5(18649) DEBUG: auth [api.c:210]: check_response: Our result =
'6f95e6235edca0b7765042ef119fd83b'
  5(18649) DEBUG: auth [api.c:220]: check_response: Authorization failed
  5(18649) DEBUG:  [db_res.c:81]: freeing 1 columns
  5(18649) DEBUG:  [db_res.c:85]: freeing RES_NAMES[0] at 0xb7b78d3c
  5(18649) DEBUG:  [db_res.c:94]: freeing result names at 0xb7b78bfc
  5(18649) DEBUG:  [db_res.c:99]: freeing result types at 0xb7b78c64
  5(18649) DEBUG:  [db_res.c:54]: freeing 1 rows
  5(18649) DEBUG:  [db_row.c:97]: freeing row values at 0xb7b78dac
  5(18649) DEBUG:  [db_res.c:62]: freeing rows at 0xb7b78d74
  5(18649) DEBUG:  [db_res.c:136]: freeing result set at 0xb7b78bb0
  5(18649) DEBUG: auth [challenge.c:102]: build_challenge_hf: realm='nymgo.com'
  5(18649) DEBUG: auth [challenge.c:244]: auth: 'WWW-Authenticate:
Digest realm="domain.com", nonce="TwMcuk8DG47SLxatlNdZfyfR8p3OiyAE"
'

I rebuilt the hashes against domain.com and then tried to connect to
sip1.domain.com and sip2.domain.com and sip3.domain.com with all of
the having


# - auth_db params -
#!ifdef WITH_AUTH
modparam("auth_db", "db_url", DBURL)
modparam("auth_db", "calculate_ha1", 0  )
modparam("auth_db", "password_column", "ha1")
modparam("auth_db", "load_credentials", "")
modparam("auth_db", "use_domain", MULTIDOMAIN)

And in the routing process :

if (!www_authorize("domain.com", "subscriber"))
 {

 www_challenge("domain.com", "0");
 exit;
 }


+

My point is that the hashes are caculated from user:doman:pwd which
are extracted from the SIP packet and in this case the domains are
sip1,sip2,sip3 while the hashes stored in the database are generated
against domain.com

If " ha1 is actually hash over 'user:realm:pwd' " shouldn't I have to
set the domain/realm in the config file ?


the first parameter in www_authorize and www_challenge functions is the 
realm and it is used to build the digest response.


Is your phone putting user@domain in authorization header? Can you paste 
here the ngrep of registration?


Cheers,
Daniel



I might be wrongthanks for the help so far.

Regards

On Tue, Jan 3, 2012 at 5:15 PM, Daniel-Constantin Mierla
  wrote:

Hello,


On 1/3/12 4:12 PM, Ali Jawad wrote:

Hi Daniel
This certainly makes sense, I will try it in a few mins, but what I
observed at Debug Level 3 is that Hash is calculated before
www_authenticate is executed and it shows HA comparison failed, if I
do use domain.com instead of $fd and use $domain.com in db domain
field and build HA1 filed based on that, wont Kamailio still try to
build the HA1 hash which it will compare form user:domain:pwd where
domain is fed in to the hash function from the header of the SIP
packet ?


the ha1 is actually hash over 'user:realm:pwd' -- it is just common practice
to use the domain as realm, since realm should be a unique token to identify
the service, but it can  be any random string. realm is given as parameter
to auth functions in kamailio.cfg

Cheers,
Daniel



Regards

On Tue, Jan 3, 2012 at 5:07 PM, Daniel-Constantin Mierla
wrote:

Hello,

you can simply use 'domain.com' as realm parameter to authentication
function instead of $fd. Also build ha1 and ha1b with domain.com and then
you are safe no matter which sip server is used.

Of course you can build the realm by striping first token before '.' in
$fd
and pass it to authentication functions, but not sure if makes sense
since
it should be always domain.com

Cheers,
Daniel


On 1/3/12 3:15 PM, Ali Jawad wrote:

Hi
After some research it seems to me that the only way to achieve this
is to "try" and change how hashing is done in the source code, a
little bit too ambitious for me, and it means I will have loads of
problems each time an upgrade is released.

Or

Use pseudovariables to fix the value of the $fd value to something
constant, while this worked for values like $var(y) I was not able to
assign/strip $fd to remove the subdomain part.

Any input please ?

Regards

On Tue, Jan 3, 2012 at 2:06 PM, Ali Jawad
  wrote:

Hi
I do have 3 Kamailio servers, one for mobile phone registrations, one
for softphone registrations and one for SIP device registrations. Each
of those devices connects to it's perspective kamailio server

sip1.domain.com
sip2.domain.com
sip3.domain.com

All 3 Kamailio servers share the same database, 

Re: [SR-Users] Authentication Feature Question

2012-01-03 Thread Daniel-Constantin Mierla

Hello,

I need the entire flow for registration, including the 401 reply and the 
following REGISTER request.


Cheers,
Daniel

On 1/3/12 5:02 PM, Ali Jawad wrote:

Hi
Please see the ngrep below, please note that if I use in the db
register.domain.com and generate a hash against it for HA1 it
works,but then the user cant logon to register2.domain.com


U +10.630576 xx.yy.yy.yy:20020 ->  xx.xx.xx.xx:5060
REGISTER sip:register.domain SIP/2.0.
Via: SIP/2.0/UDP
192.168.0.191:20020;branch=z9hG4bK-d8754z-af65a442980c375f-1---d8754z-;rport.
Max-Forwards: 70.
Contact:.
To: "Test Ast".
From: "Test Ast";tag=976bb004.
Call-ID: MDFmZDU2ZTI2YjJjMGNlMGFmOTIzMWFmZGQ1ZTNjMDE..
CSeq: 1 REGISTER.
Expires: 3600.
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE,
SUBSCRIBE, INFO.
User-Agent: eyeBeam release 1102q stamp 51814.
Content-Length: 0.

On Tue, Jan 3, 2012 at 5:58 PM, Daniel-Constantin Mierla
  wrote:

Hello,


On 1/3/12 4:48 PM, Ali Jawad wrote:

Hi Daniel

Please see

  5(18649) DEBUG:[db_res.c:184]: allocate 8 bytes for rows at
0xb7b78d74
  5(18649) DEBUG:[db_row.c:119]: allocate 20 bytes for row
values at 0xb7b78dac
  5(18649) DEBUG:[db_val.c:117]: converting STRING
[6f966cd9c628f14cdc20172f96a4d065]
  5(18649) DEBUG: auth [api.c:210]: check_response: Our result =
'6f95e6235edca0b7765042ef119fd83b'
  5(18649) DEBUG: auth [api.c:220]: check_response: Authorization failed
  5(18649) DEBUG:[db_res.c:81]: freeing 1 columns
  5(18649) DEBUG:[db_res.c:85]: freeing RES_NAMES[0] at 0xb7b78d3c
  5(18649) DEBUG:[db_res.c:94]: freeing result names at 0xb7b78bfc
  5(18649) DEBUG:[db_res.c:99]: freeing result types at 0xb7b78c64
  5(18649) DEBUG:[db_res.c:54]: freeing 1 rows
  5(18649) DEBUG:[db_row.c:97]: freeing row values at 0xb7b78dac
  5(18649) DEBUG:[db_res.c:62]: freeing rows at 0xb7b78d74
  5(18649) DEBUG:[db_res.c:136]: freeing result set at 0xb7b78bb0
  5(18649) DEBUG: auth [challenge.c:102]: build_challenge_hf:
realm='nymgo.com'
  5(18649) DEBUG: auth [challenge.c:244]: auth: 'WWW-Authenticate:
Digest realm="domain.com", nonce="TwMcuk8DG47SLxatlNdZfyfR8p3OiyAE"
'

I rebuilt the hashes against domain.com and then tried to connect to
sip1.domain.com and sip2.domain.com and sip3.domain.com with all of
the having


# - auth_db params -
#!ifdef WITH_AUTH
modparam("auth_db", "db_url", DBURL)
modparam("auth_db", "calculate_ha1", 0  )
modparam("auth_db", "password_column", "ha1")
modparam("auth_db", "load_credentials", "")
modparam("auth_db", "use_domain", MULTIDOMAIN)

And in the routing process :

if (!www_authorize("domain.com", "subscriber"))
 {

 www_challenge("domain.com", "0");
 exit;
 }


+

My point is that the hashes are caculated from user:doman:pwd which
are extracted from the SIP packet and in this case the domains are
sip1,sip2,sip3 while the hashes stored in the database are generated
against domain.com

If " ha1 is actually hash over 'user:realm:pwd' " shouldn't I have to
set the domain/realm in the config file ?


the first parameter in www_authorize and www_challenge functions is the
realm and it is used to build the digest response.

Is your phone putting user@domain in authorization header? Can you paste
here the ngrep of registration?

Cheers,
Daniel



I might be wrongthanks for the help so far.

Regards

On Tue, Jan 3, 2012 at 5:15 PM, Daniel-Constantin Mierla
wrote:

Hello,


On 1/3/12 4:12 PM, Ali Jawad wrote:

Hi Daniel
This certainly makes sense, I will try it in a few mins, but what I
observed at Debug Level 3 is that Hash is calculated before
www_authenticate is executed and it shows HA comparison failed, if I
do use domain.com instead of $fd and use $domain.com in db domain
field and build HA1 filed based on that, wont Kamailio still try to
build the HA1 hash which it will compare form user:domain:pwd where
domain is fed in to the hash function from the header of the SIP
packet ?


the ha1 is actually hash over 'user:realm:pwd' -- it is just common
practice
to use the domain as realm, since realm should be a unique token to
identify
the service, but it can  be any random string. realm is given as
parameter
to auth functions in kamailio.cfg

Cheers,
Daniel



Regards

On Tue, Jan 3, 2012 at 5:07 PM, Daniel-Constantin Mierla
  wrote:

Hello,

you can simply use 'domain.com' as realm parameter to authentication
function instead of $fd. Also build ha1 and ha1b with domain.com and
then
you are safe no matter which sip server is used.

Of course you can build the realm by striping first token before '.' in
$fd
and pass it to authentic

Re: [SR-Users] Authentication Feature Question

2012-01-03 Thread Daniel-Constantin Mierla
G4bK-d8754z-81517d296225234f-1---d8754z-;rport=63610;received=yy.yy.yy.146.
To: "Test 
Ast";tag=e597ca73bdb255490f0cefa03b2fda82.2f76.
From: "Test Ast";tag=ba705453.
Call-ID: MzM4Y2IwNzQzZGYwOGI3ZTY1YzYxZjcyZGJjMTMwODI..
CSeq: 2 REGISTER.
WWW-Authenticate: Digest realm="domain.com",
nonce="TwMpsU8DKIX4lvWDwPsV4iUhCl+iOAdk".
Server: kamailio (3.2.1 (i386/linux)).
Content-Length: 0.
.

On Tue, Jan 3, 2012 at 6:08 PM, Daniel-Constantin Mierla
  wrote:

Hello,

I need the entire flow for registration, including the 401 reply and the
following REGISTER request.

Cheers,
Daniel


On 1/3/12 5:02 PM, Ali Jawad wrote:

Hi
Please see the ngrep below, please note that if I use in the db
register.domain.com and generate a hash against it for HA1 it
works,but then the user cant logon to register2.domain.com


U +10.630576 xx.yy.yy.yy:20020 ->xx.xx.xx.xx:5060
REGISTER sip:register.domain SIP/2.0.
Via: SIP/2.0/UDP

192.168.0.191:20020;branch=z9hG4bK-d8754z-af65a442980c375f-1---d8754z-;rport.
Max-Forwards: 70.

Contact:.
To: "Test Ast".
From: "Test Ast";tag=976bb004.
Call-ID: MDFmZDU2ZTI2YjJjMGNlMGFmOTIzMWFmZGQ1ZTNjMDE..
CSeq: 1 REGISTER.
Expires: 3600.
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE,
SUBSCRIBE, INFO.
User-Agent: eyeBeam release 1102q stamp 51814.
Content-Length: 0.

On Tue, Jan 3, 2012 at 5:58 PM, Daniel-Constantin Mierla
wrote:

Hello,


On 1/3/12 4:48 PM, Ali Jawad wrote:

Hi Daniel

Please see

  5(18649) DEBUG:  [db_res.c:184]: allocate 8 bytes for rows at
0xb7b78d74
  5(18649) DEBUG:  [db_row.c:119]: allocate 20 bytes for row
values at 0xb7b78dac
  5(18649) DEBUG:  [db_val.c:117]: converting STRING
[6f966cd9c628f14cdc20172f96a4d065]
  5(18649) DEBUG: auth [api.c:210]: check_response: Our result =
'6f95e6235edca0b7765042ef119fd83b'
  5(18649) DEBUG: auth [api.c:220]: check_response: Authorization failed
  5(18649) DEBUG:  [db_res.c:81]: freeing 1 columns
  5(18649) DEBUG:  [db_res.c:85]: freeing RES_NAMES[0] at
0xb7b78d3c
  5(18649) DEBUG:  [db_res.c:94]: freeing result names at
0xb7b78bfc
  5(18649) DEBUG:  [db_res.c:99]: freeing result types at
0xb7b78c64
  5(18649) DEBUG:  [db_res.c:54]: freeing 1 rows
  5(18649) DEBUG:  [db_row.c:97]: freeing row values at
0xb7b78dac
  5(18649) DEBUG:  [db_res.c:62]: freeing rows at 0xb7b78d74
  5(18649) DEBUG:  [db_res.c:136]: freeing result set at
0xb7b78bb0
  5(18649) DEBUG: auth [challenge.c:102]: build_challenge_hf:
realm='nymgo.com'
  5(18649) DEBUG: auth [challenge.c:244]: auth: 'WWW-Authenticate:
Digest realm="domain.com", nonce="TwMcuk8DG47SLxatlNdZfyfR8p3OiyAE"
'

I rebuilt the hashes against domain.com and then tried to connect to
sip1.domain.com and sip2.domain.com and sip3.domain.com with all of
the having


# - auth_db params -
#!ifdef WITH_AUTH
modparam("auth_db", "db_url", DBURL)
modparam("auth_db", "calculate_ha1", 0  )
modparam("auth_db", "password_column", "ha1")
modparam("auth_db", "load_credentials", "")
modparam("auth_db", "use_domain", MULTIDOMAIN)

And in the routing process :

if (!www_authorize("domain.com", "subscriber"))
 {

 www_challenge("domain.com", "0");
 exit;
 }


+

My point is that the hashes are caculated from user:doman:pwd which
are extracted from the SIP packet and in this case the domains are
sip1,sip2,sip3 while the hashes stored in the database are generated
against domain.com

If " ha1 is actually hash over 'user:realm:pwd' " shouldn't I have to
set the domain/realm in the config file ?


the first parameter in www_authorize and www_challenge functions is the
realm and it is used to build the digest response.

Is your phone putting user@domain in authorization header? Can you paste
here the ngrep of registration?

Cheers,
Daniel



I might be wrongthanks for the help so far.

Regards

On Tue, Jan 3, 2012 at 5:15 PM, Daniel-Constantin Mierla
  wrote:

Hello,


On 1/3/12 4:12 PM, Ali Jawad wrote:

Hi Daniel
This certainly makes sense, I will try it in a few mins, but what I
observed at Debug Level 3 is that Hash is calculated before
www_authenticate is executed and it shows HA comparison failed, if I
do use domain.com instead of $fd and use $domain.com in db domain
field and build HA1 filed based on that, wont Kamailio still try to
build the HA1 hash which it will compare form user:domain:pwd where
domain is fed in to the hash function from the header of the SIP
packet ?


the ha1 is actually hash over 'user:realm:pwd' -- it is just common
practice
to use the domain as realm, since realm should be a unique token to
identify
the service, but it c

Re: [SR-Users] Authentication Feature Question

2012-01-03 Thread Daniel-Constantin Mierla

Hello,

On 1/3/12 10:08 PM, Ali Jawad wrote:

Hi
In Xlite/eyebeam I put in the username and one of my 3 kamailio
servers respectively as the sip registrar, I.e. register1.domain.com,
register2.domain.com and register3.domain.com, that is why I was
saying that hashing will create different hashes based on the register
domain.  With reference to my first related post, one kamailio server
is for softphones, one for sip devices and one for mobile phones with
SIP software. Each server has a slightly different NAT and Call
routing structure.
but your service domain is 'domain.com', specific server addresses 
(domains) per UA type should be set as outbound proxy on the UA devices.

This is why I wanted to eliminate the domain factor from the hashing
procedure, I am sure it chooses the right value from the DB  value
because it is the same value shown in the log of kamailio against
which a comparison is being done and because it works if I put
register.domain.com in the domain column rehash the HA! value of the
db.


When auth_db module is configured to take the hashed value from database 
(calculate_ha1 parameter is 0), there is no more computation of it in 
kamailio -- it is just fetched from database and used -- so it does not 
matter anymore the domains in the sip message.


Check to see if the xlite does not have a realm field that has to be set 
properly.




values at 0xb7b78dac

  5(18649) DEBUG:[db_val.c:117]: converting STRING
[6f966cd9c628f14cdc20172f96a4d065]<# This is the value in the DB based 
on domain.com
  5(18649) DEBUG: auth [api.c:210]: check_response: Our result =
'6f95e6235edca0b7765042ef119fd83b'<# This value appears to be the value 
generated register.domain.com
  5(18649) DEBUG: auth [api.c:220]: check_response: Authorization

How can I enable the SQL query log ?


I don't know by hart, googling should help you.

Cheers,
Daniel



On Tue, Jan 3, 2012 at 8:12 PM, Daniel-Constantin Mierla
  wrote:

Hello,

why are you using register.domain.com as domain for registration? Isn't
domain.com the right one?

Can you enable the sql query log for mysql server and double check if the
right value (column) is selected from the database table?

Cheers,
Daniel


On 1/3/12 5:13 PM, Ali Jawad wrote:

Hi
Please see the below, thanks !

interface: eth1 (xx.xx.xx.0/255.255.255.0)
match: support1

U +6.698682 yy.yy.yy.146:18832 ->xx.xx.xx.51:5060
REGISTER sip:register.domain.com SIP/2.0.
Via: SIP/2.0/UDP

192.168.0.191:18832;branch=z9hG4bK-d8754z-05164a466600837d-1---d8754z-;rport.
Max-Forwards: 70.

Contact:.
To: "Test Ast".
From: "Test Ast";tag=f710b930.
Call-ID: Y2RmNmFhZWM2MzM5OWQ5ODEwNjc0NzJiNGE2MmQzYjY..
CSeq: 1 REGISTER.
Expires: 3600.
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE,
SUBSCRIBE, INFO.
User-Agent: eyeBeam release 1102q stamp 51814.
Content-Length: 0.
.


U +0.005245 xx.xx.xx.51:5060 ->yy.yy.yy.146:18832
SIP/2.0 401 Unauthorized.
Via: SIP/2.0/UDP

192.168.0.191:18832;branch=z9hG4bK-d8754z-05164a466600837d-1---d8754z-;rport=18832;received=yy.yy.yy.146.
To: "Test
Ast";tag=e597ca73bdb255490f0cefa03b2fda82.3053.
From: "Test Ast";tag=f710b930.
Call-ID: Y2RmNmFhZWM2MzM5OWQ5ODEwNjc0NzJiNGE2MmQzYjY..
CSeq: 1 REGISTER.
WWW-Authenticate: Digest realm="domain.com",
nonce="TwMpUE8DKCSt/IP7jcNRMbCT4TnbqlHl".
Server: kamailio (3.2.1 (i386/linux)).
Content-Length: 0.
.


U +0.428042 yy.yy.yy.146:18832 ->xx.xx.xx.51:5060
REGISTER sip:register.domain.com SIP/2.0.
Via: SIP/2.0/UDP

192.168.0.191:18832;branch=z9hG4bK-d8754z-fc633b21627dca6d-1---d8754z-;rport.
Max-Forwards: 70.

Contact:.
To: "Test Ast".
From: "Test Ast";tag=f710b930.
Call-ID: Y2RmNmFhZWM2MzM5OWQ5ODEwNjc0NzJiNGE2MmQzYjY..
CSeq: 2 REGISTER.
Expires: 3600.
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE,
SUBSCRIBE, INFO.
User-Agent: eyeBeam release 1102q stamp 51814.
Authorization: Digest

username="support1",realm="domain.com",nonce="TwMpUE8DKCSt/IP7jcNRMbCT4TnbqlHl",uri="sip:register.domain.com",response="6122245b77e2df0b90179304464341e7",algorithm=MD5.
Content-Length: 0.
.


U +0.005146 xx.xx.xx.51:5060 ->yy.yy.yy.146:18832
SIP/2.0 401 Unauthorized.
Via: SIP/2.0/UDP

192.168.0.191:18832;branch=z9hG4bK-d8754z-fc633b21627dca6d-1---d8754z-;rport=18832;received=yy.yy.yy.146.
To: "Test
Ast";tag=e597ca73bdb255490f0cefa03b2fda82.fce3.
From: "Test Ast";tag=f710b930.
Call-ID: Y2RmNmFhZWM2MzM5OWQ5ODEwNjc0NzJiNGE2MmQzYjY..
CSeq: 2 REGISTER.
WWW-Authenticate: Digest realm="domain.com",
nonce="TwMpUE8DKCSt/IP7jcNRMbCT4TnbqlHl".
Server: kamailio (3.2.1 (i386/linux)).
Content-Length: 0.
.

[root@kam-rtp-100-51 mysql]# mail alijaw...@gmail.com<output.txt
[root@kam-rtp-100-51 mysql]#  ngrep -W byline -T support1  -q -d eth1
interface: eth1 (xx.xx.xx.0/255.255.2

Re: [SR-Users] app_lua coredump

2012-01-04 Thread Daniel-Constantin Mierla

Hello,

can you send the backtrace? Locate the core file and do:

gdb /path/to/kamailio /path/to/corefile
bt

Cheers,
Daniel

On 1/4/12 3:39 AM,  (by way of n...@nelcom-voip.com) wrote:

I've installed kamailio (3.2, 3.2-nightly, dev-nightly) for debian unstable 
(wheezy)
using repository at http://deb.kamailio.org and constantly get a coredump
with this lua code:

-- SIP request routing
function route_request(name)
sr.dbg("routing SIP request from Lua [" .. name .. "]\n")

-- initial checks of SIP request
if sr.maxfwd.process_maxfwd(10)<  0 then
   sr.sl.send_reply(483,"Too Many Hops")
   return
end
end

I've started with an example at this page 
http://kb.asipto.com/kamailio:usage:k32-lua-routing,
and then just reduced the lua script to code above.

If I do comment sr.maxfwd.process_maxfwd(10) it passes. It is impossible to
call sr.modf("mf_maxfwd...") because it says about fixups.

What's wrong?

--
With best regards,
Roman Galeev.

___
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://linkedin.com/in/miconda -- http://twitter.com/miconda


___
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] Authentication Feature Question

2012-01-04 Thread Daniel-Constantin Mierla

Hello,

can you get the backtrace? Locate the core file (perhaps in / directory 
if you don't use -w command line parameter) and do:


gdb /path/to/kamailio /path/to/corefile
bt

Cheers,
Daniel


On 1/4/12 9:17 AM, Ali Jawad wrote:

Hi
When I did set modparam("auth_db", "calculate_ha1", 0  )

Kamailio is crashing see

http://pastebin.com/anaKan0Y

Regards

On Tue, Jan 3, 2012 at 11:54 PM, Ali Jawad  wrote:

Hi
It fetches one value from the database to compare it against a second
value that has to be computed right, in the computation of the second
hash where is the domain part fetched from  ?
Regards

On Wed, Jan 4, 2012 at 12:26 AM, Daniel-Constantin Mierla
  wrote:

Hello,


On 1/3/12 10:08 PM, Ali Jawad wrote:

Hi

In Xlite/eyebeam I put in the username and one of my 3 kamailio
servers respectively as the sip registrar, I.e. register1.domain.com,
register2.domain.com and register3.domain.com, that is why I was
saying that hashing will create different hashes based on the register
domain.  With reference to my first related post, one kamailio server
is for softphones, one for sip devices and one for mobile phones with
SIP software. Each server has a slightly different NAT and Call
routing structure.

but your service domain is 'domain.com', specific server addresses (domains)
per UA type should be set as outbound proxy on the UA devices.


This is why I wanted to eliminate the domain factor from the hashing
procedure, I am sure it chooses the right value from the DB  value
because it is the same value shown in the log of kamailio against
which a comparison is being done and because it works if I put
register.domain.com in the domain column rehash the HA! value of the
db.


When auth_db module is configured to take the hashed value from database
(calculate_ha1 parameter is 0), there is no more computation of it in
kamailio -- it is just fetched from database and used -- so it does not
matter anymore the domains in the sip message.

Check to see if the xlite does not have a realm field that has to be set
properly.




values at 0xb7b78dac

  5(18649) DEBUG:  [db_val.c:117]: converting STRING
[6f966cd9c628f14cdc20172f96a4d065]<# This is the value in
the DB based on domain.com
  5(18649) DEBUG: auth [api.c:210]: check_response: Our result =
'6f95e6235edca0b7765042ef119fd83b'<# This value appears to
be the value generated register.domain.com
  5(18649) DEBUG: auth [api.c:220]: check_response: Authorization

How can I enable the SQL query log ?


I don't know by hart, googling should help you.

Cheers,
Daniel



On Tue, Jan 3, 2012 at 8:12 PM, Daniel-Constantin Mierla
wrote:

Hello,

why are you using register.domain.com as domain for registration? Isn't
domain.com the right one?

Can you enable the sql query log for mysql server and double check if the
right value (column) is selected from the database table?

Cheers,
Daniel


On 1/3/12 5:13 PM, Ali Jawad wrote:

Hi
Please see the below, thanks !

interface: eth1 (xx.xx.xx.0/255.255.255.0)
match: support1

U +6.698682 yy.yy.yy.146:18832 ->  xx.xx.xx.51:5060
REGISTER sip:register.domain.com SIP/2.0.
Via: SIP/2.0/UDP


192.168.0.191:18832;branch=z9hG4bK-d8754z-05164a466600837d-1---d8754z-;rport.
Max-Forwards: 70.


Contact:.
To: "Test Ast".
From: "Test Ast";tag=f710b930.
Call-ID: Y2RmNmFhZWM2MzM5OWQ5ODEwNjc0NzJiNGE2MmQzYjY..
CSeq: 1 REGISTER.
Expires: 3600.
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE,
SUBSCRIBE, INFO.
User-Agent: eyeBeam release 1102q stamp 51814.
Content-Length: 0.
.


U +0.005245 xx.xx.xx.51:5060 ->  yy.yy.yy.146:18832
SIP/2.0 401 Unauthorized.
Via: SIP/2.0/UDP


192.168.0.191:18832;branch=z9hG4bK-d8754z-05164a466600837d-1---d8754z-;rport=18832;received=yy.yy.yy.146.
To: "Test

Ast";tag=e597ca73bdb255490f0cefa03b2fda82.3053.
From: "Test Ast";tag=f710b930.
Call-ID: Y2RmNmFhZWM2MzM5OWQ5ODEwNjc0NzJiNGE2MmQzYjY..
CSeq: 1 REGISTER.
WWW-Authenticate: Digest realm="domain.com",
nonce="TwMpUE8DKCSt/IP7jcNRMbCT4TnbqlHl".
Server: kamailio (3.2.1 (i386/linux)).
Content-Length: 0.
.


U +0.428042 yy.yy.yy.146:18832 ->  xx.xx.xx.51:5060
REGISTER sip:register.domain.com SIP/2.0.
Via: SIP/2.0/UDP


192.168.0.191:18832;branch=z9hG4bK-d8754z-fc633b21627dca6d-1---d8754z-;rport.
Max-Forwards: 70.


Contact:.
To: "Test Ast".
From: "Test Ast";tag=f710b930.
Call-ID: Y2RmNmFhZWM2MzM5OWQ5ODEwNjc0NzJiNGE2MmQzYjY..
CSeq: 2 REGISTER.
Expires: 3600.
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE,
SUBSCRIBE, INFO.
User-Agent: eyeBeam release 1102q stamp 51814.
Authorization: Digest


username="support1",realm="domain.com",nonce="TwMpUE8DKCSt/IP7jcNRMbCT4TnbqlHl",uri="sip:register.domain.com",response="6122245b77e2df0b90179304464341e7",algorithm=MD5.
Content-Length: 0.
.


U +0.005146 xx.xx.xx.

Re: [SR-Users] Authentication Feature Question

2012-01-04 Thread Daniel-Constantin Mierla
io/lib/kamailio/modules_k/kex.soReading
symbols from /usr/local/kamailio/lib/kamailio/modules/tm.so...done.Loaded
symbols for /usr/local/kamailio/lib/kamailio/modules/tm.soReading
symbols from /usr/local/kamailio/lib/kamailio/modules_k/tmx.so...done.Loaded
symbols for /usr/local/kamailio/lib/kamailio/modules_k/tmx.soReading
symbols from /usr/local/kamailio/lib/kamailio/modules/sl.so...done.Loaded
symbols for /usr/local/kamailio/lib/kamailio/modules/sl.soReading
symbols from /usr/local/kamailio/lib/kamailio/modules_k/rr.so...done.Loaded
symbols for /usr/local/kamailio/lib/kamailio/modules_k/rr.soReading
symbols from /usr/local/kamailio/lib/kamailio/modules_k/pv.so...done.Loaded
symbols for /usr/local/kamailio/lib/kamailio/modules_k/pv.soReading
symbols from /usr/local/kamailio/lib/kamailio/modules_k/maxfwd.so...done.Loaded
symbols for /usr/local/kamailio/lib/kamailio/modules_k/maxfwd.soReading
symbols from /usr/local/kamailio/lib/kamailio/modules_k/usrloc.so...done.Loaded
symbols for /usr/local/kamailio/lib/kamailio/modules_k/usrloc.soReading
symbols from 
/usr/local/kamailio/lib/kamailio/modules_k/registrar.so...done.Loaded
symbols for /usr/local/kamailio/lib/kamailio/modules_k/registrar.soReading
symbols from /usr/local/kamailio/lib/kamailio/modules_k/textops.so...done.Loaded
symbols for /usr/local/kamailio/lib/kamailio/modules_k/textops.soReading
symbols from 
/usr/local/kamailio/lib/kamailio/modules_k/siputils.so...done.Loaded
symbols for /usr/local/kamailio/lib/kamailio/modules_k/siputils.soReading
symbols from /usr/local/kamailio/lib/kamailio/modules_k/xlog.so...done.Loaded
symbols for /usr/local/kamailio/lib/kamailio/modules_k/xlog.soReading
symbols from /usr/local/kamailio/lib/kamailio/modules/sanity.so...done.Loaded
symbols for /usr/local/kamailio/lib/kamailio/modules/sanity.soReading
symbols from /usr/local/kamailio/lib/kamailio/modules/ctl.so...done.Loaded
symbols for /usr/local/kamailio/lib/kamailio/modules/ctl.soReading
symbols from /usr/local/kamailio/lib/kamailio/modules/mi_rpc.so...done.Loaded
symbols for /usr/local/kamailio/lib/kamailio/modules/mi_rpc.soReading
symbols from /usr/local/kamailio/lib/kamailio/modules_k/acc.so...done.Loaded
symbols for /usr/local/kamailio/lib/kamailio/modules_k/acc.soReading
symbols from /usr/local/kamailio/lib/kamailio/modules/auth.so...done.Loaded
symbols for /usr/local/kamailio/lib/kamailio/modules/auth.soReading
symbols from /usr/local/kamailio/lib/kamailio/modules_k/auth_db.so...done.Loaded
symbols for /usr/local/kamailio/lib/kamailio/modules_k/auth_db.soReading
symbols from 
/usr/local/kamailio/lib/kamailio/modules_k/alias_db.so...done.Loaded
symbols for /usr/local/kamailio/lib/kamailio/modules_k/alias_db.soReading
symbols from 
/usr/local/kamailio/lib/kamailio/modules_k/nathelper.so...done.Loaded
symbols for /usr/local/kamailio/lib/kamailio/modules_k/nathelper.soReading
symbols from /usr/local/kamailio/lib/kamailio/modules/rtpproxy.so...done.Loaded
symbols for /usr/local/kamailio/lib/kamailio/modules/rtpproxy.soReading
symbols from /usr/local/kamailio/lib/kamailio/modules/tls.so...done.Loaded
symbols for /usr/local/kamailio/lib/kamailio/modules/tls.soReading
symbols from /lib/libnss_files.so.2...(no debugging symbols
found)...done.Loaded symbols for /lib/libnss_files.so.2Core was
generated by `./sbin/kamailio ./etc/kamailio/kamailio.cfg'.Program
terminated with signal 11, Segmentation fault.#0  0x080b51a4 in
U_MD5Update (context=0xbfd1a7b4, input=0x74756100,inputLen=1650745192) at md5.c:160160
memcpy(gdb)

On Wed, Jan 4, 2012 at 10:48 AM, Daniel-Constantin Mierla
  wrote:

Hello,

can you get the backtrace? Locate the core file (perhaps in / directory if
you don't use -w command line parameter) and do:

gdb /path/to/kamailio /path/to/corefile
bt

Cheers,
Daniel



On 1/4/12 9:17 AM, Ali Jawad wrote:

Hi
When I did set modparam("auth_db", "calculate_ha1", 0  )

Kamailio is crashing see

http://pastebin.com/anaKan0Y

Regards

On Tue, Jan 3, 2012 at 11:54 PM, Ali Jawadwrote:

Hi
It fetches one value from the database to compare it against a second
value that has to be computed right, in the computation of the second
hash where is the domain part fetched from  ?
Regards

On Wed, Jan 4, 2012 at 12:26 AM, Daniel-Constantin Mierla
wrote:

Hello,


On 1/3/12 10:08 PM, Ali Jawad wrote:

Hi

In Xlite/eyebeam I put in the username and one of my 3 kamailio
servers respectively as the sip registrar, I.e. register1.domain.com,
register2.domain.com and register3.domain.com, that is why I was
saying that hashing will create different hashes based on the register
domain.  With reference to my first related post, one kamailio server
is for softphones, one for sip devices and one for mobile phones with
SIP software. Each server has a slightly different NAT and Call
routing structure.

but your service domain is 'domain.com', specific server addresses
(domains)
per UA type should be set as outbound proxy on the UA device

  1   2   3   4   5   6   7   8   9   10   >