Re: [SR-Users] TLS Support

2011-02-11 Thread Bernhard Suttner
Thanks a lot :-)

-Ursprüngliche Nachricht-
Von: Klaus Darilion [mailto:klaus.mailingli...@pernau.at] 
Gesendet: Donnerstag, 10. Februar 2011 19:19
An: Bernhard Suttner
Cc: sr-users@lists.sip-router.org
Betreff: Re: [SR-Users] TLS Support

Bernhard Suttner wrote:
 Hi,
 
 how could I compile the TLS module and only the TLS module - not the other 
 sources.

cd modules/tls
make


regards
klaus


 
 BTW: The documentation within the http://www.kamailio.org/docs/tls.html is 
 not up-to-date.
 
 Thanks in advance.
 
 Best regards,
 Bernhard
 
 
 
 ___
 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] NAT, TLS and location table

2011-02-11 Thread Bernhard Suttner
Hi,

I am using TLS and recognize the following problem:

The TLS connection are build up successfully but the natping (natping_interval 
= 10) does not send small dummy packets to the phones. The phones are behind a 
firewall with NAT. Registered phones with NAT but UDP do work correctly. They 
are getting the natping every 10 seconds. After 120 seconds (should be the 
tcp_connection_timeout) kamailio does send a FIN to the TLS phone to close the 
TLS connection. 

Should I increase the tcp_connection_timeout to a value bigger than the 
registration timeout? I thought I do not need that, because of the 
natping_interval. Is it maybe better to use a SIP-Options Ping instead of the 
small dummy packets? I would prefer the dummy packets because they are much 
smaller.

BTW: Kamailio 3.1.1 and snom360 with latest v8 firmware.

Thanks in advance!

Best regards,
Bernhard



___
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] NAT, TLS and location table

2011-02-11 Thread Bernhard Suttner
Hi,

thanks for you response. Do you think that kamailio does send sip-options-ping 
within TCP/TLS (instead of sending the dummy packets)?

Best regards,
Bernhard



-Ursprüngliche Nachricht-
Von: Klaus Darilion [mailto:klaus.mailingli...@pernau.at] 
Gesendet: Freitag, 11. Februar 2011 12:30
An: Bernhard Suttner
Cc: sr-users@lists.sip-router.org
Betreff: Re: [SR-Users] NAT, TLS and location table



Am 11.02.2011 12:15, schrieb Bernhard Suttner:
 Hi,
 
 I am using TLS and recognize the following problem:
 
 The TLS connection are build up successfully but the natping
 (natping_interval = 10) does not send small dummy packets to the
 phones. The phones are behind a firewall with NAT. Registered phones
 with NAT but UDP do work correctly. They are getting the natping
 every 10 seconds. After 120 seconds (should be the
 tcp_connection_timeout) kamailio does send a FIN to the TLS phone to
 close the TLS connection.

IIRC the keep-alive code in nathelper module sends CRLF only on UDP. IMO
it would be nice if it sends it also on TCP/TLS connections, at least as
a config option. Of course the code should also take care of not setting
up a new TCP connection if the old one is gone.

I once have seen a client which was confused by the CRLF and then closes
the TCP connection, so there might be other problems as well.

Of course the proper solution (IETF view) is that the clients sends
keep-alive (SIP outbound RFC).

 Should I increase the tcp_connection_timeout to a value bigger than
 the registration timeout? I thought I do not need that, because of
 the natping_interval. Is it maybe better to use a SIP-Options Ping
 instead of the small dummy packets? I would prefer the dummy packets
 because they are much smaller.

http://www.kamailio.org/dokuwiki/doku.php/install:1.5.x-to-3.0.0#tcp_connection_lifetime

http://www.kamailio.org/dokuwiki/doku.php/core-cookbook:3.1.x#tcp_keepalive
and
http://www.kamailio.org/dokuwiki/doku.php/core-cookbook:3.1.x#set_forward_no_connect
(to be used after lookup())
might be interesting too.


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


[SR-Users] Change transport=tls within Contact Header

2011-02-11 Thread Bernhard Suttner
Hi,

is there a function to change the transport field within the Contact Header? 
t_relay does relay it to the UDP port of the PBX but the transport within the 
Contact Header is still set to TLS. Later, the PBX does try to establish a TLS 
connection. 

The idea is now, that kamailio does set the transport of the Contact Header to 
UDP. Another possible way would to be, that I use the re.subst method but maybe 
there is a special function for that.

Thanks in advance.

Best regards,
Bernhard



___
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] TLS Support

2011-02-10 Thread Bernhard Suttner
Hi,

how could I compile the TLS module and only the TLS module - not the other 
sources.

BTW: The documentation within the http://www.kamailio.org/docs/tls.html is not 
up-to-date.

Thanks in advance.

Best regards,
Bernhard



___
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] Redundancy between 2 Kamailio servers

2011-02-02 Thread Bernhard Suttner
Would be possible.
 
Have a look at DRBD!
 
Von: sr-users-boun...@lists.sip-router.org 
[mailto:sr-users-boun...@lists.sip-router.org] Im Auftrag von Danny Dias
Gesendet: Mittwoch, 2. Februar 2011 11:20
An: kamailio
Betreff: Re: [SR-Users] Redundancy between 2 Kamailio servers
 
