Re: [SR-Users] MSRP question

2016-04-01 Thread Daniel-Constantin Mierla
If the config file is too big, then it is not easy to analyze anyhow.

Can you try to run with debug=3 in conifiguration file, then generate
some msrp traffic to see if you can spot some hints of what happens from
syslog messages?

Cheers,
Daniel

On 31/03/16 15:53, Hussein Said wrote:
> Thank you for the reply. I did use the exact copy of the event_route
> in the above link you mentioned. My config file for default.cfg is
> using Kazoo from 2600hz and it is rather large to paste into the
> email. If it helps, tls module is missing from Kamalio and it is
> failing to load, but I am not using TLS anyways, so that should not be
> an issue. If it is ok with you I can send you the default.cfg file to
> your email? let me know..
>
> thanks
>
> On Thu, Mar 31, 2016 at 3:00 AM, Daniel-Constantin Mierla
> mailto:mico...@gmail.com>> wrote:
>
> Hello,
>
> have you seen the examples at:
>
>   *
> http://www.kamailio.org/docs/modules/stable/modules/msrp.html#msrp.usage
>
> If you used one of them, can you share your current version of
> config (strip/replace sensitive data such as passwords or ips)?
>
> Cheers,
> Daniel
>
>
> On 31/03/16 03:55, Hussein Said wrote:
>> Hello,
>> I have followed the instructions on how to enable MSRP and
>> included the event_route block in my default.cfg. The module is
>> loading fine and I see no errors. I am using a custom tool to
>> generate a SIP session for the MSRP‎ payload, but the event_route
>> never gets called, only my route function for SIP is being called
>> which does not handle this message and drops the message. I would
>> appreciate if someone can point me to a working script with SIP
>> and MSRP. Note that I am using port 5060 for both SIP And MSRP.
>>
>> Thx
>>
>>
>> ___
>> 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://twitter.com/#!/miconda  - 
> http://www.linkedin.com/in/miconda
> Kamailio World Conference, Berlin, May 18-20, 2016 - 
> http://www.kamailioworld.com
>
>
> ___
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing
> list
> sr-users@lists.sip-router.org 
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>

-- 
Daniel-Constantin Mierla
http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio World Conference, Berlin, May 18-20, 2016 - 
http://www.kamailioworld.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] Stateful Outbound Proxy...

2016-04-01 Thread Daniel-Constantin Mierla
Hello,

yes -- if you use t_relay() to send out the SIP requests, then kamailio
acts as a stateful proxy.

If you use record_route() and loose_route() in kamailio.cfg (the default
kamailio.cfg uses them, so you can look at it if you started something
from scratch), then requests within dialog end to proper asterisk.

Cheers,
Daniel

On 28/03/16 06:26, jignesh gandhi wrote:
> Hello All,
>
> Is it possible to use kamailio to be a stateful outbound proxy ?
>
> The use case is kamailio is an outbound proxy for multiple instances
> of Asterisk. 
> Thus all responses need to go back to the same instance of Asterisk
> that generated them.
>
> After the call is established.
> How can I ensure that the Re-Invites, BYEs, etc are sent to the same
> instance of Asterisk that generated the outbound Invite ?
>
> I know on the inbound side I can hash over the call-id to ensure that
> all requests within a dialogue are routed to same Asterisk instance.
>
> Thanks,
> --Jignesh
>
>
>
>
> ___
> 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://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio World Conference, Berlin, May 18-20, 2016 - 
http://www.kamailioworld.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] SQlite DB Lock with Presence

2016-04-01 Thread Daniel-Constantin Mierla


On 31/03/16 21:05, David Holl wrote:
> I'm curious why the kamailio sqlite module doesn't export a
> transaction API, especially since the native sqlite API does support
> transactions according to https://www.sqlite.org/transactional.html  
> Maybe someday, I'd get time to dig into the kamailio module myself to
> try lending a hand...
I guess nobody from dev team needed transaction operations for sqlite, I
expect that most of us use a larger sql server (mysql, postgres) if they
have presence services...

Your contribution to add them will be very welcome, of course!

>
> Anyhow, the following is what I did to work around the locked db errors:
>
> I'm not running BLF, but I have been using sqlite for my testing.  At
> first, I was getting occasional "database is locked" errors, but then
> I enabled "wal" mode on my database on a hunch to speed up
> operations.  I didn't measure the actual db performance before/after
> enabling wal, but the error messages went away after enabling wal. 
> (Now, I only get an occasional locked message if I happen to have SIP
> tracing enabled and writing to the same database as the rest of the
> kamailio tables.  To work around this issue, I just moved the
> sip_trace table to a separate sqlite db file.)
>
> wal is described in detail at https://www.sqlite.org/wal.html
>
> The following is the short script I wrote to remind myself how I
> enabled wal.  It just runs  "journal_mode=WAL;
> " on the
> database, and the database supposedly can be converted back to the
> default via " journal_mode=DELETE;
> ".  (Though,
> the usual "cya" disclaimer of backing up your DB always applies...)
>
> Contents of make_siptrace_db.sh
>
> #!/bin/sh
> set -e
> # Instructions:
> #   /etc/init.d/kamailio stop
> #   #Run this script with db file as the command line parameter:
> #   ./make_siptrace_db.sh /path/to/db/kamailio.sqlite
> #   /etc/init.d/kamailio start
> #
> # For details on Write-Ahead Logging (WAL), see
> https://www.sqlite.org/wal.html
> exec sqlite3 -bail -batch "$1" << 'EOF'
> PRAGMA journal_mode=WAL;
> EOF
> # If this works, sqlite3 should print out "wal"
>
>

Very useful hint, many thanks for sharing all these details!

Cheers,
Daniel

>
>
> On 3/31/16 11:25 AM, Kristian Kielhofner wrote:
>> Hi Daniel,
>>
>>   I switched to mysql and haven't looked back but I will take another
>> look with sqlite because it *should* work.
>>
>>   Thanks!
>>
>> On Thu, Mar 31, 2016 at 12:11 PM, Daniel-Constantin Mierla
>>  wrote:
>>> Hello,
>>>
>>> I looked quickly at sqlite and the module doesn't export db transaction API,
>>> so it is not what I thought in the first place (some presence operations try
>>> to use db transactions if supported by db module). So it is something in
>>> sqlite that locks the table. Do you see any error message in the logs before
>>> the one with the table locked?
>>>
>>> Cheers,
>>> Daniel
>>>
>>>
>>> On 30/03/16 14:28, Kristian Kielhofner wrote:
>>>
>>> Hi Daniel,
>>>
>>>  First call.
>>>
>>> Thanks!
>>>
>>> On Wednesday, March 30, 2016, Daniel-Constantin Mierla 
>>> wrote:
 Hello,

 not using sqlite here, but could be related to presence modules doing db
 transactions and not releasing the locks. Do you get the issue after the
 first call, or it runs for a while and at some point it breaks?

 Cheers,
 Daniel

 On 30/03/16 02:50, Kristian Kielhofner wrote:
> Hello everyone,
>
>   I'm trying to use BLF with the config here (except with SQlite):
>
> http://kb.asipto.com/kamailio:presence:k43-blf
>
>   BLF seems to work perfectly except after the call is ended I get
> "sqlite commit failed: database is locked" error messages as seen
> here:
>
> http://pastebin.com/xVijj98H
>
> BLF is then broken at this point.
>
> kamailio -v
> version: kamailio 4.3.5 (x86_64/linux) 950657
> flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, 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_PTHREAD_MUTEX, 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 8MB
> poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
> id: 950657
> compiled on 01:33:01 Mar 29 2016 with x86_64-openwrt-linux-gnu-gcc 4.8.3
>
> Has anyone ever seen this before?
>
> Thanks!
>
 --
 Daniel-Constantin Mierla
 http://www.asipto.com
 http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
 Kamailio World Conference, Berlin, May 18-20, 2016 -
 http://www.kamailioworld.com


 ___
 SIP E

