Re: [SR-Users] VERY IMPORTANT: deciding when to remove the MI code

2016-12-05 Thread ycaner

  

  
  
Hello, 
you are right. some
carrier route functions are missing.important of them are dump
and show methods.if i have time ,i can add them. 
Cheers. 


6.12.2016 10:48 tarihinde
  Daniel-Constantin Mierla-6 [via SIP Router] yazdı: 

 Hello,
  
  
  looking in the code I see the carrierroute module has already rpc
  
  command for reload operations. But there are some other mi
  commands not
  
  implemented as rpc.
  
  
  Cheers,
  
  Daniel
  
  
  
  On 05/12/2016 11:28, Daniel-Constantin Mierla wrote:
  
> Hello,

>

> few that are missing can be probably added once we discover
them. The

> best is to open an issue on bug tracker whenever you are
aware of a mi

> command not implemented in rpc. Even better will be a pull
request :-)

> -- migrating from mi to rpc should not be complex and
rather easy to

> lean by looking at other variants with both
implementations.

>

> Cheers,

> Daniel

>

>

> On 02/12/2016 16:18, ycaner wrote:

>> Hello

>> Carrier route module doesnt have RPC command., we need
to add it 
>> Cheers.

>>

>>

>>

>> --

>> View this message in context: 
http://sip-router.1086192.n5.nabble.com/VERY-IMPORTANT-deciding-when-to-remove-the-MI-code-tp153719p153773.html
 
>> Sent from the Users mailing list archive at Nabble.com.

>>

>> ___

>> SIP Express Router (SER) and Kamailio (OpenSER) -
sr-users mailing list

>> [hidden email] 

>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users 
  
  -- 
  Daniel-Constantin Mierla
  
  www.twitter.com/miconda  -- www.linkedin.com/in/miconda 
  
  Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.com 
  
  
  
  ___
  
  SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing
  list
  
  [hidden email] 
  
  http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users 
  
  
  
  
If you reply to this email, your
  message will be added to the discussion below: 

http://sip-router.1086192.n5.nabble.com/VERY-IMPORTANT-deciding-when-to-remove-the-MI-code-tp153719p153841.html
 
  
  
To unsubscribe from VERY IMPORTANT: deciding when to remove the
MI code, click
  here . 
NAML  


-- 
  
  
  

  

  

  

  



yasin-imza-2016.jpg (23K) 





--
View this message in context: 
http://sip-router.1086192.n5.nabble.com/VERY-IMPORTANT-deciding-when-to-remove-the-MI-code-tp153719p153843.html
Sent from the Users mailing list archive at Nabble.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] Local messages are malformed in Kamailio 4.4.X

2016-12-05 Thread Daniel-Constantin Mierla
For reference: patches to fix this issue were pushed to master and 4.4
branches several days ago.

Cheers,
Daniel


On 02/12/2016 01:52, g.Helio wrote:
>
> Yes, in my test te parameter reparse_invite was enabled. And I was
> using Kamailio 4.4.2.
>
> Regards,
> Helio
>
>  
>
>  
> 
>
> *De: *"Daniel-Constantin Mierla" 
> *Enviada: *2016/12/01 06:52:04
> *Para: *sr-users@lists.sip-router.org, hok.s...@gmail.com
> *Assunto: * Re: [SR-Users] Local messages are malformed in Kamailio 4.4.X
>  
>
> Hello,
>
> have you set modparams for tm module related to reparsing the invite
> or on dns failover?
>
> The build_local() should be used only in some specific cases and want
> to be sure it doesn't get executed somehow when it shouldn't be.
>
> Cheers,
> Daniel
>
>  
> On 30/11/2016 16:40, Helio Okuyama wrote:
>> Local messages are malformed in Kamailio 4.4.X. For example after
>> receiving an error response (603) to an INVITE message, the ACK is
>> generated with header Max-Forwards concatenated to header CSeq and
>> double CRLF, which is wrong.
>>  
>> Via: SIP/2.0/TLS
>> 173.16.10.61:5061;branch=z9hG4bKc782.5b960c7c48a4363a0126963daa797eb0.0;i=7
>> From: "22861";tag=snl_OIPEOzJUNy
>> Call-ID: 61b500a71b510a1Pj61qq1k9dPW
>> To: ;tag=435012226
>> CSeq: 2351 ACKMax-Forwards: 70
>>  
>> User-Agent:...
>>  
>>  
>> The fix for that seems to be just the order of append_str in function
>> build_local() from tm\t_msgbuilder.c.
>>  
>> append_str( p, method, method_len );
>> +append_str( p, CRLF, CRLF_LEN );
>> append_str( p, MAXFWD_HEADER, MAXFWD_HEADER_LEN );
>> -append_str( p, CRLF, CRLF_LEN );
>>  
>>  
>>  
>>
>>  
>> ___
>> 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://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
> Kamailio Advanced Training, Berlin, Nov 28-30, 2016 - http://www.asipto.com
>
>
> ___
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users@lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference - May 8-10, 2017 - 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] VERY IMPORTANT: deciding when to remove the MI code

2016-12-05 Thread Daniel-Constantin Mierla
Hello,

