Re: [SR-Users] IPv6 addresses in dispatcher.list file

2017-02-15 Thread Sergey Okhapkin
I use sip:[X:X:X:X::X:1]:5060 format, it works fine to me.

On Thursday, February 16, 2017 02:25:29 AM Joel Serrano | VOZELIA wrote:
> Hi,
> 
> What is the correct format for the dispatcher.list file using IPv6?
> 
> I have the following file:
> 
> $ cat /etc/kamailio/dispatcher.list
> # $Id$
> # dispatcher destination sets
> #
> 
> # line format
> # setit(int) destination(sip uri) flags(int,opt) priority(int,opt)
> attributes(str,opt)
> 
> # proxies
> 4 sip:XX.XX.XX.XX:5060
> 4 sip:ZZ.ZZ.ZZ.ZZ:5060
> 6 sip:[X:X:X:X::X:1]:5060
> 6 sip:[Z:Z:Z:Z::Z:2]:5060
> $
> 
> 
> For some reason, Kamailio doesn't recognize the v6 endpoints:
> 
> kamcmd> dispatcher.list
> {
>   NRSETS: 1
>   RECORDS: {
>   SET: {
>   ID: 4
>   TARGETS: {
>   DEST: {
>   URI: sip:XX.XX.XX.XX:5060
>   FLAGS: AP
>   PRIORITY: 0
>   }
>   DEST: {
>   URI: sip:ZZ.ZZ.ZZ.ZZ:5060
>   FLAGS: AP
>   PRIORITY: 0
>   }
>   }
>   }
>   }
> }
> kamcmd>
> 
> 
> I have tried multiple combinations for the v6 format but I cannot get one to
> work.
> 
> What am I doing wrong?
> 
> Thanks,
> Joel.
> 
> 
> Este mensaje y, en su caso, los ficheros anexos son confidenciales,
> especialmente en lo que respecta a los datos personales, y se dirigen
> exclusivamente al destinatario referenciado.Les informamos que los datos
> contenidos en el presente mail, han sido facilitados por usted o recogidos
> de Fuentes Accesibles al Público. Dicha información personal, será incluida
> en un fichero bajo la responsabilidad de VOZELIA TELECOM S.L.Todos los
> ficheros que trata nuestra empresa se encuentran debidamente inscritos ante
> la Agencia Española de Protección de Datos.Vd. Como propio interesado podrá
> ejercitar sus derechos de Acceso, Cancelación, Rectificación u Oposición,
> en el mail: administrac...@vozelia.com o en la dirección Avenida de
> Manoteras 8 escalera 3 2ºB, 28050 Madrid.Tal y como establece la Ley
> Orgánica de Protección de Datos 15/1999 de 13 de Diciembre.Para ejercer sus
> derechos desde Panama podrá hacerlo en la dirección Vía Argentina, Edificio
> Mediteranean Loft. Panama.En caso de no ser el destinatario y haya recibido
> este mensaje por error, agradeceremos que nos lo comunique inmediatamente
> al remitente sin difundir, almacenar o copiar su contenido.La divulgación o
> el suministro, en todo o en parte, a cualquier tercero, no podrá ser
> realizada sin el previo, expreso y escrito consentimiento de VOZELIA
> TELECOM S.L. .
> 
> 
> ___
> 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] Best way to log incoming/outgoing sip messages?

2017-01-20 Thread Sergey Okhapkin
Use xlog function. See $mb core variable documentation.

On Friday, January 20, 2017 10:27:03 PM Pranathi Venkatayogi wrote:
> Hi,
>   What is the best way to get a complete dump of incoming/outgoing SIP
> messages of Kamailio server?
 I encountered “SIPTrace” module, but it
> writes to database. Is there a way we can write to syslog instead? 
> Thanks
> Pranathi
> 


___
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] IP-based security + registrations

2016-12-08 Thread Sergey Okhapkin
Sure you can. Look at "permissions" module, allow_source_address() function.

On Thursday, December 08, 2016 05:48:39 PM JLL wrote:
> Hello,
> 
> 
> 
> I would like to know if anyone can help me accomplish the following:
> 
> 
> 
> I have a Kamailio server (4.2.3 on CentOS 7 x64) and 5 Asterisk servers
> (1.6.2.13 . I know, it's old but we have a lot of custom modules written for
> it).  I need for certain IP's to be "trusted" (able to send INVITE's to K
> from the internet - these would be our origination providers), but any
> other IP's that come along would need to register before sending an INVITE
> (the REGISTER would be sent to any of the Asterisk servers for validation,
> if this is possible).
> 
> 
> 
> Can this be done?
> 
> 
> 
> 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] Location Table In db_mode 3

2016-09-24 Thread Sergey Okhapkin
I'd avoid slow innodb engine for "temporary" frequently changing tables like 
location. Use MyISAM engine instead for the table.

On Saturday 24 September 2016 19:37:22 Phil Lavin wrote:
> Did you have a look at
> innodb_flush_log_at_trx_commit b-parameters.html#sysvar_innodb_flush_log_at_trx_commit>?
 
> Also, what value do you have for MySQL parameter innodb_buffer_pool_size and
> how large is your MySQL data directory at peak?
 
> 
> 
> From: sr-users [mailto:sr-users-boun...@lists.sip-router.org] On Behalf Of
> Gholamreza Sabery
 Sent: 24 September 2016 20:25
> To: Kamailio (SER) - Users Mailing List 
> Subject: Re: [SR-Users] Location Table In db_mode 3
> 
> Thank you so much for your response. Well if putting the table into memory
> is not a good option what is the best way to handle this situation?
 
> On Sat, Sep 24, 2016 at 10:50 PM, Phil Lavin
> > wrote:
 You
> could look at tweaking MySQL setting
> innodb_flush_log_at_trx_commit b-parameters.html#sysvar_innodb_flush_log_at_trx_commit> and setting its
> value to 0. It’ll make your database not ACID compliant, but I don’t see
> that as being a major issue for transient data such as that stored in the
> Kamailio DB. 
> I’m not entirely convinced that changing it to a memory table will help as
> you are presumably doing MySQL replication between your two Kamailio nodes.
> Memory tables don’t replicate well.
 
> 
> From: sr-users
> [mailto:sr-users-boun...@lists.sip-router.org .sip-router.org>] On Behalf Of Gholamreza Sabery
 Sent: 24 September 2016
> 20:04
> To: Kamailio (SER) - Users Mailing List
> >
> Subject: Re: [SR-Users] Location Table In db_mode 3
> 
> On average I have about 2000 registrations per second and this configuration
> does not work with this rate. Maximum number of registrations that we can
> handle with db_mode 3 is 1000 per second.
 
> On Sat, Sep 24, 2016 at 10:12 PM, Phil Lavin
> > wrote:
 What
> rate of registrations do you have?
> 
> 
> From: sr-users
> [mailto:sr-users-boun...@lists.sip-router.org .sip-router.org>] On Behalf Of Gholamreza Sabery
 Sent: 24 September 2016
> 19:39
> To: Kamailio (SER) - Users Mailing List
> >
> Subject: [SR-Users] Location Table In db_mode 3
> 
> I have multiple Kamailio servers in an Active/Active scenario (the database
> is a MySQL server) using db_mode 3. But when the number of clients goes up
> writes on the location table become too much and it causes database
> problems. I even put my location table on a separate SSD disk on the server
> to separate it's IO but still at times I have problems. How can I move
> location table into memory? Is this a good solution? What other options do
> I have?
 
> ___
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users@lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
> 
> 
> ___
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users@lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
> 


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


Re: [SR-Users] Error 2002 (HY000) creating database kamailio

2016-09-21 Thread Sergey Okhapkin
Is mysql server running?

On Wednesday 21 September 2016 08:30:48 Diogenes Marcano wrote:
> Iam new in kamailio.
> When I try to create the data base with kamdbctl y have the following  error
> 
> root@diogenes-Inspiron-1525:/usr/local/sbin# kamdbctl create
> MySQL password for root:
> INFO: test server charset
> ERROR 2002 (HY000): Can't connect to local MySQL server through socket
> '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")
> ERROR 2002 (HY000): Can't connect to local MySQL server through socket
> '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")
> Usage: grep [OPTION]... PATTERN [FILE]...
> Try 'grep --help' for more information.
> /usr/local/lib/kamailio//kamctl/kamdbctl.mysql: line 111: [: =: unary
> operator expected
> INFO: creating database kamailio ...
> ERROR 2002 (HY000): Can't connect to local MySQL server through socket
> '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")
> ERROR: Creating database kamailio failed!
> root@diogenes-Inspiron-1525:/usr/local/sbin# mysql
> ERROR 2002 (HY000): Can't connect to local MySQL server through socket
> '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")
> Thank you for your hrlp
> 
> Diogenes Marcano

___
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]: How to count three or more invalid REGISTERs from the same IP-address

2016-06-19 Thread Sergey Okhapkin
Log error message on unsuccessful REGISTER and let fail2ban do the rest. 
Anyway you're running fail2ban, don't you?

On Sunday 19 June 2016 21:19:42 Яцко Эллад Геннадьевич wrote:
> Hello!
> 
> How to detect several unsuccessful REGISTER attempts from the same IP?
> 
> For example: a malicious user tries to look for passwords, can I detect
> this in some way to black list it? As you know there are different SIP
> dialogs here.. I need to mention these attempts should be counted
> during certain period of time (e. g. 1 minute). If there were ONLY TWO
> attempts  for 1 minute the counter need to be reset to zero.
> 
> I've read about PERMISSIONS/BLST, but they don't offer such a mechanism.
> 
> I'll be waiting for your help, guys! :-)
> 
> Kind regards,
> Ellad
> 
> ___
> 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] IPv6 Only client-rtp proxy configuration

2016-06-07 Thread Sergey Okhapkin
Why do you need rtpproxy for IPv6 first of all? Rtpproxy was invented to avoid 
ipv4 NAT issues, NAT should not be used with IPv6.

On Tuesday 07 June 2016 15:11:19 aman jeff wrote:
> Hi team,
> 
> How to do the Configuration of Kamailio+RTP-Proxy for SER in IPv6,
> Currently I can establish SIP Session,while rtp start call are not
> audible.So Some configuration need to change,Am bit
> confused on it,Please help to resolve the issue,For my proper
> VoIP-Communication in IPv6 Surveillance.
> 
> 
> Regards
> Arnab

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


Re: [SR-Users] How long will be client online in kamailio server since client is forcely closed

2016-02-20 Thread Sergey Okhapkin
It depends on the client's settings, the expiry parameter from the client on 
registration.

On Saturday 20 February 2016 09:29:45 sgy wrote:
> Hi All,
> If the client is forcely closed, the client will be shown as online
> state in kamailio when I run the command: "kamctl online". How long will be
> the client online since client is closed? Thank you.
> 
> 
> --
> 
> Best Regards,
> Shengy

___
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 - Asterisk: Handling loss of SIP BYE and dangling channels

2016-01-08 Thread Sergey Okhapkin
RTP timeout in asterisk is the best place to handle the situation. Another 
option is SIP session timer, but it could give false negatives with NATed 
clients.

On Friday 08 January 2016 11:56:51 Benjamin Fitzgerald wrote:
> Hi,
> 
> I'm wondering what the best approach to handling a SIP dialog when one
> endpoint disappears/fails to send the BYE message.
> 
> I have Kamailio as a proxy for all mobile (iPhone/Android) SIP clients.
> Occasionally, the user hangs up the call but no BYE message is received.
> This means that Asterisk has an open channel even though there is no
> client. Kamailio also continues to receive successful registrations from
> the SIP client so the endpoint is not down completely.
> 
> Is Kamailio the appropriate place to handle this situation? What do you
> recommend? If not could you point me in the right direction? RTP timeout?
> Asterisk? The SIP client itself?
> 
> Thanks for your help.
> 
> Benjamin Fitzgerald
> LETS Corporation
> (925) 235-1154
> b...@letscorp.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] crash on using the $expires variable

2015-11-26 Thread Sergey Okhapkin
Confirmed, I'm getting crash too.

