Re: [SR-Users] Possible memory leak dealing with presence in kamailio

2015-01-15 Thread Daniel-Constantin Mierla
Hello,

I applied the patch, with some adjustments. Now in master, to be
backported to stable branches soon.

Cheers,
Daniel

On 13/01/15 20:16, Nuno Reis wrote:
 Hi Kristian and Daniel.

 Kristian, hhanks for you feedback and patch. 
 I'll try your patch here and will let you know the outcome soon.
 Thanks again guys.

 Cheers,

 --

 *Nuno Miguel Reis*| *Unified Communication**Systems*
 M. +351 913907481 | nr...@wavecom.pt mailto:nr...@wavecom.pt

 WAVECOM-Soluções Rádio, S.A.
 Cacia Park | Rua do Progresso, Lote 15
 3800-639 AVEIRO | Portugal
 T. +351 309 700 225 | F. +351 234 919 191
 *GPS
 http://maps.google.com/maps/ms?msa=0msid=202333747613191340808.0004b4b227a6144f0df88
 | www.wavecom.pt http://www.wavecom.pt/**http://www.wavecom.pt/*

 Description: Description: WavecomSignature
 http://www.wavecom.pt/pt/wavecom/premios.php

 Publicity http://www.wavecom.pt/pt/mail_eventos.php



 On Tue, Jan 13, 2015 at 10:00 AM, Daniel-Constantin Mierla
 mico...@gmail.com mailto:mico...@gmail.com wrote:

 Hello,

 thanks for the details and patch. I will try to look at later today.

 Cheers,
 Daniel


 On 13/01/15 08:35, Kristian F. Høgh wrote:

 Hi,

  

 I've been hunting a memory error in publish handling the last
 couple of days.

 The error is on our old but good 3.1.x presence server.

 Using memory debug, I located the memory leak in
 modules/presence/hash.c, function insert_phtable, line 492 (in
 trunk):

 p= (pres_entry_t*)shm_malloc(size);

  

 As far I can see there are two errors when deleting publish
 htable entries

 1. When calling delete_phtable pres.event-type is used instead
 of pres.event-evp-type

  

 2. When creating publish hashtable, p-publ_count is not set.
 (defaults to 0)

 In delete_phtable, the following code is present

 p-publ_count--;

 if(p-publ_count== 0)

 p-publ_count is probably decremented to -1 (unless the user have
 two active dialogs)

  

 I attach a patch, which I would carefully test in a test
 environment :-)

  

 Regards,

 Kristian Høgh

 Uni-tel

  

  

 On Monday 12 January 2015 15:39:27 Nuno Reis wrote:

  Hello all.

 

  I'm consistently watching a memory increase in kamailio when
 dealing with

  PRESENCE events, namely SIP PUBLISH events. The system
 eventually hangs

  running out of memory.

  This behavior is seen at least in kamailio 4.1 and 4.2. I'm
 currently using

  the latest stable 4.2.2.

  If I disable the SIP PUBLISH handling in kamailio i don't
 observe the issue

  anymore but as a side effect I don't have presence (name BLFs)
 also.

  What do you think can be the right approach here? Should I open
 an issue in

  github for this? Should I run kamailio under valgrind for some
 time? Are

  there any other possible debug hints here?

  Please find attached a code snippet with the presence related
 parts I'm

  using right now.

  Looking forward to hear from you.

 

  Best Regards,

 

  --

 

  *Nuno Miguel Reis* | *Unified Communication** Systems*

  M. +351 913907481 tel:%2B351%20913907481 | nr...@wavecom.pt
 mailto:nr...@wavecom.pt

  WAVECOM-Soluções Rádio, S.A.

  Cacia Park | Rua do Progresso, Lote 15

  3800-639 AVEIRO | Portugal

  T. +351 309 700 225 tel:%2B351%20309%20700%20225 | F. +351
 234 919 191

  *GPS

 
 
 http://maps.google.com/maps/ms?msa=0msid=202333747613191340808.0004b4b227a6144f0df88
 
 http://maps.google.com/maps/ms?msa=0msid=202333747613191340808.0004b4b227a6144f0df88

  | www.wavecom.pt http://www.wavecom.pt
 http://www.wavecom.pt/ http://www.wavecom.pt/**
 http://www.wavecom.pt/ http://www.wavecom.pt/*

 

  [image: Description: Description: WavecomSignature]

  http://www.wavecom.pt/pt/wavecom/premios.php
 http://www.wavecom.pt/pt/wavecom/premios.php

 

  [image: Publicity] http://www.wavecom.pt/pt/mail_eventos.php
 http://www.wavecom.pt/pt/mail_eventos.php

  



 ___
 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://twitter.com/#!/miconda http://twitter.com/#%21/miconda - 
 http://www.linkedin.com/in/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
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda


Re: [SR-Users] Changing SDP with subst after rtpproxy_answer corrupts SDP

2015-01-15 Thread Daniel Tryba
On Thursday 15 January 2015 13:38:00 Matthias van der Vlies wrote:
 I have an on-reply route that needs to change the SDP version for the
 reply coming in. The use case is that I have a mobile originated call
 and there is some Ericsson switch that doesn't like it when the SDP
 version is updated (in this case by asterisk) although nothing has
 changed to the actual SDP (183 session progress and then OK.)  Funny
 thing is that Asterisk will actually drop a call if it receives a
 re-INVITE with same version... That's why they invented
 ignoresdpversion, but now it's the other way around :)
 
 Mobile phone - Ericsson MSC - ACME packet - (18X.4X.XXX.XX) Kamailio
 (10.41.0.21) - Asterisk