Re: [SR-Users] stateful messages in a dialog

2016-04-01 Thread Daniel-Constantin Mierla
Hello,

transaction stateful relaying is done by using t_relay().

For handling them with dialog, use dlg_manage() for those requests.

Cheers,
Daniel

On 30/03/16 14:35, Al S wrote:
> Hi,
>
>
> I would like to know how I can make subsequent messages in a dialog
> (ACK and BYE) to be stateful.
> Your help will be greatly appreciated.
>
>
> // reroute INVITE after timeout.
> failure_route[MANAGE_FAILURE]
> {
>if (t_branch_timeout())
>{
>   # change to new destination IP
>   $rd = "10.10.10.10";
>   t_relay();
>   exit;
>}
> ...
> }
>
> Thanks,
> AS
>
>
> ___
> 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://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio World Conference, Berlin, May 18-20, 2016 - 
http://www.kamailioworld.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] How can I send 404 to the caller instead of BYE?

2016-04-01 Thread Daniel-Constantin Mierla
Hello,

not sure I understand properly, but it seems you want to send a response
(404) to caller, but the caller hasn't sent any request. Even you would
be able to do that, is useless, the caller won't do anything with it.

Again, might be my misunderstanding, so re-phrase if you meant something
else.

Cheers,
Daniel

On 28/03/16 22:23, Humberto H wrote:
> Hello 
>
> I am trying to send 404 to the caller instead of BYE. Using the
> configuration showned bellow. when the callee send BYE 
>
> Kamailio sends  -- *404* to the callee (to the source of the BYE
> signaling)
>   --- and *BYE* to the caller 
>
> But I need to send  404 response to the caller only
>
> Thanks in advance 
>
>
> event_route[dialog:end] {
> if(is_method("BYE") && ((src_ip==XXX) )){ 
> send_reply("404", "Not found");
> xlog("L_INFO","ENVIO 404 ON BYE \n");
> }
> exit;
> }
>
>
> ___
> 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://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio World Conference, Berlin, May 18-20, 2016 - 
http://www.kamailioworld.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] HOW send 4XX to the caller when the callee response to bye is 481 Call leg/transaction does not exist

2016-04-01 Thread Daniel-Constantin Mierla
Hello,

the 481 is sent by the caller, meaning it doesn't know the call anymore.

To help troubleshooting, you have to send the full sip trace of the
call, from initial invite to the bye, including the responses, taken on
sip server, in both directions.

You can use ngrep, like:

ngrep -d any -qt -W byline "sip" port 5060

Cheers,
Daniel

On 30/03/16 19:14, Humberto H wrote:
> Hello; 
>
> Inline image 1
> HOW can I send 4XX to the caller when the callee response to a BYE
> message  is:
>  *481 Call leg/transaction does not exist. BUT the caller is waiting.*
>
> Before this message.  I drop the bye sent by the callee,  my purpose
> here is
>  "*Do not send the BYE TO THE CALLER"* 
>
> JUST send a message in order to the caller do failover, If I send
> *BYE* to the caller  it can't do failover 
>
> Thanks in advance.
>
>
> 10.929596|   | BYE   |   |
>   |SIP Request BYE CSeq:104
> | |   |(5060)   -->  (5060)  
> |   |
> |10.929981|   | 481 Call leg/transac
>  |   |SIP Status 481 Call leg/transaction does not exist
> | |   |(5060)   <--  (5060)  
> |   |
> |10.929983|   | 481 Call leg/transac
>  |   |SIP Status 481 Call leg/transaction does not exist
> Call leg/transaction does not exist
> | |   |(5060)   -->  (5060)  
> |   |
> |10.930445|   | 481 Call leg/transac
>  |   |SIP Status 481 Call leg/transaction does not exist
> | |   |(5060)   -->  (5060)  
> |   |
> |10.930451|   | 481 Call leg/transac
>  |   |SIP Status 481 Call leg/transaction does not exist
> 
>
>
> ___
> 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://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio World Conference, Berlin, May 18-20, 2016 - 
http://www.kamailioworld.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] Framework/Lib to create SIP packets

2016-04-01 Thread Daniel-Constantin Mierla
Hello,

to add a bit more to the suggestions offered by the others ... if you
have the sip packet in a file, you can send it over with protoshoot
(included in kamailio at utils/protoshoot/).

Maybe more useful will be sipsak, it allows to do a lot of sip stuff
from command line -- this should be packaged on most linux distros, if
not, it is hosted on github by the author Nils Olhmeier:

  * https://github.com/nils-ohlmeier/sipsak

If you need to send over websocket, a while ago I wrote a small tool in
go - wsctl:

  * https://github.com/miconda/wsctl

Cheers,
Daniel

On 30/03/16 21:21, Igor Olhovskiy wrote:
> Hi, all
> Not a Kamailio-related question, but.
> I want to form SIP-packets with info I need and receive answers.
> At first iteration in would be PUBLISH (with XML info) messages
> (PUBLISH - 200 OK) sent to Kamailio.
> I want to use Python (more preferable) or Lua (less preferable). Is
> there any lib I can create messages with, or forget and just use plain
> text + UDP socket?
>
> -- 
> Best regards,
> Igor
>
>
> ___
> 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://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio World Conference, Berlin, May 18-20, 2016 - 
http://www.kamailioworld.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] Kamailio start up issue

2016-04-01 Thread NITESH BANSAL
Hello,
I installed Kamailio 4.3 on debian wheezy machine using debian package from 
https://www.kamailio.org/wiki/packages/debsThe installation went fine, but I'm 
unable to start kamailio. It seems that Kamailio is having issue locating the 
issues.Kamailio installed all the modules in location 
'/usr/lib/x86_64-linux-gnu/kamailio/modules', when building from source, it 
usedto copy modules in '/usr/lib/kamailio/modules'.Any suggestions on how can I 
fix it?
Thanks,Nitesh ___
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 start up issue

2016-04-01 Thread NITESH BANSAL
The error message looks like the following
' ERROR:  [sr_module.c:576]: load_module(): could not find module  
in  0(24421)'
Nitesh

From: nitesh.ban...@outlook.com
To: sr-users@lists.sip-router.org
Date: Fri, 1 Apr 2016 12:12:39 +0200
Subject: [SR-Users] Kamailio start up issue




Hello,
I installed Kamailio 4.3 on debian wheezy machine using debian package from 
https://www.kamailio.org/wiki/packages/debsThe installation went fine, but I'm 
unable to start kamailio. It seems that Kamailio is having issue locating the 
issues.Kamailio installed all the modules in location 
'/usr/lib/x86_64-linux-gnu/kamailio/modules', when building from source, it 
usedto copy modules in '/usr/lib/kamailio/modules'.Any suggestions on how can I 
fix it?
Thanks,Nitesh 

___
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] Load balancing traffic based on SIP URI

2016-04-01 Thread NITESH BANSAL
Hello,
I want to use Kamailio to load balance traffic across multiple asterisks.The 
problem is that my SIP traffic is related to conference, so if a SIP callfor a 
particular URI is sent to an Asterisk instance, any subsequent calls for 
thatSIP URI should be sent to the same Asterisk instance.Is there anyway to 
achieve this in Kamailio?
Thanks,Nitesh ___
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] Acc INVITE dialog start timing difference

