Re: [SR-Users] siptrace and duplicate_uri - not forwarding the packets

2012-03-07 Thread Mino Haluz
Hm, the same settings works on testing 3.2.1. But this is not the solution
- I have to get it working on 3.2.0...

On Tue, Mar 6, 2012 at 5:16 PM, Mino Haluz mino.ha...@gmail.com wrote:

 Hi,

 I have siptrace working but when I set duplicate_uri, no packet is sent to
 the destination. Was there some bug fix or anything I have to set further?
 There is nothing in syslog, siptrace locally is stored fine.

 modparam(siptrace, db_url, mysql://localhost/kamailio) #
 Database URL
 # modparam(siptrace, traced_user_avp, $avp(s:traced_user))
 modparam(siptrace, trace_on,1)
 modparam(siptrace, trace_flag,  22) # Flag is used to
 mark messages to trace
 modparam(siptrace, trace_sl_acks,0) # Do not trace
 ACKs separately. They are traced during normal sip_trace()
 modparam(siptrace, duplicate_uri, sip:IP1:5060)

 kamailio 3.2.0

 Thanks

 Mino

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


Re: [SR-Users] sr-users Digest, Vol 82, Issue 21

2012-03-07 Thread Javier Gallart
Hello

this is what I normally use:

if (defined $var(x)) {...}

Regards

Javi


 --

 Message: 4
 Date: Tue, 6 Mar 2012 20:05:32 -0600
 From: Krishna Kurapati kkura...@gmail.com
 Subject: [SR-Users] Improving Kamailo configuration parser ...
 To: kamailio users sr-users@lists.sip-router.org
 Message-ID:
caozcjafcarq+ht3r+mwckpyavjh+evfwna_hj6tahgyd2da...@mail.gmail.com
 
 Content-Type: text/plain; charset=iso-8859-1

 I used

 if ($var(x) != null) { ... }

 in one of the routes, and tried to run Kamailio server.
 The server exited with an error. I did not know why.

 Once I changed it to if ($var(x) != $null) {} the error went away.
 I missed $ infront null. I think it is hard to trace such problems once a
 large chunk
 of logic is written since many of us come from C++ and scripting background
 where $null
 is not a common practice.

 Also if I tried to use if (!$var(x)) { ... } Kamailio tries to convert the
 value of $var(x) to integer.
 prints WARNINGS in the log when the $var(x) consists of a string.

 Krish Kura
 -- next part --
 An HTML attachment was scrubbed...
 URL: 
 http://lists.sip-router.org/pipermail/sr-users/attachments/20120306/d591f3b0/attachment-0001.htm
 

 --


___
SIP Express Router (SER) 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] Advice on placement of t_replicate (REGISTER)

2012-03-07 Thread Asgaroth

Hi Guru's,

I'd just like some advice on t_replace and its placement in the routing 
script.


A lot of examples show the following setup:

save(location);
t_replicate(backup_server);

Would it not be wiser to have something like:

if (save(location)) {
  t_replcate(backup_server);
}

Would there be any scenario where you would want to t_replicate if 
save(location) fails for some reason? The configuration I refer to is 
if the location database is in memory. I suspect you may want to 
replicate all if location is going to db core in case of external 
failure. But would it matter on the placement if the location was in memory?


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] default IP to forward TCP request

2012-03-07 Thread Laurent Schweizer
Hello all,

 

I have a linux server with different IP.

 

eth0 - 10.2.2.4

eth0:1 - 10.2.2.5

 

 

I have kamailio listening on IP:

 

listen=udp:10.2.2.5:5060

listen=tcp:10.2.2.5:5060

 

and in the script I do :

 

rewritehostport(10.2.2.10:5060;transport=tcp);

 

if (!t_relay()) {

sl_reply_error();

}

exit;

 

 

the problem is that t_relay is not using the IP  10.2.2.5 to forward this
SIP request but the eth0 IP ( 10.2.2.4)

 