Sounds familiar (the Ericsson is the troublemaker), my solution was to upgrade 
to asterisk 11.x. But since patching is not possible, I assume upgrading is 
neither. A workaround was to drop the 183 message in kamailio to Ericsson:

onreply_route[MANAGE_REPLY] {
xlog(incoming reply\n);
if(status=~[12][0-9][0-9])
route(NATMANAGE);

if(status==183)
{
drop;
}

...

-- 

Telefoon: 088 0100 700
Sales: sa...@pocos.nl | Service: serviced...@pocos.nl
http://www.pocos.nl/ | Croy 9c, 5653 LC Eindhoven | Kamer van Koophandel 
17097024

___
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] Changing SDP with subst after rtpproxy_answer corrupts SDP

2015-01-15 Thread Matthias van der Vlies
That's also a solution, but I prefer not dropping the 183 :)

Daniel's (the other one ;-)) suggestion was the solution in the end:

if(subst(/^o=somestuff ([0-9]+) ([0-9]+) IN IP4
(.*)$/o=somestuff \1 \1 IN IP4 \3/)) {
xlog(L_INFO, Fixed Asterisk incorrect
version number in SDP);
msg_apply_changes();
}
rtpproxy_answer(wrei);

Now it's looking OK:

v=0
o=tismi 895007076 895007076 IN IP4 185.X.X.X
s=X
c=IN IP4 185.X.X.X
t=0 0
m=audio 39250 RTP/AVP 8 0 18 3 101
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv
a=sdpmangled:yes

Matthias


On 01/15/2015 03:29 PM, Daniel Tryba wrote:
 On Thursday 15 January 2015 13:38:00 Matthias van der Vlies wrote:
 I have an on-reply route that needs to change the SDP version for the
 reply coming in. The use case is that I have a mobile originated call
 and there is some Ericsson switch that doesn't like it when the SDP
 version is updated (in this case by asterisk) although nothing has
 changed to the actual SDP (183 session progress and then OK.)  Funny
 thing is that Asterisk will actually drop a call if it receives a
 re-INVITE with same version... That's why they invented
 ignoresdpversion, but now it's the other way around :)

 Mobile phone - Ericsson MSC - ACME packet - (18X.4X.XXX.XX) Kamailio
 (10.41.0.21) - Asterisk
 Sounds familiar (the Ericsson is the troublemaker), my solution was to 
 upgrade 
 to asterisk 11.x. But since patching is not possible, I assume upgrading is 
 neither. A workaround was to drop the 183 message in kamailio to Ericsson:

 onreply_route[MANAGE_REPLY] {
 xlog(incoming reply\n);
 if(status=~[12][0-9][0-9])
 route(NATMANAGE);

 if(status==183)
 {
 drop;
 }

 ...



___
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] OMA/RCS Presence compliance

2015-01-15 Thread Osbun, Alex
Hello,

Are the Kamailio presence modules (presence, xcap, pua, rls, etc.) RCS 5.X and 
OMA Presence Simple spec compliant.  I found the following bullet from this 
announcement - http://www.kamailio.org/w/2012/09/kamailio-at-11-years/


 *   SIMPLE Presence  IM extensions – embedded XCAP server, MSRP relay, RLS 
full OMA/RCS extensions implementation, IMS registrar records replication, 
a.s.o.

Does that mean that only the RLS functionality is fully OMA/RCS compliant?  
Thanks and I appreciate any guidance.

Regards,

Alex
___
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] Wrong dialog selected in on_reply/failure route in case of spirals.

2015-01-15 Thread Daniel-Constantin Mierla
Hello,

I looked at the logs, but I cannot see the log message I added with the
patch for reseting local dialog shortcuts after onreply and failure
route. It shuld be something like:

... resetting the local dialog shortcuts

Are you sure you are running the latest branch 4.1? You can send the
output of kamailio -v to double check here.

I separated the logs per process and looked when a 301 was received,
apparently the ones for Call-ID: 4-21712 are matching the same dialog. I
found something not printing the same kind of logs like for other 301
for Call-ID: 2-21712. If you can point the line in the logs where you
think it was the wrong dialog match, I can investigate from there, but
now I couldn't find any lead.

Anyhow, if it is the latest branch 4.1 and the problem still persists,
can you add the following xlog at the beginning of main request_route
(or the route {...} ), plus in each reply_route, onreply_route and
failure_route:

xlog(processing $rm ( $ci / %ft / $tt / $hdr(Via) ) [$fu = $tu]\n);

Then redo the tests to catch the issue and send me the new logs. Because
you use sipp with tags like '4', it is hard to search on a single tocken
and I want to have the all message attribute when a relevant route block
is executed.

Cheers,
Daniel