2016-04-01 Thread Dirk Teurlings - Signet B.V.
Hi,

I'm seeing a difference in timestamp for acc modules recorderd INVITES
and the dialog start event.


This is the log entry:
Apr  1 12:55:59 host /usr/sbin/kamailio[15642]: INFO: 

[SR-Users] Make Kamailio Great Again!

2016-04-01 Thread Alex Balashov

For immediate release:

ATLANTA, GA (1 April 2016)--Alex J. Balashov, a self-styled
businessman based in Atlanta, Georgia, USA, has a plan to "Make
Kamailio Great Again".

"Evariste Systems is huge. My name is on the building," said
Balashov of his iconic VoIP consulting brand.

"And you know what, I have been very successful. Everybody loves me."

Balashov has capitalised on a contentious election cycle marked by
deep political polarisation, growing income inequality and geopolitical
challenges such as global terrorism. And his sharp message of alarm
about the declining influence of the Kamailio SIP server project has
resonated with increasing numbers in the CxO suite, vaulting him to
the lead in the race for the IETF SIP Working Group nomination,
according to recent polls of primary voters.

He has been quick to tout his competitive credentials in a tough
global open-source ecosystem. At a recent colloqium on unified
communications, he asked:

"When was the last time anybody saw us beating, let's say, OpenSIPS
in Git commits? They kill us. I beat OpenSIPS all the time. All the
time."

As Balashov sees it, a major cause of the beleaguered Kamailio
project's woes lies in its liberal patch acceptance policy and
lax scrutiny of third-party contributions:

"When GitHub sends its people, they're not sending their best.
They're not sending you. They're not sending you. They're sending
people that have lots of problems, and they're bringing those
problems. They're bringing drugs. They're bringing crime. They're
rapists. And some, I assume, are good people."

He has proposed a controversial solution that has drawn ire from
liberal ranks in the open-source community, but has also attracted
applause and standing ovations at his speaking engagements:

"We have to have a firewall around the Kamailio source code. We
have to have an access control list. And in that firewall, we're
going to have a big fat door where commits and pull requests can
come into the master branch, but they have to come in legally.
The firewall will go up, and GitHub will start behaving."

Balashov's firewall proposal has been met with scorn from critics who
deride it as impractical and quixotic. In particular, commentators
have raised questions about funding and resources as well as GitHub's
willingness to entertain a boundary around a project in its vicinity.
Balashov isn't concerned, however:

"I will build a great firewall--and nobody builds firewalls better
than me, believe me--and I'll build them very inexpensively. I will
build a great, great stateful packet inspection wall on our border
with GitHub, and I will make GitHub pay for that wall. Mark my words."

He has also been rebuked by rival IETF leadership candidates for his
often acerbic Twitter remarks directed at Lennart Poettering and the
developers of "firewalld". As he sees it, however, the network effects
of social media are a strength:  "My Twitter has become so powerful
that I can actually make my enemies tell the truth." He scoffed at
the suggestion that his characterisations of industry actors behind
the RedHat-led "systemd" movement are misleading:

"RedHat was the worst Steward of Linux in the history of the kernel.
There has never been a Steward so bad as RedHat. The source code
blew up around us. We lost everything, including all synergies.
There wasn't one good thing that came out of that administration or
them being Stewards of Linux."

Balashov's idiosyncratic campaign is not standing still. He has proven
to be a capable populist, adapting rapidly to an evolving sense of the
kinds of pronouncements that activate his swelling crowds of devotees.
Along the way, he has deftly deflected calls to subject his policy
proposals to expert review.

"I know what I'm doing, and I listen to a lot of people, I talk to
a lot of people, and at the appropriate time I'll tell you who
the people are. But I speak to a lot of people, but my primary
consultant is myself, and I have a good instinct for this stuff."

At a recent gathering of SIP stack interoperability specialists,
Balashov the latest pillar of his platform to "Make Kamailio Great
Again", in view of growing security vulnerabilities in the latest
Kamailio modules:

"Alex J. Balashov is calling for a total and complete shutdown of
commits entering the master branch from the territory of the European
Union until our project's representatives can figure out what's going
on. According to Netcraft, among others, there are a lot of buffer
overflows in Kamailio by large segments of the EU population."

___
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] Load balancing traffic based on SIP URI

2016-04-01 Thread Alberto Sagredo
I have done something similar as follows


if($rU=~"^[0-3][0-9][0-9]$")
{
$var(valor)=1;
}

And later..

if(!ds_select_domain("$var(valor)", "4")) {
sl_send_reply("500", "Service Unavailable");
xlog("L_INFO","[$fU@$si:$sp]{$rm} Sin destinos disponibles
para $rd \n");

exit;
}

That could be one idea to do that...

On your load balance table you have to use 0 -> All

1 -> Destination 1

2 -> Destination 2

an so.




2016-04-01 12:26 GMT+02:00 NITESH BANSAL :

> Hello,
>
> I want to use Kamailio to load balance traffic across multiple asterisks.
> The problem is that my SIP traffic is related to conference, so if a SIP
> call
> for a particular URI is sent to an Asterisk instance, any subsequent calls
> for that
> SIP URI should be sent to the same Asterisk instance.
> Is there anyway to achieve this in Kamailio?
>
> Thanks,
> Nitesh
>
> ___
> 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] pseudo variables in strings

2016-04-01 Thread Juha Heinanen
If I have a string that contains pseudo variables, e.g,,

$var(uri_pattern) = "sip:$f...@tutpro.com";

is it somehow possible to replace them with their values, something like:

$var(uri) = eval("$var(uri_pattern)");

-- 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


Re: [SR-Users] pseudo variables in strings

2016-04-01 Thread Alex Balashov
‎Juha,

Yes, either by separating the PV elements, e.g.

$var(x) = $fU + "abc";

... or with the newer $_s() PV created for this purpose:

$var(x) = $_s($fUabc);

--
Alex Balashov | Principal | Evariste Systems LLC
1447 Peachtree Street NE, Suite 700
Atlanta, GA 30309
United States

Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct)
Web: http://www.evaristesys.com/, http://www.csrpswitch.com/

Sent from my BlackBerry.
  Original Message  
From: Juha Heinanen
Sent: Friday, April 1, 2016 08:14
To: sr-users@lists.sip-router.org
Reply To: Kamailio (SER) - Users Mailing List
Subject: [SR-Users] pseudo variables in strings

If I have a string that contains pseudo variables, e.g,,

$var(uri_pattern) = "sip:$f...@tutpro.com";

is it somehow possible to replace them with their values, something like:

$var(uri) = eval("$var(uri_pattern)");

-- 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] about xml rpc response behavior

2016-04-01 Thread Yasin CANER

  
  
Hello;
      Xml rpc is useful module for kamailio that improve flexibility
  and can help to addons. But there is a little problem about it
  when use non-value response that reply  empty xml or no response
  so there isnt ack about what happened after command sends. at
  least need a "OK" for acknowledgement. i can accept that there is
  a fault reply and it is useful with return code and description.
  after looking http://xmlrpc.scripting.com/spec.html webpage ,
  there isnt any spec about "OK" . if you ask where it uses; For
  example , after module reloads or terminating dialog which callid.
  I think it is good when realtime reload in Kamailio Version 5 can
  be reload by remotly. it can reply which module reloaded correctly
  , which doesnt.What do you think about it?
  
  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] Load balancing traffic based on SIP URI