Hello, 
 
I was thinking that if i store the contacts that are registered into my proxy 
in a database, like this:
 
.
.
 
# - usrloc params -
modparam(usrloc, db_mode,   3)
.
.
if (is_method(REGISTER))
{
if (!save(location))
sl_reply_error();
exit;
  }
.
.
 
This way i would store the contacts in table location, and then i could make 
a backup of the DB and restore on the other server...is that ok? or i'm missing 
something?
 
Thanks in advance for your help! 
 
 
 
2011/1/27 Iñaki Baz Castillo i...@aliax.net
2011/1/27 Danny Dias ing.diasda...@gmail.com:
 Two Kamailios in a HeartBeat cluster which manages the kamailio
 service along with a virtual IP in which kamailios are supposed to
 listen. Just one kamailio is running (HA manages them).


 So, the heartbeat cluster shall manage that both are ok and also check that
 the virtual ip and the kamailio service in the primary server is OKif
 something fails it will activate the virtual IP address and the kamailio
 process in the other server? so this heartbeat cluster is installed in both
 kamailio servers?
 which HA software do you recommend?
As I said at the top of my previous mail: HeartBeat (as it is the only
I'm used to).


 Regsitration can be done in a shared database with db_mode=3 (or 2) so
 no locations are lost when HA stops the running instance of kamailio
 (or the server is down) and starts kamailio in the other cluster node.


 So, the database of the kamailios should be dedicated and externalised
 server?
Could be, or not. It doesn't matter too much.


--
Iñaki Baz Castillo
i...@aliax.net
 ___
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] t_local_replied() ?

2011-02-01 Thread Bernhard Suttner
Hi,

I am using the dispatcher module and want to check within the failure_route if 
the 408 was internally generated from kamailio or it was received from the 
dispatcher gateway. 

There was previously a function called t_local_replied() in the TM-module but I 
could not find this function in the current documentation. Was it removed?

Is there a alternative to check if the 408 was local generated or if it was 
received from the peer (= from the dispatcher gateway)?

Thanks in advance!

Best regards,
Bernhard


___
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] t_local_replied() ?

2011-02-01 Thread Bernhard Suttner
Hi,

just to be sure:

- If the gateway does send back a 100 Trying and then a 408 is detected within 
failure_route the method t_branch_replied does return false (means: gateway is 
up and running) - dont go to next gateway (dispatcher)

- If the gateway does not respond and a 408 is detected within failure_route (= 
408 was generated from kamailio) t_branch_replied does return true (means: 
gateway is down) - go to the next gateway (dispatcher)

Is that correct or am I wrong?

Best regards,
Bernhard



- Original Message -
From: Daniel-Constantin Mierla [mailto:mico...@gmail.com]
To: Bernhard Suttner [mailto:bernhard.sutt...@winet.ch]
Cc: sr-users@lists.sip-router.org
Sent: Tue, 01 Feb 2011 13:30:54 +0100
Subject: Re: [SR-Users] t_local_replied() ?


 Hello,
 
 On 2/1/11 12:08 PM, Bernhard Suttner wrote:
  Hi,
 
  I am using the dispatcher module and want to check within the
 failure_route if the 408 was internally generated from kamailio or it was
 received from the dispatcher gateway.
 
  There was previously a function called t_local_replied() in the TM-module
 but I could not find this function in the current documentation. Was it
 removed?
 
  Is there a alternative to check if the 408 was local generated or if it
 was received from the peer (= from the dispatcher gateway)?
 see the example of:
 http://kamailio.org/docs/modules/stable/modules/tm.html#t_branch_replied
 
 Cheers,
 Daniel
 
 -- 
 Daniel-Constantin Mierla
 http://www.asipto.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] t_local_replied() ?

2011-02-01 Thread Bernhard Suttner
argh. I just mixed up the true/false return values in the eMail but you still 
got it :-)

Thanks a lot!

- Original Message -