I see that they is a function force_send_socket , I need to use this
function to set the correct IP used to forward the request ?

 

As I'm using only one IP 10.2.2.5 for openser, why he cannot always use this
ip  as default Ip ?

 

Best regards

 

Laurent

 

 

___
SIP Express Router (SER) 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] Limiting registrations to known users without auth

2012-03-07 Thread Pedro Antonio Vico Solano
Thanks for the clarification, Daniel.

I've tried the 'sqlops' solution but
there is something wrong. Is sqlops compatible with the db_text DB?

I've tried:

modparam(sqlops,sqlcon,ca=text:///etc/kamailio/dbtext)
...
sql_query(ca, select
* from uri, ra);
xlog(rows: $dbr(ra=rows) cols:
$dbr(ra=cols)\n);
sql_result_free(ra);
...

It gives a segmentation fault.

Thanks  BR,
Pedro




De:   
Daniel-Constantin Mierla
mico...@gmail.com
Para:   
SIP Router -
Kamailio (OpenSER) and SIP Express Router (SER) - Users Mailing List
sr-users@lists.sip-router.org
cc:   
Pedro Antonio Vico
Solano pvsol...@amper.es
Fecha:   
02/03/2012 10:04
Asunto:  
 Re: [SR-Users]
Limiting registrations to known users without auth




Hello,

check_to() matches to see if the authenticated user is allowed to use the
address in the To header, so it has to be called for authenticated requests.

does_uri_exist() is checking to see if r-uri address is a valid local subscriber,
but it does not have an option take it from To header.

What you can do is to use sqlops module to do a query and check if the
address (or user part of it) in To header is matching a record (username
and eventually the domain) in subscriber table.

Cheers,
Daniel

On 3/1/12 6:10 PM, Pedro Antonio Vico Solano wrote: 
Hello, 

I'm trying to restrict registrations based on the username/number but without
authentication. I'm using uri_db module, the URI table and
the check_to() function. But when a user tries to register Kamailio 3.1.5
says the following error: 

0(11832) ERROR: uri_db [checks.c:71]: No authorized credentials found (error
in scripts) 
0(11832) ERROR: uri_db [checks.c:72]: Call {www,proxy}_authorize before
calling check_* functions! 

I've read README from uri_db and seems to be possible doing it the way
I do. I have the following configuration: 

modparam(usrloc|uri_db, db_url, text:///etc/kamailio/dbtext)

modparam(uri_db, db_table, uri)

modparam(uri_db, use_uri_table, 1)


route{ 
... 
check_to() 
... 
} 

am I doing right? 

Thanks  BR, 
Pedro
ADVERTENCIA 

Este mensaje y/o sus anexos, pueden contener información personal y confidencial
cuyo uso, reproducción o distribución no autorizados están legalmente
prohibidos. Por lo tanto, si Vd. no fuera su destinatario y, erróneamente,
lo hubiera recibido, le rogamos que informe al remitente y lo borre de
inmediato.

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

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

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

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


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

ADVERTENCIA 

Este mensaje y/o sus anexos, pueden contener información personal y confidencial
cuyo uso, reproducción o distribución no autorizados están legalmente prohibidos.
Por lo tanto, si Vd. no fuera su destinatario y, erróneamente, lo hubiera
recibido, le rogamos que informe al remitente y lo borre de inmediato.

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

Re: [SR-Users] Limiting registrations to known users without auth

2012-03-07 Thread Ovidiu Sas
db_text doesn't have sql capabilites (I think it should be mentioned
in the documentation).
Also, it should not crash too (this is a bug that needs to be
addressed - please open a bug and provide a backtrace).

If you don't want to use a truedb, you can try to use sqlite:
http://kamailio.org/docs/modules/stable/modules_k/db_sqlite.html
This should be compatible with sqlops.

Regards,
Ovidiu Sas

-- 
VoIP Embedded, Inc.
http://www.voipembedded.com

On Wed, Mar 7, 2012 at 11:18 AM, Pedro Antonio Vico Solano
pvsol...@amper.es wrote:
 Thanks for the clarification, Daniel.

 I've tried the 'sqlops' solution but there is something wrong. Is sqlops
 compatible with the db_text DB?

 I've tried:

 modparam(sqlops,sqlcon,ca=text:///etc/kamailio/dbtext)
 ...
 sql_query(ca, select * from uri, ra);
 xlog(rows: $dbr(ra=rows) cols: $dbr(ra=cols)\n);
 sql_result_free(ra);
 ...

 It gives a segmentation fault.

 Thanks  BR,
 Pedro




 De:        Daniel-Constantin Mierla mico...@gmail.com
 Para:        SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) -
 Users Mailing List sr-users@lists.sip-router.org
 cc:        Pedro Antonio Vico Solano pvsol...@amper.es
 Fecha:        02/03/2012 10:04
 Asunto:        Re: [SR-Users] Limiting registrations to known users without
 auth
 



 Hello,

 check_to() matches to see if the authenticated user is allowed to use the
 address in the To header, so it has to be called for authenticated requests.

 does_uri_exist() is checking to see if r-uri address is a valid local
 subscriber, but it does not have an option take it from To header.

 What you can do is to use sqlops module to do a query and check if the
 address (or user part of it) in To header is matching a record (username and
 eventually the domain) in subscriber table.

 Cheers,
 Daniel

 On 3/1/12 6:10 PM, Pedro Antonio Vico Solano wrote:
 Hello,

 I'm trying to restrict registrations based on the username/number but
 without authentication. I'm using uri_db module, the URI table and the
 check_to() function. But when a user tries to register Kamailio 3.1.5 says
 the following error:

 0(11832) ERROR: uri_db [checks.c:71]: No authorized credentials found (error
 in scripts)
 0(11832) ERROR: uri_db [checks.c:72]: Call {www,proxy}_authorize before
 calling check_* functions!

 I've read README from uri_db and seems to be possible doing it the way I do.
 I have the following configuration:

 modparam(usrloc|uri_db, db_url, text:///etc/kamailio/dbtext)
 modparam(uri_db, db_table, uri)
 modparam(uri_db, use_uri_table, 1)

 route{
        ...
        check_to()
        ...
 }

 am I doing right?

 Thanks  BR,
 Pedro
 ADVERTENCIA

 Este mensaje y/o sus anexos, pueden contener información personal y
 confidencial cuyo uso, reproducción o distribución no autorizados están
 legalmente prohibidos. Por lo tanto, si Vd. no fuera su destinatario y,
 erróneamente, lo hubiera recibido, le rogamos que informe al remitente y lo
 borre de inmediato.

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

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

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

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


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

 ADVERTENCIA

 Este mensaje y/o sus anexos, pueden contener información personal y
 confidencial cuyo uso, reproducción o 

[SR-Users] Rewrite $tU

2012-03-07 Thread Lucas Alvarez
I want rewrite $tU but I'm not being able, I'm doing the following:

   remove_hf(To);
  insert_hf(To: sip:$rU@$rd\r\n, From);
___
SIP Express Router (SER) 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] Rewrite $tU

2012-03-07 Thread Alex Balashov

Note that proxies shouldn't be doing that.

On 03/07/2012 01:34 PM, Lucas Alvarez wrote:


I want rewrite $tU but I'm not being able, I'm doing the following:

remove_hf(To);
   insert_hf(To: sip:$rU@$rd\r\n, From);



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



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

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


[SR-Users] Rewrite $tU

2012-03-07 Thread Lucas Alvarez
I want rewrite $tU but I'm not being able, I'm doing the following:

  remove_hf(To);
  insert_hf(To: sip:$rU@$rd\r\n, From);

Then I'm printing $tU and it is still having the previous value, any help
will be appreciated.
Thanks in advance.

Lucas Alvarez
___
SIP Express Router (SER) 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] Rewrite $tU