2016-04-01 Thread Federico Cabiddu
Hi,
if I understand correctly your problem is that the first INVITE for a
specific URI will go to a server and the conference will be instantiated
there. Then you must route all the INVITEs from the other participants to
the same server, is it right?
If this is the case why not use algorithm 3 in ds_select_ds (or
ds_select_domain) which does hashing over Request-URI?
(
http://www.kamailio.org/docs/modules/devel/modules/dispatcher.html#dispatcher.f.ds_select_dst
)

Regards,

Federico

On Fri, Apr 1, 2016 at 12:26 PM, NITESH BANSAL 
wrote:

> Hello,
>
> I want to use Kamailio to load balance traffic across multiple asterisks.
> The problem is that my SIP traffic is related to conference, so if a SIP
> call
> for a particular URI is sent to an Asterisk instance, any subsequent calls
> for that
> SIP URI should be sent to the same Asterisk instance.
> Is there anyway to achieve this in Kamailio?
>
> Thanks,
> Nitesh
>
> ___
> 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] Make Kamailio Great Again!

2016-04-01 Thread SamyGo
I just took a printout of it and will be framing it in my office. :D

My vote for Alex B.
On Apr 1, 2016 07:27, "Alex Balashov"  wrote:

> For immediate release:
>
> ATLANTA, GA (1 April 2016)--Alex J. Balashov, a self-styled
> businessman based in Atlanta, Georgia, USA, has a plan to "Make
> Kamailio Great Again".
>
> "Evariste Systems is huge. My name is on the building," said
> Balashov of his iconic VoIP consulting brand.
>
> "And you know what, I have been very successful. Everybody loves me."
>
> Balashov has capitalised on a contentious election cycle marked by
> deep political polarisation, growing income inequality and geopolitical
> challenges such as global terrorism. And his sharp message of alarm
> about the declining influence of the Kamailio SIP server project has
> resonated with increasing numbers in the CxO suite, vaulting him to
> the lead in the race for the IETF SIP Working Group nomination,
> according to recent polls of primary voters.
>
> He has been quick to tout his competitive credentials in a tough
> global open-source ecosystem. At a recent colloqium on unified
> communications, he asked:
>
> "When was the last time anybody saw us beating, let's say, OpenSIPS
> in Git commits? They kill us. I beat OpenSIPS all the time. All the
> time."
>
> As Balashov sees it, a major cause of the beleaguered Kamailio
> project's woes lies in its liberal patch acceptance policy and
> lax scrutiny of third-party contributions:
>
> "When GitHub sends its people, they're not sending their best.
> They're not sending you. They're not sending you. They're sending
> people that have lots of problems, and they're bringing those
> problems. They're bringing drugs. They're bringing crime. They're
> rapists. And some, I assume, are good people."
>
> He has proposed a controversial solution that has drawn ire from
> liberal ranks in the open-source community, but has also attracted
> applause and standing ovations at his speaking engagements:
>
> "We have to have a firewall around the Kamailio source code. We
> have to have an access control list. And in that firewall, we're
> going to have a big fat door where commits and pull requests can
> come into the master branch, but they have to come in legally.
> The firewall will go up, and GitHub will start behaving."
>
> Balashov's firewall proposal has been met with scorn from critics who
> deride it as impractical and quixotic. In particular, commentators
> have raised questions about funding and resources as well as GitHub's
> willingness to entertain a boundary around a project in its vicinity.
> Balashov isn't concerned, however:
>
> "I will build a great firewall--and nobody builds firewalls better
> than me, believe me--and I'll build them very inexpensively. I will
> build a great, great stateful packet inspection wall on our border
> with GitHub, and I will make GitHub pay for that wall. Mark my words."
>
> He has also been rebuked by rival IETF leadership candidates for his
> often acerbic Twitter remarks directed at Lennart Poettering and the
> developers of "firewalld". As he sees it, however, the network effects
> of social media are a strength:  "My Twitter has become so powerful
> that I can actually make my enemies tell the truth." He scoffed at
> the suggestion that his characterisations of industry actors behind
> the RedHat-led "systemd" movement are misleading:
>
> "RedHat was the worst Steward of Linux in the history of the kernel.
> There has never been a Steward so bad as RedHat. The source code
> blew up around us. We lost everything, including all synergies.
> There wasn't one good thing that came out of that administration or
> them being Stewards of Linux."
>
> Balashov's idiosyncratic campaign is not standing still. He has proven
> to be a capable populist, adapting rapidly to an evolving sense of the
> kinds of pronouncements that activate his swelling crowds of devotees.
> Along the way, he has deftly deflected calls to subject his policy
> proposals to expert review.
>
> "I know what I'm doing, and I listen to a lot of people, I talk to
> a lot of people, and at the appropriate time I'll tell you who
> the people are. But I speak to a lot of people, but my primary
> consultant is myself, and I have a good instinct for this stuff."
>
> At a recent gathering of SIP stack interoperability specialists,
> Balashov the latest pillar of his platform to "Make Kamailio Great
> Again", in view of growing security vulnerabilities in the latest
> Kamailio modules:
>
> "Alex J. Balashov is calling for a total and complete shutdown of
> commits entering the master branch from the territory of the European
> Union until our project's representatives can figure out what's going
> on. According to Netcraft, among others, there are a lot of buffer
> overflows in Kamailio by large segments of the EU population."
>
> ___
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users

Re: [SR-Users] Load balancing traffic based on SIP URI

2016-04-01 Thread Alberto Sagredo
Hi Federico. In mi case i have to force some RURIs to a determinate
Asterisk . There was some logic to do that instead letting kamailio to
handle that situations

I haven't tested option 3 , but it must do what you expect i think. Maybe
you would need to adjust
 ds_hash_expire
Regards

2016-04-01 14:46 GMT+02:00 Federico Cabiddu :

> Hi,
> if I understand correctly your problem is that the first INVITE for a
> specific URI will go to a server and the conference will be instantiated
> there. Then you must route all the INVITEs from the other participants to
> the same server, is it right?
> If this is the case why not use algorithm 3 in ds_select_ds (or
> ds_select_domain) which does hashing over Request-URI?
> (
> http://www.kamailio.org/docs/modules/devel/modules/dispatcher.html#dispatcher.f.ds_select_dst
> )
>
> Regards,
>
> Federico
>
> On Fri, Apr 1, 2016 at 12:26 PM, NITESH BANSAL 
> wrote:
>
>> Hello,
>>
>> I want to use Kamailio to load balance traffic across multiple asterisks.
>> The problem is that my SIP traffic is related to conference, so if a SIP
>> call
>> for a particular URI is sent to an Asterisk instance, any subsequent
>> calls for that
>> SIP URI should be sent to the same Asterisk instance.
>> Is there anyway to achieve this in Kamailio?
>>
>> Thanks,
>> Nitesh
>>
>> ___
>> 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


[SR-Users] Kamailio as a presence server

2016-04-01 Thread Igor Olhovskiy
Hi!
I want to create custom Presence server. Main idea - phones subscribes to
it (for ex, extension 100@domain). This subscription actually lit BLF
button on a phone.
But main idea - change status of BLF can arrive from different locations
via PUBLISH, I assume.
Problem - phones has different type of SUBSCRIBE, like
dialog(application/dialog-info+xml) or presence(application/pidf+xml). Some
of phones are not fully follow RFC (Like using in SUBSCRIBE R-URI not
domain, but IP, but in From or To - domains are used)
Phones are registered elsewhere, not on Kamailio. After reading RFC
(especially event:dialog part) I’ve found about SIP-If-Match part, but
problem about sync this data across multiple PUBLISH locations.
Can be Kamailio be a presence server in this scenario?