From: Daniel-Constantin Mierla [mailto:mico...@gmail.com]
To: Bernhard Suttner [mailto:bernhard.sutt...@winet.ch]
Cc: sr-users@lists.sip-router.org
Sent: Tue, 01 Feb 2011 20:31:17 +0100
Subject: Re: [SR-Users] t_local_replied() ?


 Hello,
 
 not sure if you ask about the options, or you tried them and don't give 
 you the needed feature, since there are some improper true/false return 
 codes in your email. t_branch_replied() will return false if the 408 is 
 generated locally.
 
 Cheers,
 Daniel
 
 On 2/1/11 8:25 PM, Bernhard Suttner wrote:
  Hi,
 
  just to be sure:
 
  - If the gateway does send back a 100 Trying and then a 408 is detected
 within failure_route the method t_branch_replied does return false (means:
 gateway is up and running) - dont go to next gateway (dispatcher)
 
  - If the gateway does not respond and a 408 is detected within
 failure_route (= 408 was generated from kamailio) t_branch_replied does
 return true (means: gateway is down) - go to the next gateway (dispatcher)
 
  Is that correct or am I wrong?
 
  Best regards,
  Bernhard
 
 
 
  - Original Message -
  From: Daniel-Constantin Mierla [mailto:mico...@gmail.com]
  To: Bernhard Suttner [mailto:bernhard.sutt...@winet.ch]
  Cc: sr-users@lists.sip-router.org
  Sent: Tue, 01 Feb 2011 13:30:54 +0100
  Subject: Re: [SR-Users] t_local_replied() ?
 
 
  Hello,
 
  On 2/1/11 12:08 PM, Bernhard Suttner wrote:
  Hi,
 
  I am using the dispatcher module and want to check within the
  failure_route if the 408 was internally generated from kamailio or it was
  received from the dispatcher gateway.
  There was previously a function called t_local_replied() in the
 TM-module
  but I could not find this function in the current documentation. Was it
  removed?
  Is there a alternative to check if the 408 was local generated or if it
  was received from the peer (= from the dispatcher gateway)?
  see the example of:
  http://kamailio.org/docs/modules/stable/modules/tm.html#t_branch_replied
 
  Cheers,
  Daniel
 
  -- 
  Daniel-Constantin Mierla
  http://www.asipto.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
 
 -- 
 Daniel-Constantin Mierla
 http://www.asipto.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] [sr-dev] planning release of v3.1.2

2011-01-29 Thread Bernhard Suttner
Hi,

whats about: http://sip-router.org/tracker/index.php?do=detailstask_id=108 I 
think that some users are trying to register to an asterisk system. Or does 
somebody have a solution for that?

A new release would be nice!!!

Thanks in advance.

Best regards,
Bernhard



- Original Message -
From: Daniel-Constantin Mierla [mailto:mico...@gmail.com]
To: kamailio [mailto:sr-users@lists.sip-router.org], sr-dev 
[mailto:sr-...@lists.sip-router.org]
Sent: Fri, 28 Jan 2011 20:15:50 +0100
Subject: [sr-dev] planning release of v3.1.2


 Hello,
 
 I think it is time to release v3.1.2, first date that comes in my mind 
 is next Thursday if everyone feels it is enough time to take care of 
 backporting any fix he/she did and it is not yet there. That will 
 provide us a fresh release for the FOSDEM event. If not, then maybe the 
 other week, Tuesday, so the participants at the Kamailio Devel training 
 in Barcelona can practice on it.
 
 Soon after we should plan also a release for previous stable, branch 3.0.
 
 Anyone having other options?
 
 Thanks,
 Daniel
 
 -- 
 Daniel-Constantin Mierla
 http://www.asipto.com
 
 
 ___
 sr-dev mailing list
 sr-...@lists.sip-router.org
 http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
 

___
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] onreply_route and failure_route

2011-01-29 Thread Bernhard Suttner
Hi,

is it possible to call a route within onreply_ and failure_route? I mean, 
within the main route { ... } its possible to call the route[NAT]. Is this also 
possible for this special routes? If this is possible, is it also allowed to 
call a route which will normally called from the main route { ... }

Thanks in advance.

Best regards,
Bernhard

___
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] onreply_route and failure_route

2011-01-29 Thread Bernhard Suttner
Hi,

that was _really_ fast. Thanks. :-)

One more question: Could I somehow test with the route[NAT] for example, if the 
request was from the main route { ... } or from the onreply_route[] ?

Best regards,
Bernhard 

- Original Message -
From: Alex Balashov [mailto:abalas...@evaristesys.com]
To: Bernhard Suttner [mailto:bernhard.sutt...@winet.ch]
Cc: sr-users@lists.sip-router.org [mailto:sr-users@lists.sip-router.org]
Sent: Sat, 29 Jan 2011 21:37:34 +0100
Subject: Re: [SR-Users] onreply_route and failure_route


 Yes.
 
 --
 Alex Balashov - Principal
 Evariste Systems LLC
 260 Peachtree Street NW
 Suite 2200
 Atlanta, GA 30303
 Tel: +1-678-954-0670
 Fax: +1-404-961-1892
 Web: http://www.evaristesys.com/
 
 On Jan 29, 2011, at 3:35 PM, Bernhard Suttner bernhard.sutt...@winet.ch 
   wrote:
 
  Hi,
 
  is it possible to call a route within onreply_ and failure_route? I  
  mean, within the main route { ... } its possible to call the route 
  [NAT]. Is this also possible for this special routes? If this is  
  possible, is it also allowed to call a route which will normally  
  called from the main route { ... }
 
  Thanks in advance.
 
  Best regards,
  Bernhard
 
  ___
  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] xlogl and pseudo variables

2011-01-29 Thread Bernhard Suttner
Hi,

I am using xlogl for debugging and logging the most important actions within 
the kamailio script. Does it take much resources if I use the pseudo variables 
with the xlogl statements? Example:

xlogl(L_NOTICE, Route $rm to destination! F=$fu T=$tu IP=$si \n);

I´m planning to do this in all the xlogl statements to be able to debug / see 
whats going on on the system.

Thanks in advance.

Best regard,
Bernhard

___
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] Redundancy between 2 Kamailio servers