2012-03-07 Thread Dani Popa
Hi,

I think you should use uac_replace_from/uac_replace_to.

Dani

On Wed, Mar 7, 2012 at 8:37 PM, Lucas Alvarez luca...@gmail.com wrote:

 I want rewrite $tU but I'm not being able, I'm doing the following:

   remove_hf(To);
   insert_hf(To: sip:$rU@$rd\r\n, From);

 Then I'm printing $tU and it is still having the previous value, any help
 will be appreciated.
 Thanks in advance.

 Lucas Alvarez



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




-- 
Dani Popa
___
SIP Express Router (SER) 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] Rewrite $tU

2012-03-07 Thread Alex Balashov

On 03/07/2012 01:41 PM, Dani Popa wrote:


I think you should use uac_replace_from/uac_replace_to.


http://www.kamailio.org/docs/modules/3.2.x/modules_k/uac.html

Where do you see uac_replace_to()?  :)

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

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


Re: [SR-Users] Rewrite $tU

2012-03-07 Thread Andrew Pogrebennyk
On 03/07/2012 07:37 PM, Lucas Alvarez wrote:
 I want rewrite $tU but I'm not being able, I'm doing the following:
 
   remove_hf(To);
   insert_hf(To: sip:$rU@$rd\r\n, From);
 
 Then I'm printing $tU and it is still having the previous value, any
 help will be appreciated.
 Thanks in advance.

Did you verify what is actually sent on the wire?
If it's just a logging issue you need to do msg_apply_changes().

___
SIP Express Router (SER) 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] Backing up htable to SQL table ...

2012-03-07 Thread Krishna Kurapati
Any help on how to backup the htable content to database table?

Thanks

On Tue, Mar 6, 2012 at 5:28 PM, Krishna Kurapati kkura...@gmail.com wrote:

 I did little more digging into htable source code. It looks like syncing
 to database is happening when the module is being
 destroyed.

 To see if this is working, I tried to stop Kamailio and looked into the
 database. The htable is still empty. Any configuration
 changes required to make the process happen?

 Thanks
 Krish Kura

 On Tue, Mar 6, 2012 at 8:38 AM, Krishna Kurapati kkura...@gmail.comwrote:

 Hi,

 This is my first time attempt using htable module.
 How can I back up the htable content in the database incase the server
 restarts. I saw a htable in the MySQL database.
 My observation has been that htable module is not automatically backing
 up to database even though I added
 modparams to point to the database. Do I need to explicitly backup htable
 content to database using sqlops or some
 other mechanism?

 Thanks
 Krish Kura



___
SIP Express Router (SER) 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] Backing up htable to SQL table ...

2012-03-07 Thread Daniel-Constantin Mierla
Hello,

you have to set dbmode=1 when defining the hash table:

http://kamailio.org/docs/modules/stable/modules_k/htable.html#id2541457

Cheers,
Daniel

On Thu, Mar 8, 2012 at 4:48 AM, Krishna Kurapati kkura...@gmail.com wrote:

 Any help on how to backup the htable content to database table?

 Thanks

 On Tue, Mar 6, 2012 at 5:28 PM, Krishna Kurapati kkura...@gmail.comwrote:

 I did little more digging into htable source code. It looks like syncing
 to database is happening when the module is being
 destroyed.

 To see if this is working, I tried to stop Kamailio and looked into the
 database. The htable is still empty. Any configuration
 changes required to make the process happen?

 Thanks
 Krish Kura

 On Tue, Mar 6, 2012 at 8:38 AM, Krishna Kurapati kkura...@gmail.comwrote:

 Hi,

 This is my first time attempt using htable module.
 How can I back up the htable content in the database incase the server
 restarts. I saw a htable in the MySQL database.
 My observation has been that htable module is not automatically backing
 up to database even though I added
 modparams to point to the database. Do I need to explicitly backup
 htable content to database using sqlops or some
 other mechanism?

 Thanks
 Krish Kura




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




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