For ex, SUBSCRIBE

SUBSCRIBE sip:212.232.26.232:5060;transport=udp SIP/2.0
Via: SIP/2.0/UDP 192.168.88.60:5060;branch=z9hG4bK1656003104;rport
From: ;tag=521811605
To: ;tag=05ea6038656678bd0198b8977f3c0221.4e93
Call-ID: 805970257-506...@bjc.bgi.ii.ga
CSeq: 20202 SUBSCRIBE
Contact: 
X-Grandstream-PBX: true
Max-Forwards: 70
User-Agent: Grandstream GXP2160 1.0.5.33
Expires: 180
Supported: replaces, path, timer, eventlist
Event: dialog
Accept: application/dialog-info+xml,multipart/related,application/rlmi+xml
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER,
UPDATE, MESSAGE
Content-Length: 0


I’ve tried send to Kamailio this PUBLISH

PUBLISH sip:*5...@master.rufan.at:5060 SIP/2.0
Via: SIP/2.0/UDP 10.0.20.71:5060;branch=z9hG4bK-6930-1-0
Max-Forwards: 70
To: 
From: ;tag=1
Call-ID: 1-6930@127.0.1.1
CSeq: 1 PUBLISH
Contact: 
Event: presence
Expires: 3600
Content-Type: application/pidf+xml
Content-Length:  486





open






Night



Kamailio answers with 200OK, but after this - no NOTIFY to subscribed
clients.

-- 
Best regards,
Igor
___
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 tcp_send query, connection problem

2016-04-01 Thread Ed Todd
KAMAILIO tcp_send query, connection problem
I have a KAMAILIO SIP server on a static IP from Comcast, using a modem/router 
Cisco DPC39412B.

I have a PC application server which is successfully signing on to the SIP 
server, via a LAN cable on the same network as the SIP server (Cisco). 

In my second test, the PC application server is connected to the internet via a 
ZTE Falcon Z-917. In a third test, the PC application server is connected to 
the internet via a Talk-Talk fiber broadband. The connection does not occur.

>From the log files, the successful connection says:

Apr  1 10:44:30 SIP-Server kamailio[7817]: DEBUG:  [tcp_main.c:2281]: 
tcpconn_send_put(): tcp_send: send from reader (7817 (14)), reusing fd

Apr  1 10:44:30 SIP-Server kamailio[7817]: DEBUG:  [tcp_main.c:2516]: 
tcpconn_do_send(): tcp_send: sending...

Apr  1 10:44:30 SIP-Server kamailio[7817]: DEBUG:  [tcp_main.c:2550]: 
tcpconn_do_send(): tcp_send: after real write: c= 0x7f6270b8a4a0 n=565 fd=1

On the failed connection:

Apr  1 09:41:23 SIP-Server kamailio[7816]: DEBUG:  [tcp_main.c:1818]: 
tcp_send(): tcp_send: no open tcp connection found, opening new one

Apr  1 09:41:23 SIP-Server kamailio[7816]: DEBUG:  [ip_addr.c:243]: 
print_ip(): tcpconn_new: new tcp connection: 192.168.0.146

Apr  1 09:41:23 SIP-Server kamailio[7816]: DEBUG:  [tcp_main.c:1073]: 
tcpconn_new(): tcpconn_new: on port 55133, type 3

Apr  1 09:41:23 SIP-Server kamailio[7816]: DEBUG:  [tcp_main.c:1382]: 
tcpconn_add(): tcpconn_add: hashes: 1776:802:0, 803

Apr  1 09:41:23 SIP-Server kamailio[7816]: DEBUG: tls [tls_server.c:184]: 
tls_complete_init(): Using TLS domain TLSc [tcp_main.c:4320]: 
tcpconn_main_timeout(): tcp_main: entering timer for 0x7f6270b8a4a0 
(ticks=862851529, timeout=862909176 (3602 s), wr_timeout=862851529 (0 s)), 
write queue: 197 bytes

Apr  1 09:41:38 SIP-Server kamailio[7820]: ERROR:  [tcp_main.c:4338]: 
tcpconn_main_timeout(): connect 192.168.0.146:55133 failed (timeout)

Apr  1 09:41:38 SIP-Server kamailio[7820]: DEBUG:  [tcp_main.c:4362]: 
tcpconn_main_timeout(): tcp_main: timeout for 0x7f6270b8a4a

Any clues or tips would be greatly appreciated!



Ed
___
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] Multiple Registrations - Overwrite oldest contact

2016-04-01 Thread Bruno Emer
Hello all.

I have problem here and I tried to find a solution and search over
internet, but without success.

My scenario is the following: I have an application that must be registered
in Kamailio when a user logs in the web interface, so he can get calls
(something like a web softphone using webrtc). At this point, we are OK,
and everything is working fine.

To get these register functions I am using the parameter "save("location",
"0x04")" as described in the REGISTRAR module documentation, so if a user
logs in another web browser or computer, only the last one will continue
registered and all calls will be forwarded to him.

The point is that now we are creating a phone app that will do almost the
same thing as the web interface, allowing users to receive calls using the
mobile device, and here is my problem: I want to allow my users to be
registered on two devices at the same time, but if a user logs into another
device, I don't want to reply with a 503. I want to allow the user to
register again, deregistering the oldest contact.

I saw that there is a module named "ims_usrloc_scscf" and on its
description it says "implemented overwrite oldest contact behaviour", but I
couldn't find any documentation about it.

So, is there a way to get this working today?


*Bruno Emer*

Mobile: +55 11 96540-0044
email: brunoe...@gmail.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] Multiple Registrations - Overwrite oldest contact

2016-04-01 Thread Olle E. Johansson

> On 01 Apr 2016, at 21:31, Bruno Emer  wrote:
> 
> Hello all.
> 
> I have problem here and I tried to find a solution and search over internet, 
> but without success.
> 
> My scenario is the following: I have an application that must be registered 
> in Kamailio when a user logs in the web interface, so he can get calls 
> (something like a web softphone using webrtc). At this point, we are OK, and 
> everything is working fine.
> 
> To get these register functions I am using the parameter "save("location", 
> "0x04")" as described in the REGISTRAR module documentation, so if a user 
> logs in another web browser or computer, only the last one will continue 
> registered and all calls will be forwarded to him.
> 
> The point is that now we are creating a phone app that will do almost the 
> same thing as the web interface, allowing users to receive calls using the 
> mobile device, and here is my problem: I want to allow my users to be 
> registered on two devices at the same time, but if a user logs into another 
> device, I don't want to reply with a 503. I want to allow the user to 
> register again, deregistering the oldest contact.
> 
> I saw that there is a module named "ims_usrloc_scscf" and on its description 
> it says "implemented overwrite oldest contact behaviour", but I couldn't find 
> any documentation about it.
> 
> So, is there a way to get this working today?

There is a modparam to register the amount of contacts per AOR - which would do 
what you need.

/O

___
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] Multiple Registrations - Overwrite oldest contact

2016-04-01 Thread Olle E. Johansson