2011-01-27 Thread Bernhard Suttner
Try to set this option to bind to an non existing ip:

net.ipv4.ip_nonlocal_bind = 1

does work for SSH and thefore should also work with kamailio


-Ursprüngliche Nachricht-
Von: sr-users-boun...@lists.sip-router.org 
[mailto:sr-users-boun...@lists.sip-router.org] Im Auftrag von Klaus Darilion
Gesendet: Donnerstag, 27. Januar 2011 15:18
An: Alex Hermann
Cc: sr-users@lists.sip-router.org
Betreff: Re: [SR-Users] Redundancy between 2 Kamailio servers



Am 27.01.2011 13:05, schrieb Alex Hermann:
  Yes - the problem with SIP based replication is that both proxies must
  be running. This is a problem as Kamailio binds to the virtual IP at
  start up - thus adding the virtual IP address to the backup server does
  not make Backup-Kamailio listening to the new IP address - you would
  have to restart the backup Kamailio.
 Just bind kamailio to the HA IP on both servers and do REGISTER replication 
 between the two (on SIP level). Then if the IP migrates to the other server, 
 it will take over the rgistrar function with no loss of records. No restart 
 needed.

Is it possible to bind Kamailio to an IP address which is not active?
(e.g. start Kamailio on the backup server)

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] fix_nated_sdp()

2011-01-25 Thread Bernhard Suttner
Hi,

thanks for your answer. 

The question was about, if the fix_nated_sdp() (in the example below) could 
maybe break something. I am sure, that the fix_nated_sdp() would work in some 
cases but I am not sure, if the function could break something:


 if (method==INVITE  has_sdp()  nat_uac_test(8)) fix_nated_sdp(3)

 and within the onreply route:

 if (status=~(180|183|200)  has_sdp()  nat_uac_test(8)) fix_nated_sdp(3)


Or is there a better solution to fix these damend NAT scenarios?

Best regards,
Bernhard


-Ursprüngliche Nachricht-
Von: kaiserbo...@googlemail.com [mailto:kaiserbo...@googlemail.com] Im Auftrag 
von Carsten Bock
Gesendet: Dienstag, 25. Januar 2011 18:56
An: Bernhard Suttner
Cc: sr-users@lists.sip-router.org
Betreff: Re: [SR-Users] fix_nated_sdp()

Hi Bernhard,

have you checked the SDP which is going to and from the
Freeswitch-Server? Is it modified?

If yes: You may want to check your NAT-Firewall. A working (but not
nice) solution might be to relay the RTP through an proxy in this
case...
If No: Verify the result of nat_uac_test: Why is it returning false?

Carsten

2011/1/25 Bernhard Suttner bernhard.sutt...@winet.ch:
 Hi,

 someone has an idea?

 Thanks in advance!

 Best regards,
 Bernhard

 -Ursprüngliche Nachricht-
 Von: sr-users-boun...@lists.sip-router.org 
 [mailto:sr-users-boun...@lists.sip-router.org] Im Auftrag von Bernhard Suttner
 Gesendet: Montag, 24. Januar 2011 20:38
 An: sr-users@lists.sip-router.org
 Betreff: [SR-Users] fix_nated_sdp()

 Hi,

 I have a question about the fix_nated_sdp() function. Different devices 
 (phones, pbxes, gateways) are using Kamailio as SBC. The SBC does t_relay() 
 the message to a pool of FreeSWITCH Servers.

 The scenario does work quite well but:

 if a call is initiated from one of the freeswitch server, pass it through 
 kamailio to the PBX and the PBX does have a forwarding back to kamailio and 
 in the end to freeswitch I have no audio because the PBX is behind a NAT and 
 uses private ip addresses in all the SDP of 200 OK and 183 Session Progress. 
 Therefore FreeSWITCH could not do the (very cool) RTP Auto-Adjustment (check 
 if IP in incoming packet is different to the IP in the SDP) to detect the 
 real IP address.

 Therefore I have to use fix_nated_sdp(). I am not sure, what this function 
 could break therefore I want to be very sure and use it only, if really 
 necessary. Test which User-Agent or Server the peer (in this example the PBX) 
 has, is not really possible because some devices does not send this header.

 What do you think about the follwoing pseudo code:

 if (method==INVITE  has_sdp()  nat_uac_test(8)) fix_nated_sdp(3)

 and within the onreply route:

 if (status=~(180|183|200)  has_sdp()  nat_uac_test(8)) fix_nated_sdp(3)

 Somebody has a better idea to handle this? What could go wrong?

 Thanks in advance.

 Best regards,
 Bernhard Suttner

 ___
 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




-- 
Carsten Bock
Schomburgstr. 80
22767 Hamburg
Germany

Mobile +49 179 2021244
Home +49 40 34927217
Büro (Verl) +49 5246 801427
Fax +49 40 34927218
mailto:cars...@bock.info


___
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] fix_nated_sdp()

2011-01-25 Thread Bernhard Suttner
Hi,

thanks for your response. I think I understand the scenario very good - but im 
not so familiar with the fix_nated_sdp() functionality. 