On Thursday 26 November 2015 13:05:57 Jayesh Nambiar wrote:
> Hi,
> I am trying to extract out the expires value from the incoming REGISTER
> request. It might be present in the Contact header or as a separate Expires
> header and hence I planned to use the $expires(max) PV to get this. But
> kamailio just crashes as soon as I use the variable. Here's when it crashes:
> 
> if(is_method("REGISTER")) {
>  xlog("L_INFO", "Expires is $expires(max)");
>  if(!save("location", "0x01")) {
> t_reply("500", "Error while saving AOR");
>  }
> }
> 
> It crashes at the xlog point. Here's the backtrace for reference:
> Reading symbols from /usr/local/kamailio/sbin/kamailio...done.
> [New LWP 16609]
> [Thread debugging using libthread_db enabled]
> Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
> Core was generated by `/usr/local/kamailio/sbin/kamailio -P
> /var/run/kamailio.pid -f /usr/local/kamail'.
> Program terminated with signal SIGSEGV, Segmentation fault.
> #0  0x7f34b658b311 in pv_get_expires (msg=0x7f34bd879e58,
> param=0x7f34bd7e9220, res=0x7ffcf67af530) at pv_core.c:3060
> 3060 if(c->expires && c->expires->body.len) {
> (gdb) backtrace
> #0  0x7f34b658b311 in pv_get_expires (msg=0x7f34bd879e58,
> param=0x7f34bd7e9220, res=0x7ffcf67af530) at pv_core.c:3060
> #1  0x004fb6e1 in pv_get_spec_value (msg=0x7f34bd879e58,
> sp=0x7f34bd7e9208, value=0x7ffcf67af530) at pvapi.c:1304
> #2  0x004fbb46 in pv_printf (msg=0x7f34bd879e58,
> list=0x7f34bd80ef38, buf=0x7f34bd8735a0 "Expires is ", len=0x7ffcf67af618)
> at pvapi.c:1363
> #3  0x7f34b67ea745 in xl_print_log (msg=0x7f34bd879e58,
> list=0x7f34bd80ef38, buf=0x7f34bd8735a0 "Expires is ", len=0x7ffcf67af618)
> at xl_lib.c:37
> #4  0x7f34b67eb0f9 in xlog_helper (msg=0x7f34bd879e58,
> xm=0x7f34bd808648, level=2, line=0, facility=-1) at xlog.c:215
> #5  0x7f34b67ec160 in xlog_2_helper (msg=0x7f34bd879e58,
> lev=0x7f34bd7e9130 "", frm=0x7f34bd808648 "84\177", mode=0, facility=-1)
> at xlog.c:284
> #6  0x7f34b67ec19c in xlog_2 (msg=0x7f34bd879e58, lev=0x7f34bd7e9130
> "", frm=0x7f34bd808648 "84\177") at xlog.c:292
> #7  0x0041e23b in do_action (h=0x7ffcf67b0b40, a=0x7f34bd817cd0,
> msg=0x7f34bd879e58) at action.c:1065
> #8  0x0042a8e7 in run_actions (h=0x7ffcf67b0b40, a=0x7f34bd813e18,
> msg=0x7f34bd879e58) at action.c:1548
> #9  0x0041ab16 in do_action (h=0x7ffcf67b0b40, a=0x7f34bd7e8738,
> msg=0x7f34bd879e58) at action.c:677
> #10 0x0042a8e7 in run_actions (h=0x7ffcf67b0b40, a=0x7f34bd7e8738,
> msg=0x7f34bd879e58) at action.c:1548
> #11 0x0041e094 in do_action (h=0x7ffcf67b0b40, a=0x7f34bd7e89c8,
> msg=0x7f34bd879e58) at action.c:1044
> #12 0x0042a8e7 in run_actions (h=0x7ffcf67b0b40, a=0x7f34bd7e19d8,
> msg=0x7f34bd879e58) at action.c:1548
> #13 0x0042b04d in run_top_route (a=0x7f34bd7e19d8,
> msg=0x7f34bd879e58, c=0x0) at action.c:1634
> #14 0x0050f3d4 in receive_msg (
> buf=0xa80c00  "REGISTER sip:devsip.tlkn.com SIP/2.0\r\nVia:
> SIP/2.0/UDP
> 203.153.53.145:8300;branch=z9hG4bK119a.e23ed10b856f38b41c93d1d259d8869f.0;i
> =b1\r\nVia: SIP/2.0/TCP
> 172.16.16.32:52358;rport=52359;received=203.153."..., len=712,
> rcv_info=0x7ffcf67b0e60) at receive.c:196
> #15 0x00613b9e in udp_rcv_loop () at udp_server.c:495
> #16 0x004aa119 in main_loop () at main.c:1577
> #17 0x004b0e1e in main (argc=5, argv=0x7ffcf67b1318) at main.c:2553
> 
> Thanks,
> 
> - Jayesh

___
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] Media address family

2015-11-26 Thread Sergey Okhapkin
What is the best way to find out address family (IPV4 or IPV6) of media in SDP? 
My goal is to reject INVITEs which have different address families in headers 
and SDP, i.e. IPv4 INVITE with IPv6 media address in SDP and vice versa.


___
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] SIP Packet identifier

2015-05-19 Thread Sergey Okhapkin
Why not log the SIP message itself to the same syslog?

On May 19, 2015 12:46:34 AM EDT, jay binks jaybi...@gmail.com wrote:
So im logging lots of information to Syslog to assist our helpdesk in
diagnosing customer issues.

Im seeing LOTS of user agents that re-use the sip Call-ID ( especially
in
registers ).
What im wanting to be able to do is link a log message ( that I log at
some
point in my dialplan ) to a specific SIP packet ( viewed from
voipmonitor,
HOMER, wireshark ).

I cant REALLY see anything in the SIP to uniquely identify a packet,
however if kamailio provided the UDP packet checksum in a pseudo
variable
then we could combine that with the sip call-id to hopefully do what im
after.

does anyone else have any ideas about how do what im after ?

-- 
Sincerely

Jay




___
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] Continent Code GeoIP module, kamailio 4.2

2015-03-11 Thread Sergey Okhapkin
I'd prefer contc (as I implemented in geoip2) to be consistent with existing 
names like cc, regc.

On Wednesday 11 March 2015 22:46:38 you wrote:
 As I had a short spare time and code it, my first idea went for
 cont[inent] id, to be suggestive and rather short that using full words.
 
 On the other hand, I can rename it in the old module if people prefer
 other variant.
 
 Cheers,
 Daniel
 
 On 11/03/15 19:14, Sergey Okhapkin wrote:
  Why the pvar name is contid when the entity name is continent code?
  
  On Wednesday 11 March 2015 19:06:39 Daniel-Constantin Mierla wrote:
  Hello,
  
  no, it is in the master branch.
  
  If you installed from git repo, you can pick the patch with:
  
  git pull origin
  git cherry-pick 1ace8a167b9a6515be2b9f4a79786909c9ffce37
  
  You can see the diff at:
  
  https://github.com/kamailio/kamailio/commit/1ace8a167b9a6515be2b9f4a79786
  909 c9ffce37
  
  Cheers,
  Daniel
  
  On 11/03/15 17:23, Rene Montilva wrote:
  Hi Daniel
  
  was the patch for v1 geoip module  to kamailio 4.2 , i got the doubt
  
  On Wed, Mar 11, 2015 at 11:39 AM, Daniel-Constantin Mierla
  
  mico...@gmail.com mailto:mico...@gmail.com wrote:
  I will apply the patch, but I will change to use same attribute
  name for
  continent id as for geoip module, to be coherent.
  
  Cheers,
  Daniel
  
  On 11/03/15 15:34, Sergey Okhapkin wrote:
   The patch to return continent code in geoip2 module attached.
  
  Daniel, please
  
   apply the diff to the master, I have bad luck fighting with
   github.
   
   On Wednesday 11 March 2015 11:08:12 Daniel-Constantin Mierla 
wrote:
   I pushed a path to geoip module in master branch to return
  
  continent id
  
   via 'contid' attribute of the geoip variable. No testing here
  
  though,
  
   therefore I appreciate if you report back it works or not.
   
   Would be good to get it in geoip2 as well -- hopefully Sergey
  
  has the
  
   time for it.
   
   Cheers,
   Daniel
   
   On 11/03/15 01:08, Rene Montilva wrote:
   I am trying to separate from continent to have rtp more dynamic
   to
   simplify the assignment, the geoip i'm working on v1
   
   On Tue, Mar 10, 2015 at 7:22 PM, Sergey Okhapkin
   
   s...@sokhapkin.dyndns.org mailto:s...@sokhapkin.dyndns.org
  
  mailto:s...@sokhapkin.dyndns.org
  
  mailto:s...@sokhapkin.dyndns.org wrote:
   Hmm, I can add continent code pvar to geoip2 module in
  
  kamailio
  
   trunk. Is it
   really useful instead of country code?
   
   On Tuesday 10 March 2015 19:03:35 Rene Montilva wrote:
Hi list

i'm trying to configure rtp engine routing by source ip,
i'd
   
   like divide it
   
by continent code, is there any pseudo-variables or
  
  possibilites
  
   to handle
   
continent code.

Team, any idea about it?
   
   ___
   SIP Express Router (SER) and Kamailio (OpenSER) - sr-users
  
  mailing
  
   list
   sr-users@lists.sip-router.org
  
  mailto:sr-users@lists.sip-router.org
  mailto:sr-users@lists.sip-router.org
  mailto:sr-users@lists.sip-router.org
  
   http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-user
   s
   
   ___
   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
  Kamailio World Conference, May 27-29, 2015
  Berlin, Germany - http://www.kamailioworld.com
  
  
  ___
  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


Re: [SR-Users] Continent Code GeoIP module, kamailio 4.2

2015-03-11 Thread Sergey Okhapkin
Why the pvar name is contid when the entity name is continent code?

On Wednesday 11 March 2015 19:06:39 Daniel-Constantin Mierla wrote:
 Hello,
 
 no, it is in the master branch.
 
 If you installed from git repo, you can pick the patch with:
 
 git pull origin
 git cherry-pick 1ace8a167b9a6515be2b9f4a79786909c9ffce37
 
 You can see the diff at:
 
 https://github.com/kamailio/kamailio/commit/1ace8a167b9a6515be2b9f4a79786909
 c9ffce37
 
 Cheers,
 Daniel
 
 On 11/03/15 17:23, Rene Montilva wrote:
  Hi Daniel
  
  was the patch for v1 geoip module  to kamailio 4.2 , i got the doubt
  
  On Wed, Mar 11, 2015 at 11:39 AM, Daniel-Constantin Mierla
  
  mico...@gmail.com mailto:mico...@gmail.com wrote:
  I will apply the patch, but I will change to use same attribute
  name for
  continent id as for geoip module, to be coherent.
  
  Cheers,
  Daniel
  
  On 11/03/15 15:34, Sergey Okhapkin wrote:
   The patch to return continent code in geoip2 module attached.
  
  Daniel, please
  
   apply the diff to the master, I have bad luck fighting with github.
   
   On Wednesday 11 March 2015 11:08:12 Daniel-Constantin Mierla wrote:
   I pushed a path to geoip module in master branch to return
  
  continent id
  
   via 'contid' attribute of the geoip variable. No testing here
  
  though,
  
   therefore I appreciate if you report back it works or not.
   
   Would be good to get it in geoip2 as well -- hopefully Sergey
  
  has the
  
   time for it.
   
   Cheers,
   Daniel
   
   On 11/03/15 01:08, Rene Montilva wrote:
   I am trying to separate from continent to have rtp more dynamic to
   simplify the assignment, the geoip i'm working on v1
   
   On Tue, Mar 10, 2015 at 7:22 PM, Sergey Okhapkin
   
   s...@sokhapkin.dyndns.org mailto:s...@sokhapkin.dyndns.org
  
  mailto:s...@sokhapkin.dyndns.org
  
  mailto:s...@sokhapkin.dyndns.org wrote:
   Hmm, I can add continent code pvar to geoip2 module in
  
  kamailio
  
   trunk. Is it
   really useful instead of country code?
   
   On Tuesday 10 March 2015 19:03:35 Rene Montilva wrote:
Hi list

i'm trying to configure rtp engine routing by source ip, i'd
   
   like divide it
   
by continent code, is there any pseudo-variables or
  
  possibilites
  
   to handle
   
continent code.

Team, any idea about it?
   
   ___
   SIP Express Router (SER) and Kamailio (OpenSER) - sr-users
  
  mailing
  
   list
   sr-users@lists.sip-router.org
  
  mailto:sr-users@lists.sip-router.org
  mailto:sr-users@lists.sip-router.org
  mailto:sr-users@lists.sip-router.org
  
   http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
   
   ___
   SIP Express Router (SER) and Kamailio (OpenSER) - sr-users
  
  mailing list
  
   sr-users@lists.sip-router.org
  
  mailto:sr-users@lists.sip-router.org
  
   http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
  
  --
  Daniel-Constantin Mierla
  http://twitter.com/#!/miconda http://twitter.com/#%21/miconda -
  http://www.linkedin.com/in/miconda
  Kamailio World Conference, May 27-29, 2015
  Berlin, Germany - http://www.kamailioworld.com
  
  
  ___
  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


Re: [SR-Users] Continent Code GeoIP module, kamailio 4.2

2015-03-11 Thread Sergey Okhapkin
The patch to return continent code in geoip2 module attached. Daniel, please 
apply the diff to the master, I have bad luck fighting with github.

On Wednesday 11 March 2015 11:08:12 Daniel-Constantin Mierla wrote:
 I pushed a path to geoip module in master branch to return continent id
 via 'contid' attribute of the geoip variable. No testing here though,
 therefore I appreciate if you report back it works or not.
 
 Would be good to get it in geoip2 as well -- hopefully Sergey has the
 time for it.
 
 Cheers,
 Daniel
 
 On 11/03/15 01:08, Rene Montilva wrote:
  I am trying to separate from continent to have rtp more dynamic to
  simplify the assignment, the geoip i'm working on v1
  
  On Tue, Mar 10, 2015 at 7:22 PM, Sergey Okhapkin
  
  s...@sokhapkin.dyndns.org mailto:s...@sokhapkin.dyndns.org wrote:
  Hmm, I can add continent code pvar to geoip2 module in kamailio
  trunk. Is it
  really useful instead of country code?
  
  On Tuesday 10 March 2015 19:03:35 Rene Montilva wrote:
   Hi list
   
   i'm trying to configure rtp engine routing by source ip, i'd
  
  like divide it
  
   by continent code, is there any pseudo-variables or possibilites
  
  to handle
  
   continent code.
   
   Team, any idea about it?
  
  ___
  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-usersdiff --git a/modules/geoip2/README b/modules/geoip2/README
index c9cb1ed..fd07cdd 100644
--- a/modules/geoip2/README
+++ b/modules/geoip2/README
@@ -141,6 +141,7 @@ if(geoip2_match($si, src))
   + regc - region
   + regn - region name
   + metro - metro code
+  + contc - continent code
 
Exported pseudo-variables are documented at
http://www.kamailio.org/wiki/.
diff --git a/modules/geoip2/doc/geoip2_admin.xml b/modules/geoip2/doc/geoip2_admin.xml
index 244930d..b944bb3 100644
--- a/modules/geoip2/doc/geoip2_admin.xml
+++ b/modules/geoip2/doc/geoip2_admin.xml
@@ -163,6 +163,9 @@ if(geoip2_match($si, src))
 listitempara
 	emphasismetro/emphasis - metro code
 /para/listitem
+listitempara
+	emphasiscontc/emphasis - continent code
+/para/listitem
 			/itemizedlist
 			/listitem
 		/itemizedlist
diff --git a/modules/geoip2/geoip2_pv.c b/modules/geoip2/geoip2_pv.c
index f9f7dbb..69bd719 100644
--- a/modules/geoip2/geoip2_pv.c
+++ b/modules/geoip2/geoip2_pv.c
@@ -41,6 +41,7 @@ typedef struct _sr_geoip2_record {
 	str region_code;
 	str region_name;
 	str country;
+	str cont_code;
 	char latitude[16];
 	char longitude[16];
 	char metro[16];
@@ -207,6 +208,8 @@ int pv_parse_geoip2_name(pv_spec_p sp, str *in)
 gpv-type = 12;
 			else if(strncmp(pvs.s, nmask, 5)==0)
 gpv-type = 13;
+			else if(strncmp(pvs.s, contc, 5)==0)
+gpv-type = 6;
 			else goto error;
 		break;
 		default:
@@ -311,6 +314,22 @@ int pv_get_geoip2(struct sip_msg *msg, pv_param_t *param,
 			}
 			return pv_geoip2_get_strzval(msg, param, res,
 	gpv-item-r.longitude);
+		case 6: /* contc */
+			if(gpv-item-r.cont_code.s==NULL)
+			{
+if(gpv-item-r.flags16)
+	return pv_get_null(msg, param, res);
+if(MMDB_get_value(gpv-item-r.record.entry, entry_data,
+	continent,code, NULL
+	) != MMDB_SUCCESS)
+	return pv_get_null(msg, param, res);
+if(entry_data.has_data  entry_data.type == MMDB_DATA_TYPE_UTF8_STRING) {
+	gpv-item-r.cont_code.s = (char *)entry_data.utf8_string;
+	gpv-item-r.cont_code.len = entry_data.data_size;
+}
+gpv-item-r.flags |= 16;
+			}
+			return pv_get_strval(msg, param, res, gpv-item-r.cont_code);
 		case 8: /* city */
 			if(gpv-item-r.city.s==NULL)
 			{
 
___
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] Continent Code GeoIP module, kamailio 4.2

2015-03-10 Thread Sergey Okhapkin
Hmm, I can add continent code pvar to geoip2 module in kamailio trunk. Is it 
really useful instead of country code?

On Tuesday 10 March 2015 19:03:35 Rene Montilva wrote:
 Hi list
 
 i'm trying to configure rtp engine routing by source ip, i'd like divide it
 by continent code, is there any pseudo-variables or possibilites to handle
 continent code.
 
 Team, any idea about it?

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


Re: [SR-Users] how can I use WITH_IPAUTH when the IP may be stored in the DB as a FQDN?

2015-03-08 Thread Sergey Okhapkin
Authentication by IP address must be done by IP address only, DNS names must 
not be allowed. Period. By definition.

What you want can be achieved with dns_int_match_ip() function provided by 
ipops module. But keep in mind it is slow because of DNS lookup.

On Sunday 08 March 2015 13:38:52 canuck15 wrote:
 Here is is the relevant section of kamailio.cfg
 
 $var(tempfU) = $fU;
 #!ifdef WITH_IPAUTH
  if((!is_method(REGISTER))  allow_source_address()  $au == )
  {
  # Loading $fU from database using IP
 
  sql_pvquery(elxpbx, SELECT name FROM sip WHERE host = '$si'
 AND sippasswd IS NULL, $var(tempfU));
 
  # source IP allowed
  return;
  }
 
 The problem is that when host= somefqdn.com the above will fail since
 $si will always be an IP address as far as I can tell.  More often than
 not host= is a fqdn and requiring it to always be an IP address is not
 an option.  Converting it to IP before storing it in the DB is also not
 an option because it needs to be able to work of the IP address changes.
 
 So how can the above be done to accomodate the possibility that host=
 somefqdn.com or an IP address.  Preferably in such a way that it can
 scale to hundreds/thousands of rows in the database without slowing
 things down or crashing.
 
 
 ___
 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] source websocket ip address

2015-02-26 Thread Sergey Okhapkin
The same way like for other transports - $si.

On Thursday 26 February 2015 18:11:39 jaflong jaflong wrote:
 On a request  received over websocket how can the ip address of the http
 server that jssip library connected through and send the call from be know?
 
 ___
 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] allow_trusted and ipv6 addresses

2015-02-24 Thread Sergey Okhapkin
Looks like I found a solution:

create function toint(num int) returns int NO SQL
begin
return num;
end;

select toint(1) as grp

returns LONG datatype.

On Monday 23 February 2015 17:42:30 Sergey Okhapkin wrote:
 I think the problem is not in the source column type, but in casts. I found
 no way to create a view using existing table with select cast(1 as
 unsigned) as grp to return LONG. It always returns LONGLONG. I don't have
 concept of group in my DB schema and I don't need one, I just need to
 emulate the table structure kamailio expects.
 
 On Monday 23 February 2015 23:34:12 you wrote:
  Interesting to learn that mysql views are not using same type as the
  source column...
  
  I guess we should handle this case internally, doing views is quite
  common out there.
  
  Cheers,
  Daniel
  
  On 23/02/15 21:23, Sergey Okhapkin wrote:
   Address() functions are incompatible with mysql views/casts,
   reload_address_table() expects columns grp, mask and port to be type
   DB1_INT (mysql LONG) but views and casts always return column type
   LONGLONG (DB1_BIGINT). reload_address_table() always fail because of
   that.
   
   On Monday 23 February 2015 09:53:08 Daniel-Constantin Mierla wrote:
   Hello,
   
   trusted does string comparison for the address field, it is not
   considered an ip address.
   
   You should use address table instead if you just need matching on any
   ip
   address or subnet.
   
   Cheers,
   Daniel
   
   On 23/02/15 03:49, Sergey Okhapkin wrote:
   allow_trusted() function of permissions module doesn't work right with
   ipv6
   addresses - it treats IP addresses as strings and doesn't take into
   account
   variations aaa:bbb::0 vs aaa:bbb:0:0:0:0:0:0.
   
   ___
   SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing
   list
   sr-users@lists.sip-router.org
   http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
 
 ___
 SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
 sr-users@lists.sip-router.org
 http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

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


Re: [SR-Users] RTPEngine IPv4 to IPv6 bridging returning c=IN IP4 0.0.0.0 on answer?

2015-02-24 Thread Sergey Okhapkin
Which IP address has been sent to carrier in SDP offer? GLOBAL_IPv6 or 
EXTERNAL_IPv4?

On Tuesday 24 February 2015 19:20:15 Anthony Messina wrote:
 This is probably very likely a configuration issue on my part, but I wanted
 to check before reporting an RTPEngine bug...
 
 Thank you for any pointers or suggestions.
 
 This is a multi-homed server where
 
 em1: INTERNAL_IPv4  GLOBAL_IPv6
 em2: EXTERNAL_IPv4
 
 Note that below, the IPv6 address on my server is the same on priv and pub
 and is reachable from internal and external endpoints.  I have it set
 this way as I eventually want to use ICE and have it create the proper
 IPv4/IPv6 candidates regardless of the RTPEngine --interface.
 
 I'm running RTPEngine with the following:
 
 /usr/sbin/rtpengine
   --table=0
   --interface=pub/EXTERNAL_IPv4
   --interface=pub/GLOBAL_IPv6
   --interface=priv/INTERNAL_IPv4
   --interface=priv/GLOBAL_IPv6
   --listen-ng=127.0.0.1:12221
   --tos=184
   --log-level=7
   --pidfile=/run/rtpengine/rtpengine.test.pid
 
 I'm trying to bridge an IPv4-initated call to an IPv6 carrier. The call
 seems to flow properly until the carrier's SDP is passed through RTPEngine
 on answer.  The snippets are here, and I have attached the full log.
 
 [TdBe4MJa1DC4teIllJkqq6U-PAw9Zh4y] Received command 'answer' from
 127.0.0.1:38786
 [TdBe4MJa1DC4teIllJkqq6U-PAw9Zh4y] Dump for 'answer' from 127.0.0.1:38786: {
 sdp: v=0
 o=FreeSWITCH 1424799070 1424799071 IN IP6 CARRIER_IPv6
 s=FreeSWITCH
 c=IN IP6 CARRIER_IPv6
 t=0 0
 m=audio 24308 RTP/AVP 0 101
 a=rtpmap:0 PCMU/8000
 a=rtpmap:101 telephone-event/8000
 a=fmtp:101 0-16
 a=silenceSupp:off - - - -
 a=ptime:20
 a=rtcp:24309 IN IP6 CARRIER_IPv6
 
 
 The CARRIER_IPv6 gets converted as follows with 0.0.0.0 in place of what
 should be the address of my RTPEngine instance.  Shouldn't it be returning
 the IPv4 address of my RTPEngine instance (either priv or pub as called
 from Kamailio)?
 
 [TdBe4MJa1DC4teIllJkqq6U-PAw9Zh4y] Replying to 'answer' from 127.0.0.1:38786
 [TdBe4MJa1DC4teIllJkqq6U-PAw9Zh4y] Response dump for 'answer' to
 127.0.0.1:38786: { sdp: v=0
 o=FreeSWITCH 1424799070 1424799071 IN IP4 0.0.0.0
 s=FreeSWITCH
 c=IN IP4 0.0.0.0
 t=0 0
 m=audio 38914 RTP/SAVP 0 101
 a=rtpmap:0 PCMU/8000
 a=rtpmap:101 telephone-event/8000
 a=fmtp:101 0-16
 a=silenceSupp:off - - - -
 a=ptime:20
 a=sendrecv
 a=rtcp:38915
 a=crypto:1 AES_CM_128_HMAC_SHA1_80
 inline:Jby5IPt4WlNySLd66eK+Mcky8yJeUwp7dWH7W3aO

___
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] allow_trusted and ipv6 addresses

2015-02-23 Thread Sergey Okhapkin
Address() functions are incompatible with mysql views/casts, 
reload_address_table() expects columns grp, mask and port to be type DB1_INT 
(mysql LONG) but views and casts always return column type LONGLONG 
(DB1_BIGINT). reload_address_table() always fail because of that.

On Monday 23 February 2015 09:53:08 Daniel-Constantin Mierla wrote:
 Hello,
 
 trusted does string comparison for the address field, it is not
 considered an ip address.
 
 You should use address table instead if you just need matching on any ip
 address or subnet.
 
 Cheers,
 Daniel
 
 On 23/02/15 03:49, Sergey Okhapkin wrote:
  allow_trusted() function of permissions module doesn't work right with
  ipv6
  addresses - it treats IP addresses as strings and doesn't take into
  account
  variations aaa:bbb::0 vs aaa:bbb:0:0:0:0:0:0.
  
  ___
  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] allow_trusted and ipv6 addresses

2015-02-23 Thread Sergey Okhapkin
I think the problem is not in the source column type, but in casts. I found no 
way to create a view using existing table with select cast(1 as unsigned) as 
grp to return LONG. It always returns LONGLONG. I don't have concept of group 
in my DB schema and I don't need one, I just need to emulate the table 
structure kamailio expects.

On Monday 23 February 2015 23:34:12 you wrote:
 Interesting to learn that mysql views are not using same type as the
 source column...
 
 I guess we should handle this case internally, doing views is quite
 common out there.
 
 Cheers,
 Daniel
 
 On 23/02/15 21:23, Sergey Okhapkin wrote:
  Address() functions are incompatible with mysql views/casts,
  reload_address_table() expects columns grp, mask and port to be type
  DB1_INT (mysql LONG) but views and casts always return column type
  LONGLONG (DB1_BIGINT). reload_address_table() always fail because of
  that.
  
  On Monday 23 February 2015 09:53:08 Daniel-Constantin Mierla wrote:
  Hello,
  
  trusted does string comparison for the address field, it is not
  considered an ip address.
  
  You should use address table instead if you just need matching on any ip
  address or subnet.
  
  Cheers,
  Daniel
  
  On 23/02/15 03:49, Sergey Okhapkin wrote:
  allow_trusted() function of permissions module doesn't work right with
  ipv6
  addresses - it treats IP addresses as strings and doesn't take into
  account
  variations aaa:bbb::0 vs aaa:bbb:0:0:0:0:0:0.
  
  ___
  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] allow_trusted and ipv6 addresses

2015-02-22 Thread Sergey Okhapkin
allow_trusted() function of permissions module doesn't work right with ipv6 
addresses - it treats IP addresses as strings and doesn't take into account 
variations aaa:bbb::0 vs aaa:bbb:0:0:0:0:0:0.

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

2015-02-20 Thread Sergey Okhapkin
Here is web browser's log:

Request URL:ws://sip1.callwithus.com:5060/
Request Method:GET
Status Code:101 Switching Protocols

Request Headers
Accept-Encoding:gzip, deflate, sdch
Accept-Language:en-US,en;q=0.8
Cache-Control:no-cache
Connection:Upgrade
Host:sip1.callwithus.com:5060
Origin:http://www.callwithus.com
Pragma:no-cache
Sec-WebSocket-Extensions:permessage-deflate; client_max_window_bits
Sec-WebSocket-Key:ITH30EL8eWOPvyaqbIIFsA==
Sec-WebSocket-Protocol:sip
Sec-WebSocket-Version:13
Upgrade:websocket
User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like 
Gecko) Chrome/40.0.2214.93 Safari/537.36

Response Headers
Connection:upgrade
Content-Length:0
Sec-WebSocket-Accept:AnL9/ez1KsQtmMjyM2/b4FDqQPE=
Sec-WebSocket-Protocol:sip
Server:CWU SIP GW
Sia:SIP/2.0/TCP [2601:3:8840:A:172E:9CAD:6BB2:3F69]:45464
Upgrade:websocket

On Friday 20 February 2015 15:24:09 Sergey Okhapkin wrote:
 Works but something is still wrong:
 
 Feb 20 15:19:32 east /usr/local/sbin/kamailio[31935]: INFO: script: HTTP
 Request Received
 Feb 20 15:19:32 east /usr/local/sbin/kamailio[31935]: ERROR: core
 [parser/parse_fline.c:257]: parse_first_line(): parse_fir
 st_line: bad message (offset: 22)
 Feb 20 15:19:32 east /usr/local/sbin/kamailio[31935]: ERROR: core
 [parser/msg_parser.c:688]: parse_msg(): ERROR: parse_msg:
  message=HTTP/1.1 101 Switching Protocols
 *Sia: SIP/2.0/TCP [2601:3:8840:A:172E:9CAD:6BB2:3F69]:45395*
 Sec-WebSocket-Protocol: sip
 Upgrade: websocket
 Connection: upgrade
 Sec-WebSocket-Accept: LDFXlUJtVZUIkU3Fr+yQE4cf32U=
 Server: CWU SIP GW
 Content-Length: 0
 
 
 Feb 20 15:19:32 east /usr/local/sbin/kamailio[31935]: ERROR: core
 [msg_translator.c:3057]: build_sip_msg_from_buf(): parsin
 g failed
 Feb 20 15:19:32 east /usr/local/sbin/kamailio[31935]: INFO: script: SIP
 message from ws:2601:3:8840:A:172E:9CAD:6BB2:3F69:4
 5395
 REGISTER sip:sip1.callwithus.com SIP/2.0
 *Via: SIP/2.0/WS
 df7jal23ls0d.invalid;branch=z9hG4bKRyhgyWxh96q86MCmDUoT1CJkKsAKhTw
 F;rport*
 From: sip:659372...@sip1.callwithus.com;tag=U1x7c0lwCu7xmFUfEydT
 To: sip:659372...@sip1.callwithus.com
 Contact: sip:659372106@df7jal23ls0d.invalid;rtcweb-
 breaker=no;transport=ws;expires=200;click2call=no;+g.oma.sip-im;
 +audio;l
 anguage=en,fr
 Call-ID: 96020df3-0561-fab3-5ef8-30ef748059d1
 CSeq: 6919 REGISTER
 Content-Length: 0
 Max-Forwards: 69
 User-Agent: IM-client/OMA1.0 sipML5-v1.2014.12.11
 Supported: path
 
 On Friday 20 February 2015 20:44:59 Daniel-Constantin Mierla wrote:
  Can you try with the small patch from the commit?
 
 https://github.com/kamailio/kamailio/commit/5c1a9df4fc8bd72f44066bcef1
 3f381f
 
  01cd9d07
  
  If ok, I will backport.
  
  Cheers,
  Daniel
  
  On 20/02/15 20:30, Sergey Okhapkin wrote:
   It looks like when http request comes from ipv6 address, the module
   inserts Via header without [] around the address:
   
   
   
   Feb 20 14:26:17 east /usr/local/sbin/kamailio[30965]: ERROR: core
   [parser/parse_via.c:2193]: parse_via(): ERROR:parse_via: bad port
   
   Feb 20 14:26:17 east /usr/local/sbin/kamailio[30965]: ERROR: core
   [parser/parse_via.c:2708]: parse_via(): ERROR: parse_via on:
   SIP/2.0/TCP 2601:3:8840:A:172E:9CAD:6BB2:3F69:45306
   
   Host: sip1.callwithus.com:5060
   
   Connection: Upgrade
   
   Pragma: no-cache
   
   Cache-Control: no-cache
   
   Upgrade: websocket
   
   Origin: http://www.callwithus.com
   
   Sec-WebSocket-Version: 13
   
   User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36
 
 (KHTML,
 
   like Gecko) Chrome/40.0.2214.93 Safari/537.36
   
   Accept-Encoding: gzip, deflate, sdch
   
   Accept-Language: en-US,en;q=0.8
   
   Sec-WebSocket-Key: nyAUyArASVRXTI+Nvx82/Q==
   
   Sec-WebSocket-Extensions: permessage-deflate;
 
 client_max_window_bits
 
   Sec-WebSocket-Protocol: sip
   
   
   
   
   
   Feb 20 14:26:17 east /usr/local/sbin/kamailio[30965]: ERROR: core
   [parser/parse_via.c:2712]: parse_via(): ERROR: parse_via parse error,
   parsed so far:SIP/2.0/TCP 2601:3
   
   Feb 20 14:26:17 east /usr/local/sbin/kamailio[30965]: ERROR: core
   [parser/msg_parser.c:125]: get_hdr_field(): ERROR: get_hdr_field: bad
 
 via
 
   Feb 20 14:26:17 east /usr/local/sbin/kamailio[30965]: INFO: core
   [parser/msg_parser.c:338]: parse_headers(): ERROR: bad header field
   [Via: SIP/2.0/TCP 260]
   
   Feb 20 14:26:17 east /usr/local/sbin/kamailio[30965]: ERROR: core
 
   [parser/msg_parser.c:688]: parse_msg(): ERROR: parse_msg:
 message=GET
 
   / HTTP/1.1
   
   Via: SIP/2.0/TCP 2601:3:8840:A:172E:9CAD:6BB2:3F69:45306
   
   Host: sip1.callwithus.com:5060
   
   Connection: Upgrade
   
   Pragma: no-cache
   
   Cache-Control: no-cache
   
   Upgrade: websocket
   
   Origin: http://www.callwithus.com
   
   Sec-WebSocket-Version: 13
   
   User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36
 
 (KHTML,
 
   like Gecko) Chrome/40.0.2214.93 Safari/537.36
   
   Accept-Encoding: gzip, deflate, sdch
   
   Accept-Language: en-US,en;q=0.8

Re: [SR-Users] xhttp module and IPv6

2015-02-20 Thread Sergey Okhapkin
Works but something is still wrong:

Feb 20 15:19:32 east /usr/local/sbin/kamailio[31935]: INFO: script: HTTP 
Request Received
Feb 20 15:19:32 east /usr/local/sbin/kamailio[31935]: ERROR: core 
[parser/parse_fline.c:257]: parse_first_line(): parse_fir
st_line: bad message (offset: 22)
Feb 20 15:19:32 east /usr/local/sbin/kamailio[31935]: ERROR: core 
[parser/msg_parser.c:688]: parse_msg(): ERROR: parse_msg:
 message=HTTP/1.1 101 Switching Protocols
*Sia: SIP/2.0/TCP [2601:3:8840:A:172E:9CAD:6BB2:3F69]:45395*
Sec-WebSocket-Protocol: sip
Upgrade: websocket
Connection: upgrade
Sec-WebSocket-Accept: LDFXlUJtVZUIkU3Fr+yQE4cf32U=
Server: CWU SIP GW
Content-Length: 0


Feb 20 15:19:32 east /usr/local/sbin/kamailio[31935]: ERROR: core 
[msg_translator.c:3057]: build_sip_msg_from_buf(): parsin
g failed
Feb 20 15:19:32 east /usr/local/sbin/kamailio[31935]: INFO: script: SIP 
message from ws:2601:3:8840:A:172E:9CAD:6BB2:3F69:4
5395
REGISTER sip:sip1.callwithus.com SIP/2.0
*Via: SIP/2.0/WS 
df7jal23ls0d.invalid;branch=z9hG4bKRyhgyWxh96q86MCmDUoT1CJkKsAKhTw
F;rport*
From: sip:659372...@sip1.callwithus.com;tag=U1x7c0lwCu7xmFUfEydT
To: sip:659372...@sip1.callwithus.com
Contact: sip:659372106@df7jal23ls0d.invalid;rtcweb-
breaker=no;transport=ws;expires=200;click2call=no;+g.oma.sip-im;
+audio;l
anguage=en,fr
Call-ID: 96020df3-0561-fab3-5ef8-30ef748059d1
CSeq: 6919 REGISTER
Content-Length: 0
Max-Forwards: 69
User-Agent: IM-client/OMA1.0 sipML5-v1.2014.12.11
Supported: path



On Friday 20 February 2015 20:44:59 Daniel-Constantin Mierla wrote:
 Can you try with the small patch from the commit?
 
 
https://github.com/kamailio/kamailio/commit/5c1a9df4fc8bd72f44066bcef1
3f381f
 01cd9d07
 
 If ok, I will backport.
 
 Cheers,
 Daniel
 
 On 20/02/15 20:30, Sergey Okhapkin wrote:
  It looks like when http request comes from ipv6 address, the module
  inserts Via header without [] around the address:
  
  
  
  Feb 20 14:26:17 east /usr/local/sbin/kamailio[30965]: ERROR: core
  [parser/parse_via.c:2193]: parse_via(): ERROR:parse_via: bad port
  
  Feb 20 14:26:17 east /usr/local/sbin/kamailio[30965]: ERROR: core
  [parser/parse_via.c:2708]: parse_via(): ERROR: parse_via on:
  SIP/2.0/TCP 2601:3:8840:A:172E:9CAD:6BB2:3F69:45306
  
  Host: sip1.callwithus.com:5060
  
  Connection: Upgrade
  
  Pragma: no-cache
  
  Cache-Control: no-cache
  
  Upgrade: websocket
  
  Origin: http://www.callwithus.com
  
  Sec-WebSocket-Version: 13
  
  User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 
(KHTML,
  like Gecko) Chrome/40.0.2214.93 Safari/537.36
  
  Accept-Encoding: gzip, deflate, sdch
  
  Accept-Language: en-US,en;q=0.8
  
  Sec-WebSocket-Key: nyAUyArASVRXTI+Nvx82/Q==
  
  Sec-WebSocket-Extensions: permessage-deflate; 
client_max_window_bits
  
  Sec-WebSocket-Protocol: sip
  
  
  
  
  
  Feb 20 14:26:17 east /usr/local/sbin/kamailio[30965]: ERROR: core
  [parser/parse_via.c:2712]: parse_via(): ERROR: parse_via parse error,
  parsed so far:SIP/2.0/TCP 2601:3
  
  Feb 20 14:26:17 east /usr/local/sbin/kamailio[30965]: ERROR: core
  [parser/msg_parser.c:125]: get_hdr_field(): ERROR: get_hdr_field: bad 
via
  
  Feb 20 14:26:17 east /usr/local/sbin/kamailio[30965]: INFO: core
  [parser/msg_parser.c:338]: parse_headers(): ERROR: bad header field
  [Via: SIP/2.0/TCP 260]
  
  Feb 20 14:26:17 east /usr/local/sbin/kamailio[30965]: ERROR: core
  [parser/msg_parser.c:688]: parse_msg(): ERROR: parse_msg: 
message=GET
  / HTTP/1.1
  
  Via: SIP/2.0/TCP 2601:3:8840:A:172E:9CAD:6BB2:3F69:45306
  
  Host: sip1.callwithus.com:5060
  
  Connection: Upgrade
  
  Pragma: no-cache
  
  Cache-Control: no-cache
  
  Upgrade: websocket
  
  Origin: http://www.callwithus.com
  
  Sec-WebSocket-Version: 13
  
  User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 
(KHTML,
  like Gecko) Chrome/40.0.2214.93 Safari/537.36
  
  Accept-Encoding: gzip, deflate, sdch
  
  Accept-Language: en-US,en;q=0.8___
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] xhttp module and IPv6

2015-02-20 Thread Sergey Okhapkin
It looks like when http request comes from ipv6 address, the module 
inserts Via header without [] around the address:

Feb 20 14:26:17 east /usr/local/sbin/kamailio[30965]: ERROR: core 
[parser/parse_via.c:2193]: parse_via(): ERROR:parse_via: bad port
Feb 20 14:26:17 east /usr/local/sbin/kamailio[30965]: ERROR: core 
[parser/parse_via.c:2708]: parse_via(): ERROR: parse_via on: SIP/2.0/TCP 
2601:3:8840:A:172E:9CAD:6BB2:3F69:45306
Host: sip1.callwithus.com:5060
Connection: Upgrade
Pragma: no-cache
Cache-Control: no-cache
Upgrade: websocket
Origin: http://www.callwithus.com
Sec-WebSocket-Version: 13
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like 
Gecko) Chrome/40.0.2214.93 Safari/537.36
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8
Sec-WebSocket-Key: nyAUyArASVRXTI+Nvx82/Q==
Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits
Sec-WebSocket-Protocol: sip


Feb 20 14:26:17 east /usr/local/sbin/kamailio[30965]: ERROR: core 
[parser/parse_via.c:2712]: parse_via(): ERROR: parse_via parse error, 
parsed so far:SIP/2.0/TCP 2601:3
Feb 20 14:26:17 east /usr/local/sbin/kamailio[30965]: ERROR: core 
[parser/msg_parser.c:125]: get_hdr_field(): ERROR: get_hdr_field: bad via
Feb 20 14:26:17 east /usr/local/sbin/kamailio[30965]: INFO: core 
[parser/msg_parser.c:338]: parse_headers(): ERROR: bad header field [Via: 
SIP/2.0/TCP 260]
Feb 20 14:26:17 east /usr/local/sbin/kamailio[30965]: ERROR: core 
[parser/msg_parser.c:688]: parse_msg(): ERROR: parse_msg: 
message=GET / HTTP/1.1
*Via: SIP/2.0/TCP 2601:3:8840:A:172E:9CAD:6BB2:3F69:45306*
Host: sip1.callwithus.com:5060
Connection: Upgrade
Pragma: no-cache
Cache-Control: no-cache
Upgrade: websocket
Origin: http://www.callwithus.com
Sec-WebSocket-Version: 13
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like 
Gecko) Chrome/40.0.2214.93 Safari/537.36
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8
Sec-WebSocket-Key: nyAUyArASVRXTI+Nvx82/Q==
Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits
Sec-WebSocket-Protocol: sip


Feb 20 14:26:17 east /usr/local/sbin/kamailio[30965]: ERROR: xhttp 
[xhttp_mod.c:264]: xhttp_process_request(): parse_msg failed

___
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] Registrar module and ipv6 addresses

2015-02-03 Thread Sergey Okhapkin
Registrar module save() function stores received field in wrong format like

sip:2601:3:8805:107:41E6:C7A1:7724:CF01:5062

When lookup() config function is executed for ipv6 client, kamailio log shows 
error


Feb  3 12:07:34 east /usr/local/sbin/kamailio[16069]: ERROR: tm [ut.h:254]: 
uri2dst2(): ERROR: uri2dst: bad_uri: sip:2601:3:8
805:107:41E6:C7A1:7724:CF01:5062
Feb  3 12:07:34 east /usr/local/sbin/kamailio[16069]: ERROR: tm 
[t_fwd.c:1709]: t_forward_nonack(): ERROR: t_forward_nonack: 
failure to add branches

Is it kamailio bug or a problem with my config?

___
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] Registrar module and ipv6 addresses

2015-02-03 Thread Sergey Okhapkin
Nevermind, that was a problem with kamailio.cfg.

On Tuesday 03 February 2015 12:17:07 Sergey Okhapkin wrote:
 Registrar module save() function stores received field in wrong format
 like
 
 sip:2601:3:8805:107:41E6:C7A1:7724:CF01:5062
 
 When lookup() config function is executed for ipv6 client, kamailio log
 shows error
 
 
 Feb  3 12:07:34 east /usr/local/sbin/kamailio[16069]: ERROR: tm [ut.h:254]:
 uri2dst2(): ERROR: uri2dst: bad_uri: sip:2601:3:8
 805:107:41E6:C7A1:7724:CF01:5062
 Feb  3 12:07:34 east /usr/local/sbin/kamailio[16069]: ERROR: tm
 [t_fwd.c:1709]: t_forward_nonack(): ERROR: t_forward_nonack:
 failure to add branches
 
 Is it kamailio bug or a problem with my config?
 
 ___
 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] GeoIP Module and IPv6 seems not to match

2015-01-27 Thread Sergey Okhapkin
The pull request with the patch submitted.

On Tuesday 27 January 2015 07:59:04 Sergey Okhapkin wrote:
 Yes, geoip2 module will handle v4 and v6 addresses at the same time.
 
 I'm learning now how to use github and will issue pull request today.
 
 On Tuesday 27 January 2015 12:54:59 Jöran Vinzens wrote:
  Hi, thanks for that info.
  
  Will there be support to handle V4 and V6 at the same time? So far there
  is
  the possibility just for one database in the module to configure.
  
  BR
  Jöran
  
  On Tue, Jan 27, 2015 at 10:26 AM, Daniel-Constantin Mierla 
  
  mico...@gmail.com wrote:
Hello,
   
   the geoip module is using the old database format (API) that is not
   supporting ipv6, there is a new module in the work that uses the new
   geoip
   database format/API.
   
   I already got some code and I asked the developer to make a github pull
   request. It should show up soon.
   
   Cheers,
   Daniel
   
   
   On 27/01/15 10:18, Jöran Vinzens wrote:
   
   Hi All,
   
i'm trying to get GEO IP Location for an IPv6 Setup.
   
   We downloaded the GeoLiteCityv6.dat from maxmind and referred to it in
   modparams of geoip.
   
If i now place a call from an V6 User and do something like:

if(geoip_match($si, src)) {

   xlog(L_NOTICE, Call comes from IP '$si'
   ($gip(src=cc))
   
   CID=$ci F=$fU URI=$ru\n);
   
   append_hf(X-GeoIP: $gip(src=cc)\r\n);
   
   }
   
it will not match for any reason

if i xlog the src IP it look like: Src IP = 2A01:abc:321:123:0:0:0:2
   
   so it should match to the GEO IP Database.
   
In CSV version of geo IP database there is an entry for my IP Address.

Since the Module is not that verbose, i cannot tell whether the entry
   
   exists or not. Just the result in my if is False.
   
Has anybody experience with GEOIP and IPv6?

thanks

Best regards,
   
   Jöran
   
   
   ___
   SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing
   listsr-us...@lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mai
   l
   man/listinfo/sr-users
   
   
   --
   Daniel-Constantin Mierlahttp://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


Re: [SR-Users] GeoIP Module and IPv6 seems not to match

2015-01-27 Thread Sergey Okhapkin
Yes, geoip2 module will handle v4 and v6 addresses at the same time.

I'm learning now how to use github and will issue pull request today.

On Tuesday 27 January 2015 12:54:59 Jöran Vinzens wrote:
 Hi, thanks for that info.
 
 Will there be support to handle V4 and V6 at the same time? So far there is
 the possibility just for one database in the module to configure.
 
 BR
 Jöran
 
 On Tue, Jan 27, 2015 at 10:26 AM, Daniel-Constantin Mierla 
 
 mico...@gmail.com wrote:
   Hello,
  
  the geoip module is using the old database format (API) that is not
  supporting ipv6, there is a new module in the work that uses the new geoip
  database format/API.
  
  I already got some code and I asked the developer to make a github pull
  request. It should show up soon.
  
  Cheers,
  Daniel
  
  
  On 27/01/15 10:18, Jöran Vinzens wrote:
  
  Hi All,
  
   i'm trying to get GEO IP Location for an IPv6 Setup.
  
  We downloaded the GeoLiteCityv6.dat from maxmind and referred to it in
  modparams of geoip.
  
   If i now place a call from an V6 User and do something like:
   
   if(geoip_match($si, src)) {
   
  xlog(L_NOTICE, Call comes from IP '$si' ($gip(src=cc))
  
  CID=$ci F=$fU URI=$ru\n);
  
  append_hf(X-GeoIP: $gip(src=cc)\r\n);
  
  }
  
   it will not match for any reason
   
   if i xlog the src IP it look like: Src IP = 2A01:abc:321:123:0:0:0:2
  
  so it should match to the GEO IP Database.
  
   In CSV version of geo IP database there is an entry for my IP Address.
   
   Since the Module is not that verbose, i cannot tell whether the entry
  
  exists or not. Just the result in my if is False.
  
   Has anybody experience with GEOIP and IPv6?
   
   thanks
   
   Best regards,
  
  Jöran
  
  
  ___
  SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing
  listsr-us...@lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mail
  man/listinfo/sr-users
  
  
  --
  Daniel-Constantin Mierlahttp://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


Re: [SR-Users] event on table location Duplicate entry for key 'ruid_idx'

2015-01-13 Thread Sergey Okhapkin
Add server_id=N to kamailio.cfg on both servers, where N is an integer with 
unique value. userloc module will use server_id value to create unique between 
servers ruid.

On Tuesday 13 January 2015 10:53:28 Daniel-Constantin Mierla wrote:
 Hello,
 
 On 12/01/15 22:54, Yuriy Gorlichenko wrote:
  Hello. We use 2 kamailio servers  cluster  and we have porblems with
  db. Database failed pecause of error:
  
  Could not execute Write_rows_v1 event on table production.location;
  Duplicate entry 'uloc-54aae947-86d-a67' for key 'ruid_idx',
  Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's
  master log FIRST, end_log_pos 380, Internal MariaDB error code: 1062
  
  But a location table no row 'ruid_idx' and no entry uloc-54aae947-86d-a67.
 
 ruid_idx is a unique key constraint on column uid. Can you check if you
 have that value in ruid column?
 
 Also, can you share the output of 'kamctl ps' for each of the servers?
 Assuming you haven't restarted the kamailios.
 
 Provide the output of 'kamailio -V' to figure out the version and the
 parameters for usrloc module.
 
 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] Maxmind GeoIP2 implementation.

2015-01-12 Thread Sergey Okhapkin
 OK, I will do it.

On Monday, January 12, 2015 12:36:28 PM Daniel-Constantin Mierla wrote:
 I don't do it and I am not aware of anyone else. You can do it.
 
 Cheers,
 Daniel
 
 On 10/01/15 22:25, Sergey Okhapkin wrote:
  Is anybody working on implementation of geoip2 module for kamailio? The
  advantage of the new API is a seamless support of both ipv4 and ipv6
  addresses. If there is no work in progress, I'm goild to take the duty to
  implement module geoip2 based on the existing geoip module. I don't think
  it worth to extend geoip module to support both maxmind database formats.
  
  ___
  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] Maxmind GeoIP2 implementation.

2015-01-10 Thread Sergey Okhapkin
Is anybody working on implementation of geoip2 module for kamailio? The 
advantage of the new API is a seamless support of both ipv4 and ipv6 
addresses. If there is no work in progress, I'm goild to take the duty to 
implement module geoip2 based on the existing geoip module. I don't think it 
worth to extend geoip module to support both maxmind database formats.

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


Re: [SR-Users] (no subject)

2013-11-14 Thread Sergey Okhapkin
No, you may not that way.

On Thursday 14 November 2013 21:11:58 Roni | wrote:
 may i join

___
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] Reason for 401 Unauthorized message

2013-11-04 Thread Sergey Okhapkin
 This is expected behavior, it is how SIP authentication works.

On Monday, November 04, 2013 02:58:41 PM Owais ul Haq wrote:
 Hello,
 
 I am using kamailio server. Problem is when my soft phone
 tries to connect to Kamailio server, it connects in second attempt.
 First it gets a sip reply saying Status : 401 Unauthorized (0
 bindings). I checked this using Wire Shark. Can some one please help me
  in finding the reason for this error message found all the time.
 Thanks
 
 Best Regards

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


Re: [SR-Users] Event route sl:local-response is not executed in kamailio 4.1

2013-11-03 Thread Sergey Okhapkin
Here is the fix.

diff --git a/modules/sl/sl_funcs.c b/modules/sl/sl_funcs.c
index fd19e1c..c642249 100644
--- a/modules/sl/sl_funcs.c
+++ b/modules/sl/sl_funcs.c
@@ -90,7 +90,7 @@ void sl_lookup_event_routes(void)
 
 _sl_evrt_local_response = route_lookup(event_rt, sl:local-
response);
if (_sl_evrt_local_response=0
-event_rt.rlist[_sl_evrt_local_response]!=NULL)
+event_rt.rlist[_sl_evrt_local_response]==NULL)
_sl_evrt_local_response = -1;
 }


On Saturday 02 November 2013 19:08:04 Sergey Okhapkin wrote:
 I just upgraded one server to latest git (version: kamailio 4.1.0-pre0
 (x86_64/linux) 26fa46-dirty), sl:local-response route is no longer executed.
 I have in kamailio.cfg
 
 event_route[sl:local-response] {
   xlog(L_INFO,Local response\n$mb\n);
 }
 
 No local responses are logged in kamailio log file. It was working fine in
 kamailio 4.1.0-dev7 (x86_64/linux) b2a536-dirty
 
 ___
 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] Event route sl:local-response is not executed in kamailio 4.1

2013-11-02 Thread Sergey Okhapkin
I just upgraded one server to latest git (version: kamailio 4.1.0-pre0 
(x86_64/linux) 26fa46-dirty), sl:local-response route is no longer executed. I 
have in kamailio.cfg

event_route[sl:local-response] {

xlog(L_INFO,Local response\n$mb\n); 

}   


No local responses are logged in kamailio log file. It was working fine in 
kamailio 4.1.0-dev7 (x86_64/linux) b2a536-dirty

___
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] bad cseq attack

2013-08-21 Thread Sergey Okhapkin
Actually nothing needs to be done in kamailio core. I's a simple scripting 
logic.

if(!sanity_check(whatever_you wan't_check)) {
xlog(L_INFO,Malformed message from $proto:$si:$sp\n$mb\n);
break;
}

On Thursday 22 August 2013 00:07:56 Daniel-Constantin Mierla wrote:
 On 8/21/13 12:53 PM, Juha Heinanen wrote:
  i have noticed lots of these kind of attacks in my syslog:
  
  /var/log/syslog.1:Aug 21 04:23:46 host /usr/sbin/sip-proxy[13490]: ERROR:
  core [parser/parse_cseq.c:95]: parse_cseq(): ERROR: CSeq EoL expected
  /var/log/syslog.1:Aug 21 04:23:46 host /usr/sbin/sip-proxy[13490]: ERROR:
  core [parser/parse_cseq.c:98]: parse_cseq(): ERROR: parse_cseq: bad
  cseq /var/log/syslog.1:Aug 21 04:23:46 host /usr/sbin/sip-proxy[13490]:
  ERROR: core [parser/msg_parser.c:161]: get_hdr_field(): ERROR:
  get_hdr_field: bad cseq
  
  in order to be able to fail2ban the attacker, source ip address should
  appear in syslog message.
  
  is there a way to catch sip request syntax errors in config file so that
  appropriate syslog message could be generated?
 
 We can add an event_route for it as well as print the src ip in the log
 message for quick fix (this one can be backported easy).
 
 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


[SR-Users] Call DNS resolver from a cfg script.

2013-08-20 Thread Sergey Okhapkin
Is there a way to run DNS lookups from cfg script? I need some way to get host 
IP by DNS name.

___
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: MI Command: 'trusted_dump' and 'trusted_reload'

2013-06-21 Thread Sergey Okhapkin
Hmm... trusted_dump and trusted_reload work OK to me. Kamailio compiled from 
git a week ago.

On Friday 21 June 2013 10:59:54 José Luis Millán wrote:
 Hi,
 
 I'm using 'allow_trusted()' from Permissions module without a problem in a
 Kamailio 4.0 routing logic. It does just work, but the MI command
 'trusted_dump' tells me that the module is not in use:
 
 '''
 server:/home/jmillan# kamctl fifo trusted_dump
 500 Trusted-module not in use
 '''
 
 Doing a 'trusted_reload' does neither make any query to database to
 retrieve the data.
 
 Other MI commands of same module do work correctly. ie: 'address_reload' or
 'address_dump'
 
 Note: I have tested in a Kamailio 1.5 and the result is the same.
 
 Regards.

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


[SR-Users] Variables in event_route[sl:local-response]

2013-06-19 Thread Sergey Okhapkin
Which variables I can use in 
event_route[sl:local-response] route to xlog 
proto:ip:port to which the response will be 
sent?

event_route[sl:local-response] {

xlog(L_INFO,Local response to 
*$??*\n$mb\n); 
 
} 
___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] usrloc + multimaster replication

2013-04-08 Thread Sergey Okhapkin
I'm running kamailio 3.X with the following patch for years, works fine to me 
with distributed servers and replication:

diff --git a/modules_k/usrloc/udomain.c b/modules_k/usrloc/udomain.c
index b52bb76..e457cc5 100644
--- a/modules_k/usrloc/udomain.c
+++ b/modules_k/usrloc/udomain.c
@@ -318,6 +318,7 @@ static inline ucontact_info_t* dbrow2info( db_val_t *vals, 
str *contact)
ci.sock = grep_sock_info( host, (unsigned short)port, proto);
if (ci.sock==0) {
LM_WARN(non-local socket %s...ignoring\n, p);
+   return 0;
}
}


On Monday 08 April 2013 04:52:35 Alex Balashov wrote:
 I know I'm revisiting a problem that has been discussed in multiple
 threads from various angles, so I might be rightly accused of laziness
 in neglecting to research them all.  All the same:
 
 I have proxy1 and proxy2 writing to database A and database B,
 respectively.  Database A and database B are active-active masters,
 synchronised via some replication system attached to the underlying DB
 technology.
 
 The 'location' table is also replicated this way. We know that 'usrloc'
 doesn't work so well with this: one instance of Kamailio will
 periodically delete the other's contacts, even if they have a nonlocal
 SIP domain.
 
 Is there any db_mode that can be used (other than 0/purely in-memory) to
 make this work right?  Or is that the essential problem that p_usrloc is
 written to solve?
 
 Thanks,
 
 -- 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] Kamailio strange behavior : bad Via, bad port

2013-03-17 Thread Sergey Okhapkin
Why you're sure that INVITE message is OK?

On Sunday 17 March 2013 20:22:21 Khoa Pham wrote:
 Hi,
 
 When A calls B. The INVITE goes through Kamailio. In the Kamalio 's log
 file, I see it say bad Via, bad port. And it doesnot reply A with 100
 Trying not forwarding INVITE to B.
 
 The INVITE message (espcially the Via header) is OK.
 
 This problem sometimes happens. Do you know why ?
 
 Please help. Thanks

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


Re: [SR-Users] Kamailio Geoip

2013-03-06 Thread Sergey Okhapkin
There are 2 separate databases, but common API (I believe).

On Wednesday 06 March 2013 12:28:19 Daniel-Constantin Mierla wrote:
 Hello,
 
 On 3/5/13 1:31 PM, Sergey Okhapkin wrote:
  Are there plans to extend geoip module to work in dual stack environment,
  i.e. lookup both ipv4 and ipv6 addresses? Maxmind provides ipv6
  databases.
 is there any change in the API for the IPv6? Or there are two separate
 databases that should be used?
 
 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] Kamailio Geoip

2013-03-05 Thread Sergey Okhapkin
Are there plans to extend geoip module to work in dual stack environment, i.e. 
lookup both ipv4 and ipv6 addresses? Maxmind provides ipv6 databases.

On Tuesday 05 March 2013 09:36:59 Daniel-Constantin Mierla wrote:
 Hello,
 
 On 3/4/13 11:48 AM, Ian French wrote:
  Hey List,
  
I'm looking at an article by Daniel,
  
  http://by-miconda.blogspot.ie/2010/10/best-of-new-in-kamailio-310-5-geoip-
  api.html.
  
  In it he's uses the below to block source IP addresses by country,How
  could this be used to block multiple country sources?? I've tried a
  couple of things aleardy but have failed
  
  geoip_match($si, src);
  if($gip(src=cc)==CA) {
  
 xlog(SIP message from Canada (ip: $si) - drop it\n);
 
 send_reply(403, Forbidden);
 exit;
  
  }
 
 just make an OR expression:
 
 if($gip(src=cc)==CA || $gip(src=cc)==DE || $gip(src=cc)==FR) {
 
 Just as an alternative example, you can use sqlops to make a db query
 and check againts a list stored in a database table.
 
 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] Kamailio-Java Integration

2012-11-24 Thread Sergey Okhapkin
 Slow Java coupled with real-time SIP protocol? Hmm... Not viable to my point 
of view.

On Saturday 24 November 2012 14:15:26 ron.kamai...@mcleodnet.com wrote:
 I am looking for a way to integrate Java business logic with Kamailio to
 influence routing decisions, add/remove/modify headers, record
 accounting-related information, etc.  A while back there was a project named
 WeSIP, but it doesn't appear to active anymore.
 
 
 
 Is anyone doing something like this now, or any ideas or suggestions?
 
 Thanks,
 
 Ron

___
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-Java Integration

2012-11-24 Thread Sergey Okhapkin
 I don't want to start language holy war, but I can't accept a programming 
language which has operator new, but doesn't provide operator delete. 
Garbage collection? Yes, it runs from time to time. Usually at the worst 
moments of time when precious CPU cycles are vital to run actual business 
logic code.

On Saturday 24 November 2012 17:49:09 Alex Balashov wrote:
 On 11/24/2012 05:41 PM, Sergey Okhapkin wrote:
  Slow Java coupled with real-time SIP protocol? Hmm... Not viable to
  my point of view.
 
 Despite the stereotype, Java actually performs quite well, and is used
 in highly concurrent, real-time environments like telephony extensively.
   I think the stereotype about slow interpreted languages belongs to the
 first era of Java (1996-2000(?)), back when it had green threads and so on.
 
 Having said that, it is true that the JVM consumes a lot of resources
 just to run at all, and that the bureaucratic fashions of Java are
 chiefly an affectation of the enterprise world.  However, once it spools
 up and gets going, Java is quite fast, and adequate for SIP.  It has
 posted comparable benchmarks to C for many scientific computing
 applications for years now.
 
 Initially, I was as surprised by this as you are.
 
 -- 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] dialog - keep alives with lower cseq

2012-05-02 Thread Sergey Okhapkin
 Isn't it a responsibility of SIP session timer?

On Wednesday 02 May 2012 15:07:50 Daniel-Constantin Mierla wrote:
 Hello,
 
 OPTIONS out of dialog are ok to detect if the device is gone (e.g.,
 network problem -- good for dispatcher case where it needs only to
 figure out if gws are up).
 
 Besides this one, I tried to figure out if the dialog is still active in
 the end device, by setting dialog's call-id, from-tag and to-tag (e.g.,
 like when the device (crashed and) is restarted between keepalives -- it
 is still reachable but no dialog anymore). A request with unknown To-tag
 should be rejected with 481.
 
 My doubts were related to what would be the behaviour of getting a lower
 cseq when dialog is active (callid, from-tag and to-tag mach).
 
 Cheers,
 Daniel
 
 On 5/2/12 2:52 PM, Carsten Bock wrote:
  Hi Daniel,
  
  we did something similar with Kamailio at Telefonica. But we chose a
  little different approach:
  Our OPTION-Request was in fact not associated with the Dialog at all,
  thus we did not care about correct CSeq or anything at all. We just
  sent the OPTIONs to the URI/Routes of the Dialog. All the device had
  to do, was to reply in one way or another to that OPTIONs Request.
  That worked pretty well with all kinds of Devices, ranging from Zyxel
  CPE's, Snom phones, AVM boxes, Asterisk, Symbian built-in and many
  more.
  Some very rare crappy network devices (i think, we saw this issue only
  once, it was a SIP-Client for Symbian, open-source, discontinued)
  however simply ignored the OPTIONs, but that was anyway a
  non-supported device. Probably, it would also ignore the OPTION
  request, if it was with a call-id, cseq, totag, etc.
  This is similar to the behaviour used by the Dispatcher module.
  
  Just my $0,02,
  Carsten
  
  2012/5/2 Daniel-Constantin Mierlamico...@gmail.com:
  Hello,
  
  several days ago, just before freezing the development for v3.3.0, I
  added
  to dialog module the option to send keep alives for ongoing calls in
  order
  to detect if caller/callee is gone.
  
  SIP specs require to increment the CSeq for requests within dialog, but
  because the keep alives are sent from the sip server, it would results
  de-synchronization of the CSeq values hold in phones themselves (e.g., a
  BYE created by caller/callee after a keep alive will be with lower cseq
  than the other side would expect and accept). One solution would be to
  update cseq when BYE passes the server to the right value. This implies
  more processing, as a call can have many re-INVITEs or other requests
  within dialog sent by caller/callee, including periodic updates to
  database to store cseq numbers.
  
  So I went for a different approach, like stated in subject -- let's see
  your opinion if you think is going to work. Practically the keep alives
  will be OPTIONS with CSeq equal or lower than the last valid value
  (e.g., the cseq of the INVITE creating the call).
  
  If the caller/callee is gone, that is simply, the OPTION will be timed
  out
  and dialog module will send BYE.
  
  If the caller/callee are reachable, but for some reason the call was
  destroyed (e.g., a crash and restart meanwhile), since there is a To-tag,
  the OPTIONS should get a 481 Call/Leg transaction does not exists. Again,
  a
  case when kamailio will end the dialog.
  
  The one to be discussed here would be caller/callee are still on the
  call.
  
  Based on RFC (and the feedback from people on another thread here), a
  requests coming within a dialog with lower CSEq should be replies with
  500.
  CSeq numbers are still ok in both sides (note that requests with lower
  CSeq
  can happen in reality, like two fast re-INVITEs sent over UDP, the second
  arriving first due to network transmission).
  
  I tested with snom phones and jitsi so far, seems to be a working
  solution
  (well, jitsi was replying 500 after 20secs to keep alive OPTIONS request,
  not sure for what reason, just reported back to the project).
  
  Is anyone here seeing any possible issues with the approach?
  
  Call are ended by dialog, with proper CSeq in the BYE, after 10seconds
  from
  the moment 408 or 481 is received, no other replies are taken in
  consideration for ending the dialog from server side.
  
  Cheers,
  Daniel
  
  --
  Daniel-Constantin Mierla - http://www.asipto.com
  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


Re: [SR-Users] OT: are there still asymmetric SIP clients?

2011-06-22 Thread Sergey Okhapkin
A lot of Cisco (not linksys) SIP equipment is asymmetric.

On Wednesday 22 June 2011, Klaus Darilion wrote:
 Hi!
 
 Just a small survey: Are you still using NAT detection checks? I prefer
 to apply NAT traversal always (never trust the contact header) which of
 course only works if all the clients are symmetric.
 
 Thus - do you still see asymmetric SIP clients?
 
 Thanks
 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] OT: are there still asymmetric SIP clients?

2011-06-22 Thread Sergey Okhapkin
I use a separate IP address to accept calls from such SIP clients and do not 
check for NAT on those calls.

On Wednesday 22 June 2011, Klaus Darilion wrote:
 So what do you use as nat_check? Only the received IP address?
 
 regards
 Klaus
 
 Am 22.06.2011 15:36, schrieb Sergey Okhapkin:
  A lot of Cisco (not linksys) SIP equipment is asymmetric.
  
  On Wednesday 22 June 2011, Klaus Darilion wrote:
  Hi!
  
  Just a small survey: Are you still using NAT detection checks? I prefer
  to apply NAT traversal always (never trust the contact header) which of
  course only works if all the clients are symmetric.
  
  Thus - do you still see asymmetric SIP clients?
  
  Thanks
  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
 
 ___
 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] Remote Party ID Header

2011-06-17 Thread Sergey Okhapkin
RPID header is sent by linksys/sipura ATAs... I have a lot of headaches with 
those wide spread ATAs here in USA... PAP series are OK, but SPA series send 
RPID.

On Friday 17 June 2011, Alex Balashov wrote:
 Brian,
 
 Remote-Party-ID is a long-obsolete draft that never became an RFC;
 why are you still using it?
 
 Anyway, if you know the 'privacy' header parameter will always be
 there, you can do this, assuming is_present_hf(Remote-Party-ID), of
 course.
 
 $var(x) = $(hdr(Remote-Party-ID){s.select,1,});
 
 xlog(L_INFO, Remote Party ID privacy value:
 $(var(x){param.value,privacy})\n);


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


Re: [SR-Users] ACK not received

2011-05-25 Thread Sergey Okhapkin
No ACK from caller at 91.121.81.212.

On Wednesday 25 May 2011, Mokhtar Bengana wrote:
 I am trying to forward a DID to a sip account registered to Kamailio.
 The call get established with two way audio and Kamailio shows it's
 comming from an Asterisk server. However the call get disconnected
 each time after 31s. Ngrep is showing ACK not received by the
 Kamailio test account before the call get disconnected. If Kamailio is
 suppose to send an ACK back to the asterisk server to keep the call
 up, I am not sure why it's not happening. Or is it the other way
 around? I have included the ngrep output. I appreciate any help.
 
 
 
 U 2011/05/26 00:27:12.525344 91.121.81.212:5060 - 192.168.2.4:5060
 INVITE sip:t...@sipsoft.dyndns.org SIP/2.0.
 Record-Route: sip:91.121.81.212;lr;mr=yes.
 Via: SIP/2.0/UDP 91.121.81.212;branch=z9hG4bK33ad.da5ada05.0.
 Via: SIP/2.0/UDP 188.165.98.47:5060;branch=z9hG4bK60ba8b25;rport=5060.
 From: 3313144859493 sip:3313144859493@188.165.98.47;tag=as6c63c119.
 To: sip:33980307...@sip.antisip.com:5060.
 Contact: sip:3313144859493@188.165.98.47:5060.
 Call-ID: 5e5ba375661c69273f32a463764879b0@188.165.98.47.
 CSeq: 102 INVITE.
 User-Agent: Asterisk PBX.
 Max-Forwards: 69.
 Date: Thu, 26 May 2011 00:27:10 GMT.
 Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO.
 Supported: replaces.
 Content-Type: application/sdp.
 Content-Length: 260.
 P-Antisip: forwarded with alias.
 P-PMR: mediarelay enabled.
 .
 v=0.
 o=root 10502 10502 IN IP4 91.121.81.212.
 s=session.
 c=IN IP4 91.121.81.212.
 t=0 0.
 m=audio 41316 RTP/AVP 8 101.
 a=rtpmap:8 PCMA/8000.
 a=rtpmap:101 telephone-event/8000.
 a=fmtp:101 0-16.
 a=silenceSupp:off - - - -.
 a=ptime:20.
 a=sendrecv.
 a=nortpproxy:yes.
 
 
 U 2011/05/26 00:27:12.526734 192.168.2.4:5060 - 91.121.81.212:5060
 SIP/2.0 100 trying -- your call is important to us.
 Via: SIP/2.0/UDP 91.121.81.212;branch=z9hG4bK33ad.da5ada05.0.
 Via: SIP/2.0/UDP 188.165.98.47:5060;branch=z9hG4bK60ba8b25;rport=5060.
 From: 3313144859493 sip:3313144859493@188.165.98.47;tag=as6c63c119.
 To: sip:33980307...@sip.antisip.com:5060.
 Call-ID: 5e5ba375661c69273f32a463764879b0@188.165.98.47.
 CSeq: 102 INVITE.
 Server: kamailio (3.1.3 (x86_64/linux)).
 Content-Length: 0.
 .
 
 
 U 2011/05/26 00:27:12.527013 192.168.2.4:5060 - 192.168.2.8:65412
 INVITE sip:test@192.168.2.8:65412;rinstance=befda46036a026ac SIP/2.0.
 Record-Route: sip:192.168.2.4;lr=on.
 Record-Route: sip:91.121.81.212;lr;mr=yes.
 Via: SIP/2.0/UDP 192.168.2.4;branch=z9hG4bK33ad.55f7f307.0.
 Via: SIP/2.0/UDP 91.121.81.212;branch=z9hG4bK33ad.da5ada05.0.
 Via: SIP/2.0/UDP 188.165.98.47:5060;branch=z9hG4bK60ba8b25;rport=5060.
 From: 3313144859493 sip:3313144859493@188.165.98.47;tag=as6c63c119.
 To: sip:33980307...@sip.antisip.com:5060.
 Contact: sip:3313144859493@188.165.98.47:5060.
 Call-ID: 5e5ba375661c69273f32a463764879b0@188.165.98.47.
 CSeq: 102 INVITE.
 User-Agent: Asterisk PBX.
 Max-Forwards: 68.
 Date: Thu, 26 May 2011 00:27:10 GMT.
 Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO.
 Supported: replaces.
 Content-Type: application/sdp.
 Content-Length: 260.
 P-Antisip: forwarded with alias.
 P-PMR: mediarelay enabled.
 .
 v=0.
 o=root 10502 10502 IN IP4 91.121.81.212.
 s=session.
 c=IN IP4 91.121.81.212.
 t=0 0.
 m=audio 41316 RTP/AVP 8 101.
 a=rtpmap:8 PCMA/8000.
 a=rtpmap:101 telephone-event/8000.
 a=fmtp:101 0-16.
 a=silenceSupp:off - - - -.
 a=ptime:20.
 a=sendrecv.
 a=nortpproxy:yes.
 
 
 U 2011/05/26 00:27:12.601815 192.168.2.8:65412 - 192.168.2.4:5060
 SIP/2.0 180 Ringing.
 Via: SIP/2.0/UDP 192.168.2.4;branch=z9hG4bK33ad.55f7f307.0.
 Via: SIP/2.0/UDP 91.121.81.212;branch=z9hG4bK33ad.da5ada05.0.
 Via: SIP/2.0/UDP 188.165.98.47:5060;branch=z9hG4bK60ba8b25;rport=5060.
 Record-Route: sip:192.168.2.4;lr.
 Record-Route: sip:91.121.81.212;lr;mr=yes.
 Contact: sip:test@192.168.2.8:65412;rinstance=befda46036a026ac.
 To: sip:33980307...@sip.antisip.com:5060;tag=1df26a5d.
 From: 3313144859493sip:3313144859493@188.165.98.47;tag=as6c63c119.
 Call-ID: 5e5ba375661c69273f32a463764879b0@188.165.98.47.
 CSeq: 102 INVITE.
 User-Agent: X-Lite 4 release 4.0 stamp 58832.
 Content-Length: 0.
 .
 
 
 U 2011/05/26 00:27:12.601967 192.168.2.4:5060 - 91.121.81.212:5060
 SIP/2.0 180 Ringing.
 Via: SIP/2.0/UDP 91.121.81.212;branch=z9hG4bK33ad.da5ada05.0.
 Via: SIP/2.0/UDP 188.165.98.47:5060;branch=z9hG4bK60ba8b25;rport=5060.
 Record-Route: sip:192.168.2.4;lr.
 Record-Route: sip:91.121.81.212;lr;mr=yes.
 Contact: sip:test@192.168.2.8:65412;rinstance=befda46036a026ac.
 To: sip:33980307...@sip.antisip.com:5060;tag=1df26a5d.
 From: 3313144859493sip:3313144859493@188.165.98.47;tag=as6c63c119.
 Call-ID: 5e5ba375661c69273f32a463764879b0@188.165.98.47.
 CSeq: 102 INVITE.
 User-Agent: X-Lite 4 release 4.0 stamp 58832.
 Content-Length: 0.
 .
 
 
 U 2011/05/26 00:27:22.568944 192.168.2.8:65412 - 192.168.2.4:5060
 SIP/2.0 200 OK.
 Via: SIP/2.0/UDP 192.168.2.4;branch=z9hG4bK33ad.55f7f307.0.
 Via: SIP/2.0/UDP 

Re: [SR-Users] Authenticate if receiving 401

2011-04-17 Thread Sergey Okhapkin
http://kamailio.org/docs/modules/3.0.x/modules_k/uac.html

On Sunday 17 April 2011, Eric Hiller wrote:
 I want kamailio to authenticate itself to a host if it is sent a 401, just
 as that host is expected to authenticate if kamailio sends it one. I am
 not finding much in the online probably because I am not searching for the
 right terms. Does anyone have any experience in this?
 
 Thanks!
 -Eric


___
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] checking if calls are still active

2010-11-01 Thread Sergey Okhapkin
SST.

On Monday 01 November 2010, Vic Jolin wrote:
 Hi,
 
 Just want to ask what is the best way to check if calls are still active
 especially when we are not handling media?
 
 Thanks
 


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


[SR-Users] How to log local SIP replies?

2010-10-30 Thread Sergey Okhapkin
Is there a way to log local replies sent by kamailio? For example, I want to 
log a reply sent by kamailio in response to REGISTER request.

___
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] setdebug() and 3.X

2010-10-29 Thread Sergey Okhapkin
Daniel, I think this could be implemented without re-introduction of 
error_route, what about core parameter route_on_error=yes/no (default no)? If 
route on error is enabled, then sanity module will do the trick:

route{
if(!sanity_check(1159)) {
xlog(L_INFO,Bad message from $proto:$si:$sp\n$mb\n);
break;
}


It will be up to script writer what to do in main routing block if message 
parsing fails.


On Friday 29 October 2010, Sergey Okhapkin wrote:
 It would be nice to get error_route back. The route was trivial in my cfg
  file:
 
 error_route {
 xlog(L_INFO,Bad message from $proto:$si:$sp\n$mb\n);
 drop();
 }
 
 On Friday 29 October 2010, Daniel-Constantin Mierla wrote:
  On 10/28/10 1:41 PM, Sergey Okhapkin wrote:
   I've found one more feature missed in 3.1 - error_route is eliminated
   and sanity module added. But if received SIP message is malformed and
   can't be parsed, routing script is not executed and I have no way to
   log the message to kamailio log. I did it in error_route before.
  
   This logging is important to me to support customers. SIP ALG in
   routers often breaks Via line :-(
 
  Since I developed error_route, I remember that it handled just sporadic
  cases, but I can add an event_route to pass the buffer and some hints to
  configuration file in case the initial parsing fails and the message is
  dropped before getting to config file.
 
  It is good to know that someone use such case, introduction of sanity
  was clearly mentioned and so far there was no complain.
 
  Cheers,
  Daniel
 
   On Thursday 28 October 2010, Daniel-Constantin Mierla wrote:
   On 10/26/10 2:22 PM, Sergey Okhapkin wrote:
   setdebug() function is no longer provided by core. How to change
   debug level dynamically in the script to trace execution of a few
   statements only?
  
   seems was lost in transition to 3.0, I will check to see what can be
   done with the new architecture.
  
   Thanks,
   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
 
 ___
 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] setdebug() and 3.X

2010-10-29 Thread Sergey Okhapkin
I just realized that 3.1 executes main routing block when broken SIP message 
is received! But sanity_check() function returns 0 on failed checks and script 
execution stops, my favorite xlog() is not executed.

Oct 29 09:48:54 west /usr/local/sbin/kamailio[12225]: ERROR: core 
[parser/msg_parser.c:177]: ERROR: get_hdr_field: bad to header
Oct 29 09:48:54 west /usr/local/sbin/kamailio[12225]: INFO: core 
[parser/msg_parser.c:351]: ERROR: bad header field [To: Chi Nhung sip:
]
Oct 29 09:48:54 west /usr/local/sbin/kamailio[12225]: ERROR: core 
[parser/msg_parser.c:177]: ERROR: get_hdr_field: bad to header
Oct 29 09:48:54 west /usr/local/sbin/kamailio[12225]: INFO: core 
[parser/msg_parser.c:351]: ERROR: bad header field [To: Chi Nhung sip:
]
Oct 29 09:48:54 west /usr/local/sbin/kamailio[12225]: ERROR: core 
[parser/msg_parser.c:177]: ERROR: get_hdr_field: bad to header
Oct 29 09:48:54 west /usr/local/sbin/kamailio[12225]: INFO: core 
[parser/msg_parser.c:351]: ERROR: bad header field [To: Chi Nhung sip:
]
Oct 29 09:48:54 west /usr/local/sbin/kamailio[12225]: ERROR: core 
[msg_translator.c:1946]: ERROR: build_res_buf_from_sip_req: alas, parse
_headers failed
Oct 29 09:48:54 west /usr/local/sbin/kamailio[12225]: WARNING: sanity 
[sanity.c:253]: sanity_check(): check_required_headers(): failed to s
end 400 via sl reply


On Friday 29 October 2010, Daniel-Constantin Mierla wrote:
 On 10/29/10 11:53 AM, Sergey Okhapkin wrote:
  Daniel, I think this could be implemented without re-introduction of
  error_route,
 
 it will not be re-introduced for sure, we have now a different core
 framework which care reuse event_route mechanism.
 
 In the past the error route was executed when the error was discovered,
 so it several places of the code, and I am not sure that the core can
 continue up to config execution of something is really broken.
 
 I will have it in mind when I get some spare time.
 
 Cheers,
 Daniel
 
what about core parameter route_on_error=yes/no (default no)? If
  route on error is enabled, then sanity module will do the trick:
 
  route{
   if(!sanity_check(1159)) {
   xlog(L_INFO,Bad message from $proto:$si:$sp\n$mb\n);
   break;
   }
  
 
  It will be up to script writer what to do in main routing block if
  message parsing fails.
 
  On Friday 29 October 2010, Sergey Okhapkin wrote:
  It would be nice to get error_route back. The route was trivial in my
  cfg file:
 
  error_route {
   xlog(L_INFO,Bad message from $proto:$si:$sp\n$mb\n);
   drop();
  }
 
  On Friday 29 October 2010, Daniel-Constantin Mierla wrote:
  On 10/28/10 1:41 PM, Sergey Okhapkin wrote:
  I've found one more feature missed in 3.1 - error_route is eliminated
  and sanity module added. But if received SIP message is malformed and
  can't be parsed, routing script is not executed and I have no way to
  log the message to kamailio log. I did it in error_route before.
 
  This logging is important to me to support customers. SIP ALG in
  routers often breaks Via line :-(
 
  Since I developed error_route, I remember that it handled just sporadic
  cases, but I can add an event_route to pass the buffer and some hints
  to configuration file in case the initial parsing fails and the message
  is dropped before getting to config file.
 
  It is good to know that someone use such case, introduction of sanity
  was clearly mentioned and so far there was no complain.
 
  Cheers,
  Daniel
 
  On Thursday 28 October 2010, Daniel-Constantin Mierla wrote:
  On 10/26/10 2:22 PM, Sergey Okhapkin wrote:
  setdebug() function is no longer provided by core. How to change
  debug level dynamically in the script to trace execution of a few
  statements only?
 
  seems was lost in transition to 3.0, I will check to see what can be
  done with the new architecture.
 
  Thanks,
  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
 
  ___
  SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
  sr-users@lists.sip-router.org
  http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
 
  ___
  SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
  sr-users@lists.sip-router.org
  http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
 


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


Re: [SR-Users] setdebug() and 3.X

2010-10-28 Thread Sergey Okhapkin
I've found one more feature missed in 3.1 - error_route is eliminated and 
sanity module added. But if received SIP message is malformed and can't be 
parsed, routing script is not executed and I have no way to log the message to 
kamailio log. I did it in error_route before.

This logging is important to me to support customers. SIP ALG in routers often 
breaks Via line :-(

On Thursday 28 October 2010, Daniel-Constantin Mierla wrote:
 On 10/26/10 2:22 PM, Sergey Okhapkin wrote:
  setdebug() function is no longer provided by core. How to change debug
  level dynamically in the script to trace execution of a few statements
  only?
 
 seems was lost in transition to 3.0, I will check to see what can be
 done with the new architecture.
 
 Thanks,
 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] Sanity module documentation error?

2010-10-26 Thread Sergey Okhapkin
Correct, the page mentions old 3.0 error codes, but not new error codes 
returned by merged auth module. For example, functions return -3 for invalid 
user condition.

On Tuesday 26 October 2010, Daniel-Constantin Mierla wrote:
 On 10/26/10 12:56 PM, Sergey Okhapkin wrote:
  Documentation of auth_db module is wrong too, error codes returned by
  www_authorize and proxy_authorize are different.
 
 do you mean the last version of it?
 http://kamailio.org/docs/modules/3.1.x/modules_k/auth_db.html
 
 I did some fixes regarding the documentation last days.
 
 Cheers,
 Daniel
 
  On Tuesday 26 October 2010, Daniel-Constantin Mierla wrote:
  Hello,
 
  indeed, the readme was misleading, the function return false when a
  check fails. I updated the readme and committed to git.
 
  Thanks,
  Daniel
 
  On 10/25/10 12:48 AM, Sergey Okhapkin wrote:
  The routing script has
 
if(sanity_check(1159, 6)) {
xlog(L_INFO,Bad message from
  $proto:$si:$sp\n$mb\n); break;
}
 
  Seems like sanity_check function returns true is sanity check passes,
  but not failed. Am I right?
 
 0(14085) DEBUG:core   [receive.c:145]: After parse_msg...
 0(14085) DEBUG:core   [receive.c:186]: preparing to run routing
  scripts... 0(14085) DEBUG:core   [parser/parse_to.c:803]: end of
  header reached, state=10
 0(14085) DEBUG:core   [parser/msg_parser.c:185]: DEBUG:
  get_hdr_field:To  [35]; uri=[sip:167147...@204.74.213.5:5090]
 0(14085) DEBUG:core   [parser/msg_parser.c:187]: DEBUG: to body
  [sip:167147...@204.74.213.5:5090
  ]
 0(14085) DEBUG:core   [parser/msg_parser.c:165]: get_hdr_field:
  cseqCSeq:73   REGISTER
 0(14085) DEBUG:core   [parser/msg_parser.c:199]: DEBUG:
  get_hdr_body : content_length=0
 0(14085) DEBUG:core   [parser/msg_parser.c:101]: found end of
  header 0(14085) DEBUG:core   [parser/parse_to.c:174]: DEBUG:
  add_param: tag=jzbyj 0(14085) DEBUG:core   [parser/parse_to.c:803]:
  end of header reached, state=29
 0(14085) DEBUG: sanity [mod_sanity.c:217]: all sanity checks passed
 0(14085) INFO:script: Bad message from udp:71.59.87.156:5066
 
  ___
  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] setdebug() and 3.X

2010-10-26 Thread Sergey Okhapkin
setdebug() function is no longer provided by core. How to change debug level 
dynamically in the script to trace execution of a few statements only?

___
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] dictionary attacks

2010-10-24 Thread Sergey Okhapkin
I'm second for fail2ban. I block IP addresses with failed registration 
attempts for 1 hour. Here is my setup:

kamailio.cfg:

if (is_method(REGISTER)) {
if(www_authorize(, subscriber)  0) {
  if($rc == -1) {
 xlog(L_INFO,Invalid username from $proto:$si:$sp\n);
 sl_send_reply(200,OK);
   } else
 www_challenge(, 0);
   exit;
 }


/etc/fail2ban/filter.d/openser.conf:

[Definition]
#_daemon = kamailio
failregex = Invalid username from ...:HOST:

/etc/fail2ban/jail.conf:

findtime  = 600

[openser-iptables]
enabled  = true
filter   = openser
action   = iptables-allports[name=OPENSER, protocol=all]
logpath  = /var/log/openser/openser # Replace with your sr log location
maxretry = 10
bantime = 3600


On Sunday 24 October 2010, Uriel Rozenbaum wrote:
 Juha,
 
 I think we should be specially careful about black-lists. We receive
 many of these attacks in a per-day basis and a lot of them are from
 residential addresses or university, so I'm guessing some kind of worm
 or trojan performing the attack from various IPs.
 
 If you have the time, try fail2ban deamon. It can relate some
 brute-force events and act accordingly blocking an IP on iptables,
 executing a script. You send to jail those addresses for a period of
 time, then you can get them out again; and of course you can manually
 revert.
 
 Last, as a description of the attacks I saw, first it runs an NMAP
 like scan checking which IPs answer from 5060, then it starts sending
 registers (usually asterisk answers 404 if the user does not exist),
 then when the proxy challenges, it interprets the user is found and
 starts making dictionary attacks on the password (1234, admin, and so
 on). Keep safe complicated passwords, make kamailio challenge
 everything and you'll be safe. and again, fail2ban is a pretty good
 solution for brute force.
 
 This might help you finding a solution for your attacks.
 
 Cheers,
 Uriel
 
 On Sun, Oct 24, 2010 at 8:54 AM, Juha Heinanen j...@tutpro.com wrote:
  while doing some tests, i noticed that one of my proxies started to
  receive lots of register requests with different user names starting
  from a letter.  there was also invite attempts in the logs.  they came
  from ip 202.82.16.99 which according to traceroute is somewhere in
  china.
 
  should we start publishing a black list of these attack ip addresses?
 
  -- 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
 
 ___
 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] dictionary attacks

2010-10-24 Thread Sergey Okhapkin
Correction - auth module is merged in 3.1, but auth_db modules are still 
separate.

On Sunday 24 October 2010, Daniel-Constantin Mierla wrote:
 probably omitted by mistake, but please keep the mailing list cc-ed.
 
 On 10/24/10 3:38 PM, Sergey Okhapkin wrote:
  Note that I check return code of www_authorize to be -1 (invalid user)
  and block IP in this case only. Other error codes should not block the IP
  address.
 
 This one remembered me that in 3.1 we merged the auth modules and we
 used the one coming from ser because it has better nonce protection and
 other enhancements than kamailio version.
 
 That means the return codes have changed, the new ones are listed now at:
 http://kamailio.org/docs/modules/stable/modules_k/auth_db.html#id2753068
 
 Added also note in migration wiki page:
 http://www.kamailio.org/dokuwiki/doku.php/install:3.0.x-to-3.1.0#modules_k_
 auth_db
 
 Cheers,
 Daniel
 
  On Sunday 24 October 2010, you wrote:
  I watched live an attack on voipuser.org while running 3.1 before
  release. It lasted 18 hours. I didn't want to ban it because was useful
  for testing and see if it reveals any weak. In most of the cases it hit
  pike module. I got some data and plan to make an article about it soon.
 
  Anyhow, as a result of that, default config for kamailio has a section
  for detecting and banning such bad IPs, using pike to detect floods
  and htable to keep it blocked. Search WITH_ANTIFLOOD directive. It can
  be enhanced like you pointed here, so if the authorize fails, add the IP
  in the banned list stored in htable.
 
  Using fail2ban together with IP tables has the advantage of dropping the
  packets before getting to application and eating cpu, although in the
  case of voipuser.org the cpu was not affected much - the rate was
  170-200 requests per second.
 
  Cheers,
  Daniel
 
  On 10/24/10 3:06 PM, Sergey Okhapkin wrote:
  I'm second for fail2ban. I block IP addresses with failed registration
  attempts for 1 hour. Here is my setup:
 
  kamailio.cfg:
 
  if (is_method(REGISTER)) {
if(www_authorize(, subscriber)   0) {
  if($rc == -1) {
 xlog(L_INFO,Invalid username from
  $proto:$si:$sp\n); sl_send_reply(200,OK);
   } else
 www_challenge(, 0);
   exit;
 }
  
 
  /etc/fail2ban/filter.d/openser.conf:
 
  [Definition]
  #_daemon = kamailio
  failregex = Invalid username from ...:HOST:
 
  /etc/fail2ban/jail.conf:
 
  findtime  = 600
 
  [openser-iptables]
  enabled  = true
  filter   = openser
  action   = iptables-allports[name=OPENSER, protocol=all]
  logpath  = /var/log/openser/openser # Replace with your sr log location
  maxretry = 10
  bantime = 3600
 
  On Sunday 24 October 2010, Uriel Rozenbaum wrote:
  Juha,
 
  I think we should be specially careful about black-lists. We receive
  many of these attacks in a per-day basis and a lot of them are from
  residential addresses or university, so I'm guessing some kind of worm
  or trojan performing the attack from various IPs.
 
  If you have the time, try fail2ban deamon. It can relate some
  brute-force events and act accordingly blocking an IP on iptables,
  executing a script. You send to jail those addresses for a period of
  time, then you can get them out again; and of course you can manually
  revert.
 
  Last, as a description of the attacks I saw, first it runs an NMAP
  like scan checking which IPs answer from 5060, then it starts sending
  registers (usually asterisk answers 404 if the user does not exist),
  then when the proxy challenges, it interprets the user is found and
  starts making dictionary attacks on the password (1234, admin, and so
  on). Keep safe complicated passwords, make kamailio challenge
  everything and you'll be safe. and again, fail2ban is a pretty good
  solution for brute force.
 
  This might help you finding a solution for your attacks.
 
  Cheers,
  Uriel
 
  On Sun, Oct 24, 2010 at 8:54 AM, Juha Heinanenj...@tutpro.com   wrote:
  while doing some tests, i noticed that one of my proxies started to
  receive lots of register requests with different user names starting
  from a letter.  there was also invite attempts in the logs.  they
  came from ip 202.82.16.99 which according to traceroute is somewhere
  in china.
 
  should we start publishing a black list of these attack ip addresses?
 
  -- 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
 
  ___
  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

Re: [SR-Users] dictionary attacks

2010-10-24 Thread Sergey Okhapkin
I'm working on migration of my kamailio.cfg from v1.4 to 3.1 and stuck with 
weird problem:

 0(25026) ERROR: auth_db [authdb_mod.c:236]: empty parameter 1 not allowed
 0(25026) ERROR: core [route.c:1161]: fixing failed (code=-1) at 
cfg:/usr/local/etc/kamailio/kamailio.cfg.31:433
 0(25026) ERROR: core [route.c:1161]: fixing failed (code=-1) at 
cfg:/usr/local/etc/kamailio/kamailio.cfg.31:438
 0(25026) ERROR: core [route.c:1161]: fixing failed (code=-1) at 
cfg:/usr/local/etc/kamailio/kamailio.cfg.31:445
 0(25026) ERROR: core [route.c:1161]: fixing failed (code=-1) at 
cfg:/usr/local/etc/kamailio/kamailio.cfg.31:445
 0(25026) ERROR: core [route.c:1161]: fixing failed (code=-1) at 
cfg:/usr/local/etc/kamailio/kamailio.cfg.31:445
 0(25026) ERROR: core [route.c:1161]: fixing failed (code=-1) at 
cfg:/usr/local/etc/kamailio/kamailio.cfg.31:451
ERROR: error -1 while trying to fix configuration

The complained lines are calls like

proxy_authorize(, subscriber)
proxy_challenge(, 0)

According to auth_db module documentation the realm parameter can be an 
empty string, but code in modules_k/auth_db/authdb_mod.c line 236 explicitly 
checks that parameter value must be non-empty.


On Sunday 24 October 2010, Daniel-Constantin Mierla wrote:
 On 10/24/10 10:12 PM, Sergey Okhapkin wrote:
  Correction - auth module is merged in 3.1, but auth_db modules are still
  separate.
 
 yes, only auth modules were merged, like I wrote.
 
 auth_db functions use return codes and API functions from auth module.
 
 Cheers,
 Daniel
 
  On Sunday 24 October 2010, Daniel-Constantin Mierla wrote:
  probably omitted by mistake, but please keep the mailing list cc-ed.
 
  On 10/24/10 3:38 PM, Sergey Okhapkin wrote:
  Note that I check return code of www_authorize to be -1 (invalid user)
  and block IP in this case only. Other error codes should not block the
  IP address.
 
  This one remembered me that in 3.1 we merged the auth modules and we
  used the one coming from ser because it has better nonce protection and
  other enhancements than kamailio version.
 
  That means the return codes have changed, the new ones are listed now
  at:
  http://kamailio.org/docs/modules/stable/modules_k/auth_db.html#id2753068
 
  Added also note in migration wiki page:
  http://www.kamailio.org/dokuwiki/doku.php/install:3.0.x-to-3.1.0#modules
 _k_ auth_db
 
  Cheers,
  Daniel
 
  On Sunday 24 October 2010, you wrote:
  I watched live an attack on voipuser.org while running 3.1 before
  release. It lasted 18 hours. I didn't want to ban it because was
  useful for testing and see if it reveals any weak. In most of the
  cases it hit pike module. I got some data and plan to make an article
  about it soon.
 
  Anyhow, as a result of that, default config for kamailio has a section
  for detecting and banning such bad IPs, using pike to detect floods
  and htable to keep it blocked. Search WITH_ANTIFLOOD directive. It can
  be enhanced like you pointed here, so if the authorize fails, add the
  IP in the banned list stored in htable.
 
  Using fail2ban together with IP tables has the advantage of dropping
  the packets before getting to application and eating cpu, although in
  the case of voipuser.org the cpu was not affected much - the rate was
  170-200 requests per second.
 
  Cheers,
  Daniel
 
  On 10/24/10 3:06 PM, Sergey Okhapkin wrote:
  I'm second for fail2ban. I block IP addresses with failed
  registration attempts for 1 hour. Here is my setup:
 
  kamailio.cfg:
 
  if (is_method(REGISTER)) {
 if(www_authorize(, subscriber)0) {
   if($rc == -1) {
  xlog(L_INFO,Invalid username from
  $proto:$si:$sp\n); sl_send_reply(200,OK);
} else
  www_challenge(, 0);
exit;
  }
  
 
  /etc/fail2ban/filter.d/openser.conf:
 
  [Definition]
  #_daemon = kamailio
  failregex = Invalid username from ...:HOST:
 
  /etc/fail2ban/jail.conf:
 
  findtime  = 600
 
  [openser-iptables]
  enabled  = true
  filter   = openser
  action   = iptables-allports[name=OPENSER, protocol=all]
  logpath  = /var/log/openser/openser # Replace with your sr log
  location maxretry = 10
  bantime = 3600
 
  On Sunday 24 October 2010, Uriel Rozenbaum wrote:
  Juha,
 
  I think we should be specially careful about black-lists. We receive
  many of these attacks in a per-day basis and a lot of them are from
  residential addresses or university, so I'm guessing some kind of
  worm or trojan performing the attack from various IPs.
 
  If you have the time, try fail2ban deamon. It can relate some
  brute-force events and act accordingly blocking an IP on iptables,
  executing a script. You send to jail those addresses for a period
  of time, then you can get them out again; and of course you can
  manually revert.
 
  Last, as a description of the attacks I saw, first it runs an NMAP
  like scan checking which IPs answer from 5060, then it starts
  sending

Re: [SR-Users] realm param for auth functons (was: Re: dictionary attacks)

2010-10-24 Thread Sergey Okhapkin
Thanks! Kamailio is up. Now I need to make it working... :-)

On Sunday 24 October 2010, Daniel-Constantin Mierla wrote:
 please start a new email each time you have a different topic, do not
 reply to old messages, otherwise the subject is misleading and the
 discussion gets in former email thread.
 
 Use as first parameter $fd for proxy_authorize() and $td for
 www_authorize() (same for challenge counterpaths) -- you can see the
 kamailio.cfg shipped with 3.1. These were the implicit values taken when
 the parameter was empty in the older versions. 3.1 deliberately asks for
 the the parameter, the docs have to be updated.
 
 Cheers,
 Daniel
 
 On 10/24/10 10:44 PM, Sergey Okhapkin wrote:
  I'm working on migration of my kamailio.cfg from v1.4 to 3.1 and stuck
  with weird problem:
 
0(25026) ERROR: auth_db [authdb_mod.c:236]: empty parameter 1 not
  allowed 0(25026) ERROR:core  [route.c:1161]: fixing failed (code=-1) at
  cfg:/usr/local/etc/kamailio/kamailio.cfg.31:433
0(25026) ERROR:core  [route.c:1161]: fixing failed (code=-1) at
  cfg:/usr/local/etc/kamailio/kamailio.cfg.31:438
0(25026) ERROR:core  [route.c:1161]: fixing failed (code=-1) at
  cfg:/usr/local/etc/kamailio/kamailio.cfg.31:445
0(25026) ERROR:core  [route.c:1161]: fixing failed (code=-1) at
  cfg:/usr/local/etc/kamailio/kamailio.cfg.31:445
0(25026) ERROR:core  [route.c:1161]: fixing failed (code=-1) at
  cfg:/usr/local/etc/kamailio/kamailio.cfg.31:445
0(25026) ERROR:core  [route.c:1161]: fixing failed (code=-1) at
  cfg:/usr/local/etc/kamailio/kamailio.cfg.31:451
  ERROR: error -1 while trying to fix configuration
 
  The complained lines are calls like
 
  proxy_authorize(, subscriber)
  proxy_challenge(, 0)
 
  According to auth_db module documentation the realm parameter can be an
  empty string, but code in modules_k/auth_db/authdb_mod.c line 236
  explicitly checks that parameter value must be non-empty.
 
  On Sunday 24 October 2010, Daniel-Constantin Mierla wrote:
  On 10/24/10 10:12 PM, Sergey Okhapkin wrote:
  Correction - auth module is merged in 3.1, but auth_db modules are
  still separate.
 
  yes, only auth modules were merged, like I wrote.
 
  auth_db functions use return codes and API functions from auth module.
 
  Cheers,
  Daniel
 
  On Sunday 24 October 2010, Daniel-Constantin Mierla wrote:
  probably omitted by mistake, but please keep the mailing list cc-ed.
 
  On 10/24/10 3:38 PM, Sergey Okhapkin wrote:
  Note that I check return code of www_authorize to be -1 (invalid
  user) and block IP in this case only. Other error codes should not
  block the IP address.
 
  This one remembered me that in 3.1 we merged the auth modules and we
  used the one coming from ser because it has better nonce protection
  and other enhancements than kamailio version.
 
  That means the return codes have changed, the new ones are listed now
  at:
  http://kamailio.org/docs/modules/stable/modules_k/auth_db.html#id27530
 68
 
  Added also note in migration wiki page:
  http://www.kamailio.org/dokuwiki/doku.php/install:3.0.x-to-3.1.0#modul
 es _k_ auth_db
 
  Cheers,
  Daniel
 
  On Sunday 24 October 2010, you wrote:
  I watched live an attack on voipuser.org while running 3.1 before
  release. It lasted 18 hours. I didn't want to ban it because was
  useful for testing and see if it reveals any weak. In most of the
  cases it hit pike module. I got some data and plan to make an
  article about it soon.
 
  Anyhow, as a result of that, default config for kamailio has a
  section for detecting and banning such bad IPs, using pike to
  detect floods and htable to keep it blocked. Search WITH_ANTIFLOOD
  directive. It can be enhanced like you pointed here, so if the
  authorize fails, add the IP in the banned list stored in htable.
 
  Using fail2ban together with IP tables has the advantage of dropping
  the packets before getting to application and eating cpu, although
  in the case of voipuser.org the cpu was not affected much - the rate
  was 170-200 requests per second.
 
  Cheers,
  Daniel
 
  On 10/24/10 3:06 PM, Sergey Okhapkin wrote:
  I'm second for fail2ban. I block IP addresses with failed
  registration attempts for 1 hour. Here is my setup:
 
  kamailio.cfg:
 
  if (is_method(REGISTER)) {
  if(www_authorize(, subscriber) 0) {
if($rc == -1) {
   xlog(L_INFO,Invalid username from
  $proto:$si:$sp\n); sl_send_reply(200,OK);
 } else
   www_challenge(, 0);
 exit;
   }
  
 
  /etc/fail2ban/filter.d/openser.conf:
 
  [Definition]
  #_daemon = kamailio
  failregex = Invalid username from ...:HOST:
 
  /etc/fail2ban/jail.conf:
 
  findtime  = 600
 
  [openser-iptables]
  enabled  = true
  filter   = openser
  action   = iptables-allports[name=OPENSER, protocol=all]
  logpath  = /var/log/openser/openser # Replace with your sr log
  location maxretry = 10
  bantime = 3600

Re: [SR-Users] Record-route issue in Kamailio 3.0.3

2010-10-14 Thread Sergey Okhapkin
Is Record-Route: a,b,c

analog of

Record-Route: a
Record-Route: b
Record-Route: c

or

Record-Route: c
Record-Route: b
Record-Route: a

?

On Thursday 14 October 2010, Juha Heinanen wrote:
 Morten Isaksen writes:
  When OpenSer sends the message to Kamailio the recourd-routes look like
  this:
 
  Record-Route: sip:x.x.248.20;r2=on;lr;ftag=3d9e7d131b
  Record-Route: sip:x.x.248.20;transport=tcp;r2=on;lr;ftag=3d9e7d131b
 
  But when the message comes back from Kamailio it is:
  Record-Route:
  sip:x.x.248.7;lr=on;ftag=3d9e7d131b;did=584.1a683a45,sip:x.x.248.20;r2
 =on;lr;ftag=3d9e7d131b,sip:x.x.248.20;transport=tcp;r2=on;lr;ftag=3d9e7d
 131b
 
  OpenSER forwards the message to the OCS with Record-route unchanged
  and the OCS gets confused and does not reply.
 
 then file a bug to ocs folks, because ocs should understand r-r header
 that contains more than one entry.
 
 -- 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
 


___
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] Can this be done with xhttp module (3.1 devel)?

2010-10-01 Thread Sergey Okhapkin
I need to get http request with xhttp module, process request parameters, 
build SIP request (based on received http parameters), receive SIP reply and 
send http response back based on SIP reply. HTTP part is simple, but how to 
send SIP request from event_route[xhttp:request] and get SIP reply?

uac_req_send() function doesn't wait for SIP reply, t_uac_dlg MI command does 
everything needed but is not accessible from config script. Any other 
ideas/suggestions?

___
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] Can this be done with xhttp module (3.1 devel)?

2010-10-01 Thread Sergey Okhapkin
There is a way, t_uac_dlg MI does that. I wonder why something similar is not 
available from cfg script. You can issue http request and wait for response 
from cfg, it would be nice to have  t_uac_dlg() script function too.

I have no problem to run apache and invoke t_uac_dlg from CGI, but I'd prefer 
to avoid cgi overhead and implement kamailio-only based solution.

On Friday 01 October 2010, Alex Balashov wrote:
 Sergey,
 
 There is no way to get Kamailio to wait for a reply.  You would have
 to come up with some sort of asynchronous means of providing the reply
 result to the waiting HTTP client that is prompted by a reply on the
 Kamailio side also asynchronously.
 
 -- Alex
 
 On 10/01/2010 11:56 AM, Sergey Okhapkin wrote:
  I need to get http request with xhttp module, process request parameters,
  build SIP request (based on received http parameters), receive SIP reply
  and send http response back based on SIP reply. HTTP part is simple, but
  how to send SIP request from event_route[xhttp:request] and get SIP
  reply?
 
  uac_req_send() function doesn't wait for SIP reply, t_uac_dlg MI command
  does everything needed but is not accessible from config script. Any
  other ideas/suggestions?
 
  ___
  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] Can this be done with xhttp module (3.1 devel)?

2010-10-01 Thread Sergey Okhapkin
 t_uac_dlg returns final response to the initiated request. I don't know if it 
really waits for the response or uses some kind of async callback.

On Friday 01 October 2010, Alex Balashov wrote:
 Sergey,
 
 On 10/01/2010 06:11 PM, Sergey Okhapkin wrote:
  There is a way, t_uac_dlg MI does that. I wonder why something similar is
  not available from cfg script. You can issue http request and wait for
  response from cfg, it would be nice to have  t_uac_dlg() script function
  too.
 
 You can send a request from script, sure.  That's what uac_req_send()
 does;  t_uac_dlg is just its MI equivalent, allowing that action to be
 externally stimulated.  Unless I am missing something that is not in
 the documentation, t_uac_dlg does not wait for a reply either.  Or
 does it?  I have not used it.
 
  I have no problem to run apache and invoke t_uac_dlg from CGI, but I'd
  prefer to avoid cgi overhead and implement kamailio-only based solution.
 
 Understandably.  However, generally speaking, the architecture of
 Kamailio, and the entire *SER technology stack, is patterned after a
 strictly (external) event-driven process.  This means that route
 script is invoked only when messages are received;  some state
 information can be retained across sets of related messages
 (transactions, dialogs, etc.), but in principle, Kamailio does not sit
 around and block, waiting for replies to come back.
 
 Given the present architecture, waiting on a response would be
 additionally problematic because Kamailio/sip-router does not use
 threads per se.  It spawns a set of forked processes which act as
 worker threads that are specialised into different roles, but these
 are finite in nature.  It would be catastrophic to throughput to have
 one of these pause and block, waiting on a reply before returning from
 an invocation of route script for a given message.
 


___
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] Can this be done with xhttp module (3.1 devel)?

2010-10-01 Thread Sergey Okhapkin
Yes, it returns final SIP response back. Checked with kamailio/opensips 1.4, 
kamailio 1.5 and 3.1

On Friday 01 October 2010, Alex Balashov wrote:
 On 10/01/2010 07:24 PM, Sergey Okhapkin wrote:
t_uac_dlg returns final response to the initiated request. I don't know
  if it really waits for the response or uses some kind of async callback.
 
 Really?  Very interesting.  The documentation does not say that it
 does that at all, although that is not uncommon with this product.  :-)
 


___
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] Can this be done with xhttp module (3.1 devel)?

2010-10-01 Thread Sergey Okhapkin
I never checked with datagram/RPC, I use MI FIFO for that in production 
environment.

On Friday 01 October 2010, Alex Balashov wrote:
 On 10/01/2010 07:38 PM, Sergey Okhapkin wrote:
  Yes, it returns final SIP response back. Checked with kamailio/opensips
  1.4, kamailio 1.5 and 3.1
 
 Does it do this with the MI FIFO interface too, or just datagram/RPC?
 
 If it does it only via datagram or RPC, this is quite logical because
 the client stays connected and keeps listening for events.
 


___
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