On 14/01/15 15:07, Daniel-Constantin Mierla wrote:
 Hello Julia,

 ok, I will look over the logs very soon.

 As a short note for the future, make the archives zip or tgz, being
 more common formats that can be unarchived everywhere without
 installing additional app, being handy to open even on small devices.
 Now it is ok with rar, being at the desk.

 Cheers,
 Daniel

 On 14/01/15 14:43, Julia Boudniatsky wrote:
 Hello Daniel,

 Please find in attached file the debug 3 log.
 Failed call with Call-ID: 4-21712@10.25.153.150
 mailto:4-21712@10.25.153.150.
 The problem occurred with all modes of dlg_match_mode 
 The same load test in 3.3 executed without failures.

 Thank you,

 Julia.

-- 
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/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] REGISTER replication using t_replicate with ds_select_dst

2015-01-15 Thread Spencer Thomason
Hello all,
We are moving our registration and location services to dedicated instances 
geographically separate from our proxies and then using redirects to locate the 
registered user.  The idea is to protect the proxies from a potential 
thundering herd of registrations if there was some network outage   I’m using 
dispatcher to find a registrar that has a registration for the user, if a user 
is not locally registered a 503 is returned and the next server is contacted.  
Registrations are replicated to other servers when the client is not behind 
NAT.  If the client is behind NAT, the registrar where the client initially 
registered performs keep-alives and NAT traversal and also acts as an outbound 
proxy instead of sending a redirect.

I’m attempting to simplify the configuration by using a dispatcher group to 
classify incoming registrations and to select replication targets but the 
registrar that initially received the request is in the group as well.  Is 
there an elegant way to chose all destinations except the local instance?  I’m 
currently doing this with the hack below but any suggestions would be greatly 
appreciated.

Also, if anyone has any comments or recommendations on the topology, please 
share!

Thanks,
Spencer

if (isflagset(FLT_FROMREG))
return;