looking in the code I see the carrierroute module has already rpc
command for reload operations. But there are some other mi commands not
implemented as rpc.

Cheers,
Daniel


On 05/12/2016 11:28, Daniel-Constantin Mierla wrote:
> Hello,
>
> few that are missing can be probably added once we discover them. The
> best is to open an issue on bug tracker whenever you are aware of a mi
> command not implemented in rpc. Even better will be a pull request :-)
> -- migrating from mi to rpc should not be complex and rather easy to
> lean by looking at other variants with both implementations.
>
> Cheers,
> Daniel
>
>
> On 02/12/2016 16:18, ycaner wrote:
>> Hello
>> Carrier route module doesnt have RPC command., we need to add it 
>> Cheers.
>>
>>
>>
>> --
>> View this message in context: 
>> http://sip-router.1086192.n5.nabble.com/VERY-IMPORTANT-deciding-when-to-remove-the-MI-code-tp153719p153773.html
>> Sent from the Users mailing list archive at Nabble.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
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference - May 8-10, 2017 - 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] Send SIP Info within a dialog using $uac_req(method)="INFO"

2016-12-05 Thread Daniel-Constantin Mierla
Hello,


you can reorganize the config in order to execute t_relay() for ACK,
then you can do your stuff after it.


if is ack {

  t_relay();

  custom stuff

  exit;

}


Cheers,
Daniel