> On 01 Apr 2016, at 21:59, Olle E. Johansson  wrote:
> 
> 
>> On 01 Apr 2016, at 21:31, Bruno Emer > > wrote:
>> 
>> Hello all.
>> 
>> I have problem here and I tried to find a solution and search over internet, 
>> but without success.
>> 
>> My scenario is the following: I have an application that must be registered 
>> in Kamailio when a user logs in the web interface, so he can get calls 
>> (something like a web softphone using webrtc). At this point, we are OK, and 
>> everything is working fine.
>> 
>> To get these register functions I am using the parameter "save("location", 
>> "0x04")" as described in the REGISTRAR module documentation, so if a user 
>> logs in another web browser or computer, only the last one will continue 
>> registered and all calls will be forwarded to him.
>> 
>> The point is that now we are creating a phone app that will do almost the 
>> same thing as the web interface, allowing users to receive calls using the 
>> mobile device, and here is my problem: I want to allow my users to be 
>> registered on two devices at the same time, but if a user logs into another 
>> device, I don't want to reply with a 503. I want to allow the user to 
>> register again, deregistering the oldest contact.
>> 
>> I saw that there is a module named "ims_usrloc_scscf" and on its description 
>> it says "implemented overwrite oldest contact behaviour", but I couldn't 
>> find any documentation about it.
>> 
>> So, is there a way to get this working today?
> 
> There is a modparam to register the amount of contacts per AOR - which would 
> do what you need.
Sorry - late evening… It’s within the normal registrar module, not in ims.
http://kamailio.org/docs/modules/4.4.x/modules/registrar.html#registrar.p.max_contacts

/O

___
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] Multiple Registrations - Overwrite oldest contact

2016-04-01 Thread Bruno Emer
Hello, *Olle!*

*Thanks for your help in this case, and don't worry about the time
(actually I wasn't even expecting to get an answer today).*


*I know the max_contacts parameter. But the problem is that if I set the
max_contacts to 2, when the user tries to register again, he gets an error
message 503. The point is that I want to get the user registered, and
replace the oldest location entry for the newest one.*



*Bruno Emer*

Mobile: +55 11 96540-0044
email: brunoe...@gmail.com

2016-04-01 16:31 GMT-03:00 Bruno Emer :

> Hello all.
>
> I have problem here and I tried to find a solution and search over
> internet, but without success.
>
> My scenario is the following: I have an application that must be
> registered in Kamailio when a user logs in the web interface, so he can get
> calls (something like a web softphone using webrtc). At this point, we are
> OK, and everything is working fine.
>
> To get these register functions I am using the parameter "save("location",
> "0x04")" as described in the REGISTRAR module documentation, so if a user
> logs in another web browser or computer, only the last one will continue
> registered and all calls will be forwarded to him.
>
> The point is that now we are creating a phone app that will do almost the
> same thing as the web interface, allowing users to receive calls using the
> mobile device, and here is my problem: I want to allow my users to be
> registered on two devices at the same time, but if a user logs into another
> device, I don't want to reply with a 503. I want to allow the user to
> register again, deregistering the oldest contact.
>
> I saw that there is a module named "ims_usrloc_scscf" and on its
> description it says "implemented overwrite oldest contact behaviour", but
> I couldn't find any documentation about it.
>
> So, is there a way to get this working today?
>
>
> *Bruno Emer*
>
> Mobile: +55 11 96540-0044
> email: brunoe...@gmail.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] Multiple Registrations - Overwrite oldest contact

2016-04-01 Thread Olle E. Johansson

> On 01 Apr 2016, at 22:07, Bruno Emer  wrote:
> 
> Hello, Olle!
> 
> Thanks for your help in this case, and don't worry about the time (actually I 
> wasn't even expecting to get an answer today).
> 
> I know the max_contacts parameter. But the problem is that if I set the 
> max_contacts to 2, when the user tries to register again, he gets an error 
> message 503. The point is that I want to get the user registered, and replace 
> the oldest location entry for the newest one.
THen you need to check the parameters to the save() command on the same 
documentation page:
"
0x04 - store and maintain one contact per AoR. If there are other contact 
addresses for AoR not matching current registration, remove them. This mode 
ensures one contact per AoR (user).

“

/O
> 
> 
> 
> Bruno Emer
> 
> Mobile: +55 11 96540-0044 
> email: brunoe...@gmail.com 
> 
> 2016-04-01 16:31 GMT-03:00 Bruno Emer  >:
> Hello all.
> 
> I have problem here and I tried to find a solution and search over internet, 
> but without success.
> 
> My scenario is the following: I have an application that must be registered 
> in Kamailio when a user logs in the web interface, so he can get calls 
> (something like a web softphone using webrtc). At this point, we are OK, and 
> everything is working fine.
> 
> To get these register functions I am using the parameter "save("location", 
> "0x04")" as described in the REGISTRAR module documentation, so if a user 
> logs in another web browser or computer, only the last one will continue 
> registered and all calls will be forwarded to him.
> 
> The point is that now we are creating a phone app that will do almost the 
> same thing as the web interface, allowing users to receive calls using the 
> mobile device, and here is my problem: I want to allow my users to be 
> registered on two devices at the same time, but if a user logs into another 
> device, I don't want to reply with a 503. I want to allow the user to 
> register again, deregistering the oldest contact.
> 
> I saw that there is a module named "ims_usrloc_scscf" and on its description 
> it says "implemented overwrite oldest contact behaviour", but I couldn't find 
> any documentation about it.
> 
> So, is there a way to get this working today?
> 
> 
> Bruno Emer
> 
> Mobile: +55 11 96540-0044  
> email: brunoe...@gmail.com 
> ___
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users@lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

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


Re: [SR-Users] Multiple Registrations - Overwrite oldest contact

2016-04-01 Thread Bruno Emer
This is my problem... I want to have 2 contacts for AOR, and not only one.

When the 3rd arrives, it must remove the oldest and continue with 2...

*If I am using the 0x04 parameter, it will save just one contact, and the
user will not be able to get the Invite both, in the mobile device and web
interface.*

*Bruno Emer*

Mobile: +55 11 96540-0044
email: brunoe...@gmail.com




  

2016-04-01 17:07 GMT-03:00 Bruno Emer :

> Hello, *Olle!*
>
> *Thanks for your help in this case, and don't worry about the time
> (actually I wasn't even expecting to get an answer today).*
>
>
> *I know the max_contacts parameter. But the problem is that if I set the
> max_contacts to 2, when the user tries to register again, he gets an error
> message 503. The point is that I want to get the user registered, and
> replace the oldest location entry for the newest one.*
>
>
>
> *Bruno Emer*
>
> Mobile: +55 11 96540-0044
> email: brunoe...@gmail.com
>
> 2016-04-01 16:31 GMT-03:00 Bruno Emer :
>
>> Hello all.
>>
>> I have problem here and I tried to find a solution and search over
>> internet, but without success.
>>
>> My scenario is the following: I have an application that must be
>> registered in Kamailio when a user logs in the web interface, so he can get
>> calls (something like a web softphone using webrtc). At this point, we are
>> OK, and everything is working fine.
>>
>> To get these register functions I am using the parameter
>> "save("location", "0x04")" as described in the REGISTRAR module
>> documentation, so if a user logs in another web browser or computer, only
>> the last one will continue registered and all calls will be forwarded to
>> him.
>>
>> The point is that now we are creating a phone app that will do almost the
>> same thing as the web interface, allowing users to receive calls using the
>> mobile device, and here is my problem: I want to allow my users to be
>> registered on two devices at the same time, but if a user logs into another
>> device, I don't want to reply with a 503. I want to allow the user to
>> register again, deregistering the oldest contact.
>>
>> I saw that there is a module named "ims_usrloc_scscf" and on its
>> description it says "implemented overwrite oldest contact behaviour",
>> but I couldn't find any documentation about it.
>>
>> So, is there a way to get this working today?
>>
>>
>> *Bruno Emer*
>>
>> Mobile: +55 11 96540-0044
>> email: brunoe...@gmail.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] Multiple Registrations - Overwrite oldest contact