Currently the SDP will be modified with the source IP of the message. This does 
work good but currently I only do that for some special devices (matching the 
User-Agent / Server string). I want to do that fix_nated_sdp() in all cases and 
not only for some special devices. 

The FreeSWITCH RTP-Auto Adjustment does work in nearly every case but in one 
(currently known) scenario it does not. 

Maybe I should just give it a try to do fix_nated_sdp() in combination with 
nat_uac_test (RFC1918 private address in SDP).

Thanks a lot for this discussion. 

Best Regards,
Bernhard

- Original Message -
From: Ovidiu Sas [mailto:o...@voipembedded.com]
To: Bernhard Suttner [mailto:bernhard.sutt...@winet.ch]
Cc: Carsten Bock [mailto:li...@bock.info], sr-users@lists.sip-router.org
Sent: Tue, 25 Jan 2011 20:38:14 +0100
Subject: Re: [SR-Users] fix_nated_sdp()


 You need to experiment with nathelper module and while doing that, you
 need to inspect the SIP messages in order to understand how it works.
 Only when you fully understand your scenarios, you will be able to
 properly configure, debg and setup kamailio.
 
 Best thing to do here is to use rtpproxy and relay media if needed.
 
 Another option would be to let the SDP untouched and let freeswitch do
 it's magic (if it can).  Not sure if this will work in all scenarios.
 
 Calling fix_nated_sdp() on the SBC will definitely not work (you are
 just messing with the IP on the SDP and you don't know if the real RTP
 port on the NATed side will match the advertised port in your fixed
 SDP).
 
 
 Regards,
 Ovidiu Sas
 
 On Tue, Jan 25, 2011 at 1:23 PM, Bernhard Suttner
 bernhard.sutt...@winet.ch wrote:
  Hi,
 
  thanks for your answer.
 
  The question was about, if the fix_nated_sdp() (in the example below)
 could maybe break something. I am sure, that the fix_nated_sdp() would work
 in some cases but I am not sure, if the function could break something:
 
 
   if (method==INVITE  has_sdp()  nat_uac_test(8)) fix_nated_sdp(3)
 
   and within the onreply route:
 
   if (status=~(180|183|200)  has_sdp()  nat_uac_test(8))
 fix_nated_sdp(3)
 
 
  Or is there a better solution to fix these damend NAT scenarios?
 
  Best regards,
  Bernhard
 
 
  -Ursprüngliche Nachricht-
  Von: kaiserbo...@googlemail.com [mailto:kaiserbo...@googlemail.com] Im
 Auftrag von Carsten Bock
  Gesendet: Dienstag, 25. Januar 2011 18:56
  An: Bernhard Suttner
  Cc: sr-users@lists.sip-router.org
  Betreff: Re: [SR-Users] fix_nated_sdp()
 
  Hi Bernhard,
 
  have you checked the SDP which is going to and from the
  Freeswitch-Server? Is it modified?
 
  If yes: You may want to check your NAT-Firewall. A working (but not
  nice) solution might be to relay the RTP through an proxy in this
  case...
  If No: Verify the result of nat_uac_test: Why is it returning false?
 
  Carsten
 
  2011/1/25 Bernhard Suttner bernhard.sutt...@winet.ch:
  Hi,
 
  someone has an idea?
 
  Thanks in advance!
 
  Best regards,
  Bernhard
 
  -Ursprüngliche Nachricht-
  Von: sr-users-boun...@lists.sip-router.org
 [mailto:sr-users-boun...@lists.sip-router.org] Im Auftrag von Bernhard
 Suttner
  Gesendet: Montag, 24. Januar 2011 20:38
  An: sr-users@lists.sip-router.org
  Betreff: [SR-Users] fix_nated_sdp()
 
  Hi,
 
  I have a question about the fix_nated_sdp() function. Different devices
 (phones, pbxes, gateways) are using Kamailio as SBC. The SBC does t_relay()
 the message to a pool of FreeSWITCH Servers.
 
  The scenario does work quite well but:
 
  if a call is initiated from one of the freeswitch server, pass it through
 kamailio to the PBX and the PBX does have a forwarding back to kamailio and
 in the end to freeswitch I have no audio because the PBX is behind a NAT and
 uses private ip addresses in all the SDP of 200 OK and 183 Session Progress.
 Therefore FreeSWITCH could not do the (very cool) RTP Auto-Adjustment (check
 if IP in incoming packet is different to the IP in the SDP) to detect the
 real IP address.
 
  Therefore I have to use fix_nated_sdp(). I am not sure, what this
 function could break therefore I want to be very sure and use it only, if
 really necessary. Test which User-Agent or Server the peer (in this example
 the PBX) has, is not really possible because some devices does not send this
 header.
 
  What do you think about the follwoing pseudo code:
 
  if (method==INVITE  has_sdp()  nat_uac_test(8)) fix_nated_sdp(3)
 
  and within the onreply route:
 
  if (status=~(180|183|200)  has_sdp()  nat_uac_test(8))
 fix_nated_sdp(3)
 
  Somebody has a better idea to handle this? What could go wrong?
 
  Thanks in advance.
 
  Best regards,
  Bernhard Suttner
 
  ___
  SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
  sr-users@lists.sip-router.org
  http://lists.sip

