Re: [SR-Users] Over 100% of CPU usage on kamailio

2012-06-25 Thread Daniel-Constantin Mierla

Hello,


On 6/24/12 10:50 PM, Konstantin M. wrote:

Hello,

Is there any reason to consume over 135% of CPU usage on kamailio ? 
(sreenshot: http://i48.tinypic.com/2u72hr8.png).


Any ideas ?

do you have heavy traffic on that instance? How many children have you 
configured?


What you can do is to attach with gdb to a process using lot of CPU and 
do the backtrace:


gdb /path/to/kamailio __pid__

Replace __pid__ with the PID of process eating the CPU. Then run bt

It may be a deadlock/infinite loop somewhere. I saw three processes in 
top, others were down with no much cpu usage. Is the SIP routing going 
fine anyhow when CPU usage is high? How do you solve it, by restart or 
it just appears from time to time and solves itself periodically?


Cheers,
Daniel

--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, Seattle, USA, Sep 23-26, 2012 - 
http://asipto.com/u/katu
Kamailio Practical Workshop, Netherlands, Sep 10-12, 2012 - 
http://asipto.com/u/kpw


___
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] Reply 503 was replaced to 500

2012-06-25 Thread Daniel-Constantin Mierla

Hello,

this 503 to 500 is a requirement from RFC, to prevent propagation of 
blacklisting/disabling destination hosts. I don't remember right now any 
configuration option for it, but you can try to enforce it from the 
failure route, like:


t_reply(503, ...);

Cheers,
Daniel

On 6/24/12 4:30 PM, Uri Shacked wrote:

I just read the topic - _Copy reason field from 503 to 500. _
Is there a way to change it if i want to send back the original leg 2 
503 reply?


On Sun, Jun 24, 2012 at 4:17 PM, Uri Shacked ushac...@gmail.com 
mailto:ushac...@gmail.com wrote:


Hi,
Kamailio server is behind our company's softswitch and acts as a
sip application server.
I notice that there are calls that the softswitch replied with 503
service unavailable and kamailio sent to the originator leg 500
service unavaileable.
When kamailio recieved 504 or 502 it sends them back as is.
shouldn't it be the same with 503?
It also does not have a to tag in the CDR. And the to tag in
the 503 that was recieved is not equal to the 500 reply to
tag  kamailio sent back.
any ideas?
BR,
Uri




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


--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, Seattle, USA, Sep 23-26, 2012 - 
http://asipto.com/u/katu
Kamailio Practical Workshop, Netherlands, Sep 10-12, 2012 - 
http://asipto.com/u/kpw

___
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] ERROR: uri2dst: bad_uri

2012-06-25 Thread Daniel-Constantin Mierla

Hello,

On 6/22/12 4:13 PM, Barthel Marco (CI/AFU1) wrote:

Hi,
  we are using kamailio at Bosch with some several thousand users. From time to 
time we encounter the following in the logs of kamailio:

/usr/sbin/kamailio[9247]: ERROR: tm [ut.h:255]: ERROR: uri2dst: bad_uri: sip:
/usr/sbin/kamailio[9247]: ERROR: tm [t_fwd.c:1528]: ERROR: t_forward_nonack: 
failure to add branches

Am I right that this means a relay/forward happened and either $ru or $du was just set to 
sip: ?
yes, it looks like. Check your rules for updating $ru/$du - it may be 
also the incoming request, probably unlikely.


Cheers,
Daniel



Thanks in advance.

Mit freundlichen Grüßen / Best regards

Marco Barthel

Robert Bosch GmbH
  (CI/AFU1)
www.bosch.com

Tel. +49 711 811-3602341
marco.bart...@de.bosch.com

Sitz: Stuttgart, Registergericht: Amtsgericht Stuttgart, HRB 14000;
Aufsichtsratsvorsitzender: Hermann Scholl; Geschäftsführung: Franz Fehrenbach, 
Siegfried Dais;
Stefan Asenkerschbaumer, Bernd Bohr, Rudolf Colm, Volkmar Denner, Christoph 
Kübel, Uwe Raschke,
Wolf-Henning Scheider, Werner Struth, Peter Tyroller


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


--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, Seattle, USA, Sep 23-26, 2012 - 
http://asipto.com/u/katu
Kamailio Practical Workshop, Netherlands, Sep 10-12, 2012 - 
http://asipto.com/u/kpw


___
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] Fwd: Can Kamailio be used to redirect media between a client that switches from wifi to 3g/gsm

2012-06-25 Thread Klaus Darilion
Within Kamailio there is nothing you can do to trigger a reINVITE. You 
need a B2BUA (e.g. Asterisk) to force a reINVITE, and even then it is 
not sure that the SIP client sends properly updated SDP and contact 
header (I would try this with a manually sent reINVITE).


Further, even if there is no reINVITE, you should still have audio.

How do you handle the media stream? Is it sent directly to Asterisk? Is 
there rtpproxy inbetween? (if yes, then you need the reINVITEs so that 
rtpproxy will accept the new source IP address of the RTP stream (lock-in)).


regards
Klaus

On 22.06.2012 15:58, Shaun Clark wrote:

Forgot to post the response to the list as well.

Date: Fri, Jun 22, 2012 at 6:57 AM
Subject: Re: [SR-Users] Can Kamailio be used to redirect media between a
client that switches from wifi to 3g/gsm
To: Klaus Darilion klaus.mailingli...@pernau.at
mailto:klaus.mailingli...@pernau.at


Thanks for the response! I see a series of what I believe are
re-REGISTER statements:

Message sent: (to dest=75.101.244.XXX:5060)
REGISTER sip:75.101.244.XXX SIP/2.0
Via: SIP/2.0/UDP 10.165.27.161:2407;rport;branch=z9hG4bK1839704852
From: sip:99...@75.101.244.xxx;tag=1689684502
To: sip:99...@75.101.244.xxx
Call-ID: 1867622191
CSeq: 1 REGISTER
Contact: sip:990XX@10.165.27.161:2407;line=daeb0d9351eff22
Max-Forwards: 70
User-Agent: Linphone/3.4.0 (eXosip2/unknown)
Expires: 3600
Content-Length: 0

Received message:
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 10.165.27.161:2407;received=32.158.143.61
tel:32.158.143.61;rport=2407;branch=z9hG4bK1839704852
From: sip:99...@75.101.244.xxx;tag=1689684502
To: sip:99...@75.101.244.xxx;tag=c97b4d1cb1f3d0da549e06a8d482ef63.e10d
Call-ID: 1867622191
CSeq: 1 REGISTER
WWW-Authenticate: Digest realm=75.101.244.XXX,
nonce=4fe476e50e00aa8700d49b8c668f4c6f1e6a367f2XXX
Server: Kamailio
Content-Length: 0