2016-04-01 Thread Olle E. Johansson
That requires a bit more of reading the same doc page, but I still think you 
can do it.

Run reg_fetch_contacts and check how many you have. Loop through them and 
unregister by the ruri (id) of the one that expires first
if you have too many.

We’ve made this function to make the location database handling very 
transparent to the script writer that wants to go beyond 
the ordinary and do some fun scripting :-)

http://kamailio.org/docs/modules/devel/modules/registrar.html#registrar.f.reg_fetch_contacts
http://kamailio.org/docs/modules/devel/modules/registrar.html#registrar.f.unregister

Kamailio is cool, isn’t it? :-)

/O

> On 01 Apr 2016, at 22:18, Bruno Emer  wrote:
> 
> This is my problem... I want to have 2 contacts for AOR, and not only one. 
> 
> When the 3rd arrives, it must remove the oldest and continue with 2...
> 
> If I am using the 0x04 parameter, it will save just one contact, and the user 
> will not be able to get the Invite both, in the mobile device and web 
> interface.
> 
> Bruno Emer
> 
> Mobile: +55 11 96540-0044  
> email: brunoe...@gmail.com 
>    
>   
>   
>   
>   
> 2016-04-01 17:07 GMT-03:00 Bruno Emer  >:
> Hello, Olle!
> 
> Thanks for your help in this case, and don't worry about the time (actually I 
> wasn't even expecting to get an answer today).
> 
> I know the max_contacts parameter. But the problem is that if I set the 
> max_contacts to 2, when the user tries to register again, he gets an error 
> message 503. The point is that I want to get the user registered, and replace 
> the oldest location entry for the newest one.
> 
> 
> 
> Bruno Emer
> 
> Mobile: +55 11 96540-0044  
> email: brunoe...@gmail.com 
> 
> 2016-04-01 16:31 GMT-03:00 Bruno Emer  >:
> Hello all.
> 
> I have problem here and I tried to find a solution and search over internet, 
> but without success.
> 
> My scenario is the following: I have an application that must be registered 
> in Kamailio when a user logs in the web interface, so he can get calls 
> (something like a web softphone using webrtc). At this point, we are OK, and 
> everything is working fine.
> 
> To get these register functions I am using the parameter "save("location", 
> "0x04")" as described in the REGISTRAR module documentation, so if a user 
> logs in another web browser or computer, only the last one will continue 
> registered and all calls will be forwarded to him.
> 
> The point is that now we are creating a phone app that will do almost the 
> same thing as the web interface, allowing users to receive calls using the 
> mobile device, and here is my problem: I want to allow my users to be 
> registered on two devices at the same time, but if a user logs into another 
> device, I don't want to reply with a 503. I want to allow the user to 
> register again, deregistering the oldest contact.
> 
> I saw that there is a module named "ims_usrloc_scscf" and on its description 
> it says "implemented overwrite oldest contact behaviour", but I couldn't find 
> any documentation about it.
> 
> So, is there a way to get this working today?
> 
> 
> Bruno Emer
> 
> Mobile: +55 11 96540-0044  
> email: brunoe...@gmail.com 
> 
> ___
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users@lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

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


Re: [SR-Users] Multiple Registrations - Overwrite oldest contact

2016-04-01 Thread Bruno Emer
Sure it is!

This is exactly what I was looking for! Actually I wasn't able to see that
there was a way to perform this action!

Thanks for your help, Olle!

I will try to create this, and when I have it done, I will post my script
here, so if someone else need the same problem I can help.

Now, I have just one more question about my scenario: when I register a
user, is there a way to create something like a "custom field" on the
location? To explain better: If possible, I can add something like a custom
header that says if the user is registered from a phone device or the web
interface, then I can perform the loop and replace only the oldest contact
using that device...



*Bruno Emer*

Mobile: +55 11 96540-0044
email: brunoe...@gmail.com

2016-04-01 17:18 GMT-03:00 Bruno Emer :

> This is my problem... I want to have 2 contacts for AOR, and not only one.
>
> When the 3rd arrives, it must remove the oldest and continue with 2...
>
> *If I am using the 0x04 parameter, it will save just one contact, and the
> user will not be able to get the Invite both, in the mobile device and web
> interface.*
>
> *Bruno Emer*
>
> Mobile: +55 11 96540-0044
> email: brunoe...@gmail.com
> 
> 
> 
> 
>   
>
> 2016-04-01 17:07 GMT-03:00 Bruno Emer :
>
>> Hello, *Olle!*
>>
>> *Thanks for your help in this case, and don't worry about the time
>> (actually I wasn't even expecting to get an answer today).*
>>
>>
>> *I know the max_contacts parameter. But the problem is that if I set the
>> max_contacts to 2, when the user tries to register again, he gets an error
>> message 503. The point is that I want to get the user registered, and
>> replace the oldest location entry for the newest one.*
>>
>>
>>
>> *Bruno Emer*
>>
>> Mobile: +55 11 96540-0044
>> email: brunoe...@gmail.com
>>
>> 2016-04-01 16:31 GMT-03:00 Bruno Emer :
>>
>>> Hello all.
>>>
>>> I have problem here and I tried to find a solution and search over
>>> internet, but without success.
>>>
>>> My scenario is the following: I have an application that must be
>>> registered in Kamailio when a user logs in the web interface, so he can get
>>> calls (something like a web softphone using webrtc). At this point, we are
>>> OK, and everything is working fine.
>>>
>>> To get these register functions I am using the parameter
>>> "save("location", "0x04")" as described in the REGISTRAR module
>>> documentation, so if a user logs in another web browser or computer, only
>>> the last one will continue registered and all calls will be forwarded to
>>> him.
>>>
>>> The point is that now we are creating a phone app that will do almost
>>> the same thing as the web interface, allowing users to receive calls using
>>> the mobile device, and here is my problem: I want to allow my users to be
>>> registered on two devices at the same time, but if a user logs into another
>>> device, I don't want to reply with a 503. I want to allow the user to
>>> register again, deregistering the oldest contact.
>>>
>>> I saw that there is a module named "ims_usrloc_scscf" and on its
>>> description it says "implemented overwrite oldest contact behaviour",
>>> but I couldn't find any documentation about it.
>>>
>>> So, is there a way to get this working today?
>>>
>>>
>>> *Bruno Emer*
>>>
>>> Mobile: +55 11 96540-0044
>>> email: brunoe...@gmail.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] Trouble initializing TLS on Fedora 23