Re: [SR-Users] $ua in on_reply route not set?

2011-01-24 Thread Bernhard Suttner
Hi,

found the problem. The device does sometimes use User-Agent and sometimes 
Server. 

Is it better to use $hdr() or the Search() function?

I use this to check for the User-Agent and then to do a fix_nated_sdp() (in 
route[] and onreply[]) because I am not really sure, if the fix_nated_sdp() 
could break something. Or should kamailio break nothing here? Sometimes the 
User-Agent/Server is missing in Session-Progress 183. Therefore a global 
fix_nated_sdp() would be nice to have.

Best regards,
Bernhard

- Original Message -
From: Daniel-Constantin Mierla [mailto:mico...@gmail.com]
To: Bernhard Suttner [mailto:bernhard.sutt...@winet.ch]
Cc: sr-users@lists.sip-router.org
Sent: Mon, 24 Jan 2011 17:09:12 +0100
Subject: Re: [SR-Users] $ua in on_reply route not set?


 Hello,
 
 On 1/24/11 5:03 PM, Bernhard Suttner wrote:
  Hi,
 
  could it be, that the $ua pseudo variable is not set within in a onreply
 route? (Version 3.1).
 no, should be set, there was no change in this regard for quite long 
 time. Can you sent the sip reply plus log with debug=3?
 
  What is the best alternative for that? Search()?
 
 The alternative is $hdr(User-Agent) which is practically returning the 
 same value as $ua, using generic header search mechanism.
 
 Cheers,
 Daniel
 
 -- 
 Daniel-Constantin Mierla
 http://www.asipto.com
 
 

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


[SR-Users] fix_nated_sdp()

2011-01-24 Thread Bernhard Suttner
Hi,

I have a question about the fix_nated_sdp() function. Different devices 
(phones, pbxes, gateways) are using Kamailio as SBC. The SBC does t_relay() the 
message to a pool of FreeSWITCH Servers.

The scenario does work quite well but:

if a call is initiated from one of the freeswitch server, pass it through 
kamailio to the PBX and the PBX does have a forwarding back to kamailio and in 
the end to freeswitch I have no audio because the PBX is behind a NAT and uses 
private ip addresses in all the SDP of 200 OK and 183 Session Progress. 
Therefore FreeSWITCH could not do the (very cool) RTP Auto-Adjustment (check if 
IP in incoming packet is different to the IP in the SDP) to detect the real IP 
address.

Therefore I have to use fix_nated_sdp(). I am not sure, what this function 
could break therefore I want to be very sure and use it only, if really 
necessary. Test which User-Agent or Server the peer (in this example the PBX) 
has, is not really possible because some devices does not send this header.

What do you think about the follwoing pseudo code:

if (method==INVITE  has_sdp()  nat_uac_test(8)) fix_nated_sdp(3)

and within the onreply route:

if (status=~(180|183|200)  has_sdp()  nat_uac_test(8)) fix_nated_sdp(3)

Somebody has a better idea to handle this? What could go wrong?

Thanks in advance.

Best regards,
Bernhard Suttner

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


Re: [SR-Users] Dispatcher Setting

2011-01-13 Thread Bernhard Suttner
Hi,

thanks for your response. It's like that how I handle it currently but some 
500 Internal server error from freeswitch will result, that the message is 
send to all the other freeswitch server, too. They will of course respond in 
the same way than the first does. All the freeswitch server should have the 
same version and dialplan logic.

Best regards,
Bernhard

-Ursprüngliche Nachricht-
Von: kaiserbo...@googlemail.com [mailto:kaiserbo...@googlemail.com] Im Auftrag 
von Carsten Bock
Gesendet: Donnerstag, 13. Januar 2011 11:39
An: Bernhard Suttner
Cc: sr-users@lists.sip-router.org
Betreff: Re: [SR-Users] Dispatcher Setting

Hi Bernhard,

that is simply up to you. But for my production setups so far, i used
to catch 408, 5xx and 6xx.
- 408 of course, it is a timeout (others were always valid responses in my case)
- 5xx is, according to the RFC, a server failure, so that particular
server cannot process the request.
- 6xx is, according to the RFC, a global failure, a definite answer
about the destination.

Actually, if you take the RFC seriously, you should not disable based
upon a 6xx response, since if it is implemented correctly, no-one can
answer the question, not only the choosen destination. However, many
network components do not take this too seriously, so that was a valid
failed answer for a system

Kind regards,
Carsten

2011/1/13 Bernhard Suttner bernhard.sutt...@winet.ch:
 Hi,

 I am using the Dispatcher module to load-balance the calls to several 
 freeswitch servers.

 On which responses within the failure_route should be a fallback to another 
 server (dst_next_dst())? I am sure, that on a 408 response there should be a 
 fallback but whats about other 4XX responses and 5XX or 6XX?

 Thanks in advance.

 Best regards,
 Bernhard Suttner




 ___
 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




-- 
Carsten Bock
Schomburgstr. 80
22767 Hamburg
Germany

Mobile +49 179 2021244
Home +49 40 34927217
Büro (Verl) +49 5246 801427
Fax +49 40 34927218
mailto:cars...@bock.info



___
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] IP Address

2011-01-13 Thread Bernhard Suttner
Hi,

I have a very short question: Kamailio does listen to many IP Addresses and 
does forward messages to the peer with t_relay. Which IP address will kamailio 
use for the outgoing traffic as source-ip, if there are many IP addresses on 
the interface? Is it possible to specify this somehow? 

Thanks in advance.

Best regards,
Bernhard


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


[SR-Users] Dispatcher Setting

2011-01-12 Thread Bernhard Suttner
Hi,

I am using the Dispatcher module to load-balance the calls to several 
freeswitch servers. 

On which responses within the failure_route should be a fallback to another 
server (dst_next_dst())? I am sure, that on a 408 response there should be a 
fallback but whats about other 4XX responses and 5XX or 6XX?

Thanks in advance.

Best regards,
Bernhard Suttner




___
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] Change the SIP-To-User

2011-01-07 Thread Bernhard Suttner
Hi,

ah, thanks. Would be good to have a uac_replace_to. Sounds like a 30min task 
to someone familiar with kamailio programming :-)

BR,
Bernhard

- Original Message -
From: Klaus Darilion [mailto:klaus.mailingli...@pernau.at]
To: Bernhard Suttner [mailto:bernhard.sutt...@winet.ch]
Cc: sr-users@lists.sip-router.org
Sent: Fri, 07 Jan 2011 21:59:55 +0100
Subject: Re: [SR-Users] Change the SIP-To-User


 Bernhard Suttner wrote:
  Hi,
  
  thanks to all responses. I wonder if there is a function to modify the
 To/From Header stateful. I mean, change the TO header in the INVITE to A and
 then the 200 OK (for example) reverse the change back to the previous value
 to B?
  
  but the magic $tU is amazing...
 
 If you use uac_replace_from(), the changes will stateful and fixed for 
 every in-dialog requests and responses.
 
 But there is no similar feature for To header manipulation.
 
 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] Replace number in pseudo variable

2011-01-03 Thread Bernhard Suttner
Hi,

thanks for your fast response. $ou is the original request uri but I tried with 
$rU and it still does not work. Is it not possible to use a pseudo variable 
with re.subst ?

Best regards,
Bernhard

-Ursprüngliche Nachricht-
Von: Juha Heinanen [mailto:j...@tutpro.com] 
Gesendet: Montag, 3. Januar 2011 16:04
An: Bernhard Suttner
Cc: sr-users@lists.sip-router.org
Betreff: [SR-Users] Replace number in pseudo variable

Bernhard Suttner writes:

 I try to replace the user-name of the Request URI and save that into a
 AVP later.

userpart of request uri is $rU.  se pvar doc.

-- juha



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


[SR-Users] Change the SIP-To-User

2011-01-03 Thread Bernhard Suttner
Hi,

what is the best way to replace the userpart of the SIP-To URI with the content 
of a pseudo variable?

Thanks for every hint.

Best regards,
Bernhard


___
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] Store Source IP in DB

2010-12-07 Thread Bernhard Suttner
Hi,

I am using Kamailio with usrloc, nathelper and register module (and some 
other). All the data will be stored within a MySQL database. The contact 
address will be stored within the database. Is it somehow possible to store the 
SOURCE-IP of a incoming REGISTER from a phone to Kamailio somewhere in the 
database? It's just for debugging purposes.

Best regards,
Bernhard



___
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] Store Source IP in DB

2010-12-07 Thread Bernhard Suttner
Hi,

thanks for these replys. I already saw the nathelper module but I am not sure, 
which method will store the received value. Does the nat_uac_test save the 
received value?

Best regards,
Bernhard

- Original Message -
From: Klaus Darilion [mailto:klaus.mailingli...@pernau.at]
To: Bernhard Suttner [mailto:bernhard.sutt...@winet.ch]
Cc: sr-users@lists.sip-router.org
Sent: Tue, 07 Dec 2010 18:59:36 +0100
Subject: Re: [SR-Users] Store Source IP in DB


 
 
 Am 07.12.2010 15:20, schrieb Bernhard Suttner:
  Hi,
 
  I am using Kamailio with usrloc, nathelper and register module (and
  some other). All the data will be stored within a MySQL database. The
  contact address will be stored within the database. Is it somehow
  possible to store the SOURCE-IP of a incoming REGISTER from a phone
  to Kamailio somewhere in the database? It's just for debugging
  purposes.
 
 If you are doing NAT traversal, e.g. fix_nated_register(), you will have 
 the source IP address of the REGISTER in the location table in the 
 received column.
 
 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


[SR-Users] DoS on Kamailio

2010-11-03 Thread Bernhard Suttner
Hi,

is there a Kamailio module to prevent DoS Attacks like SIP Register Scanners? I 
know, that there is a way to implement that with Fail2Ban and xlog but it would 
be nice to have a pure Kamailio solution for that?

Any idea is appreciated.

Best regards,
Bernhard Suttner


___
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] loop through variables

2010-11-02 Thread Bernhard Suttner
Hi,

yeah, that looks like a good solution. But I assume that there should be the 
similar way to use the shm or pseudo variables as a array. Maybe someone else 
does know more about this way?

Best regards,
Bernhard

-Ursprüngliche Nachricht-
Von: sr-users-boun...@lists.sip-router.org 
[mailto:sr-users-boun...@lists.sip-router.org] Im Auftrag von Alex Balashov
Gesendet: Dienstag, 2. November 2010 14:41
An: sr-users@lists.sip-router.org
Betreff: Re: [SR-Users] loop through variables

On 11/02/2010 09:35 AM, Sergey Okhapkin wrote:

 htable module should do the trick to you.

 On Tuesday 02 November 2010, Bernhard Suttner wrote:
 Hi,

 I want something like that:

 # define some router to use later in the script (global section)
 Mod_param(router(1), 10.10.10.1)
 mod_param(router(2), 10.10.10.2)
 mod_param(router(3), 10.10.10.3)
 Mod_param(router_count, 3)

 within the different routes I want to loop through the routers like that:

 $var(i)
 while($(var(i)  $var(router_count)) {
   if ($var(router($var(i)) == src_ip) {
 .. do something
}
 }

Another option is to push the constants into AVP arrays at startup (I 
assume there is some sort of init route at this point, otherwise a 
module init event-route):

$(avp(s:routers)[0]) = 10.10.10.1;
$(avp(s:routers)[1]) = 10.10.10.2;
$(avp(s:routers)[2]) = 10.10.10.3;

You can then iterate through them, using is_avp_set() to check if 
something exists at the current index/array subscript:

$var(i) = 0;

while(is_avp_set($(avp(s:routers)[$var(i)]))) {
   xlog(L_INFO, Router is: $(avp(s:routers)[$var(i)])\n;
   $var(i) = $var(i) + 1;
}

-- 
Alex Balashov - Principal
Evariste Systems LLC
1170 Peachtree Street
12th Floor, Suite 1200
Atlanta, GA 30309
Tel: +1-678-954-0670
Fax: +1-404-961-1892
Web: http://www.evaristesys.com/

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



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


Re: [SR-Users] loop through variables

2010-11-02 Thread Bernhard Suttner
Hi,

thanks @ all. I will try out the AVP method.

Best regards,
Bernhard

-Ursprüngliche Nachricht-
Von: Daniel-Constantin Mierla [mailto:mico...@gmail.com] 
Gesendet: Dienstag, 2. November 2010 17:16
An: Alex Balashov
Cc: Bernhard Suttner; sr-users@lists.sip-router.org
Betreff: Re: [SR-Users] loop through variables



On 11/2/10 5:13 PM, Alex Balashov wrote:
 On 11/02/2010 12:01 PM, Daniel-Constantin Mierla wrote:

 What Alex provided for assignment is not working exactly that way,
 because an assignment to an AVP always adds at the first position like a
 stack (the index is not relevant for avp in the left side of assignment
 unless it is '*' and assigned value is null - meaning delete all avps
 with that name).

 That is true.  I forgot about that.  That still means he could insert 
 the IPs in backward order, though, doesn't it?
yes, it inserts them in backward order.

Cheers,
Daniel

-- 
Daniel-Constantin Mierla
http://www.asipto.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] loop through variables

2010-11-02 Thread Bernhard Suttner
Ok. Thx. And where could I add the global variables (the configured routers)? I 
would like to have them in the global section (like the mod_param).

-Ursprüngliche Nachricht-
Von: Daniel-Constantin Mierla [mailto:mico...@gmail.com] 
Gesendet: Dienstag, 2. November 2010 17:57
An: Bernhard Suttner
Cc: sr-users@lists.sip-router.org
Betreff: Re: [SR-Users] loop through variables



On 11/2/10 5:52 PM, Bernhard Suttner wrote:
 Hi,

 thanks @ all. I will try out the AVP method.
beware that normally the avps are persistent per transaction. Meaning 
that when the transaction processing (or the message in stateless mode) 
is done, avps are removed automatically.

There are global avps coming from ser 2.0 (therefore you have to use 
version 3.0+) where the name has to contain 'g.' prefix - $avp(g.foo)

Cheers,
Daniel

 Best regards,
 Bernhard

 -Ursprüngliche Nachricht-
 Von: Daniel-Constantin Mierla [mailto:mico...@gmail.com]
 Gesendet: Dienstag, 2. November 2010 17:16
 An: Alex Balashov
 Cc: Bernhard Suttner; sr-users@lists.sip-router.org
 Betreff: Re: [SR-Users] loop through variables



 On 11/2/10 5:13 PM, Alex Balashov wrote:
 On 11/02/2010 12:01 PM, Daniel-Constantin Mierla wrote:

 What Alex provided for assignment is not working exactly that way,
 because an assignment to an AVP always adds at the first position like a
 stack (the index is not relevant for avp in the left side of assignment
 unless it is '*' and assigned value is null - meaning delete all avps
 with that name).
 That is true.  I forgot about that.  That still means he could insert
 the IPs in backward order, though, doesn't it?
 yes, it inserts them in backward order.

 Cheers,
 Daniel


-- 
Daniel-Constantin Mierla
http://www.asipto.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