subst('/^From:(.*)sip:.*@[a-zA-Z0-9.:]+(.*)$/From:\1sip:$au@DOMAIN\2/ig');
subst('/^To:(.*)sip:.*@[a-zA-Z0-9.:]+(.*)$/To:\1sip:$au@DOMAIN\2/ig’);

$rd = DOMAIN;
$var(local_uri) = sip: + $Ri + : + $Rp;
ds_select_dst(10, 4);
if ($du != $var(local_uri)) {
t_replicate($du);
}

while (ds_next_dst()) {
if ($du != $var(local_uri)) {
t_replicate($du);
}
}
___
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 the iptel Switch for both home office environments...

2015-01-15 Thread H. KAIMARAH

Thanks Daniel,

I downloaded the Switch and are in the process of installing...
Will request for support in case i face challenges.

Best of regards,


Daniel-Constantin Mierla mailto:mico...@gmail.com
Monday, January 12, 2015 2:57 PM
Hello,

the latest iptel's SER is now Kamailio, you can take it from 
kamailio.org. It runs on Linux (or other unixes), if you have only 
windows, then get a Linux in a virtual machine (e.g., via virtualbox) 
to play with it.


Cheers,
Daniel

On 09/01/15 08:57, H. KAIMARAH wrote:

--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
H. KAIMARAH mailto:kaima...@gmail.com
Friday, January 09, 2015 10:57 AM
Hello there,

Kindly advise me on how i can download and install the iptel soft 
switch for both Windows and Linux

platforms.

I intend to install a hosted Sip VoiP service using your open source 
switch for both home and office environments.
I have jst been checking out the documentation  from the site but 
seams some documentation pages are

failing to load (timing out).

Kindly advise or share with me some of the download links for the 
application so i can make a successful

installation.

Sincere regards,



--

***/Happy New Year/***

*HENRY K. Kaimarah*
/Cell:/ +256-754462010
/Now in Kampala/ - UGANDA.


___
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] Trouble getting start time / call duration from dialog module

2015-01-15 Thread Will Ferrer
Hi Daniel

Thanks so much for the response and help as always.

I tried changing my config to use loose route.

It looks like this now:

loadmodule dialog.so

...
modparam(dialog, db_url, DBURL)
modparam(dialog, db_mode, 1)
modparam(dialog, dlg_flag, 4)
modparam(dialog, dlg_match_mode, 1)

...

request_route {
if (is_method(INVITE)  (! has_totag() ) ) {
dlg_manage();
xlog (L_INFO, request_route DIALOG TEST: Dialog initiated);
}
if (is_method(BYE)) {
#dlg_manage();
loose_route();
$var(elapsed) = ( $TV(s) - $dlg(start_ts) );
xlog (L_INFO, request_route DIALOG TEST: Completed $dlg(from_uri) to
$dlg(to_uri), elapsed: $var(elapsed), now seconds: $TV(s), dlg start time:
$dlg(start_ts), DLG_lifetime: $DLG_lifetime);
}


I now get:

INFO: script: request_route DIALOG TEST: Dialog initiate
INFO: script: request_route DIALOG TEST: Completed
sip:willf1976t...@develop-sbc.switchsoft.com to
sip:+18054515...@develop-sbc.switchsoft.com, elapsed: 1421386898, now
seconds: 1421386898, dlg start time: 0, DLG_lifetime: 1421386898


So the $DLG_lifetime is being populated, but it has all the seconds since
epoch time. You can also see that the $dlg(start_ts) is 0.

I also tried using the dlg_manage() instead of the loose route in my test
and got the same result.

Any idea what might be missing?

Thanks again for your help.

All the best.

Will





On Thu, Jan 15, 2015 at 5:53 AM, Daniel-Constantin Mierla mico...@gmail.com
wrote:

 Hello,

 try to do dlg_manage() or lose_route() before accessing the dialog
variables.

 Cheers,
 Daniel


 On 15/01/15 08:25, Will Ferrer wrote:

 An update on this.

 I tried setting my dialog module to the use the db. No db entry is ever
made.

 My config looks like this now:

 loadmodule dialog.so

 ...
 modparam(dialog, db_url, DBURL)
 modparam(dialog, db_mode, 1)
 modparam(dialog, dlg_flag, 4)
 modparam(dialog, dlg_match_mode, 1)

 ...

 request_route {
 if (is_method(INVITE)  (! has_totag() ) ) {
 dlg_manage();
 }
 if (is_method(BYE)) {
 $var(elapsed) = ( $TV(s) - $dlg(start_ts) );
 xlog (L_INFO, request_route DIALOG TEST: Completed $dlg(from_uri) to
$dlg(to_uri), elapsed: $var(elapsed), now seconds: $TV(s), dlg start time:
$dlg(start_ts), DLG_lifetime: $DLG_lifetime);
 }
 


 I hope this message finds every one well.

 All the best.

 Will

 On Thu, Jan 15, 2015 at 12:03 AM, Will Ferrer will.fer...@switchsoft.com
wrote:

 Hi All

 I am in need of being able to see what the duration of the call was at
the time of hang out.

 I tried turning on the dialog module, but the result is that the values
I need are either null or always show as zero.

 I tried to follow the suggestions in the thread about this here:

 http://lists.sip-router.org/pipermail/sr-users/2010-October/065889.html

 In the end my config looks like this:

 loadmodule dialog.so

 ...

 modparam(dialog, dlg_flag, 4)
 modparam(dialog, dlg_match_mode, 1)

 ...

 request_route {
 if (is_method(INVITE)  (! has_totag() ) ) {
 dlg_manage();
 }
 if (is_method(BYE)) {
 $var(elapsed) = ( $TV(s) - $dlg(start_ts) );
 xlog (L_INFO, request_route DIALOG TEST: Completed $dlg(from_uri) to
$dlg(to_uri), elapsed: $var(elapsed), now seconds: $TV(s), dlg start time:
$dlg(start_ts), DLG_lifetime: $DLG_lifetime);
 }
 



 Note that I put at the top of the request route just for testing purposes

 The result I get in the log is this:

 INFO: script: request_route DIALOG TEST: Completed
sip:willf1976t...@develop-sbc.switchsoft.com to
sip:+18054515...@develop-sbc.switchsoft.com, elapsed: 1421305210, now
seconds: 1421305210, dlg start time: 0, DLG_lifetime: null


 I was wondering if any one could point out to me what I have set up
wrong.

 Thanks in advance

 All the best.

 Will Ferrer
 Switchsoft




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

___
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] dialog module shared memory

2015-01-15 Thread Grant Bagdasarian
Hello,

I'm using the dialog module to control the maximum number of calls allowed to 
be passed through.
Is it possible to share the dialogs stored in memory with multiple instances of 
kamailio?

So if both kamailio instances process calls, and the maximum is set to a global 
of 10, both combined should never let more than 10 calls through.

Regards,

Grant
___
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 4.2.1 core in timer.c:877

2015-01-15 Thread 张顺通
I user rtimer module :

loadmodule rtimer.so
modparam(rtimer, timer, name=p_route;interval=1;mode=1;)
modparam(rtimer, exec, timer=p_route;route=P_ROUTE)

application will coredump in sometimes, and core file in below, what's the
reason?

Program terminated with signal 11, Segmentation fault.
#0  0x005fda98 in timer_list_expire (t=1043586690,
h=0x7f9ed45ac9b0, slow_l=0x7f9ed45adc80, slow_mark=2316) at timer.c:877
877 timer.c: No such file or directory.
in timer.c
(gdb) bt full
#0  0x005fda98 in timer_list_expire (t=1043586690,
h=0x7f9ed45ac9b0, slow_l=0x7f9ed45adc80, slow_mark=2316) at timer.c:877
tl = 0x7f9ed47f7e98
ret = 0
#1  0x005fc686 in timer_handler () at timer.c:953
saved_ticks = 1043586690
run_slow_timer = 0
i = 268
__FUNCTION__ = timer_handler
#2  0x005fdd4d in timer_main () at timer.c:992
No locals.
#3  0x004aa571 in main_loop () at main.c:1700
i = 12
pid = 0
si = 0x0
si_desc = udp receiver child=11
sock=10.1.*.*:5160\000\000\b\000\000\000\000\000\000\000\000\060S\324\236\177\000\000\060=#z\001\000\000\000(\205V\324\236\177\000\000\060=#z\377\177\000\000\214\216N\000\000\000\000\000\037t\372D\000\000\000\000(\205V\324\236\177\000\000\220@
#z\377\177\000\000\000\000\000\000\001\000\000
nrprocs = 12
__FUNCTION__ = main_loop
#4  0x004af166 in main (argc=11, argv=0x7fff7a234098) at main.c:2561
cfg_stream = 0x1da75e0
c = -1
r = 0
tmp = 0x7fff7a234681 
tmp_len = 32767
port = 2049130512
proto = 32673
options = 0x706ec0
:f:cm:M:dVIhEeb:l:L:n:vKrRDTN:W:w:t:u:g:P:G:SQ:O:a:A:
ret = -1
seed = 220012340
rfd = 4
debug_save = 0
debug_flag = 0
dont_fork_cnt = 0
n_lst = 0xb
p = 0x0
__FUNCTION__ = main
___
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] Redirect Server Including Path/Recieved Information

2015-01-15 Thread Asgaroth

Hi All,

Thanks for the responses thus far, I would be interrested in the patches 
mentioned when they are released for 4.2 :)


In the meantime, I have another question relating to this configuration:

[1] How would I apply the recieved paramaters to the contact header in 
the reply message, I have tried the following logic,


if ( lookup(location, sip:$r...@domain.com) ) {
  $var(received) = $(du{uri.param,received});
  if !strempty( $var(received) ) {
$ru = $ru + ;received=+ $var(received);
  }
  sl_send_reply(302, Moved Temporarily);
  exit;
}

and end up with a contact header looking like below:

[a] Contact: 
sip:user@192.168.1.1:37891;rinstance=ef7f216ba0d07156;transport=UDP*;received=sip:213.146.165.189:37891*


What I am trying to achieve is:

[a] Contact: 
sip:user@213.146.165.189:37891;rinstance=ef7f216ba0d07156;transport=UDP*;received=sip:213.146.165.189:37891*


Are these two versions of the contact header interpretted the same way?

Thanks



On 08/01/2015 21:09, Asgaroth wrote:

Hi All,

I am attempting to setup a standalone redirect server which will 
lookup contact info and redirect to appropriate outbound proxy.


The problem I am having is that the registrar is storing the path and 
recieved information, however, when I perform a lookup and reply with 
302, the recieved and path information is not included.


Are there module parameters in the registrar module that will include 
these contact parameters (recieved) or create the appropriate headers 
(path/route) in the 302 response, or, is this something I need to do 
manually.


Currently I have the following lookup code:

route {

  t_check_trans();

  if ( method == INVITE ) {
xlog(route[MAIN] : $rm : ruri=$ru);
xlog(route[MAIN] : $rm : lookup=sip:$rU@registered.domain);
if ( lookup(location, sip:$rU@registered.domain) ) {
  send_reply(302, Moved Temporarily);
  exit;
}
  }
}

I had a look at the path_mode parameter but this looks like it only 
takes affect for REGISTER methods.


The INVITE that comes in supports the PATH header but I dont see this 
being passed back. In fact, I'm not entirely sure if the path header 
is a supported header in the 302 response message. I had a quick 
google and I cant seem to easily find what headers are suported in the 
302 message, and where I need to put the path/recieved information. I 
presume I can add the recieved info as a parameter to the contact 
header, but how would i specify the outbound proxy to use, would that 
be in a route or a path header in the 302 response?


I can see that the $du pseudo variable is set with the appropriate 
outbound path and received information, now I just need to include 
this information in the 302 response.


Any suggestions/comments to assist in how I get this info into the 302 
message would be greatly appreciated.


Thanks in advance.



___
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] One way audio video - Kamailio + rtpproxy ( NAT call )

2015-01-15 Thread Chirag Ajmera
Kamailio - 4.2.2 ( SIP server )
Rtpproxy - Git Compiled ( miconda patched version )

Issue:
Remote NAT Call
Bria Rmt Iphone SIP Extn (3G)  Kamailio Server - Desktop Bria
Client ( Wifi )

Audio and Video packets are sent from iPhone to desktop client .. but
nothing otherway

Also, being totally new to kamailio I can't figure out logging SIP messages
( INVITE etc ) ..

Kindly if anyone can help

Thank You
Best,
Chirag A.
___
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] Diameter problem on Kamailio

2015-01-15 Thread Kowalski Piotr 3 - Hurt
Dear sr-users!



We are facing serious problem.



We built openIMS based on Kamailio. Moreover, we have RCS users registered, but 
some users are automatically unregistered on the openIMS core:



1) We don't know what a piece of log on S-CSCF means:



/usr/sbin/kamailio[17392]: ERROR:  --- EXPLOIT --- We need to do an UNREG 
server SAR assignemnt



2) In log files there is 404 Not Found: Unknown destination or 404 user 
offline.



Probably there is some diameter problem.



Has anyone of you already faced such problem?



Many thanks for your answers.





Piotr Kowalski

Starszy Architekt Techniczny

Tel. +48 22 699 50 93

Kom. +48 519 123 289



Orange

Orange Polska

Hurt

Badania i Rozwój Sieci i Platform Usługowych

Wydział Usług Konwergentnych

Obrzeżna 7 /p. 309, 02-691 Warszawa

Fax. +48 22 857 99 86

www.hurt-orange.plhttp://www.hurt-orange.pl/



- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
- - - - - - - - - - - - - - - - - - - - - - -



Czy musisz drukować tę wiadomość? Pomyśl o środowisku. Korzystaj z e-faktury.



Treść tej wiadomości jest własnością Orange Polska i zawiera informacje 
stanowiące tajemnicę przedsiębiorstwa Orange Polska. Jeżeli nie jesteście 
Państwo jej adresatem, bądź otrzymaliście ją przez pomyłkę, prosimy o 
powiadomienie o tym nadawcy oraz trwałe jej usunięcie. Orange Polska Spółka 
Akcyjna z siedzibą i adresem w Warszawie (02-326) przy Al. Jerozolimskich 160, 
wpisana do Rejestru Przedsiębiorców prowadzonego przez Sąd Rejonowy dla m.st. 
Warszawy XII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem 
010681; REGON 012100784, NIP 526-02-50-995; z pokrytym w całości kapitałem 
zakładowym wynoszącym 3.937.072.437 złotych.



___
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] Fosdem 2015

2015-01-15 Thread Daniel-Constantin Mierla
Hello,

I haven't made any decision for this year yet. I plan to go if the
weather looks ok (easy driving) or the flight are still reasonably cheap
days before the event. Also, if there are many Kamailio friends going, I
will try harder to show up there.

Cheers,
Daniel

On 14/01/15 09:00, Alexandr Dubovikov wrote:
 Hello everybody,

 what is about Fosdem this year ? Who is going there ?

 Wbr,
 Alexandr


 ___
 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://twitter.com/#!/miconda - http://www.linkedin.com/in/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] Fosdem 2015

2015-01-15 Thread DanB

I will be there this year also, if someone prepares an event.

DanB.

___
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] Redirect Server Including Path/Recieved Information

2015-01-15 Thread Asgaroth

I just noticed a typo, the contacts should look like this:

what I end up with:
[a] Contact: 
sip:user@192.168.1.1:12345;rinstance=ef7f216ba0d07156;transport=UDP*;received=sip:213.146.165.189:37891*


what I am trying to achieve
[b] Contact: 
sip:user@192.168.1.1:12345;rinstance=ef7f216ba0d07156;transport=UDP*;received=sip:213.146.165.189:37891*


Thanks

On 15/01/2015 08:30, Asgaroth wrote:

Hi All,

Thanks for the responses thus far, I would be interrested in the 
patches mentioned when they are released for 4.2 :)


In the meantime, I have another question relating to this configuration:

[1] How would I apply the recieved paramaters to the contact header in 
the reply message, I have tried the following logic,


if ( lookup(location, sip:$r...@domain.com) ) {
  $var(received) = $(du{uri.param,received});
  if !strempty( $var(received) ) {
$ru = $ru + ;received=+ $var(received);
  }
  sl_send_reply(302, Moved Temporarily);
  exit;
}

and end up with a contact header looking like below:

[a] Contact: 
sip:user@192.168.1.1:37891;rinstance=ef7f216ba0d07156;transport=UDP*;received=sip:213.146.165.189:37891*


What I am trying to achieve is:

[a] Contact: 
sip:user@213.146.165.189:37891;rinstance=ef7f216ba0d07156;transport=UDP*;received=sip:213.146.165.189:37891*


Are these two versions of the contact header interpretted the same way?

Thanks



On 08/01/2015 21:09, Asgaroth wrote:

Hi All,

I am attempting to setup a standalone redirect server which will 
lookup contact info and redirect to appropriate outbound proxy.


The problem I am having is that the registrar is storing the path and 
recieved information, however, when I perform a lookup and reply with 
302, the recieved and path information is not included.


Are there module parameters in the registrar module that will include 
these contact parameters (recieved) or create the appropriate headers 
(path/route) in the 302 response, or, is this something I need to do 
manually.


Currently I have the following lookup code:

route {

  t_check_trans();

  if ( method == INVITE ) {
xlog(route[MAIN] : $rm : ruri=$ru);
xlog(route[MAIN] : $rm : lookup=sip:$rU@registered.domain);
if ( lookup(location, sip:$rU@registered.domain) ) {
  send_reply(302, Moved Temporarily);
  exit;
}
  }
}

I had a look at the path_mode parameter but this looks like it only 
takes affect for REGISTER methods.


The INVITE that comes in supports the PATH header but I dont see this 
being passed back. In fact, I'm not entirely sure if the path header 
is a supported header in the 302 response message. I had a quick 
google and I cant seem to easily find what headers are suported in 
the 302 message, and where I need to put the path/recieved 
information. I presume I can add the recieved info as a parameter to 
the contact header, but how would i specify the outbound proxy to 
use, would that be in a route or a path header in the 302 response?


I can see that the $du pseudo variable is set with the appropriate 
outbound path and received information, now I just need to include 
this information in the 302 response.


Any suggestions/comments to assist in how I get this info into the 
302 message would be greatly appreciated.


Thanks in advance.





___
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 with a third party operator

2015-01-15 Thread Jyaim Jyaim
Hello all,

I cannot find documentation on how to configure Kamailio to interwork with
another operator's IMS Core.
I think the s-cscf should be in charge of detecting a user is not known
locally, in order to route requests toward other operator.
Do you know where I should look to get infos on this topic ?

Thank you!
___
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] Changing SDP with subst after rtpproxy_answer corrupts SDP

2015-01-15 Thread Daniel-Constantin Mierla
Hello,

use msg_apply_changes() from textops modules in between the changes done
to sdp.

No time to check the code, so I am not sure at this moment if can be
done inside the onreply_route[x], which is executed by tm, but should be
possible in core reply_route - -there you can make a filter and detect
it is sdp, do the subst, apply the changes, then let the rtpproxy in
onreply_route[x] like now.

Cheers,
Daniel

On 15/01/15 13:38, Matthias van der Vlies wrote:
 Dear all,

 I have an on-reply route that needs to change the SDP version for the
 reply coming in. The use case is that I have a mobile originated call
 and there is some Ericsson switch that doesn't like it when the SDP
 version is updated (in this case by asterisk) although nothing has
 changed to the actual SDP (183 session progress and then OK.)  Funny
 thing is that Asterisk will actually drop a call if it receives a
 re-INVITE with same version... That's why they invented
 ignoresdpversion, but now it's the other way around :)

 Mobile phone - Ericsson MSC - ACME packet - (18X.4X.XXX.XX)
 Kamailio (10.41.0.21) - Asterisk

 The issue is that the asterisk sends a reply 200 OK, with an updated
 version because it already sent SDP for 183 session progress. This can
 be patched in asterisk, but in my scenario I can unfortunately not do
 that. Thus trying to fix this on Kamailio.

 I am able to 'fix' this currently by performing a subst on the sdp
 owner variable:

 onreply_route[WITHSDP] {
 if (has_body(application/sdp)) {
 if(ds_is_from_list()) {
 rtpproxy_answer(wrei);
   *if(subst(/^o=someowner ([0-9]+) ([0-9]+) IN
 IP4 (.*)$/o=someowner \1 \1 IN IP4 \3/)) {*
xlog(L_INFO, Fixed Asterisk
 incorrect version number in SDP);
}
# tried the answer here as well, but that
 corrupts it even more
 }
 else {
 rtpproxy_answer(wrie);
 }
 }
 exit;
 }

 However this corrupts the SDP:

 v=0
 o=tismi 652858233 652858233 IN IP4 10.41.0.21*18X.4X.XXX.XX*
 s=Some server
 c=IN IP4 18X.4X.XXX.XX
 t=0 0
 m=audio 57644 RTP/AVP 8 0 18 3 101
 a=rtpmap:8 PCMA/8000
 a=rtpmap:0 PCMU/8000
 a=rtpmap:18 G729/8000
 a=fmtp:18 annexb=no
 a=rtpmap:3 GSM/8000
 a=rtpmap:101 telephone-event/8000
 a=fmtp:101 0-16
 a=silenceSupp:off - - - -
 a=ptime:20
 a=sendrecv
 a=nortpproxy:yes

 When I do not substitute the SDP looks perfectly fine and the external
 address shows as the IN IP4. But of course the version is incremented:

 v=0
 o=tismi 1606876535 *1606876536* IN IP4 *18X.4X.XXX.XX*
 s=Some server
 c=IN IP4 18X.4X.XXX.XX
 t=0 0
 m=audio 55410 RTP/AVP 8 0 18 101
 a=rtpmap:8 PCMA/8000
 a=rtpmap:0 PCMU/8000
 a=rtpmap:18 G729/8000
 a=fmtp:18 annexb=no
 a=rtpmap:101 telephone-event/8000
 a=fmtp:101 0-16
 a=silenceSupp:off - - - -
 a=ptime:20
 a=sendrecv
 a=sdpmangled:yes


 The ericsson is now accepting this (although it's corrupt, I know
 probably the ACME doing something funky with it), but it causes issues
 with another unknown piece of equipment that fails on parsing the
 session owner. I hope there is something wrong with my subst, but I'm
 afraid I can not do this from the on_reply route because SDP is only
 updated once it finishes?

 I know it's dangerous to alter the session version like this, so I
 made sure the Asterisk will never send a re-INVITE. Now I need a way
 to not corrupt the o=

 Kind regards,

 Matthias van der Vlies




 ___
 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://twitter.com/#!/miconda - http://www.linkedin.com/in/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] Trouble getting start time / call duration from dialog module

2015-01-15 Thread Daniel-Constantin Mierla
Hello,

try to do dlg_manage() or lose_route() before accessing the dialog
variables.

Cheers,
Daniel

On 15/01/15 08:25, Will Ferrer wrote:
 An update on this.

 I tried setting my dialog module to the use the db. No db entry is
 ever made.

 My config looks like this now:

 loadmodule dialog.so

 ...
 modparam(dialog, db_url, DBURL)
 modparam(dialog, db_mode, 1)
 modparam(dialog, dlg_flag, 4)
 modparam(dialog, dlg_match_mode, 1)

 ...

 request_route {
 if (is_method(INVITE)  (! has_totag() ) ) {
 dlg_manage();
 }
 if (is_method(BYE)) {
 $var(elapsed) = ( $TV(s) - $dlg(start_ts) );
 xlog (L_INFO, request_route DIALOG TEST: Completed $dlg(from_uri)
 to $dlg(to_uri), elapsed: $var(elapsed), now seconds: $TV(s), dlg
 start time: $dlg(start_ts), DLG_lifetime: $DLG_lifetime);
 }
 


 I hope this message finds every one well.

 All the best.

 Will

 On Thu, Jan 15, 2015 at 12:03 AM, Will Ferrer
 will.fer...@switchsoft.com mailto:will.fer...@switchsoft.com wrote:

 Hi All

 I am in need of being able to see what the duration of the call
 was at the time of hang out.

 I tried turning on the dialog module, but the result is that the
 values I need are either null or always show as zero.

 I tried to follow the suggestions in the thread about this here:

 http://lists.sip-router.org/pipermail/sr-users/2010-October/065889.html

 In the end my config looks like this:

 loadmodule dialog.so

 ...

 modparam(dialog, dlg_flag, 4)
 modparam(dialog, dlg_match_mode, 1)

 ...

 request_route {
 if (is_method(INVITE)  (! has_totag() ) ) {
 dlg_manage();
 }
 if (is_method(BYE)) {
 $var(elapsed) = ( $TV(s) - $dlg(start_ts) );
 xlog (L_INFO, request_route DIALOG TEST: Completed
 $dlg(from_uri) to $dlg(to_uri), elapsed: $var(elapsed), now
 seconds: $TV(s), dlg start time: $dlg(start_ts), DLG_lifetime:
 $DLG_lifetime);
 }
 



 Note that I put at the top of the request route just for testing
 purposes

 The result I get in the log is this:

 INFO: script: request_route DIALOG TEST: Completed
 sip:willf1976t...@develop-sbc.switchsoft.com
 mailto:sip%3awillf1976t...@develop-sbc.switchsoft.com to
 sip:+18054515...@develop-sbc.switchsoft.com
 mailto:sip%3a%2b18054515...@develop-sbc.switchsoft.com, elapsed:
 1421305210, now seconds: 1421305210, dlg start time: 0,
 DLG_lifetime: null


 I was wondering if any one could point out to me what I have set
 up wrong.

 Thanks in advance

 All the best.

 Will Ferrer
 Switchsoft




 ___
 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://twitter.com/#!/miconda - http://www.linkedin.com/in/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] websocket convert and forward to asterisk

2015-01-15 Thread jaflong jaflong
Hi Everyone,

Does anyone have a example of the config where I can get the following to work

I want Kamailio to process websocket converting wss to tcp and srtp to rtp and 
forward to asterisk as tcp and rtp

incoming call on websocket (wss rtp/savpf)   --   kamailio/rtpproxy (protocol 
- convert wss to tcp) and (sdp - convert rtp/savpf to rtp/avp) and (audio -  
convert srtp to rtp)   --   asterisk (recieve protocol: tcp, sdp: rtp/avp and 
audio:rtp) 

This application  would only have incoming call from websocket to forward on to 
asterisk.  







___
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] Changing SDP with subst after rtpproxy_answer corrupts SDP

2015-01-15 Thread Matthias van der Vlies
Dear all,

I have an on-reply route that needs to change the SDP version for the
reply coming in. The use case is that I have a mobile originated call
and there is some Ericsson switch that doesn't like it when the SDP
version is updated (in this case by asterisk) although nothing has
changed to the actual SDP (183 session progress and then OK.)  Funny
thing is that Asterisk will actually drop a call if it receives a
re-INVITE with same version... That's why they invented
ignoresdpversion, but now it's the other way around :)

Mobile phone - Ericsson MSC - ACME packet - (18X.4X.XXX.XX) Kamailio
(10.41.0.21) - Asterisk

The issue is that the asterisk sends a reply 200 OK, with an updated
version because it already sent SDP for 183 session progress. This can
be patched in asterisk, but in my scenario I can unfortunately not do
that. Thus trying to fix this on Kamailio.

I am able to 'fix' this currently by performing a subst on the sdp owner
variable:

onreply_route[WITHSDP] {
if (has_body(application/sdp)) {
if(ds_is_from_list()) {
rtpproxy_answer(wrei);
  *if(subst(/^o=someowner ([0-9]+) ([0-9]+) IN IP4
(.*)$/o=someowner \1 \1 IN IP4 \3/)) {*
   xlog(L_INFO, Fixed Asterisk incorrect
version number in SDP);
   }
   # tried the answer here as well, but that
corrupts it even more
}
else {
rtpproxy_answer(wrie);
}
}
exit;
}

However this corrupts the SDP:

v=0
o=tismi 652858233 652858233 IN IP4 10.41.0.21*18X.4X.XXX.XX*
s=Some server
c=IN IP4 18X.4X.XXX.XX
t=0 0
m=audio 57644 RTP/AVP 8 0 18 3 101
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv
a=nortpproxy:yes

When I do not substitute the SDP looks perfectly fine and the external
address shows as the IN IP4. But of course the version is incremented:

v=0
o=tismi 1606876535 *1606876536* IN IP4 *18X.4X.XXX.XX*
s=Some server
c=IN IP4 18X.4X.XXX.XX
t=0 0
m=audio 55410 RTP/AVP 8 0 18 101
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv
a=sdpmangled:yes


The ericsson is now accepting this (although it's corrupt, I know
probably the ACME doing something funky with it), but it causes issues
with another unknown piece of equipment that fails on parsing the
session owner. I hope there is something wrong with my subst, but I'm
afraid I can not do this from the on_reply route because SDP is only
updated once it finishes?

I know it's dangerous to alter the session version like this, so I made
sure the Asterisk will never send a re-INVITE. Now I need a way to not
corrupt the o=

Kind regards,

Matthias van der Vlies


___
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