2016-04-01 Thread Anthony Messina
On Tuesday, January 05, 2016 07:32:32 PM Daniel-Constantin Mierla wrote:
> Hello,
> 
> On 02/01/16 03:11, Anthony Messina wrote:
> > On Friday, January 01, 2016 04:43:56 PM Bruce Ferrell wrote:
> >> On 01/01/2016 03:34 PM, Anthony Messina wrote:
> >>> Happy New Year!
> >>> 
> >>> I've just upgraded my Kamailio (build from master@c7e411e) instance to
> >>> Fedora  23 from Fedora 22.  I've built the packages specifically for
> >>> Fedora 23 with the following current sources:
> >>> 
> >>> openssl-1.0.2e-3.fc23.x86_64
> >>> openssl-libs-1.0.2e-3.fc23.x86_64
> >>> 
> >>> openssl version reports...
> >>> OpenSSL 1.0.2e-fips 3 Dec 2015
> >>> 
> >>> Even so, the following error occurs.  It seems like Kamailio having
> >>> trouble  detecting that I'm using running with the same version that I
> >>> have installed, and the same version that I have compiled against.
> >>> 
> >>> tls [tls_init.c:557]: init_tls_h(): ERROR: tls: init_tls_h: installed
> >>> openssl  library version is too different from the library the Kamailio
> >>> tls module was compiled with: installed "OpenSSL 1.0.0-fips 29 Mar 2010"
> >>> (0x1003), compiled "OpenSSL 1.0.2d-fips 9 Jul 2015" (0x1000204f).
> >>> 
> >>>   Please make sure a
> >>> 
> >>> compatible version is used (tls_force_run in kamailio.cfg will override
> >>> this  check)
> >>> 
> >>> 
> >>> 
> >>> CRITICAL:  [main.c:2558]: main(): could not initialize tls,
> >>> exiting...
> >>> 
> >>> Any pointers?  -A
> >> 
> >> Anthony,
> >> 
> >> When you did the build, it found another openssl on the system.  for
> >> starts, I'd try ldd on the Kamailio binaries/libraries.  Make sure you
> >> don't have any from previous builds hanging around... I've been bit by
> >> that more than once
> > 
> > Thanks Bruce. The strange thing is that I build the RPMs in a Koji/Mock
> > instance which should yield a clean buildroot for each build. I'll
> > continue
> > digging further. -A
> 
> the issue is that the lib on target system is different than the lib on
> built system. Are you using same OS for building as for the target machine?
> 
> Cheers,
> Daniel

I had filed a bug upstream with Fedora 
https://bugzilla.redhat.com/show_bug.cgi?id=1301301 which eventually helped me 
to find that the Makefile for Kamailio's TLS module is using:

LIBS += $(shell pkg-config libssl --libs)

which only returns '-lssl':

# pkg-config libssl --libs
-lssl

It seems that in order for the version detection to work properly, it also 
needs '-lcrypto'

Perhaps the TLS module Makefile might need to add libcrypto just as the CRYPTO 
module Makefile does:
https://github.com/kamailio/kamailio/blob/master/modules/crypto/Makefile

-A

-- 
Anthony - https://messinet.com/ - https://messinet.com/~amessina/gallery
8F89 5E72 8DF0 BCF0 10BE 9967 92DC 35DC B001 4A4E


signature.asc
Description: This is a digitally signed message part.
___
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] SQlite DB Lock with Presence

2016-04-01 Thread Kristian Kielhofner
I tried this method and seem to have exchanged one set of errors for another:

Apr  2 06:30:06 pbx kamailio[9526]: INFO: pua_dialoginfo
[dialog_publish.c:386]: dialog_publish_multi(): CALLING dialog_publish
for URI sip:9197@192.168.111.216;transport=UDP
Apr  2 06:30:06 pbx kamailio[9519]: INFO: presence [notify.c:1614]:
send_notify_request(): NOTIFY sip:1001@192.168.111.216 via
sip:1001@192.168.111.174:53512;transport=UDP on behalf of
sip:1000@192.168.111.216 for event dialog
Apr  2 06:30:12 pbx kamailio[9532]: ERROR: db_sqlite [dbase.c:489]:
db_sqlite_commit(): sqlite commit failed: NOT NULL constraint failed:
pua.call_id
Apr  2 06:30:12 pbx kamailio[9532]: ERROR: db_sqlite [dbase.c:138]:
db_sqlite_cleanup_query(): finalize failed: NOT NULL constraint
failed: pua.call_id
Apr  2 06:30:12 pbx kamailio[9532]: ERROR: pua [pua.c:1179]:
db_update(): while inserting in db table pua

On Fri, Apr 1, 2016 at 5:21 AM, Daniel-Constantin Mierla
 wrote:
>
>
> On 31/03/16 21:05, David Holl wrote:
>
> I'm curious why the kamailio sqlite module doesn't export a transaction API,
> especially since the native sqlite API does support transactions according
> to https://www.sqlite.org/transactional.html   Maybe someday, I'd get time
> to dig into the kamailio module myself to try lending a hand...
>
> I guess nobody from dev team needed transaction operations for sqlite, I
> expect that most of us use a larger sql server (mysql, postgres) if they
> have presence services...
>
> Your contribution to add them will be very welcome, of course!
>
>
> Anyhow, the following is what I did to work around the locked db errors:
>
> I'm not running BLF, but I have been using sqlite for my testing.  At first,
> I was getting occasional "database is locked" errors, but then I enabled
> "wal" mode on my database on a hunch to speed up operations.  I didn't
> measure the actual db performance before/after enabling wal, but the error
> messages went away after enabling wal.  (Now, I only get an occasional
> locked message if I happen to have SIP tracing enabled and writing to the
> same database as the rest of the kamailio tables.  To work around this
> issue, I just moved the sip_trace table to a separate sqlite db file.)
>
> wal is described in detail at https://www.sqlite.org/wal.html
>
> The following is the short script I wrote to remind myself how I enabled
> wal.  It just runs  "journal_mode=WAL;" on the database, and the database
> supposedly can be converted back to the default via " journal_mode=DELETE;".
> (Though, the usual "cya" disclaimer of backing up your DB always applies...)
>
> Contents of make_siptrace_db.sh
>
> #!/bin/sh
> set -e
> # Instructions:
> #   /etc/init.d/kamailio stop
> #   #Run this script with db file as the command line parameter:
> #   ./make_siptrace_db.sh /path/to/db/kamailio.sqlite
> #   /etc/init.d/kamailio start
> #
> # For details on Write-Ahead Logging (WAL), see
> https://www.sqlite.org/wal.html
> exec sqlite3 -bail -batch "$1" << 'EOF'
> PRAGMA journal_mode=WAL;
> EOF
> # If this works, sqlite3 should print out "wal"
>
>
>
> Very useful hint, many thanks for sharing all these details!
>
> Cheers,
> Daniel
>
>
>
>
> On 3/31/16 11:25 AM, Kristian Kielhofner wrote:
>
> Hi Daniel,
>
>   I switched to mysql and haven't looked back but I will take another
> look with sqlite because it *should* work.
>
>   Thanks!
>
> On Thu, Mar 31, 2016 at 12:11 PM, Daniel-Constantin Mierla
>  wrote:
>
> Hello,
>
> I looked quickly at sqlite and the module doesn't export db transaction API,
> so it is not what I thought in the first place (some presence operations try
> to use db transactions if supported by db module). So it is something in
> sqlite that locks the table. Do you see any error message in the logs before
> the one with the table locked?
>
> Cheers,
> Daniel
>
>
> On 30/03/16 14:28, Kristian Kielhofner wrote:
>
> Hi Daniel,
>
>  First call.
>
> Thanks!
>
> On Wednesday, March 30, 2016, Daniel-Constantin Mierla 
> wrote:
>
> Hello,
>
> not using sqlite here, but could be related to presence modules doing db
> transactions and not releasing the locks. Do you get the issue after the
> first call, or it runs for a while and at some point it breaks?
>
> Cheers,
> Daniel
>
> On 30/03/16 02:50, Kristian Kielhofner wrote:
>
> Hello everyone,
>
>   I'm trying to use BLF with the config here (except with SQlite):
>
> http://kb.asipto.com/kamailio:presence:k43-blf
>
>   BLF seems to work perfectly except after the call is ended I get
> "sqlite commit failed: database is locked" error messages as seen
> here:
>
> http://pastebin.com/xVijj98H
>
> BLF is then broken at this point.
>
> kamailio -v
> version: kamailio 4.3.5 (x86_64/linux) 950657
> flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, 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_PTHREAD_MUTEX, USE_DNS_CACHE,
> USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKL