Re: [SR-Users] get server parameters from DB when kamailio starts

2012-02-14 Thread Daniel-Constantin Mierla

Hello,

On 2/13/12 7:48 PM, Uri Shacked wrote:

thanks.
i find the htable module a little confusing, or a little harder to 
understand. (although i said so on the mtree and today i find myself 
using it a lot).


you have to understand first the structures behind it:

http://en.wikipedia.org/wiki/Hash_table

In few words, it is a generic storage in shared memory, of pairs (key, 
value) -- the key is a string and the value can be string or integer.


$sht(x=a) = b; -- this means storing in hash table 'x' a pair (a, 
b), getting the value is just using $sht(x=a)


The items in a hash table can be loaded from a database table at 
startup, you don't need event_route[htable:mod-init] and sqlops for that.


Cheers,
Daniel

but, i notice at the end of the doc at section 7 to the 
event_route[htable:mod-init].
i wonder, if i just load the htable module, and on this route, perform 
an SQL query and save the values in $shv(), will it do the trick?

cheers,
uri
On Mon, Feb 13, 2012 at 5:34 PM, Daniel-Constantin Mierla 
mico...@gmail.com mailto:mico...@gmail.com wrote:


Hello,


On 2/10/12 2:32 PM, Uri Shacked wrote:

thanks,
it is good see there is a wayto start with -A... and it
might make it easier a little (cause i use the define as the
group the server belongs to).
but, it doesn't help me fully in my case.
i would like to have a generic start, and generic cfg file (it is
much easier when you need to maintain).
the best thing i would like to do is something like that:
let say i have route on start or get data from DB on start...
then, i set something like:
get myself
from list of kamailio servers
and set my group to the value set on me
it seems to me something very usefull, when you use 2 and more
kamailio at different sites, and still want a generic code and
functions.
if i was a programer... i might try to write some module :-)

you can load values from a database table via htable module and
then use them to build the logic -- htable values are accessible
via $sht(...).

Cheers,
Daniel


thanks anyway,
Uri

On Fri, Feb 10, 2012 at 2:51 PM, Daniel-Constantin Mierla
mico...@gmail.com mailto:mico...@gmail.com wrote:

Hello,

you can use defines to control the order (the values of NP
servers), here is an example of defining NP servers (to str
value, for sake of explanation):

#!ifdef SRV1
#!define NPSRV1 abc
#!define NPSRV2 xyz
#!else
#!define NPSRV2 abc
#!define NPSRV1 xyz
#!endif

and start kamailio with parameter '-A SRV1' for the first
instance.

Cheers,
Daniel



On 2/10/12 6:28 AM, Uri Shacked wrote:

Hi again...
(i do find myself ask many questions these days :-))

well, now here is one more:

i have 2 kamailio servers that i use in 2 locations. both
use the same
tables and DBURL.
each of my server turns to a number portability (NP) server
at its same
location.
for example, if server 1 has the call, it will turn to NP
server 1 with the
query, and if the query fails, it will then turn to NP server 2.
the kamailio server 2 does the same. but, turns to NP server
2 first and if
it fails, to NP server 1.

once this is understood

here is my issue - i want to have 1 generic cfg file for my
2 servers.
today, i use the same cfg file, but in server 1 i set it in
the cfg to its
group, and on server 2 the same but a different group

i tried to understand how do i get each server to pull its
group from the
DB. something like what is my group when my IP is X.Y.Z.Q ?
i raed the cfg_db module but didn't understand how to set it
on my cfg file
and on the DB.

what is the best way to do what i want?
hope i was clear

BR,
thanks to all the guys that help me so far, i appriciate it
a lot!
Uri


___
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://www.asipto.com  http://www.asipto.com/

http://linkedin.com/in/miconda  -- http://twitter.com/miconda




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


-- 
Daniel-Constantin Mierla --http://www.asipto.com  http://www.asipto.com/


Re: [SR-Users] CAcert root in Lumicall

2012-02-14 Thread Daniel-Constantin Mierla

Hello,

On 2/9/12 11:52 PM, Daniel Pocock wrote:


On 09/02/12 21:49, Daniel-Constantin Mierla wrote:

Hello,

On 2/9/12 5:21 PM, Daniel Pocock wrote:

On 09/02/12 01:41, Daniel Pocock wrote:

I've been contemplating Daniel's earlier question about using the CAcert
certificates with Lumicall

sip5060.net should already accept mutual authentication from other
Kamailio instances running with a CAcert certificate

However, the Lumicall dialer itself will only connect to servers that
are using a cert signed by a root CA trusted within Android.  This
applies to both the SIP and STUN over TLS support.


CAcert.org now supported...

nice...

Installing Lumicall does not change the trusted CAs for all apps on the
phone.  It only adds the CACert (class 1 root) for the SIP TLS transport
within the app.  This means you can use a CAcert.org cert on a Kamailio
server, and Lumicall will trust it.

On a side note, I've noticed that CAcert.org is allowing subjectAltName
(DNSName) within the certs it issues: this is another good reason to use
the CAcert.org certs, other CAs are quite awkward (or expensive) for
subjectAltName, and it is really useful for running multiple/virtual
hosted domains on a single SIP server.

I would be interested in any feedback about this, either for the
Lumicall app, or the interconnect to/from sip5060.net over TLS

is it available for download out of the android market? I have an
android phone (I guess it is 2.2), but haven't connected it to the
market -- I guess I can just use my gmail account for that, still I
would take the direct download alternative first, if available (the
phone has a settings that allow installation of untrusted source
applications).

I've put it on the site for you to download:

http://www.lumicall.org/download

Android 2.2 is probably the minimum version supported


I can try it with my kamailio over tls, not sure when exactly I will
have the time for it in the next days.


If you don't want to register for the SIP5060 service, you can just put
dummy values in the registration form, it will then let you get to the
menu and add your own SIP details
I installed it from the download page, worked fine on android 2.2 -- had 
no time to test it yet, but I noticed some warning messages during 
installation. Not sure if it is specific for each android phone type or 
for android in general, but I was alerted that I will allow the 
application do to a lot of nasty things, like taking my gps position, 
making calls that can cost me money, etc... Being open source and people 
like myself a devel could check and be safe about if they have a doubt, 
but I wonder if usual people will not become afraid of installing it.


Is it so only when installing from untrusted sources, or also when 
getting it from the android market? Are all these accesses to various 
resources and actions needed?


Cheers,
Daniel

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


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


Re: [SR-Users] Dialogs not removed from memory, and occasionally persistent in DB as well

2012-02-14 Thread Øyvind Kolbu
On 2012-02-14 at 11:38, Daniel-Constantin Mierla wrote:
 can you create the transaction with t_newtran() somewhere before calling 
 dlg manage? It should absorb retransmissions before going into dialog 
 processing. After creating the transaction, use either send_reply() or 
 t_reply() instead of sl_send_reply().

Can try that, but as the problem with duplicates only occur for less than
1% of our conversations, it is not that easy to test in our testrig.

 what version are you using? REGISTER requests should not create any 
 dialog and that is fixed starting wit 3.2.1, iirc.

# kamailio -V
version: kamailio 3.2.1 (i386/linux) 31c991
flags: STATS: Off, USE_IPV6, USE_TCP, USE_TLS, TLS_HOOKS, USE_RAW_SOCKS,
DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC,
DBG_QM_MALLOC, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE,
USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16,
MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 4MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: 31c991
compiled on 08:08:06 Dec  6 2011 with gcc 4.1.2

Willing to upgrade to a later git, if needed.

-- 
Øyvind Kolbu


pgp86zP22jXp6.pgp
Description: PGP signature
___
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] CAcert root in Lumicall

2012-02-14 Thread Daniel Pocock

 I installed it from the download page, worked fine on android 2.2 -- had
 no time to test it yet, but I noticed some warning messages during
 installation. Not sure if it is specific for each android phone type or
 for android in general, but I was alerted that I will allow the
 application do to a lot of nasty things, like taking my gps position,
 making calls that can cost me money, etc... Being open source and people

The warnings are a common problem for Android apps

There is no opportunity for the developer to annotate the warning screen
or make the warnings more specific

E.g. permission to modify SD card: the Lumicall app only needs
permissions to export a backup of the SIP settings, it does not, for
example, need to delete pictures and movies.  But Android doesn't allow
that distinction.  As a developer, I have to choose:
- give user backup feature with nasty warnings
- give user no backup feature

However, I have been reflecting on this, and I think I am going to
remove some features (e.g. the backup function) so that users will be
less intimidated.

Another strategy is to modularise the app: e.g. divide Lumicall into 3
apps, each with less permissions, and they collaborate using
inter-process communication (IPC)

 like myself a devel could check and be safe about if they have a doubt,
 but I wonder if usual people will not become afraid of installing it.

The source code is an important issue for me too: I have now implemented
SRTP, and almost finished implementing ZRTP.  I really believe that such
source code should be open so that people can have proof that it is
secure (no back doors for someone to monitor calls and sell juicy rumors
to British newspapers)

Rather than putting the code on Sourceforge, I'm setting up a site,
opentelecoms.org (which is also the Java namespace for the library code)
- but I'm trying to choose between running it with a monolithic solution
like FusionForge, or separate systems like MoinMoin, Bugzilla, gitosis -
I'd be interested in any suggestions about that, as I want the site go
beyond the basic goal of distributing source code, and make it a useful
resource to the wider VoIP community.

___
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] creating DB in MySQL for Homer Capture server gives errors

2012-02-14 Thread Nelson Pereira
Hi all,

 

Trying to create the Homer SIP capture (Kamailio) DB and getting an error:

 

Error

SQL query: 

CREATE TABLE `sip_capture` ( `id` bigint(20) unsigned NOT NULL
AUTO_INCREMENT, `date` timestamp NOT NULL DEFAULT '-00-00 00:00:00',
`micro_ts` bigint(18) NOT NULL DEFAULT '0', `method` varchar(50) NOT NULL
DEFAULT '', `reply_reason` varchar(100) NOT NULL, `ruri` varchar(200) NOT
NULL DEFAULT '', `ruri_user` varchar(100) NOT NULL DEFAULT '', `from_user`
varchar(100) NOT NULL DEFAULT '', `from_tag` varchar(64) NOT NULL DEFAULT
'', `to_user` varchar(100) NOT NULL DEFAULT '', `to_tag` varchar(64) NOT
NULL, `pid_user` varchar(100) NOT NULL DEFAULT '', `contact_user`
varchar(120) NOT NULL, `auth_user` varchar(120) NOT NULL, `callid`
varchar(100) NOT NULL DEFAULT '', `callid_aleg` varchar(100) NOT NULL
DEFAULT '', `via_1` varchar(256) NOT NULL, `via_1_branch` varchar(80) NOT
NULL, `cseq` varchar(25) NOT NULL, `diversion` varchar(256) NOT NULL,
`reason` varchar(200) NOT NULL, `content_type` varchar(256) NOT NULL,
`authorization` varchar(256) N[...] 

MySQL said:
http://172.20.25.149/phpMyAdmin/url.php?url=http%3A%2F%2Fdev.mysql.com%2Fdo
c%2Frefman%2F5.0%2Fen%2Ferror-messages-server.htmltoken=1d6b9d77bce4c6f1648
83e3c6dd6bc09 Description: Documentation

#1064 - You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near
'PARTITION BY RANGE ( UNIX_TIMESTAMP(`date`) ) (
PARTITION pmax VALUES LESS THAN ' at line 50

 

 

System Information:

.  Apache/2.2.10 (Linux/SUSE)

.  MySQL client version: 5.0.67

.  PHP extension: mysqli

 

Server is SLES 11 SP1

image001.png___
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] creating DB in MySQL for Homer Capture server gives errors

2012-02-14 Thread Alexandr Dubovikov

  
  
Hi Nelson,

your mysql server is old. The best way upgrade your mysql server
minimum up to 5.1.43, if not, don't use UNIX_TIMESTAMP partitioning
for this mysql.

Wbr,
Alexandr

14.02.2012 15:25, Nelson Pereira wrote:

  
  
  
  
  
Hi all,

Trying to create the Homer SIP capture
  (Kamailio) DB and getting an error:

Error
SQL query: 
CREATE TABLE `sip_capture` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `date`
timestamp NOT NULL DEFAULT '-00-00 00:00:00', `micro_ts`
bigint(18) NOT NULL DEFAULT '0', `method` varchar(50) NOT
NULL DEFAULT '', `reply_reason` varchar(100) NOT NULL,
`ruri` varchar(200) NOT NULL DEFAULT '', `ruri_user`
varchar(100) NOT NULL DEFAULT '', `from_user` varchar(100)
NOT NULL DEFAULT '', `from_tag` varchar(64) NOT NULL DEFAULT
'', `to_user` varchar(100) NOT NULL DEFAULT '', `to_tag`
varchar(64) NOT NULL, `pid_user` varchar(100) NOT NULL
DEFAULT '', `contact_user` varchar(120) NOT NULL,
`auth_user` varchar(120) NOT NULL, `callid` varchar(100) NOT
NULL DEFAULT '', `callid_aleg` varchar(100) NOT NULL DEFAULT
'', `via_1` varchar(256) NOT NULL, `via_1_branch`
varchar(80) NOT NULL, `cseq` varchar(25) NOT NULL,
`diversion` varchar(256) NOT NULL, `reason` varchar(200) NOT
NULL, `content_type` varchar(256) NOT NULL, `authorization`
varchar(256) N[...] 
MySQL said: 
#1064
- You have an error in your SQL syntax; check the manual
that corresponds to your MySQL server version for the right
syntax to use near 'PARTITION BY RANGE (
UNIX_TIMESTAMP(`date`) ) (
PARTITION pmax VALUES LESS THAN ' at line 50


System
Information:
 Apache/2.2.10 (Linux/SUSE)
 MySQL client version:
5.0.67
 PHP extension: mysqli

Server is SLES 11 SP1
  
  
  
  
  ___
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] problems since upgrading mysql and php

2012-02-14 Thread Nelson Pereira
Getting the bellow error after upgrading php and mysql as requested:

 


Access forbidden!


You don't have permission to access the requested directory. There is either
no index document or the directory is read-protected. 

If you think this is a server error, please contact the webmaster
mailto:root@cbnhmr01plc . 


Error 403

172.20.25.149 http://172.20.25.149/ 
Tue Feb 14 13:37:07 2012
Apache/2.2.10 (Linux/SUSE) 

 

 

Regards,

Nelson Pereira
Sr. Network Administrator, Information Systems

Canadian Bank Note Company
18 Auriga Drive
Ottawa, Ontario K2E 7T9
Phone: (613) 225-6566 Ext 2347
Cell: (613) 410-7608

 

___
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] Record-route and high avaibility

2012-02-14 Thread Anto
Hello,

Ok ;-). Thanks !

Best regards
Anto

2012/2/8 Daniel-Constantin Mierla mico...@gmail.com:
 Hello,


 On 2/5/12 8:31 PM, Anto wrote:

 Hello

 I have a proxy that makes the function of balancer and I have a doubt.
 This balancing between two proxies that do accounting, if any falls
 during the course of a call, you lose accounting (record-route). Is
 that correct?

 Is it advisable to have at each proxy server as a slave and balance
 the ip? Thanks


 you can use hostnames in the record route headers, see rr module readme for
 the functions giving such option. Then be sure you have alias values set to
 both proxies' hotnames.

 Also, you can do static routing if the traffic comes always through your
 loadbalancer to the acc proxies and then to an outbound proxy -- this is a
 matter of your voip platform architecture.

 Cheers,
 Daniel

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


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


[SR-Users] Kamailio Asterisk Followup

2012-02-14 Thread Greg Mannie

Hello

Sorry for another newbie question, but eventually with your greatly  
appreciated help I will get proficient in this application.


After reading much RFC reading and docs for Kamailio I see where the  
benefits of using the sip proxy for registering devices while using  
asterisk for voicemail or ivr etc. has great benefit.


I am not finding much on my end user interaction.  If I use realtime  
integration and have multi domain use on kamailio, how do I allow the  
end user to configure their own IVR?  Is it possible to use modules  
like the call flow control from freepbx and allow users to configure  
this themselves?


Regards,

Greg





___
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] problems since upgrading mysql and php

2012-02-14 Thread dotnetdub
On 14 February 2012 18:42, Nelson Pereira npere...@cbnco.com wrote:

 Getting the bellow error after upgrading php and mysql as requested:

 ** **
 Access forbidden!

 You don't have permission to access the requested directory. There is
 either no index document or the directory is read-protected. 

 If you think this is a server error, please contact the 
 webmasterroot@cbnhmr01plc.
 
 Error 403172.20.25.149
 Tue Feb 14 13:37:07 2012
 Apache/2.2.10 (Linux/SUSE) 

 ** **

 ** **

 Regards,

 *Nelson Pereira*
 *Sr. Network Administrator, Information Systems*

 Canadian Bank Note Company
 18 Auriga Drive
 Ottawa, Ontario K2E 7T9
 Phone: (613) 225-6566 Ext 2347
 Cell: (613) 410-7608

 ** **


Hi Nelson,

I think you are possibly posting to the incorrect mailing list.

But as you did, anything new coming up bank note wise that we should know
about?

Best,
Stephen.





___
 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] AVP obtain with regular expression

2012-02-14 Thread Anto
Hello

I'm using AVP, but I can not finish assimilating the concept. I try to
input messages, according to their DID. Once it enters an INVITE
message treatment with alias_db for its user, but I want some AVP for
each DID.

I can think of three cases. The first I have no very clear if possible
and if it were, I think is not optimal.

1)

Given the configuration of the module:
modparam(avpops,avp_url,mysql://user:passwd@host/database)

Had thought if I can use regular expressions to get the prs in the
database (DID_IN, DID_DEST, etc).

USR_PREFERENCES table:

| id | uuid | username | domain  |   attribute   | type |
value | modified |
| 1 | XXX | user1| dmn.tld  | 571XXX_IN   |  1 |  XXX
|   |
| 2 | XXX | user2| dmn.tld  | 571XXX_DEST | 1  |  XXX  |
|

2)

Maybe better to use the module configuration schemes:

modparam(avpops,db_scheme,scheme1:uuid_col=uid;value_col=job;value_type=string;table=emp)
modparam(avpops,db_scheme,scheme2:username_col=user;domain_col=domain;value_col=email;table=users)

3)

Or use avp_db_query() function.

Can anyone guide me? I'm pretty lost :-S. The first case, I know if
possible and possibly more difficult to maintain. Thanks very much.

Best regards
Anto

___
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