On 05/12/2016 15:03, Jonathan Hunter wrote:
>
> Hello,
>
>
> I had been testing with ACK within that route, but in the ideal
> scenario I want to proxy the ACK, then follow that with the SIP INFO,
> where as at the moment it sends at same time, once it matches.
>
>
> I wondered if there is an event route I can trigger once I know the
> ACK has been relayed?
>
>
> Thanks
>
>
> Jon
>
>
>
> 
> *From:* Daniel-Constantin Mierla 
> *Sent:* 05 December 2016 13:54
> *To:* Jonathan Hunter; Kamailio SER - Users Mailing List
> *Subject:* Re: [SR-Users] Send SIP Info within a dialog using
> $uac_req(method)="INFO"
>  
>
> Hello,
>
>
> the ACK for requests within dialogs is routed via route[WITHINDLG], if
> it has a Route header -- also you can check if it belongs to an dialog
> -- dialog module should export a function for that.
>
>
> Cheers,
> Daniel
>
>
> On 05/12/2016 14:13, Jonathan Hunter wrote:
>>
>> Hello,
>>
>>
>> Ok thanks for that, it works perfectly.
>>
>>
>> I am generating the SIP INFO message, on receipt of a 200ok, which is
>> being triggered by the event_route[dialog:start].
>>
>>
>> One last thing, is it possible to trigger /capture the event of the
>> ACK being received for the 200 ok ?
>>
>>
>> As ideally I want to send SIP INFO after the ACK has been sent,
>> however currently I am triggering on receipt of the 200ok, so dialog
>> is started.
>>
>>
>> Can I have;
>>
>>
>> INVITE--->
>>
>> <---200OK
>>
>> ACK--->
>>
>> INFO>
>>
>>
>> So in effect RELAY the ACK, then trigger this SIP INFO  to be sent?
>>
>>
>> Thanks
>>
>>
>> Jon
>>
>>
>>
>>
>> 
>> *From:* Daniel-Constantin Mierla 
>> *Sent:* 05 December 2016 10:32
>> *To:* Jonathan Hunter; Kamailio SER - Users Mailing List
>> *Subject:* Re: [SR-Users] Send SIP Info within a dialog using
>> $uac_req(method)="INFO"
>>  
>>
>> Hello,
>>
>>
>> all the headers must be in a single parameter, I see that you provide
>> headers one by one in the params array. Try:
>>
>>
>> jsonrpc_exec('
>> {
>>  "jsonrpc":"2.0",
>>  "method":"tm.t_uac_start",
>>  "params": [
>> "INFO",
>> "$dlg(to_uri)",
>> ".",
>> ".",
>>
>> "From:$var(testjon)\r\nTo:$var(testjon2)\r\nContact:$var(testjon4)\r\nContent-Type:
>> application/json\r\nContent-Length: 0\r\n"
>>   ]
>> }
>> ');
>>
>> Cheers,
>> Daniel
>>
>> On 01/12/2016 17:12, Jonathan Hunter wrote:
>>> Hi Daniel, 
>>>
>>> I am trying tm.t_uac_start and its stating Content-Type Missing, I
>>> have tried to add to params but it doesnt like it, where should it
>>> be defined?
>>>
>>> Command below;
>>>
>>>
>>> jsonrpc_exec('{"jsonrpc":"2.0","method":"tm.t_uac_start","params":
>>> ["INFO",
>>> "$dlg(to_uri)",".",".","From:$var(testjon)\r\n","To:$var(testjon2)\r\n","Contact:$var(testjon4)\r\n","Content-Type:
>>> application/json\r\n","Content-Length: 0\r\n"]}');
>>>
>>> And logs;
>>>
>>> Dec  1 16:09:15 POC_ProxyA /usr/sbin/kamailio[11883]: INFO:
>>> 

Re: [SR-Users] Send SIP Info within a dialog using $uac_req(method)="INFO"

2016-12-05 Thread Jonathan Hunter
Hello,


I had been testing with ACK within that route, but in the ideal scenario I want 
to proxy the ACK, then follow that with the SIP INFO, where as at the moment it 
sends at same time, once it matches.


I wondered if there is an event route I can trigger once I know the ACK has 
been relayed?


Thanks


Jon



From: Daniel-Constantin Mierla 
Sent: 05 December 2016 13:54
To: Jonathan Hunter; Kamailio SER - Users Mailing List
Subject: Re: [SR-Users] Send SIP Info within a dialog using 
$uac_req(method)="INFO"


Hello,


the ACK for requests within dialogs is routed via route[WITHINDLG], if it has a 
Route header -- also you can check if it belongs to an dialog -- dialog module 
should export a function for that.


Cheers,
Daniel

On 05/12/2016 14:13, Jonathan Hunter wrote:

Hello,


Ok thanks for that, it works perfectly.


I am generating the SIP INFO message, on receipt of a 200ok, which is being 
triggered by the event_route[dialog:start].


One last thing, is it possible to trigger /capture the event of the ACK being 
received for the 200 ok ?


As ideally I want to send SIP INFO after the ACK has been sent, however 
currently I am triggering on receipt of the 200ok, so dialog is started.


Can I have;


INVITE--->

<---200OK

ACK--->

INFO>


So in effect RELAY the ACK, then trigger this SIP INFO  to be sent?


Thanks


Jon




From: Daniel-Constantin Mierla 
Sent: 05 December 2016 10:32
To: Jonathan Hunter; Kamailio SER - Users Mailing List
Subject: Re: [SR-Users] Send SIP Info within a dialog using 
$uac_req(method)="INFO"


Hello,


all the headers must be in a single parameter, I see that you provide headers 
one by one in the params array. Try:


jsonrpc_exec('
{
 "jsonrpc":"2.0",
 "method":"tm.t_uac_start",
 "params": [
"INFO",
"$dlg(to_uri)",
".",
".",

"From:$var(testjon)\r\nTo:$var(testjon2)\r\nContact:$var(testjon4)\r\nContent-Type:
 application/json\r\nContent-Length: 0\r\n"
  ]
}
');

Cheers,
Daniel

On 01/12/2016 17:12, Jonathan Hunter wrote:
Hi Daniel,

I am trying tm.t_uac_start and its stating Content-Type Missing, I have tried 
to add to params but it doesnt like it, where should it be defined?

Command below;


jsonrpc_exec('{"jsonrpc":"2.0","method":"tm.t_uac_start","params": ["INFO", 
"$dlg(to_uri)",".",".","From:$var(testjon)\r\n","To:$var(testjon2)\r\n","Contact:$var(testjon4)\r\n","Content-Type:
 application/json\r\n","Content-Length: 0\r\n"]}');

And logs;

Dec  1 16:09:15 POC_ProxyA /usr/sbin/kamailio[11883]: INFO: 

Re: [SR-Users] Send SIP Info within a dialog using $uac_req(method)="INFO"

2016-12-05 Thread Daniel-Constantin Mierla
Hello,


the ACK for requests within dialogs is routed via route[WITHINDLG], if
it has a Route header -- also you can check if it belongs to an dialog
-- dialog module should export a function for that.


Cheers,
Daniel


On 05/12/2016 14:13, Jonathan Hunter wrote:
>
> Hello,
>
>
> Ok thanks for that, it works perfectly.
>
>
> I am generating the SIP INFO message, on receipt of a 200ok, which is
> being triggered by the event_route[dialog:start].
>
>
> One last thing, is it possible to trigger /capture the event of the
> ACK being received for the 200 ok ?
>
>
> As ideally I want to send SIP INFO after the ACK has been sent,
> however currently I am triggering on receipt of the 200ok, so dialog
> is started.
>
>
> Can I have;
>
>
> INVITE--->
>
> <---200OK
>
> ACK--->
>
> INFO>
>
>
> So in effect RELAY the ACK, then trigger this SIP INFO  to be sent?
>
>
> Thanks
>
>
> Jon
>
>
>
>
> 
> *From:* Daniel-Constantin Mierla 
> *Sent:* 05 December 2016 10:32
> *To:* Jonathan Hunter; Kamailio SER - Users Mailing List
> *Subject:* Re: [SR-Users] Send SIP Info within a dialog using
> $uac_req(method)="INFO"
>  
>
> Hello,
>
>
> all the headers must be in a single parameter, I see that you provide
> headers one by one in the params array. Try:
>
>
> jsonrpc_exec('
> {
>  "jsonrpc":"2.0",
>  "method":"tm.t_uac_start",
>  "params": [
> "INFO",
> "$dlg(to_uri)",
> ".",
> ".",
>
> "From:$var(testjon)\r\nTo:$var(testjon2)\r\nContact:$var(testjon4)\r\nContent-Type:
> application/json\r\nContent-Length: 0\r\n"
>   ]
> }
> ');
>
> Cheers,
> Daniel
>
> On 01/12/2016 17:12, Jonathan Hunter wrote:
>> Hi Daniel, 
>>
>> I am trying tm.t_uac_start and its stating Content-Type Missing, I
>> have tried to add to params but it doesnt like it, where should it be
>> defined?
>>
>> Command below;
>>
>>
>> jsonrpc_exec('{"jsonrpc":"2.0","method":"tm.t_uac_start","params":
>> ["INFO",
>> "$dlg(to_uri)",".",".","From:$var(testjon)\r\n","To:$var(testjon2)\r\n","Contact:$var(testjon4)\r\n","Content-Type:
>> application/json\r\n","Content-Length: 0\r\n"]}');
>>
>> And logs;
>>
>> Dec  1 16:09:15 POC_ProxyA /usr/sbin/kamailio[11883]: INFO: 

Re: [SR-Users] Limiting Registration Contacts

2016-12-05 Thread Daniel-Constantin Mierla
Hello,

I didn't try to suggest that what you want won't be useful or rejected
if someone wants to contribute. My explanation was for what exists now.

Also, be aware that you can have one contact per device, which is
feature controlled differently than the max_contacts -- see save()
documentation from registrar module.

Moreover, the usrloc module can delete unreachable contacts (if they
don't respond to OPTIONS keepalives). It can also remove contacts that
have the associated tcp connection closed (if the devices connect
directly to registrar) -- you can implement also your idea of sending
notifications from an edge proxy when a tcp connection is closed (see
tcpops module for the event_route executed in such case).

Cheers,
Daniel


On 05/12/2016 13:33, Colin Morelli wrote:
> Hey Daniel,
>
> This makes sense, thanks for the explanation.
>
> While I can understand why it works the way it does now, I still think
> having an option here would be great. My thought is, whether the
> mobile phone that re-registers every 10 minutes or the desk phone is
> "older," the point is that they're both older than the device which is
> currently trying to register and is unable to. There's also some
> preferential logic you could try to add here - perhaps try to remove
> .invalid contacts first, which are generally used by browsers and
> likely less stable than contacts with an IP address.
>
> All that said, I appreciate the clarification. I believe it's fairly
> trivial to do this with sqlops anyway so it's not a huge deal. I also
> may be able to do something in the edge proxy to automatically send an
> unregister if a websocket connection closes after a register request.
>
> Thanks!
> Colin
> On Mon, Dec 5, 2016 at 6:02 AM Daniel-Constantin Mierla
> mailto:mico...@gmail.com>> wrote:
>
> Hello,
>
> right now the rule is to reject the registrations that exceed the
> max_contacts limit. The main reason behind this policy is the
> registration mechanism in SIP which requires periodic
> update/refresh but also different expires intervals.
>
> In this way it's hard to select the "old device". Can be a desktop
> phone registering every hour and stable connection but also a
> mobile phone registering every 10 minutes, changing the ip every
> now and then. By just relying on the oldest registration, the
> desktop phone is likely the candidate to remove most of the time,
> but keep other invalid mobile contacts.
>
> The solution would be to use GRUU (or the instance parameter) for
> registration contacts. In this way each new registration from a
> device will replace its own old contact, even if it has a
> different contact address.
>
> Cheers,
> Daniel
>
>
> On 01/12/2016 23:59, Colin Morelli wrote:
>> Hey Alex - not sure I'm quite following what you mean. The
>> bindings are only for web clients. Are you suggesting the clients
>> themselves de-register? I'd have no problem with that with the
>> exception of the fact that there's simply no way to guarantee
>> that happens. It's a race condition between whether the
>> unregistration can be sent before the browser kills the websocket
>> connection on refresh.
>>
>> On Thu, Dec 1, 2016 at 5:57 PM, Alex Balashov
>> mailto:abalas...@evaristesys.com>> wrote:
>>
>> Wouldn't it be more fruitful to delete and reach old bindings
>> in such a scenario? Or are these bindings not only for web
>> clients?
>>
>> On December 1, 2016 5:54:06 PM EST, Colin Morelli
>> mailto:colin.more...@gmail.com>> wrote:
>> >Hey all,
>> >
>> >I know Kamailio's registrar module has a max_contacts
>> parameter that
>> >will
>> >limit the number of active contacts for an AOR. However, is
>> there any
>> >mechanism to control what happens when that number is hit?
>> >
>> >When using a web client where every page refresh registers a new
>> >contact
>> >with Kamailio, it would be useful to automatically roll off
>> the oldest
>> >registrations and replace to make room for the new ones. I
>> know this
>> >can be
>> >manually accomplished with sqlops, but I was hoping
>> something like this
>> >already existed.
>> >
>> >Best,
>> >Colin
>> >
>> >
>> 
>> >
>> >
>> >___
>> >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
>>
>> --
>> Principal, Evariste Systems LLC (www.evaristesys.com
>> 

[SR-Users] INFO: modules purple and iptrtpproxy moved to obsolete folder

2016-12-05 Thread Daniel-Constantin Mierla
Hello,

be aware that the modules purple and iptrtpproxy were moved to obsolete
folder.

They were not compiling for several years and nobody showed interest in
updating them. If anyone wast to rescue them, she/he is welcome to get
them back and upgrade the code to work with current versions of their
dependencies.

Cheers,
Daniel

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference - May 8-10, 2017 - 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] INFO: kcore internal lib removed

2016-12-05 Thread Daniel-Constantin Mierla
Hello,

mainly for those having private modules or other components for
kamailio, take note that the internal library kcore has been removed. It
was supposed to be a termporary place where to keep some kamailio
specific functions at the time of merging with ser code back in 2008.

The main code was related to internal statistics, which was
re-implemented as fast counters several years ago, in libkcore being
only some wrappers. You have to include now directly the counters.h from
core. There were several files with some str operations helpers, not
they are exported via strutils.h from core. The sst parser was used only
by sst module and moved to it, same being done with some stats helper
functions used only by snmpstats module.

Cheers,
Daniel

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference - May 8-10, 2017 - 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] Send SIP Info within a dialog using $uac_req(method)="INFO"

2016-12-05 Thread Jonathan Hunter
Hello,


Ok thanks for that, it works perfectly.


I am generating the SIP INFO message, on receipt of a 200ok, which is being 
triggered by the event_route[dialog:start].


One last thing, is it possible to trigger /capture the event of the ACK being 
received for the 200 ok ?


As ideally I want to send SIP INFO after the ACK has been sent, however 
currently I am triggering on receipt of the 200ok, so dialog is started.


Can I have;


INVITE--->

<---200OK

ACK--->

INFO>


So in effect RELAY the ACK, then trigger this SIP INFO  to be sent?


Thanks


Jon




From: Daniel-Constantin Mierla 
Sent: 05 December 2016 10:32
To: Jonathan Hunter; Kamailio SER - Users Mailing List
Subject: Re: [SR-Users] Send SIP Info within a dialog using 
$uac_req(method)="INFO"


Hello,


all the headers must be in a single parameter, I see that you provide headers 
one by one in the params array. Try:


jsonrpc_exec('
{
 "jsonrpc":"2.0",
 "method":"tm.t_uac_start",
 "params": [
"INFO",
"$dlg(to_uri)",
".",
".",

"From:$var(testjon)\r\nTo:$var(testjon2)\r\nContact:$var(testjon4)\r\nContent-Type:
 application/json\r\nContent-Length: 0\r\n"
  ]
}
');

Cheers,
Daniel

On 01/12/2016 17:12, Jonathan Hunter wrote:
Hi Daniel,

I am trying tm.t_uac_start and its stating Content-Type Missing, I have tried 
to add to params but it doesnt like it, where should it be defined?

Command below;


jsonrpc_exec('{"jsonrpc":"2.0","method":"tm.t_uac_start","params": ["INFO", 
"$dlg(to_uri)",".",".","From:$var(testjon)\r\n","To:$var(testjon2)\r\n","Contact:$var(testjon4)\r\n","Content-Type:
 application/json\r\n","Content-Length: 0\r\n"]}');

And logs;

Dec  1 16:09:15 POC_ProxyA /usr/sbin/kamailio[11883]: INFO: 

Re: [SR-Users] Limiting Registration Contacts

2016-12-05 Thread Colin Morelli
Hey Daniel,

This makes sense, thanks for the explanation.

While I can understand why it works the way it does now, I still think
having an option here would be great. My thought is, whether the mobile
phone that re-registers every 10 minutes or the desk phone is "older," the
point is that they're both older than the device which is currently trying
to register and is unable to. There's also some preferential logic you
could try to add here - perhaps try to remove .invalid contacts first,
which are generally used by browsers and likely less stable than contacts
with an IP address.

All that said, I appreciate the clarification. I believe it's fairly
trivial to do this with sqlops anyway so it's not a huge deal. I also may
be able to do something in the edge proxy to automatically send an
unregister if a websocket connection closes after a register request.

Thanks!
Colin
On Mon, Dec 5, 2016 at 6:02 AM Daniel-Constantin Mierla 
wrote:

> Hello,
>
> right now the rule is to reject the registrations that exceed the
> max_contacts limit. The main reason behind this policy is the registration
> mechanism in SIP which requires periodic update/refresh but also different
> expires intervals.
>
> In this way it's hard to select the "old device". Can be a desktop phone
> registering every hour and stable connection but also a mobile phone
> registering every 10 minutes, changing the ip every now and then. By just
> relying on the oldest registration, the desktop phone is likely the
> candidate to remove most of the time, but keep other invalid mobile
> contacts.
>
> The solution would be to use GRUU (or the instance parameter) for
> registration contacts. In this way each new registration from a device will
> replace its own old contact, even if it has a different contact address.
>
> Cheers,
> Daniel
>
> On 01/12/2016 23:59, Colin Morelli wrote:
>
> Hey Alex - not sure I'm quite following what you mean. The bindings are
> only for web clients. Are you suggesting the clients themselves
> de-register? I'd have no problem with that with the exception of the fact
> that there's simply no way to guarantee that happens. It's a race condition
> between whether the unregistration can be sent before the browser kills the
> websocket connection on refresh.
>
> On Thu, Dec 1, 2016 at 5:57 PM, Alex Balashov 
> wrote:
>
> Wouldn't it be more fruitful to delete and reach old bindings in such a
> scenario? Or are these bindings not only for web clients?
>
> On December 1, 2016 5:54:06 PM EST, Colin Morelli 
> wrote:
> >Hey all,
> >
> >I know Kamailio's registrar module has a max_contacts parameter that
> >will
> >limit the number of active contacts for an AOR. However, is there any
> >mechanism to control what happens when that number is hit?
> >
> >When using a web client where every page refresh registers a new
> >contact
> >with Kamailio, it would be useful to automatically roll off the oldest
> >registrations and replace to make room for the new ones. I know this
> >can be
> >manually accomplished with sqlops, but I was hoping something like this
> >already existed.
> >
> >Best,
> >Colin
> >
> >
> >
> >
> >___
> >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
>
> --
> Principal, Evariste Systems LLC (www.evaristesys.com)
>
> Sent from my Google Nexus.
>
>
> ___
> 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 
> listsr-us...@lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>
> --
> Daniel-Constantin Mierlawww.twitter.com/miconda -- www.linkedin.com/in/miconda
> Kamailio World Conference - May 8-10, 2017 - 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
>
___
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 bridge internal and external network

2016-12-05 Thread Daniel-Constantin Mierla


On 05/12/2016 11:58, Alex Balashov wrote:
> On Mon, Dec 05, 2016 at 11:56:20AM +0100, Daniel-Constantin Mierla wrote:
>
>> as a further hint I would add the forcing of outgoing socket -- be sure
>> the appropriate socket is used for sending out (see force_send_socket()
>> or assignment to $fs). Then all double record-routing should be done
>> automatically.
> That's a good point. I forgot that mhomed= is off by default. :-)
>
Right -- enabling mhomed can also help here.

Cheers,
Daniel

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference - May 8-10, 2017 - 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] Getting destination ip

2016-12-05 Thread Daniel-Constantin Mierla
Hello,

do you need to get this when the sip response is received from another
address or when kamailio is generating the response?

Cheers,
Daniel


On 30/11/2016 02:49, David Villasmil wrote:
> Thanks for your help,
> $sel(via[1].host) actually shows the internal ip address of the
> client... :(
>
> David
>
> Regards,
>
> David Villasmil
> email: david.villasmil.w...@gmail.com
> 
> phone: +34669448337
>
> On Tue, Nov 29, 2016 at 9:51 PM, Alberto Llamas
> mailto:albertollam...@gmail.com>> wrote:
>
> Oh I seeWhat about to get the host attribute from the 'top'
> via header as below
>
> $sel(via[1].host)
>
> Cheers,
>
> On Tue, Nov 29, 2016 at 6:00 PM, David Villasmil
>  > wrote:
>
> Thanks Alberto,
>
> But that won't work for me. I should have mentioned it on the
> original email, but this is on kamailio working on
> Sipcapture/Homer, so there are no transactions or dialogs...
>
> David
>
> On Tue, Nov 29, 2016 at 5:18 PM Alberto Llamas
> mailto:albertollam...@gmail.com>>
> wrote:
>
> Hi David,
>
> Below instruction should work for you:
>
> $T_req($rd)
>
> Cheers,
>
> On Tue, Nov 29, 2016 at 4:29 PM, David Villasmil
>  > wrote:
>
> Hello Guys,
>
> I'm wondering how do I get destination IP on a reply?
>
> Regards,
>
> David Villasmil
> email: david.villasmil.w...@gmail.com
> 
> phone: +34669448337 
> ᐧ
>
> ___
> 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
> 
> 
>
>
>
>
> -- 
> Alberto Llamas
> Phone: +1-786-805-6003 
> TelecommunicationsEngineer
> Digium Certified Asterisk Professional (dCap)
>
> ___
> 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
> 
>
>
>
>
> -- 
> Alberto Llamas
> Phone: +1-786-805-6003 
> TelecommunicationsEngineer
> Digium Certified Asterisk Professional (dCap)
>
>
> ___
> 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

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference - May 8-10, 2017 - 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] Kamailio Processes Stop Responding

2016-12-05 Thread Daniel-Constantin Mierla


On 30/11/2016 23:46, Alex Balashov wrote:
> On Wed, Nov 30, 2016 at 05:42:56PM -0500, Peter DiSanto wrote:
>
>> OK thank you Alex.  I will look into your suggestions next time the problem
>> arises.  Each call does generate one SQL LCR lookup, one CDR INSERT, and
>> also a timer route that runs 3 queries every few minutes.  Once Kamailio
>> stops responding it will continue that way indefinitely until a process
>> restart.  Will report back. Thanks.
> The timer routes run in separate processes, FYI. 
>
> But yeah, it sounds like your SQL DB interactions are the likely source of 
> the problem. It doesn't have to be the case that these queries get "stuck". 
> If they become even a little slow, and you don't have sufficient child 
> processes to wait on them, at 200 CPS that can have consequences. Perhaps 
> profile the queries and/or log slow queries?
>
For troubleshooting, when kamailio gets stuck, do a ps and grab all the
pids of kamailio, then take the backtrace from each pid with:

gdb kamailio $PID -batch --eval-command="bt full"

Then we can see what each kamailio project is doing at that moment.

Cheers,
Daniel

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference - May 8-10, 2017 - 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] Limiting Registration Contacts

2016-12-05 Thread Daniel-Constantin Mierla
Hello,

right now the rule is to reject the registrations that exceed the
max_contacts limit. The main reason behind this policy is the
registration mechanism in SIP which requires periodic update/refresh but
also different expires intervals.

In this way it's hard to select the "old device". Can be a desktop phone
registering every hour and stable connection but also a mobile phone
registering every 10 minutes, changing the ip every now and then. By
just relying on the oldest registration, the desktop phone is likely the
candidate to remove most of the time, but keep other invalid mobile
contacts.

The solution would be to use GRUU (or the instance parameter) for
registration contacts. In this way each new registration from a device
will replace its own old contact, even if it has a different contact
address.

Cheers,
Daniel


On 01/12/2016 23:59, Colin Morelli wrote:
> Hey Alex - not sure I'm quite following what you mean. The bindings
> are only for web clients. Are you suggesting the clients themselves
> de-register? I'd have no problem with that with the exception of the
> fact that there's simply no way to guarantee that happens. It's a race
> condition between whether the unregistration can be sent before the
> browser kills the websocket connection on refresh.
>
> On Thu, Dec 1, 2016 at 5:57 PM, Alex Balashov
> mailto:abalas...@evaristesys.com>> wrote:
>
> Wouldn't it be more fruitful to delete and reach old bindings in
> such a scenario? Or are these bindings not only for web clients?
>
> On December 1, 2016 5:54:06 PM EST, Colin Morelli
> mailto:colin.more...@gmail.com>> wrote:
> >Hey all,
> >
> >I know Kamailio's registrar module has a max_contacts parameter that
> >will
> >limit the number of active contacts for an AOR. However, is there any
> >mechanism to control what happens when that number is hit?
> >
> >When using a web client where every page refresh registers a new
> >contact
> >with Kamailio, it would be useful to automatically roll off the
> oldest
> >registrations and replace to make room for the new ones. I know this
> >can be
> >manually accomplished with sqlops, but I was hoping something
> like this
> >already existed.
> >
> >Best,
> >Colin
> >
> >
> >
> >
> >___
> >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
>
> --
> Principal, Evariste Systems LLC (www.evaristesys.com
> )
>
> Sent from my Google Nexus.
>
>
> ___
> 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

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference - May 8-10, 2017 - 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] kamailio bridge internal and external network

2016-12-05 Thread Alex Balashov
On Mon, Dec 05, 2016 at 11:56:20AM +0100, Daniel-Constantin Mierla wrote:

> as a further hint I would add the forcing of outgoing socket -- be sure
> the appropriate socket is used for sending out (see force_send_socket()
> or assignment to $fs). Then all double record-routing should be done
> automatically.

That's a good point. I forgot that mhomed= is off by default. :-)

-- Alex

-- 
Alex Balashov | Principal | Evariste Systems LLC

Tel: +1-706-510-6800 (direct) / +1-800-250-5920 (toll-free) 
Web: http://www.evaristesys.com/, http://www.csrpswitch.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] kamailio bridge internal and external network

2016-12-05 Thread Daniel-Constantin Mierla
Hello,


On 05/12/2016 11:29, Alex Balashov wrote:
> Hello,
>
> On Mon, Dec 05, 2016 at 04:53:55PM +0800, zhang90501 wrote:
>
>> My kamailio listen at internal ip and external ip(advertise parameter), it 
>> send message to freeswitch from internal ip and to client from external ip.
>> How can I configure my kamailio to auto generate correct record route header?
> In principle, Kamailio should do this automatically and no explicit
> action on your part should be required, provided that your 'listen='
> statements are indeed as you describe.
>
> However, do ensure that the following parameter is enabled:
>
> http://kamailio.org/docs/modules/4.4.x/modules/rr.html#idp20509612
>
>
as a further hint I would add the forcing of outgoing socket -- be sure
the appropriate socket is used for sending out (see force_send_socket()
or assignment to $fs). Then all double record-routing should be done
automatically.

Cheers,
Daniel

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference - May 8-10, 2017 - 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] Send SIP Info within a dialog using $uac_req(method)="INFO"

2016-12-05 Thread Daniel-Constantin Mierla
Hello,


this is only when you do jsonrpc over http, but it is not the case here.
See my previous response in this discussion thread.


Cheers,
Daniel


On 02/12/2016 15:28, Jonathan Hunter wrote:
>
> Hi Daniel,
>
>
> I can see when people are using curl they can define content-type ;
>
>
> /--header 'Content-Type: application/json'/
> However is this  possible within the jsonrpc_exec command, as this
> seems to set the body.
>
>
> Can you define the Content-Type before firing the command?
>
>
> Thanks
>
>
> Jon
>
>
>
> 
> *From:* sr-users  on behalf of
> Jonathan Hunter 
> *Sent:* 01 December 2016 16:12
> *To:* Kamailio SER - Users Mailing List; mico...@gmail.com
> *Subject:* Re: [SR-Users] Send SIP Info within a dialog using
> $uac_req(method)="INFO"
>  
> Hi Daniel, 
>
> I am trying tm.t_uac_start and its stating Content-Type Missing, I
> have tried to add to params but it doesnt like it, where should it be
> defined?
>
> Command below;
>
>
> jsonrpc_exec('{"jsonrpc":"2.0","method":"tm.t_uac_start","params":
> ["INFO",
> "$dlg(to_uri)",".",".","From:$var(testjon)\r\n","To:$var(testjon2)\r\n","Contact:$var(testjon4)\r\n","Content-Type:
> application/json\r\n","Content-Length: 0\r\n"]}');
>
> And logs;
>
> Dec  1 16:09:15 POC_ProxyA /usr/sbin/kamailio[11883]: INFO: 

Re: [SR-Users] Send SIP Info within a dialog using $uac_req(method)="INFO"

2016-12-05 Thread Daniel-Constantin Mierla
Hello,


all the headers must be in a single parameter, I see that you provide
headers one by one in the params array. Try:


jsonrpc_exec('
{
 "jsonrpc":"2.0",
 "method":"tm.t_uac_start",
 "params": [
"INFO",
"$dlg(to_uri)",
".",
".",
   
"From:$var(testjon)\r\nTo:$var(testjon2)\r\nContact:$var(testjon4)\r\nContent-Type:
application/json\r\nContent-Length: 0\r\n"
  ]
}
');

Cheers,
Daniel

On 01/12/2016 17:12, Jonathan Hunter wrote:
> Hi Daniel, 
>
> I am trying tm.t_uac_start and its stating Content-Type Missing, I
> have tried to add to params but it doesnt like it, where should it be
> defined?
>
> Command below;
>
>
> jsonrpc_exec('{"jsonrpc":"2.0","method":"tm.t_uac_start","params":
> ["INFO",
> "$dlg(to_uri)",".",".","From:$var(testjon)\r\n","To:$var(testjon2)\r\n","Contact:$var(testjon4)\r\n","Content-Type:
> application/json\r\n","Content-Length: 0\r\n"]}');
>
> And logs;
>
> Dec  1 16:09:15 POC_ProxyA /usr/sbin/kamailio[11883]: INFO: 

Re: [SR-Users] kamailio bridge internal and external network

2016-12-05 Thread Alex Balashov
Hello,

On Mon, Dec 05, 2016 at 04:53:55PM +0800, zhang90501 wrote:

> My kamailio listen at internal ip and external ip(advertise parameter), it 
> send message to freeswitch from internal ip and to client from external ip.
> How can I configure my kamailio to auto generate correct record route header?

In principle, Kamailio should do this automatically and no explicit
action on your part should be required, provided that your 'listen='
statements are indeed as you describe.

However, do ensure that the following parameter is enabled:

http://kamailio.org/docs/modules/4.4.x/modules/rr.html#idp20509612

-- Alex

-- 
Alex Balashov | Principal | Evariste Systems LLC

Tel: +1-706-510-6800 (direct) / +1-800-250-5920 (toll-free) 
Web: http://www.evaristesys.com/, http://www.csrpswitch.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] VERY IMPORTANT: deciding when to remove the MI code

2016-12-05 Thread Daniel-Constantin Mierla
Hello,

few that are missing can be probably added once we discover them. The
best is to open an issue on bug tracker whenever you are aware of a mi
command not implemented in rpc. Even better will be a pull request :-)
-- migrating from mi to rpc should not be complex and rather easy to
lean by looking at other variants with both implementations.

Cheers,
Daniel


On 02/12/2016 16:18, ycaner wrote:
> Hello
> Carrier route module doesnt have RPC command., we need to add it 
> Cheers.
>
>
>
> --
> View this message in context: 
> http://sip-router.1086192.n5.nabble.com/VERY-IMPORTANT-deciding-when-to-remove-the-MI-code-tp153719p153773.html
> Sent from the Users mailing list archive at Nabble.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
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference - May 8-10, 2017 - 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] Restructuring source code tree for v5.0

2016-12-05 Thread Daniel-Constantin Mierla
Hello,

I already started playing with various scripts to do the restructuring
of the source code tree for v5.0 as we discussed in the past months and
I am considering to do it quite soon, in the next few days.

The result will look like:

/Makefile (only-forwarding make commands to various subdirs)
/README|INSTAL|LICENSE|...
/src/Makefile* (build makefiles)
/src/main.c (main c file to generate the binary)
/src/core/*.{c,h} (c code for core, including subfolders such as parser,
mem, atomic, ...)
/src/lib/* (subfolders with the internal libraries)
/src/modules/* (subfolders with the modules)

Other subfolders from root directory may be relocated, but to be decided
along the way.

At the time of doing the restructuring, I will try to merge all the pull
requests that look ok. Therefore it would be good that anyone interested
in open pull requests to do the review (and merge) meanwhile.

Also, I think it would be good to disable travis and nightly master
builds during few days when the restructuring happens in order to avoid
flooding sr-dev with alerts.

If anyone has suggestions to add, do not hesitate to write on mailing lists.

Cheers,
Daniel


-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference - May 8-10, 2017 - 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 bridge internal and external network

2016-12-05 Thread zhang90501
My kamailio listen at internal ip and external ip(advertise parameter), it send 
message to freeswitch from internal ip and to client from external ip.
How can I configure my kamailio to auto generate correct record route header?___
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