REGISTER sip:75.101.244.XXX SIP/2.0
Via: SIP/2.0/UDP 10.165.27.161:2407;rport;branch=z9hG4bK123406454
From: sip:99...@75.101.244.xxx;tag=1689684502
To: sip:99...@75.101.244.xxx
Call-ID: 1867622191
CSeq: 2 REGISTER
Contact: sip:990XX@10.165.27.161:2407;line=daeb0d9351eff22
Authorization: Digest username=990XX, realm=75.101.244.XXX,
nonce=4fe476e50e00aa8700d49b8c668f4c6f1e6a367f2XXX,
uri=sip:75.101.244.XXX, response=1e1d558894f2c05c322c76efbb2f9XXX,
algorithm=MD5
Max-Forwards: 70
User-Agent: Linphone/3.4.0 (eXosip2/unknown)
Expires: 3600
Content-Length: 0

Received message:
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.165.27.161:2407;received=32.158.143.61
tel:32.158.143.61;rport=2407;branch=z9hG4bK123406454
From: sip:99...@75.101.244.xxx;tag=1689684502
To: sip:99...@75.101.244.xxx;tag=c97b4d1cb1f3d0da549e06a8d482ef63.8b5a
Call-ID: 1867622191
CSeq: 2 REGISTER
Contact:
sip:990XX@10.165.27.161:2407;line=daeb0d9351eff22;expires=120,
sip:990XX@50.43.101.83:51879;line=59ecc207f06f4e9;expires=81
Server: Kamailio
Content-Length: 0

But after this I would expect to see an INVITE but one is never sent,
but if I switch back to the original IP on that device the call is
reconnected, so it proves we're missing an INVITE I believe. What do I
need to do on the server side to force a re-INVITE to be sent after this
registration occurs? Thanks!

On Fri, Jun 22, 2012 at 1:14 AM, Klaus Darilion
klaus.mailingli...@pernau.at mailto:klaus.mailingli...@pernau.at wrote:

Hi Shaun!

Your problem description is too short to give you any good help.

Use tcpdump (or other tools) to capture the scenario with Asterisk
and Kamailio. Then compare them to find out why it doesn't work.

Is media sent directly to Asterisk then it ca not be the problem of
Kamailio.

I hope the mobile client is smart enough to also send a reINVITE
when getting the new IP address (of the mobile connection) with
proper Contact header - otherwise it can not receive SIP requests
from Asterisk.

regards
Klaus


On 20.06.2012 18:07, Shaun Clark wrote:

The use case is that I have a SIP client registered to Kamailio
talking
to an Asterisk box connected to the PSTN. The client is a mobile
phone
and the user is connected to wifi. The user then steps out of
wifi range
and the phone drops the connection and picks up the 3g data
connection.
I want the media stream to reconnect to the client and the call to
resume without having to redial. This works now if the client is
directly connected to the Asterisk machine, but not when I am
routing
through my Kamailio server. How do I go about this, examples are
always
appreciated, thanks!


_
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 
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users






--

Re: [SR-Users] Over 100% of CPU usage on kamailio

2012-06-25 Thread Konstantin M.
 do you have heavy traffic on that instance? How many children have you
configured?

Yes, but only a voip. There are over 10k calls per day.
fork=yes
children=4

This configuration is working during 1.5 months without any issues till
now...


 What you can do is to attach with gdb to a process using lot of CPU and
do the backtrace:

 gdb /path/to/kamailio __pid__

 Replace __pid__ with the PID of process eating the CPU. Then run bt

 It may be a deadlock/infinite loop somewhere. I saw three processes in
top, others were down with no much cpu usage.
 Is the SIP routing going fine anyhow when CPU usage is high?

It hard to say 'yes', when looking to call graphs (rrd) I saw that the
calls throughput was slow down...
Looking to logs/PCAP's/etc I'm seeing that some of calls were processed
though (perhaps some of working forks).
But there were  75-80% of failed calls with 478 Request Terminated.
Also by analyzing a PCAP flows I saw that more than 70% of calls were
de-jittered, de-sync'ed in RTP timestamps, etc...

 How do you solve it, by restart or it just appears from time to time and
solves itself periodically?

I did not restarted kamailio during 20 days, following a charts this
problem was re-appeared during 2 days.

After restart of kamailio -- I can't see any issues for now, there is 0.00
on CPU by all of kamailio instance/forks/etc...




Cheers,
Daniel
___
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] Over 100% of CPU usage on kamailio

2012-06-25 Thread Daniel-Constantin Mierla

Hello,

when it occurs again, get the backtrace with gdb using the PIDs from all 
kamailio processes eating lot of CPU.


Btw, what version are you using (kamailio -V)?

Cheers,
Daniel

On 6/25/12 9:43 AM, Konstantin M. wrote:
 do you have heavy traffic on that instance? How many children have 
you configured?


Yes, but only a voip. There are over 10k calls per day.
fork=yes
children=4

This configuration is working during 1.5 months without any issues 
till now...



 What you can do is to attach with gdb to a process using lot of CPU 
and do the backtrace:


 gdb /path/to/kamailio __pid__

 Replace __pid__ with the PID of process eating the CPU. Then run bt

 It may be a deadlock/infinite loop somewhere. I saw three processes 
in top, others were down with no much cpu usage.

 Is the SIP routing going fine anyhow when CPU usage is high?

It hard to say 'yes', when looking to call graphs (rrd) I saw that the 
calls throughput was slow down...
Looking to logs/PCAP's/etc I'm seeing that some of calls were 
processed though (perhaps some of working forks).

But there were  75-80% of failed calls with 478 Request Terminated.
Also by analyzing a PCAP flows I saw that more than 70% of calls were 
de-jittered, de-sync'ed in RTP timestamps, etc...


 How do you solve it, by restart or it just appears from time to time 
and solves itself periodically?


I did not restarted kamailio during 20 days, following a charts this 
problem was re-appeared during 2 days.


After restart of kamailio -- I can't see any issues for now, there is 
0.00 on CPU by all of kamailio instance/forks/etc...





Cheers,
Daniel




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


--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, Seattle, USA, Sep 23-26, 2012 - 
http://asipto.com/u/katu
Kamailio Practical Workshop, Netherlands, Sep 10-12, 2012 - 
http://asipto.com/u/kpw

___
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] Over 100% of CPU usage on kamailio

2012-06-25 Thread Konstantin M.
Yes, I'll bt if it will appear again...

Here is a version:

# /opt/kamailio/sbin/kamailio -V
version: kamailio 3.2.3 (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 15:37:11 Jun  9 2012 with gcc 4.4.3


2012/6/25 Daniel-Constantin Mierla mico...@gmail.com

  Hello,

 when it occurs again, get the backtrace with gdb using the PIDs from all
 kamailio processes eating lot of CPU.

 Btw, what version are you using (kamailio -V)?

 Cheers,
 Daniel


 On 6/25/12 9:43 AM, Konstantin M. wrote:

  do you have heavy traffic on that instance? How many children have you
 configured?

 Yes, but only a voip. There are over 10k calls per day.
 fork=yes
 children=4

 This configuration is working during 1.5 months without any issues till
 now...


  What you can do is to attach with gdb to a process using lot of CPU and
 do the backtrace:
 
  gdb /path/to/kamailio __pid__
 
  Replace __pid__ with the PID of process eating the CPU. Then run bt
 
  It may be a deadlock/infinite loop somewhere. I saw three processes in
 top, others were down with no much cpu usage.
  Is the SIP routing going fine anyhow when CPU usage is high?

 It hard to say 'yes', when looking to call graphs (rrd) I saw that the
 calls throughput was slow down...
 Looking to logs/PCAP's/etc I'm seeing that some of calls were processed
 though (perhaps some of working forks).
 But there were  75-80% of failed calls with 478 Request Terminated.
 Also by analyzing a PCAP flows I saw that more than 70% of calls were
 de-jittered, de-sync'ed in RTP timestamps, etc...

  How do you solve it, by restart or it just appears from time to time and
 solves itself periodically?

 I did not restarted kamailio during 20 days, following a charts this
 problem was re-appeared during 2 days.

 After restart of kamailio -- I can't see any issues for now, there is 0.00
 on CPU by all of kamailio instance/forks/etc...

 
 
 
 Cheers,
 Daniel




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


 --
 Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda 
 - http://www.linkedin.com/in/miconda
 Kamailio Advanced Training, Seattle, USA, Sep 23-26, 2012 - 
 http://asipto.com/u/katu
 Kamailio Practical Workshop, Netherlands, Sep 10-12, 2012 - 
 http://asipto.com/u/kpw


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


Re: [SR-Users] Kamailio Unexpectedly Terminating

2012-06-25 Thread Daniel-Constantin Mierla

Hello,

thanks for troubleshooting further -- as I expected, it is a memalign 
problem, but some confusing reports by not using always the patches I 
made to registrar module to align the structure, made thinking is 
something else. Now is no longer in registrar, but in another module.


There might be many of these, can you try to compile first without 
strict alignment to 8 bytes? Checking quickly to gcc, the option should 
be |-mno-faster-structs


So try:

make proper
make FLAVOUR=kamailio cfg|
make Q=0 CC_EXTRA_OPTS=|-mno-faster-structs all|
...

By providing Q=0, you will see all compile flags, verify that 
|-mno-faster-structs is there.


Cheers,
Daniel
|
On 6/22/12 3:26 PM, Akan wrote:

Hello,

After doing some research, this is what I found out. On Solaris Sparc 
64bit system, there is a mandatory alignment of memory accesses and 
also for data types. I went thru the core dump, disassembled the code 
and located the instruction that produced the error. The registers 
addresses in questioned are on a 4 byte alignment but not an 8 byte or 
16 byte alignment. .The earlier patch must have forced the alignment 
which is why the error did not occur in the program common.c. It looks 
like there is a similar situation in t_funcs.c.


Here is a link that I found that can better explain:
http://blog.jgc.org/2007/04/debugging-solaris-bus-error-caused-by.html

Core was generated by `/opt/kamailio-3.2/sbin/kamailio'.
Program terminated with signal 10, Bus error.
#0  0x7bd2b7bc in t_relay_to (p_msg=0x10047c698, proxy=0x0, 
proto=0, replicate=0) at t_funcs.c:352

352 if (!t_reply( t, p_msg , 100 ,

  0x7bd2b7b0 +976:   ldx  [ %l7 + %g1 ], %g1
   0x7bd2b7b4 +980:   ldx  [ %g1 ], %g1
   0x7bd2b7b8 +984:   call  0x7be9bc80 t_reply@plt
*= 0x7bd2b7bc +988:   ldx  [ %g1 + 0x38 ], %o3*
   0x7bd2b7c0 +992:   cmp  %o0, 0
   0x7bd2b7c4 +996:   be,pn   %icc, 0x7bd2bb14 
t_relay_to+1844

   0x7bd2b7c8 +1000:  ldx  [ %fp + 0x7f7 ], %o0
   0x7bd2b7cc +1004:  b  %xcc, 0x7bd2b460 
t_relay_to+128


End of assembler dump.
(gdb) info registers g1
g1 0x7666c3e4   -2308520988
(gdb) info registers o3
o3 0x18f3d0 1635280

I hope this helps in trying to resolve this problem and to find a 
solution. Also, if you need a sparc system to test with, just let me 
know. We can help from a sparc perspective.


Thanks

Nathaniel





--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, Seattle, USA, Sep 23-26, 2012 - 
http://asipto.com/u/katu
Kamailio Practical Workshop, Netherlands, Sep 10-12, 2012 - 
http://asipto.com/u/kpw

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


[SR-Users] Kamailio v3.3.0 packages

2012-06-25 Thread Daniel-Constantin Mierla

Hello,

I'm summarizing the status of packages for latest release v3.3.0.

Debian/Ubuntu packages are ready in the usual APT repository, including 
nightly builds of the GIT branch 3.3, details at:

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

RPMs for CentOS/RedHat, Fedora, openSuse (various versions for each OS) 
are now available on opensuse build factory repository, details at:


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

There you find the note about Peter Dunkley's repository, which has also 
builds for Raspberry Pi.


Cheers,
Daniel

--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, Seattle, USA, Sep 23-26, 2012 - 
http://asipto.com/u/katu
Kamailio Practical Workshop, Netherlands, Sep 10-12, 2012 - 
http://asipto.com/u/kpw

___
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] default kamailio configuration

2012-06-25 Thread Vitaliy Aleksandrov

Hi All,

After reading default kamailio configuration i can't understand why does 
kamailio remove preloaded route headers from the incoming initial INVITE 
before calling record_route().


remove_hf(Route);
if  (is_method(INVITE|SUBSCRIBE))
record_route();

What will happen if an INVITE comes from another SIP proxy which wants 
to stay in the middle of the dialogue ?


For example, during Re-INVITE UA from our local site will construct 
in-dialog INVITE with R-URI taken from the remote contact and send it to 
our local proxy according to RR. Local proxy will process it in 
route[WITHNDLG] where loose_route() function will remove top most RR 
header because it points to us and since there is no more RR records 
forward the request to a destination from the R-URI.  As i understand in 
that case remote proxy will not receive any in-dialog requests from us.







___
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] Nathelper module, FLT_NATS, FLT_NATB

2012-06-25 Thread Richard Brady
Klaus / Daniel

Thanks again for assistance with this.

I've tried the solution based on add_contact_alias() and
handle_ruri_alias() and it works perfectly.

Richard

On 22 June 2012 13:47, Klaus Darilion klaus.mailingli...@pernau.at wrote:


 On 22.06.2012 13:50, Richard Brady wrote:

 Thanks guys, fantastic answers.

 You mention that NAT detection happens before save() and the flag is set
 by lookup() which makes much more sense. However, if Kamailio is not the
 registrar, as is the case with my current project, those functions are
 not called, so an alternative is needed. There are clearly several
 options.

 The solution I have gone for is to replace fix_nated_register() with
 fix_nated_contact() so that the REGISTER request is relayed with a
 modified Contact header containing the external ip:port of the client.


 The cleanest solution would be to use add_contact_alias() and
 handle_ruri_alias(). The do not change the contact but put the public
 address into a uri parameter. Thus, the URI seen by the client is always the
 one it sends:
 http://www.kamailio.org/docs/modules/3.2.x/modules_k/nathelper.html#id2550431


 That is then stored by the registrar (FreeSWITCH in my case) and used
 later to originate calls for that user. The FreeSWITCH know to send
 those calls to Kamailio through either use of the Path header and module
 in Kamailio, or through static configuration of fs_path or proxy
 parameters in FreeSWITCH.


 This is fine.


 The works for the first INVITE to the registered client behind NAT. But
 that client sends back a 200 OK with a Contact header containing its
 private IP address, and so fix_nated_contact() needs to be invoked on
 that response, and normally it would be due to FLB_NATB being set, but
 if Kamailio was not the registrar then that flag is not set. So I need
 to detect NAT on the client at the time of receiving the reply, or
 alternatively by having the registrar store a cookie and setting it
 based on that.


 You are correct. For in-dialog messages received from SIP clients I would
 always use add_contact_alias() and remove the NAT flags completely.


 I suppose then my next question then is can I call nat_uac_test() on a
 UAS?


 Today, almost any SIP clients are SIP symmetric. This means, that they
 receive SIP from the some port/connection where they send. Thus, skip the
 NAT tests completely and always use add_contact_alias() for messages receive
 from SIP clients and handle_ruri_alias() for messages sent to SIP clients.

 Depending on if you use Freeswitch also as media relay you can also remove
 the media proxy stuff from the Kamailio config.

 On important thing is NAT-keep-alive. This is usually done by nathelper
 module by querying the location table for contact with NAT-flag set. Thus,
 either you do NAT keep-alive by freeswitch (e.g sending OPTIONS requests) or
 do it in your Kamailio proxy (e.g. set the nat_bflag
 http://www.kamailio.org/docs/modules/3.2.x/modules_k/usrloc.html#id2541477
 and call save(location,0x02) before relaying REGISTER to freeswitch.
 Then Kamailio will do NAT-pinging. Note, if you want to keep-alive only for
 successfully registered clients, you man want to call save() in the
 reply-route of the REGISTER request).

 regards
 Klaus

___
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] Nathelper module, FLT_NATS, FLT_NATB

2012-06-25 Thread SamyGo
This is a great thread, really full of answers and concepts for me atleast.
:)

On Mon, Jun 25, 2012 at 5:57 PM, Richard Brady rnbr...@gmail.com wrote:

 Klaus / Daniel

 Thanks again for assistance with this.

 I've tried the solution based on add_contact_alias() and
 handle_ruri_alias() and it works perfectly.

 Richard

 On 22 June 2012 13:47, Klaus Darilion klaus.mailingli...@pernau.at
 wrote:
 
 
  On 22.06.2012 13:50, Richard Brady wrote:
 
  Thanks guys, fantastic answers.
 
  You mention that NAT detection happens before save() and the flag is set
  by lookup() which makes much more sense. However, if Kamailio is not the
  registrar, as is the case with my current project, those functions are
  not called, so an alternative is needed. There are clearly several
  options.
 
  The solution I have gone for is to replace fix_nated_register() with
  fix_nated_contact() so that the REGISTER request is relayed with a
  modified Contact header containing the external ip:port of the client.
 
 
  The cleanest solution would be to use add_contact_alias() and
  handle_ruri_alias(). The do not change the contact but put the public
  address into a uri parameter. Thus, the URI seen by the client is always
 the
  one it sends:
 
 http://www.kamailio.org/docs/modules/3.2.x/modules_k/nathelper.html#id2550431
 
 
  That is then stored by the registrar (FreeSWITCH in my case) and used
  later to originate calls for that user. The FreeSWITCH know to send
  those calls to Kamailio through either use of the Path header and module
  in Kamailio, or through static configuration of fs_path or proxy
  parameters in FreeSWITCH.
 
 
  This is fine.
 
 
  The works for the first INVITE to the registered client behind NAT. But
  that client sends back a 200 OK with a Contact header containing its
  private IP address, and so fix_nated_contact() needs to be invoked on
  that response, and normally it would be due to FLB_NATB being set, but
  if Kamailio was not the registrar then that flag is not set. So I need
  to detect NAT on the client at the time of receiving the reply, or
  alternatively by having the registrar store a cookie and setting it
  based on that.
 
 
  You are correct. For in-dialog messages received from SIP clients I would
  always use add_contact_alias() and remove the NAT flags completely.
 
 
  I suppose then my next question then is can I call nat_uac_test() on a
  UAS?
 
 
  Today, almost any SIP clients are SIP symmetric. This means, that they
  receive SIP from the some port/connection where they send. Thus, skip the
  NAT tests completely and always use add_contact_alias() for messages
 receive
  from SIP clients and handle_ruri_alias() for messages sent to SIP
 clients.
 
  Depending on if you use Freeswitch also as media relay you can also
 remove
  the media proxy stuff from the Kamailio config.
 
  On important thing is NAT-keep-alive. This is usually done by nathelper
  module by querying the location table for contact with NAT-flag set.
 Thus,
  either you do NAT keep-alive by freeswitch (e.g sending OPTIONS
 requests) or
  do it in your Kamailio proxy (e.g. set the nat_bflag
 
 http://www.kamailio.org/docs/modules/3.2.x/modules_k/usrloc.html#id2541477
  and call save(location,0x02) before relaying REGISTER to freeswitch.
  Then Kamailio will do NAT-pinging. Note, if you want to keep-alive only
 for
  successfully registered clients, you man want to call save() in the
  reply-route of the REGISTER request).
 
  regards
  Klaus

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

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


Re: [SR-Users] Alias possible for presence...

2012-06-25 Thread Gertjan Wolzak
Daniel, 

 

Thanks for the info, will dive into it together with an programmer that does
the client..

 

Thanks.

 

From: Daniel-Constantin Mierla [mailto:mico...@gmail.com] 
Sent: woensdag 20 juni 2012 11:42
To: SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - Users
Mailing List
Cc: Gertjan Wolzak
Subject: Re: [SR-Users] Alias possible for presence...

 

Hello,



On 6/20/12 9:19 AM, Gertjan Wolzak wrote:

Well, the account name is not public, but I would like to have the
possibility to have a private account for registering and a
publicaccount to publish.

 

The goal is to have others to be able to send messages to your  public id,
while you log in with your  private id.


most of user agent have two fields, one to be used as SIP id and another one
for authentication id.





 

I know, think the next step is to get an communicator that has that
possibility...

 

So I want to be able to publish the public account and not the private
one.

 

For example:

 

I register to the presence server with uid gertjan and my password, but I
want to be known to others as newbie.

 

So my friend can send an invitation/message to newbie as well as to gertjan
.

 

Just like the db_alias which is used in the kamalio for linking sip accounts
to aliases.


For presence, people have to subscribe to a SIP id, in this case it your
public ID known by everybody.

The easiest will be that the user agent will publish in behalf of the public
id. But ultimately, you can replace the values in headers and xml body (see
textops/xmlops functions), then do presence handling, after applying the
changes to the message (see textopsx module).

Cheers,
Daniel




 

Rgds,

 

Gertjan

 

From: Daniel-Constantin Mierla [mailto:mico...@gmail.com] 
Sent: dinsdag 19 juni 2012 10:27
To: SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - Users
Mailing List
Cc: Gertjan Wolzak
Subject: Re: [SR-Users] Alias possible for presence...

 

Hello,

On 6/14/12 10:28 AM, Gertjan Wolzak wrote:

Hello All,

 

I have the following challenge.

 

We are using kamailio 3.2 and have enabled presence. Which works fine.

 

But we would like to be able to work with aliases, so that the account name
and presentation name can be different.

 

Any Ideas. Or did I miss the documentation on that?

the account name is public or not? If it is some internal id, eventually is
used for authentication, but for presence the contacts should know the
public id.

Or maybe you can give some example to understand how you use aliases in the
context of presence...

Cheers,
Daniel









-- 
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda http://twitter.com/#%21/miconda  -
http://www.linkedin.com/in/miconda
Kamailio Advanced Training, Seattle, USA, Sep 23-26, 2012 -
http://asipto.com/u/katu
Kamailio Practical Workshop, Netherlands, Sep 10-12, 2012 -
http://asipto.com/u/kpw


-- 
This message was scanned by Foize and is believed to be clean. 
Click here to report this message as spam.
http://filter.foize.com/cgi-bin/learn-msg.cgi?id=  






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





-- 
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, Seattle, USA, Sep 23-26, 2012 -
http://asipto.com/u/katu
Kamailio Practical Workshop, Netherlands, Sep 10-12, 2012 -
http://asipto.com/u/kpw


-- 
This message was scanned by Foize and is believed to be clean. 
Click here to report this message as spam.
http://filter.foize.com/cgi-bin/learn-msg.cgi?id=  

___
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] Subscription-State: terminated;reason=terminated?

2012-06-25 Thread Min Wang

HI

when I removed 102 from 101's contact list (using jitsi nightly 1.1 
build),  kamailio 3.3 send out NOTIFY to 102 like this:



NOTIFY 
sip:102@192.168.122.147:5060;transport=udp;registering_acc=192_168_122_32 SIP/2.0.

Via: SIP/2.0/UDP 192.168.122.32;branch=z9hG4bK1bfb.afbf0a85.0.
To: sip:102@192.168.122.32;tag=f6a40771.
From: sip:101@192.168.122.32;tag=a6a1c5f60faecf035a1ae5b6e96e979a-5724.
CSeq: 4 NOTIFY.
Call-ID: c7c52dd058268596ec84dd3c645a2f17@0.0.0.0.
Content-Length: 0.
User-Agent: kamailio (3.3.0-rc0 (x86_64/linux)).
Max-Forwards: 70.
Event: presence.
Contact: sip:192.168.122.32:5060;transport=udp.
Subscription-State: terminated;reason=terminated. -



Note the reason code is:terminated.


From rfc3265, The defined reason codes are:  deactivated/  
probation/rejected/ timeout/giveup/noresource



What is the reason to send: reason=terminated instead one of the 
well-defined reason codes?



There was a discussion regarding at:

http://sip-router.org/tracker/index.php?do=detailstask_id=133 
http://sip-router.org/tracker/index.php?do=detailstask_id=133



but I did not see the explaination of  reason=terminated.


Thanks


min








___
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] EOF Error in pass_fd

2012-06-25 Thread Daniel-Constantin Mierla

Hello,

there was a wrong unlocking of the profile while printing its content 
via MI, that could caused a race and eventually this kind of crash (in 
the case a dlg was added/removed in/from profile while the mi command 
was run).


I committed a patch, you have to use latest branch 3.2. Let us know if 
all goes fine now.


Cheers,
Daniel

On 6/25/12 4:45 PM, Ricardo Martinez wrote:


Hello List.

The last weekend our kamailio process crashed with this error :

Jun 24 06:55:08 pxh /usr/local/sbin/kamailio[10661]: : core 
[pass_fd.c:293]: ERROR: receive_fd: EOF on 29


Jun 24 06:55:08 pxh /usr/local/sbin/kamailio[10542]: ALERT: core 
[main.c:751]: child process 10601 exited by a signal 11


Jun 24 06:55:08 pxh /usr/local/sbin/kamailio[10542]: ALERT: core 
[main.c:754]: core was generated


Jun 24 06:55:08 pxh /usr/local/sbin/kamailio[10542]: INFO: core 
[main.c:766]: INFO: terminating due to SIGCHLD


Can someone tell me what seems to be the problem here?

We're using  :

version: kamailio 3.2.2 (x86_64/linux) 98ba92-dirty

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: 98ba92 -dirty

compiled on 12:45:36 Feb  2 2012 with gcc 4.4.6

And this is the bt full from gdb

Core was generated by `/usr/local/sbin/kamailio -m 1024'.

Program terminated with signal 11, Segmentation fault.

#0  mi_profile_list (cmd_tree=value optimized out, param=value 
optimized out) at dlg_profile.c:789


789 if ( mi_print_dlg( rpl, ph-dlg, 0)!=0 )

Missing separate debuginfos, use: debuginfo-install 
filesystem-2.4.30-2.1.el6.x86_64 glibc-2.12-1.25.el6_1.3.x86_64 
keyutils-libs-1.4-1.el6.x86_64 krb5-libs-1.9-9.el6_1.2.x86_64 
libcom_err-1.41.12-7.el6.x86_64 libselinux-2.0.94-5.el6.x86_64 
mysql-libs-5.1.52-1.el6_0.1.x86_64 
nss-softokn-freebl-3.12.7-1.1.el6.x86_64 
openssl-1.0.0-20.el6_2.1.x86_64 pcre-7.8-3.1.el6.x86_64 
zlib-1.2.3-26.el6.x86_64


(gdb) bt full

#0  mi_profile_list (cmd_tree=value optimized out, param=value 
optimized out) at dlg_profile.c:789


node = value optimized out

rpl_tree = 0x20a6790

rpl = 0x20a67b0

profile = 0x7fe99a2dda00

ph = 0x0

profile_name = value optimized out

value = value optimized out

i = value optimized out

#1  0x7fe9dce287b1 in run_mi_cmd (fifo_stream=value optimized 
out) at ../../lib/kmi/mi.h:77


No locals.

#2  mi_fifo_server (fifo_stream=value optimized out) at fifo_fnc.c:509

mi_cmd = 0x208f8f0

mi_rpl = value optimized out

hdl = 0x0

line_len = 41

file_sep = 0x2039017 

command = 0x7fe9dfdbdef9 profile_list_dlgs

file = 0x7fe9dfd98d78 /tmp/openser_receiver_27809

f = 0x2039018

reply_stream = 0x20b0980

#3  0x7fe9dce2a640 in fifo_process (rank=value optimized out) at 
mi_fifo.c:247


fifo_stream = 0x209a0b0

#4  0x7fe9dce2a9de in mi_child_init (rank=0) at mi_fifo.c:211

pid = value optimized out

#5  0x004dba41 in init_mod_child (m=0x7fe9dfc6ba10, rank=0) at 
sr_module.c:886


No locals.

#6  0x004db9c4 in init_mod_child (m=0x7fe9dfc6bd08, rank=0) at 
sr_module.c:883


No locals.

#7  0x004db9c4 in init_mod_child (m=0x7fe9dfc6c248, rank=0) at 
sr_module.c:883


No locals.

#8  0x004db9c4 in init_mod_child (m=0x7fe9dfc6c748, rank=0) at 
sr_module.c:883


No locals.

#9  0x004db9c4 in init_mod_child (m=0x7fe9dfc6d288, rank=0) at 
sr_module.c:883


No locals.

#10 0x004db9c4 in init_mod_child (m=0x7fe9dfc6d928, rank=0) at 
sr_module.c:883


No locals.

#11 0x004db9c4 in init_mod_child (m=0x7fe9dfc6dee0, rank=0) at 
sr_module.c:883


No locals.

#12 0x004db9c4 in init_mod_child (m=0x7fe9dfc6e1f0, rank=0) at 
sr_module.c:883


No locals.

#13 0x004db9c4 in init_mod_child (m=0x7fe9dfc6e5d0, rank=0) at 
sr_module.c:883


No locals.

#14 0x004db9c4 in init_mod_child (m=0x7fe9dfc6e830, rank=0) at 
sr_module.c:883


No locals.

#15 0x004db9c4 in init_mod_child (m=0x7fe9dfc6ebd0, rank=0) at 
sr_module.c:883


No locals.

#16 0x004db9c4 in init_mod_child (m=0x7fe9dfc6f220, rank=0) at 
sr_module.c:883


No locals.

#17 0x004db9c4 in init_mod_child (m=0x7fe9dfc6f648, rank=0) at 
sr_module.c:883


No locals.

#18 0x004db9c4 in init_mod_child (m=0x7fe9dfc6fa60, rank=0) at 
sr_module.c:883


No locals.

#19 0x004db9c4 in init_mod_child (m=0x7fe9dfc6fe40, rank=0) at 
sr_module.c:883


No locals.

#20 0x004db9c4 in init_mod_child (m=0x7fe9dfc702c0, rank=0) at 
sr_module.c:883


No 

Re: [SR-Users] Nathelper module, FLT_NATS, FLT_NATB

2012-06-25 Thread Daniel-Constantin Mierla


On 6/25/12 3:34 PM, SamyGo wrote:
This is a great thread, really full of answers and concepts for me 
atleast.

:)


looks like we will have a new wiki page with the digested content of 
this thread :-)


Cheers,
Daniel


On Mon, Jun 25, 2012 at 5:57 PM, Richard Brady rnbr...@gmail.com 
mailto:rnbr...@gmail.com wrote:


Klaus / Daniel

Thanks again for assistance with this.

I've tried the solution based on add_contact_alias() and
handle_ruri_alias() and it works perfectly.

Richard

On 22 June 2012 13:47, Klaus Darilion
klaus.mailingli...@pernau.at
mailto:klaus.mailingli...@pernau.at wrote:


 On 22.06.2012 13:50, Richard Brady wrote:

 Thanks guys, fantastic answers.

 You mention that NAT detection happens before save() and the
flag is set
 by lookup() which makes much more sense. However, if Kamailio
is not the
 registrar, as is the case with my current project, those
functions are
 not called, so an alternative is needed. There are clearly several
 options.

 The solution I have gone for is to replace fix_nated_register()
with
 fix_nated_contact() so that the REGISTER request is relayed with a
 modified Contact header containing the external ip:port of the
client.


 The cleanest solution would be to use add_contact_alias() and
 handle_ruri_alias(). The do not change the contact but put the
public
 address into a uri parameter. Thus, the URI seen by the client
is always the
 one it sends:


http://www.kamailio.org/docs/modules/3.2.x/modules_k/nathelper.html#id2550431


 That is then stored by the registrar (FreeSWITCH in my case)
and used
 later to originate calls for that user. The FreeSWITCH know to send
 those calls to Kamailio through either use of the Path header
and module
 in Kamailio, or through static configuration of fs_path or proxy
 parameters in FreeSWITCH.


 This is fine.


 The works for the first INVITE to the registered client behind
NAT. But
 that client sends back a 200 OK with a Contact header
containing its
 private IP address, and so fix_nated_contact() needs to be
invoked on
 that response, and normally it would be due to FLB_NATB being
set, but
 if Kamailio was not the registrar then that flag is not set. So
I need
 to detect NAT on the client at the time of receiving the reply, or
 alternatively by having the registrar store a cookie and setting it
 based on that.


 You are correct. For in-dialog messages received from SIP
clients I would
 always use add_contact_alias() and remove the NAT flags completely.


 I suppose then my next question then is can I call
nat_uac_test() on a
 UAS?


 Today, almost any SIP clients are SIP symmetric. This means,
that they
 receive SIP from the some port/connection where they send. Thus,
skip the
 NAT tests completely and always use add_contact_alias() for
messages receive
 from SIP clients and handle_ruri_alias() for messages sent to
SIP clients.

 Depending on if you use Freeswitch also as media relay you can
also remove
 the media proxy stuff from the Kamailio config.

 On important thing is NAT-keep-alive. This is usually done by
nathelper
 module by querying the location table for contact with NAT-flag
set. Thus,
 either you do NAT keep-alive by freeswitch (e.g sending OPTIONS
requests) or
 do it in your Kamailio proxy (e.g. set the nat_bflag

http://www.kamailio.org/docs/modules/3.2.x/modules_k/usrloc.html#id2541477
 and call save(location,0x02) before relaying REGISTER to
freeswitch.
 Then Kamailio will do NAT-pinging. Note, if you want to
keep-alive only for
 successfully registered clients, you man want to call save() in the
 reply-route of the REGISTER request).

 regards
 Klaus

___
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://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, Seattle, USA, Sep 23-26, 2012 - 
http://asipto.com/u/katu
Kamailio Practical Workshop, Netherlands, Sep 10-12, 2012 - 
http://asipto.com/u/kpw

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org

Re: [SR-Users] Nathelper module, FLT_NATS, FLT_NATB

2012-06-25 Thread Fred Posner

On Jun 25, 2012, at 8:57 AM, Richard Brady wrote:

 Klaus / Daniel
 
 Thanks again for assistance with this.
 
 I've tried the solution based on add_contact_alias() and
 handle_ruri_alias() and it works perfectly.
 
 Richard
 

Do you have an example of the cfg you can share?

Fred
http://qxork.com


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


Re: [SR-Users] EOF Error in pass_fd

2012-06-25 Thread Ricardo Martinez
Thanks Daniel.

We are going to do some test with the new patch, but before can you guide
me on how to download only the modification via git ¿



Thanks!!.



Best Regards,

Ricardo Martinez.-



*De:* Daniel-Constantin Mierla [mailto:mico...@gmail.com]
*Enviado el:* lunes, 25 de junio de 2012 12:43
*Para:* SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) -
Users Mailing List
*CC:* Ricardo Martinez
*Asunto:* Re: [SR-Users] EOF Error in pass_fd



Hello,

there was a wrong unlocking of the profile while printing its content via
MI, that could caused a race and eventually this kind of crash (in the case
a dlg was added/removed in/from profile while the mi command was run).

I committed a patch, you have to use latest branch 3.2. Let us know if all
goes fine now.

Cheers,
Daniel

On 6/25/12 4:45 PM, Ricardo Martinez wrote:

Hello List.

The last weekend our kamailio process crashed with this error :



 Jun 24 06:55:08 pxh /usr/local/sbin/kamailio[10661]: : core
[pass_fd.c:293]: ERROR: receive_fd: EOF on 29

Jun 24 06:55:08 pxh /usr/local/sbin/kamailio[10542]: ALERT: core
[main.c:751]: child process 10601 exited by a signal 11

Jun 24 06:55:08 pxh /usr/local/sbin/kamailio[10542]: ALERT: core
[main.c:754]: core was generated

Jun 24 06:55:08 pxh /usr/local/sbin/kamailio[10542]: INFO: core
[main.c:766]: INFO: terminating due to SIGCHLD



Can someone tell me what seems to be the problem here?

We’re using  :



version: kamailio 3.2.2 (x86_64/linux) 98ba92-dirty

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: 98ba92 -dirty

compiled on 12:45:36 Feb  2 2012 with gcc 4.4.6



And this is the bt full from gdb



Core was generated by `/usr/local/sbin/kamailio -m 1024'.

Program terminated with signal 11, Segmentation fault.

#0  mi_profile_list (cmd_tree=value optimized out, param=value optimized
out) at dlg_profile.c:789

789 if ( mi_print_dlg( rpl,
ph-dlg, 0)!=0 )

Missing separate debuginfos, use: debuginfo-install
filesystem-2.4.30-2.1.el6.x86_64 glibc-2.12-1.25.el6_1.3.x86_64
keyutils-libs-1.4-1.el6.x86_64 krb5-libs-1.9-9.el6_1.2.x86_64
libcom_err-1.41.12-7.el6.x86_64 libselinux-2.0.94-5.el6.x86_64
mysql-libs-5.1.52-1.el6_0.1.x86_64 nss-softokn-freebl-3.12.7-1.1.el6.x86_64
openssl-1.0.0-20.el6_2.1.x86_64 pcre-7.8-3.1.el6.x86_64
zlib-1.2.3-26.el6.x86_64

(gdb) bt full

#0  mi_profile_list (cmd_tree=value optimized out, param=value optimized
out) at dlg_profile.c:789

node = value optimized out

rpl_tree = 0x20a6790

rpl = 0x20a67b0

profile = 0x7fe99a2dda00

ph = 0x0

profile_name = value optimized out

value = value optimized out

i = value optimized out

#1  0x7fe9dce287b1 in run_mi_cmd (fifo_stream=value optimized out) at
../../lib/kmi/mi.h:77

No locals.

#2  mi_fifo_server (fifo_stream=value optimized out) at fifo_fnc.c:509

mi_cmd = 0x208f8f0

mi_rpl = value optimized out

hdl = 0x0

line_len = 41

file_sep = 0x2039017 

command = 0x7fe9dfdbdef9 profile_list_dlgs

file = 0x7fe9dfd98d78 /tmp/openser_receiver_27809

f = 0x2039018

reply_stream = 0x20b0980

#3  0x7fe9dce2a640 in fifo_process (rank=value optimized out) at
mi_fifo.c:247

fifo_stream = 0x209a0b0

#4  0x7fe9dce2a9de in mi_child_init (rank=0) at mi_fifo.c:211

pid = value optimized out

#5  0x004dba41 in init_mod_child (m=0x7fe9dfc6ba10, rank=0) at
sr_module.c:886

No locals.

#6  0x004db9c4 in init_mod_child (m=0x7fe9dfc6bd08, rank=0) at
sr_module.c:883

No locals.

#7  0x004db9c4 in init_mod_child (m=0x7fe9dfc6c248, rank=0) at
sr_module.c:883

No locals.

#8  0x004db9c4 in init_mod_child (m=0x7fe9dfc6c748, rank=0) at
sr_module.c:883

No locals.

#9  0x004db9c4 in init_mod_child (m=0x7fe9dfc6d288, rank=0) at
sr_module.c:883

No locals.

#10 0x004db9c4 in init_mod_child (m=0x7fe9dfc6d928, rank=0) at
sr_module.c:883

No locals.

#11 0x004db9c4 in init_mod_child (m=0x7fe9dfc6dee0, rank=0) at
sr_module.c:883

No locals.

#12 0x004db9c4 in init_mod_child (m=0x7fe9dfc6e1f0, rank=0) at
sr_module.c:883

No locals.

#13 0x004db9c4 in init_mod_child (m=0x7fe9dfc6e5d0, rank=0) at
sr_module.c:883

No locals.

#14 0x004db9c4 in init_mod_child (m=0x7fe9dfc6e830, rank=0) at
sr_module.c:883

No locals.

#15 0x004db9c4 in init_mod_child (m=0x7fe9dfc6ebd0, rank=0) at
sr_module.c:883

No locals.

#16 0x004db9c4 in init_mod_child 

Re: [SR-Users] Subscription-State: terminated;reason=terminated?

2012-06-25 Thread Min Wang

HI

I did more analysis:

as before, the configure is:

 101 --- kamailio proxy/xcap server -- 102

  101/102 : jitsi night build, xcap/SIMPLE mode
  kamailio is 3.3
  101 has 102 on its contacts list, and 102 has 101 on its contacts 
list as well


now 101 remove 102 from its contact,  proxy will send out NOTIFY to 102

(1) if reason=terminated returned in NOTIFY ( this is the current 
kamaili behavior)


  According to RFC 3265:
If no reason code or an unknown reason code is present, the client MAY 
attempt to re-
   subscribe at any time (unless a retry-after parameter is present,
   in which case the client SHOULD NOT attempt re-subscription until
   after the number of seconds specified by the retry-after
   parameter).


Jitsi 1.1  nightly will keep on re-subscribe ( at some random time ).

And kamailio/proxy will keep on reject the subscribe with: NOTIFY, 
with reason=terminated.


   It seems to waste some resources (bandwidth/db/cpu etc). Image if 
there are a lot of deleted contacts :(.



(2) if reason=rejected  returned in NOTIFY

according to the same RFC:

   rejected: The subscription has been terminated due to change in
  authorization policy.  Clients SHOULD NOT attempt to re-subscribe.
  The retry-after parameter has no semantics for rejected.


So the client will not send any re-subscribe, which is good, will 
save some resources.


But there is an issue:

when 101 add 102 again,  after 101 puting pres-rules (allow 102) to 
the xcap server ,


there will be two cases:

(2.a). If that subscription expired, or deleted by the kamailio 
timer ( I hope I understand the code correctly)


   of course kamailio will not send any NOTIFY (to 102).

(2.b). if that subscription do still exist in active_watcher, that  
subscriptions will be marked as active


   kamailio  will send  the NOTIFY to 102 indicating 101's status

  But from 102 point of view:  since the subscription has been 
terminated , this notify will be rejected as 481 non-exist.



In neither case, can 102 see 101's status ( since 102 to 101's 
subscription has been rejected/terminated from 102 point of view)



   So from pure end-user point of view,  that is not the expected 
behavior.
   User expect the 102 can see 101's status since 101 now allow 102 
again and 102 did not remove 101 from his contact list



   The question is:  how can we do it right?




Thanks.


min




On 06/25/2012 05:43 PM, Min Wang wrote:

HI

when I removed 102 from 101's contact list (using jitsi nightly 1.1 
build),  kamailio 3.3 send out NOTIFY to 102 like this:



NOTIFY 
sip:102@192.168.122.147:5060;transport=udp;registering_acc=192_168_122_32 
SIP/2.0.

Via: SIP/2.0/UDP 192.168.122.32;branch=z9hG4bK1bfb.afbf0a85.0.
To: sip:102@192.168.122.32;tag=f6a40771.
From: sip:101@192.168.122.32;tag=a6a1c5f60faecf035a1ae5b6e96e979a-5724.
CSeq: 4 NOTIFY.
Call-ID: c7c52dd058268596ec84dd3c645a2f17@0.0.0.0.
Content-Length: 0.
User-Agent: kamailio (3.3.0-rc0 (x86_64/linux)).
Max-Forwards: 70.
Event: presence.
Contact: sip:192.168.122.32:5060;transport=udp.
Subscription-State: terminated;reason=terminated. -



Note the reason code is:terminated.


From rfc3265, The defined reason codes are:  deactivated/  
probation/rejected/ timeout/giveup/noresource



What is the reason to send: reason=terminated instead one of the 
well-defined reason codes?



There was a discussion regarding at:

http://sip-router.org/tracker/index.php?do=detailstask_id=133 
http://sip-router.org/tracker/index.php?do=detailstask_id=133



but I did not see the explaination of  reason=terminated.


Thanks


min








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



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


Re: [SR-Users] Nathelper module, FLT_NATS, FLT_NATB

2012-06-25 Thread SamyGo
I had this thread already starred here in inbox, a wiki page is definitely
going to be bookmarked.

On Mon, Jun 25, 2012 at 9:44 PM, Daniel-Constantin Mierla mico...@gmail.com
 wrote:


 On 6/25/12 3:34 PM, SamyGo wrote:

 This is a great thread, really full of answers and concepts for me
 atleast.
 :)


 looks like we will have a new wiki page with the digested content of this
 thread :-)

 Cheers,
 Daniel


 On Mon, Jun 25, 2012 at 5:57 PM, Richard Brady rnbr...@gmail.com wrote:

 Klaus / Daniel

 Thanks again for assistance with this.

 I've tried the solution based on add_contact_alias() and
 handle_ruri_alias() and it works perfectly.

 Richard

 On 22 June 2012 13:47, Klaus Darilion klaus.mailingli...@pernau.at
 wrote:
 
 
  On 22.06.2012 13:50, Richard Brady wrote:
 
  Thanks guys, fantastic answers.
 
  You mention that NAT detection happens before save() and the flag is
 set
  by lookup() which makes much more sense. However, if Kamailio is not
 the
  registrar, as is the case with my current project, those functions are
  not called, so an alternative is needed. There are clearly several
  options.
 
  The solution I have gone for is to replace fix_nated_register() with
  fix_nated_contact() so that the REGISTER request is relayed with a
  modified Contact header containing the external ip:port of the client.
 
 
  The cleanest solution would be to use add_contact_alias() and
  handle_ruri_alias(). The do not change the contact but put the public
  address into a uri parameter. Thus, the URI seen by the client is
 always the
  one it sends:
 
 http://www.kamailio.org/docs/modules/3.2.x/modules_k/nathelper.html#id2550431
 
 
  That is then stored by the registrar (FreeSWITCH in my case) and used
  later to originate calls for that user. The FreeSWITCH know to send
  those calls to Kamailio through either use of the Path header and
 module
  in Kamailio, or through static configuration of fs_path or proxy
  parameters in FreeSWITCH.
 
 
  This is fine.
 
 
  The works for the first INVITE to the registered client behind NAT. But
  that client sends back a 200 OK with a Contact header containing its
  private IP address, and so fix_nated_contact() needs to be invoked on
  that response, and normally it would be due to FLB_NATB being set, but
  if Kamailio was not the registrar then that flag is not set. So I need
  to detect NAT on the client at the time of receiving the reply, or
  alternatively by having the registrar store a cookie and setting it
  based on that.
 
 
  You are correct. For in-dialog messages received from SIP clients I
 would
  always use add_contact_alias() and remove the NAT flags completely.
 
 
  I suppose then my next question then is can I call nat_uac_test() on a
  UAS?
 
 
  Today, almost any SIP clients are SIP symmetric. This means, that they
  receive SIP from the some port/connection where they send. Thus, skip
 the
  NAT tests completely and always use add_contact_alias() for messages
 receive
  from SIP clients and handle_ruri_alias() for messages sent to SIP
 clients.
 
  Depending on if you use Freeswitch also as media relay you can also
 remove
  the media proxy stuff from the Kamailio config.
 
  On important thing is NAT-keep-alive. This is usually done by nathelper
  module by querying the location table for contact with NAT-flag set.
 Thus,
  either you do NAT keep-alive by freeswitch (e.g sending OPTIONS
 requests) or
  do it in your Kamailio proxy (e.g. set the nat_bflag
 
 http://www.kamailio.org/docs/modules/3.2.x/modules_k/usrloc.html#id2541477
  and call save(location,0x02) before relaying REGISTER to freeswitch.
  Then Kamailio will do NAT-pinging. Note, if you want to keep-alive only
 for
  successfully registered clients, you man want to call save() in the
  reply-route of the REGISTER request).
 
  regards
  Klaus

 ___
 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 
 listsr-us...@lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


 --
 Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda 
 - http://www.linkedin.com/in/miconda
 Kamailio Advanced Training, Seattle, USA, Sep 23-26, 2012 - 
 http://asipto.com/u/katu
 Kamailio Practical Workshop, Netherlands, Sep 10-12, 2012 - 
 http://asipto.com/u/kpw


___
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] Git Error on Kamailio-3.3 Install

2012-06-25 Thread SamyGo
Hello,
I'm setting up new Kamailio 3.3 from git ref-link:
http://www.kamailio.org/wiki/install/3.3.x/git
I'm using CentOS 5.8 and when I execute the line

# git checkout -b 3.3 origin/3.3

it gives me error.

fatal: git checkout: updating paths is incompatible with switching branches.
Did you intend to checkout 'origin/3.3' which can not be resolved as commit?

Can I skip it ! o need to do something about it !!

Regards,
Sammy G.
___
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