Re: [SR-Users] IMS related : ims_usrloc_pcscf : "lookup_check_received" setting is useless now

2016-11-22 Thread Carsten Bock
Hi Dragos,

you are right, it's not used anymore.
I've just removed it.

Thanks,
Carsten

2016-11-22 17:41 GMT+01:00 Dragos Oancea :
> Hi
>
> The setting "lookup_check_received" is documented here :
>
> http://www.kamailio.org/docs/modules/4.4.x/modules/ims_usrloc_pcscf.html#idp44519300
>
> But looking through the code I saw it's not used anymore, although
> it can be passed as a parameter.
> I was wondering if this is an accident or something intentional.
>
> I found some more details here:
> http://lists.sip-router.org/pipermail/sr-dev/2014-June/024371.html
>
> Cheers,
> Dragos
>
> ___
> 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



-- 
Carsten Bock
CEO (Geschäftsführer)

ng-voice GmbH
Millerntorplatz 1
20359 Hamburg / Germany

http://www.ng-voice.com
mailto:cars...@ng-voice.com

Office +49 40 5247593-40
Fax +49 40 5247593-99

Sitz der Gesellschaft: Hamburg
Registergericht: Amtsgericht Hamburg, HRB 120189
Geschäftsführer: Carsten Bock
Ust-ID: DE279344284

Hier finden Sie unsere handelsrechtlichen Pflichtangaben:
http://www.ng-voice.com/imprint/

___
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-11-22 Thread Daniel-Constantin Mierla
Hello,


got a bit of time to look at the code and discovered that there is a rpc
command tm.t_uac_start added by ser guys that might get you moving
forward. It is not waiting for the reply of the generated request and
you can use it with json rpc exec function in the config, so it avoids
using exec.


Can you give it a try?


Some documentation can be found in the comments of the function used by
this command:

  -
https://github.com/kamailio/kamailio/blob/master/modules/tm/rpc_uac.c#L399

Cheers,
Daniel


On 22/11/2016 18:35, Jonathan Hunter wrote:
>
> Hi Daniel,
>
>
> Thanks here you go;
>
>
> [root@POC_ProxyA kamailio]# kamctl mi t_uac_dlg INFO
> sip:3003@193.144.1.112 . udp:10.70.1.136:5060  
>  
> \"From:sip:1234@8.8.8.8"\r\nTo:sip:3003@193.144.1.112\r\nContact:sip:daemon@8.8.8.8\r\n\""
> 404 Invalid local socket
> [root@POC_ProxyA kamailio]# VERBOSE=1 kamctl mi t_uac_dlg INFO
> sip:3003@193.144.1.112 . udp:10.70.1.136:5060  
>  
> \"From:sip:1234@8.8.8.8"\r\nTo:sip:3003@193.144.1.112\r\nContact:sip:daemon@8.8.8.8\r\n\""
> database engine 'MYSQL' loaded
> Control engine 'FIFO' loaded
> entering fifo_cmd t_uac_dlg INFO sip:3003@193.144.1.112 .
> udp:10.70.1.136:5060 "From:sip:1234@8.8.8.8
> To:sip:3003@193.144.1.112
> Contact:sip:daemon@8.8.8.8
> "
> 404 Invalid local socket
> FIFO command was:
> :t_uac_dlg:kamailio_receiver_23469
> INFO
> sip:3003@193.144.1.112
> .
> udp:10.70.1.136:5060
> "From:sip:1234@8.8.8.8
> To:sip:3003@193.144.1.112
> Contact:sip:daemon@8.8.8.8
> "
>
>
> Thanks
>
>
> Jon
>
>
>
> 
> *From:* Daniel-Constantin Mierla 
> *Sent:* 22 November 2016 13:10
> *To:* Jonathan Hunter; Kamailio SER - Users Mailing List
> *Subject:* Re: [SR-Users] Send SIP Info within a dialog using
> $uac_req(method)="INFO"
>  
>
> Hello,
>
>
> I am trying to figure out why the kamctl is not passing further the
> params. Can you set VERBOSE=1 in kamctlrc or just run like:
>
>
> VERBOSE=1 kamctl mi ...
>
>
> It should print the command sent over the fifo file. Send the output
> here so I can check it.
>
>
> Cheers,
> Daniel
>
>
> On 21/11/2016 18:38, Jonathan Hunter wrote:
>>
>> Hello,
>>
>>
>> Thanks Daniel, knowing how I should specify all the parameters would
>> be great, just a syntax example, in particular when defining all the
>> sip headers and why their are double quotes/single quotes or what
>> best method is.
>>
>>
>> Thanks again and sorry for the noise!
>>
>>
>> Jon
>>
>>
>>
>>
>>
>> something seems to be strange with interpreting the parameters from
>> command line and forwarding them to kamailio. I will dig a bit into
>> kamctl and come back with some hints.
>>
>>
>> Cheers,
>> Daniel
>>
>>
>> On 21/11/16 13:19, Jonathan Hunter wrote:
>>>
>>> Hello.
>>>
>>>
>>> This is running from command line, not withing the configuration
>>> file, so I am testing before I try to add it in.
>>>
>>>
>>> I have tried with single quotes, but not sure how to enclose the SIP
>>> headers and the r/n , can you please advise?
>>>
>>>
>>> kamctl mi t_uac_dlg INFO sip:3003@193.144.1.112 .
>>> udp:10.70.1.136:5060  
>>>  
>>> \"From:sip:1234@8.8.8.8"\r\nTo:sip:3003@193.144.1.112\r\nContact:sip:daemon@8.8.8.8\r\n\""
>>>
>>>
>>> As I have tried;
>>>
>>>
>>> kamctl mi t_uac_dlg 'INFO' 'sip:3003@193.144.1.112' '.'
>>> 'udp:10.70.1.136:5060'  
>>>  
>>> 'From:sip:1234@8.8.8.8'r\n'To:sip:3003@193.144.1.112'\r\n'Contact:sip:daemon@8.8.8.8'\r\n\'
>>>
>>>
>>> And still get invalid socket, as it is including all the SIP headers
>>> in with the port parameter so I presume I am missing an operator?
>>>
>>>
>>> /usr/sbin/kamailio[28999]: ERROR:  [main.c:1128]:
>>> parse_phostport(): too many colons in
>>> udp:10.70.1.136:5060From:sip:1234@8.8.8.8rnTo:sip:3003@193.144.1.112rnContact:sip:daemon@8.8.8.8rn'
>>>
>>>
>>>
>>> Its including them all as the local socket/port.
>>>
>>> Thanks
>>>
>>> Jon
>>>
>>> 
>>> *From:* Daniel-Constantin Mierla 
>>> *Sent:* 21 November 2016 11:29
>>> *To:* Jonathan Hunter; Kamailio SER - Users Mailing List
>>> *Subject:* Re: [SR-Users] Send SIP Info within a dialog using
>>> $uac_req(method)="INFO"
>>>  
>>>
>>> Hello,
>>>
>>>
>>> On 20/11/16 16:12, Jonathan Hunter wrote:

 Hello,


 Ok great thanks Daniel.


 One final thing, I cant seem to get kamilio to except the parameter
 when I add the socket parameter in the kamctl mi t_uac_dlg command.


 If I add as below I get 404 invalid local socket;


  kamctl mi t_uac_dlg INFO sip:3003@193.144.1.112 .
 udp:10.70.1.136:5060  
  
 \"From:sip:1234@8.8.8.8"\r\nTo:sip:3003@193.144.1.112\r\nContact:sip:daemon@8.8.8.8\r\n\""
>>>
>>> do you run this command from command line or from kamailio.cfg? I
>>> think it's good to be sure it works from command line.
>>>
>>> Also, can you try to enclose each parameter in 

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

2016-11-22 Thread Jonathan Hunter
Hi Daniel,


Thanks here you go;


[root@POC_ProxyA kamailio]# kamctl mi t_uac_dlg INFO sip:3003@193.144.1.112 . 
udp:10.70.1.136:5060
\"From:sip:1234@8.8.8.8"\r\nTo:sip:3003@193.144.1.112\r\nContact:sip:daemon@8.8.8.8\r\n\""
404 Invalid local socket
[root@POC_ProxyA kamailio]# VERBOSE=1 kamctl mi t_uac_dlg INFO 
sip:3003@193.144.1.112 . udp:10.70.1.136:5060
\"From:sip:1234@8.8.8.8"\r\nTo:sip:3003@193.144.1.112\r\nContact:sip:daemon@8.8.8.8\r\n\""
database engine 'MYSQL' loaded
Control engine 'FIFO' loaded
entering fifo_cmd t_uac_dlg INFO sip:3003@193.144.1.112 . udp:10.70.1.136:5060 
"From:sip:1234@8.8.8.8
To:sip:3003@193.144.1.112
Contact:sip:daemon@8.8.8.8
"
404 Invalid local socket
FIFO command was:
:t_uac_dlg:kamailio_receiver_23469
INFO
sip:3003@193.144.1.112
.
udp:10.70.1.136:5060
"From:sip:1234@8.8.8.8
To:sip:3003@193.144.1.112
Contact:sip:daemon@8.8.8.8
"


Thanks


Jon



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


Hello,


I am trying to figure out why the kamctl is not passing further the params. Can 
you set VERBOSE=1 in kamctlrc or just run like:


VERBOSE=1 kamctl mi ...


It should print the command sent over the fifo file. Send the output here so I 
can check it.


Cheers,
Daniel

On 21/11/2016 18:38, Jonathan Hunter wrote:

Hello,


Thanks Daniel, knowing how I should specify all the parameters would be great, 
just a syntax example, in particular when defining all the sip headers and why 
their are double quotes/single quotes or what best method is.


Thanks again and sorry for the noise!


Jon





something seems to be strange with interpreting the parameters from command 
line and forwarding them to kamailio. I will dig a bit into kamctl and come 
back with some hints.


Cheers,
Daniel

On 21/11/16 13:19, Jonathan Hunter wrote:

Hello.


This is running from command line, not withing the configuration file, so I am 
testing before I try to add it in.


I have tried with single quotes, but not sure how to enclose the SIP headers 
and the r/n , can you please advise?


kamctl mi t_uac_dlg INFO sip:3003@193.144.1.112 . udp:10.70.1.136:5060
\"From:sip:1234@8.8.8.8"\r\nTo:sip:3003@193.144.1.112\r\nContact:sip:daemon@8.8.8.8\r\n\""



As I have tried;


kamctl mi t_uac_dlg 'INFO' 'sip:3003@193.144.1.112' '.' 'udp:10.70.1.136:5060'  
  
'From:sip:1234@8.8.8.8'r\n'To:sip:3003@193.144.1.112'\r\n'Contact:sip:daemon@8.8.8.8'\r\n\'


And still get invalid socket, as it is including all the SIP headers in with 
the port parameter so I presume I am missing an operator?


/usr/sbin/kamailio[28999]: ERROR:  [main.c:1128]: parse_phostport(): too 
many colons in 
udp:10.70.1.136:5060From:sip:1234@8.8.8.8rnTo:sip:3003@193.144.1.112rnContact:sip:daemon@8.8.8.8rn'



Its including them all as the local socket/port.

Thanks

Jon


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


Hello,

On 20/11/16 16:12, Jonathan Hunter wrote:

Hello,


Ok great thanks Daniel.


One final thing, I cant seem to get kamilio to except the parameter when I add 
the socket parameter in the kamctl mi t_uac_dlg command.


If I add as below I get 404 invalid local socket;

 kamctl mi t_uac_dlg INFO sip:3003@193.144.1.112 . udp:10.70.1.136:5060
\"From:sip:1234@8.8.8.8"\r\nTo:sip:3003@193.144.1.112\r\nContact:sip:daemon@8.8.8.8\r\n\""

do you run this command from command line or from kamailio.cfg? I think it's 
good to be sure it works from command line.

Also, can you try to enclose each parameter in single quotes -- then it's 
easier for the command line parser to identify the parameters.

Cheers,
Daniel

404 Invalid local socket

As its picking up the socket with the from address included as well, is this 
again around syntax?

ERROR:  [main.c:1128]: parse_phostport(): too many colons in 
udp:10.70.1.136:5060"From:sip:1234@8.8.8.8

As it seems to pick socket up ok;

Nov 20 15:11:36 POC_ProxyA /usr/sbin/kamailio[23175]: DEBUG: mi_fifo 
[mi_parser.c:245]: mi_parse_tree(): adding node <> ; val 
Nov 20 15:11:36 POC_ProxyA /usr/sbin/kamailio[23175]: DEBUG: mi_fifo 
[mi_parser.c:245]: mi_parse_tree(): adding node <> ; val 

Nov 20 15:11:36 POC_ProxyA /usr/sbin/kamailio[23175]: DEBUG: mi_fifo 
[mi_parser.c:245]: mi_parse_tree(): adding node <> ; val <.>
Nov 20 15:11:36 POC_ProxyA 

[SR-Users] IMS related : ims_usrloc_pcscf : "lookup_check_received" setting is useless now

2016-11-22 Thread Dragos Oancea
Hi

The setting "lookup_check_received" is documented here :

http://www.kamailio.org/docs/modules/4.4.x/modules/ims_usrloc_pcscf.html#idp44519300

But looking through the code I saw it's not used anymore, although
it can be passed as a parameter.
I was wondering if this is an accident or something intentional.

I found some more details here:
http://lists.sip-router.org/pipermail/sr-dev/2014-June/024371.html

Cheers,
Dragos

___
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] async_workers vs. async workers modparam in case of async_route()

2016-11-22 Thread Daniel-Constantin Mierla


On 22/11/2016 06:20, Alex Balashov wrote:
> On 11/21/2016 06:44 AM, Daniel-Constantin Mierla wrote:
>
>> At this moment, from what I remember by heart, mysql module and async
>> (when using async_task_route()) use async_workers from the core.
>
> What about sql_query_async()? I assume that uses core async_workers too.

Yes -- it's actually mysql that uses them. For postgress I am not sure
if it was developed...

>
>>
>> I don't recall exactly, but somehow I planned to switch async module to
>> use only processes from the core, but I thought that it can break
>> existing configs.
>>
>> To answer further, you don't need to keep them in sycn and you don't
>> need core async workers if you use only async_route() (or async_sleep(),
>> but this one has some traps highlighted in the readme, so I try not to
>> promote it that much).
>
> What kind of traps? :-) I don't really see anything in the docs for
> async_asleep() that sets off alarm bells in my mind.

A return from inside the route block done after async_sleep() is like an
exit. Also, the private memory variables (e.g., $var(...)) are not
propagated with the same values after this function. Well these are
common for async switching.

>
> At the moment I'm only using async_route(), yet this is the process
> situation:
>
> [root@allegro-4 routes]# kamcmd -s /tmp/kamailio_ctl ps
> 27621main process - attendant
> 27623udp receiver child=0 sock=10.150.20.6:5060
> 27624udp receiver child=1 sock=10.150.20.6:5060
> 27625udp receiver child=2 sock=10.150.20.6:5060
> 27626udp receiver child=3 sock=10.150.20.6:5060
> 27627udp receiver child=4 sock=10.150.20.6:5060
> 27629udp receiver child=5 sock=10.150.20.6:5060
> 27630udp receiver child=6 sock=10.150.20.6:5060
> 27632udp receiver child=7 sock=10.150.20.6:5060
> 27635slow timer
> 27638timer
> 27639secondary timer
> 27641Async Task Worker
> 27642Async Task Worker
> 27644Async Task Worker
> 27647Async Task Worker
> 27650Async Task Worker
> 27652Async Task Worker
> 27654Async Task Worker
> 27656Async Task Worker
> 27658MI FIFO
> 27661ctl handler
> 27663RTIMER USEC EXEC
> 27664RTIMER USEC EXEC
> 27666RTIMER USEC EXEC
> 27669RTIMER USEC EXEC
> 27672RTIMER USEC EXEC
> 27674RTIMER USEC EXEC
> 27676RTIMER USEC EXEC
> 27678ASYNC MOD TIMER
> 27680ASYNC MOD TIMER
> 27682ASYNC MOD TIMER
> 27684ASYNC MOD TIMER
> 27686ASYNC MOD TIMER
> 27688ASYNC MOD TIMER
> 27690ASYNC MOD TIMER
> 27692ASYNC MOD TIMER
> 27694Dialog KA Timer
> 27696Dialog Clean Timer
> 27700tcp main process
>
> So it is safe to remove the async_workers declaration entirely or set
> it to 0, and I can still benefit from 8 async processes for
> async_route()?
>
Yes.

Cheers,
Daniel

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


Re: [SR-Users] log_prefix ignored in resumed routes

2016-11-22 Thread Daniel-Constantin Mierla
Hello,

probably the reference to the current processed message is not set in
this case -- iirc, it was added for receive events. I will try to fix
it. Maybe you can open an issue on tracker, not to forget about it.

Cheers,
Daniel

On 22/11/2016 06:17, Alex Balashov wrote:
> Hi,
>
> I have this log_prefix:
>
>log_prefix="[$ci $mt] "
>
> Which means xlog("L_INFO", "xyz") normally results in log entries like
> this:
>
>Nov 22 00:29:50 allegro-4.evaristesys.com
> /usr/local/sbin/kamailio[27625]: [1-27702@10.150.20.6 1] INFO: xyz
>
> But if xlog("L_INFO", "xyz") happens to occur in a route[] block that
> is resumed after async_route()—I have not tested other async
> functions—there is no prefix:
>
> Nov 22 00:29:52 allegro-4.evaristesys.com
> /usr/local/sbin/kamailio[27678]: INFO: xyz
>
> -- Alex
>

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


Re: [SR-Users] Force OpenSER to send a Stop radius accounting record in failure route.

2016-11-22 Thread Jan Hazenberg

Daniel,

Thanks, that did the trick :) I now see a Stop record instead of a 
Failed.


Jan

Daniel-Constantin Mierla schreef op 2016-11-22 14:46:

Hello,

try with the response code you want to be reflected as event type to be
the first token in the acc_rad_request() parameter, like:

acc_rad_request("200 BYE with 481 response");

Cheers,
Daniel

On 22/11/2016 09:24, Jan Hazenberg wrote:

Hi all,

I have a issue here on a old OpenSER 1.3 system. We have some clients
that respond to a BYE message with a 481 resulting in a missing radius
accounting record. I have added some code to the failure route to
force accounting even if a 481 response in received:

 if (t_check_status("481") && $rm == "BYE")
 {
xlog("L_INFO", "INFO: [FAILURE] 481 response detected!!
Forcing accounting! - SRC=$si:$sp R=$ru ID=$ci FU=$fu M=$rm S=$rs\n");
acc_rad_request("BYE with 481 response");
 }

Now OpenSER sends a accounting record, but this has the attribute
Acct-Status-Type set to Failed. This gives a problem with our
accounting service and i would like to change it to a normal Stop 
record.


Is there a way to change this and force OpenSER/Kamailio to send a
Stop record instead of a Failed record?

Thanks,

Jan

___
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] flags documentation

2016-11-22 Thread Daniel-Constantin Mierla


On 22/11/2016 06:08, Alex Balashov wrote:
> Ah, I think I know where I got it from. :-)
>
> http://blog.miconda.eu/2009/12/best-of-new-in-kamailio-300-3-route.html
>
> So the question is, is this a "sanctioned" approach, or just something
> eccentric that happens to be supported? And if the former, perhaps a
> documentation update is in order?
>
> I would happily contribute, I just don't know how to update the core
> cookbook.
>
If you don't have one, you just need to create an account on wiki and
then you are able to edit it -- anounymous editing was disabled several
years ago due to spam.

Cheers,
Daniel

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


Re: [SR-Users] flags documentation

2016-11-22 Thread Daniel-Constantin Mierla
Hello,


On 22/11/2016 06:03, Alex Balashov wrote:
> Hi,
>
> I have this set up in my configuration boilerplate:
>
> -- 
> flags
> DUMMY   : 1,
> PDD_DAMPEN  : 2,
> PROXY_MEDIA_SET: 3,
> #!ifdef WITH_NAT_TRAVERSAL
> SIPPING : 4,
> #!endif
> DUMMY2  : 12
> -- 
>
> I then use these aliases in transaction flags, e.g. setflag(PDD_DAMPEN).
>
> But I can honestly say I don't remember how I arrived at this
> approach. I wrote it somewhere in early 3.x days. However, when I look
> at the core documentation for the 'flags' declaration, all I find is:
>
> http://www.kamailio.org/wiki/cookbooks/4.4.x/core#flags
>
> Or namely:
>
> -- 
> flags
>
> Alias name: bool
> -- 
>
> And there is no entry for "bool". So, I couldn't have possibly arrived
> at this usage from the documentation.
>
> Can anyone help me reverse-engineer this historical phenomenon? And,
> given that the documentation doesn't support it particularly, is it
> still an encouraged practice? Or should one use #!defined constants
> instead, as in the stock config?
Aliasing names to flags is inherited from SER project via the merge of
core done back in 2008. I am not familiar with the code to be able to
comment more specific, but setflag/isflagset/resetflag should work fine,
not sure if they work to be set to modparams, probably yes.

As I got used to the Kamailio way of using defines, I stayed with this
approach.

Cheers,
Daniel

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


Re: [SR-Users] Force OpenSER to send a Stop radius accounting record in failure route.

2016-11-22 Thread Daniel-Constantin Mierla
Hello,

try with the response code you want to be reflected as event type to be
the first token in the acc_rad_request() parameter, like:

acc_rad_request("200 BYE with 481 response");

Cheers,
Daniel

On 22/11/2016 09:24, Jan Hazenberg wrote:
> Hi all,
>
> I have a issue here on a old OpenSER 1.3 system. We have some clients
> that respond to a BYE message with a 481 resulting in a missing radius
> accounting record. I have added some code to the failure route to
> force accounting even if a 481 response in received:
>
>  if (t_check_status("481") && $rm == "BYE")
>  {
> xlog("L_INFO", "INFO: [FAILURE] 481 response detected!!
> Forcing accounting! - SRC=$si:$sp R=$ru ID=$ci FU=$fu M=$rm S=$rs\n");
> acc_rad_request("BYE with 481 response");
>  }
>
> Now OpenSER sends a accounting record, but this has the attribute
> Acct-Status-Type set to Failed. This gives a problem with our
> accounting service and i would like to change it to a normal Stop record.
>
> Is there a way to change this and force OpenSER/Kamailio to send a
> Stop record instead of a Failed record?
>
> Thanks,
>
> Jan
>
> ___
> 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


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

2016-11-22 Thread Daniel-Constantin Mierla
Hello,


I am trying to figure out why the kamctl is not passing further the
params. Can you set VERBOSE=1 in kamctlrc or just run like:


VERBOSE=1 kamctl mi ...


It should print the command sent over the fifo file. Send the output
here so I can check it.


Cheers,
Daniel


On 21/11/2016 18:38, Jonathan Hunter wrote:
>
> Hello,
>
>
> Thanks Daniel, knowing how I should specify all the parameters would
> be great, just a syntax example, in particular when defining all the
> sip headers and why their are double quotes/single quotes or what best
> method is.
>
>
> Thanks again and sorry for the noise!
>
>
> Jon
>
>
>
>
>
> something seems to be strange with interpreting the parameters from
> command line and forwarding them to kamailio. I will dig a bit into
> kamctl and come back with some hints.
>
>
> Cheers,
> Daniel
>
>
> On 21/11/16 13:19, Jonathan Hunter wrote:
>>
>> Hello.
>>
>>
>> This is running from command line, not withing the configuration
>> file, so I am testing before I try to add it in.
>>
>>
>> I have tried with single quotes, but not sure how to enclose the SIP
>> headers and the r/n , can you please advise?
>>
>>
>> kamctl mi t_uac_dlg INFO sip:3003@193.144.1.112 .
>> udp:10.70.1.136:5060  
>>  
>> \"From:sip:1234@8.8.8.8"\r\nTo:sip:3003@193.144.1.112\r\nContact:sip:daemon@8.8.8.8\r\n\""
>>
>>
>> As I have tried;
>>
>>
>> kamctl mi t_uac_dlg 'INFO' 'sip:3003@193.144.1.112' '.'
>> 'udp:10.70.1.136:5060'  
>>  
>> 'From:sip:1234@8.8.8.8'r\n'To:sip:3003@193.144.1.112'\r\n'Contact:sip:daemon@8.8.8.8'\r\n\'
>>
>>
>> And still get invalid socket, as it is including all the SIP headers
>> in with the port parameter so I presume I am missing an operator?
>>
>>
>> /usr/sbin/kamailio[28999]: ERROR:  [main.c:1128]:
>> parse_phostport(): too many colons in
>> udp:10.70.1.136:5060From:sip:1234@8.8.8.8rnTo:sip:3003@193.144.1.112rnContact:sip:daemon@8.8.8.8rn'
>>
>>
>>
>> Its including them all as the local socket/port.
>>
>> Thanks
>>
>> Jon
>>
>> 
>> *From:* Daniel-Constantin Mierla 
>> *Sent:* 21 November 2016 11:29
>> *To:* Jonathan Hunter; Kamailio SER - Users Mailing List
>> *Subject:* Re: [SR-Users] Send SIP Info within a dialog using
>> $uac_req(method)="INFO"
>>  
>>
>> Hello,
>>
>>
>> On 20/11/16 16:12, Jonathan Hunter wrote:
>>>
>>> Hello,
>>>
>>>
>>> Ok great thanks Daniel.
>>>
>>>
>>> One final thing, I cant seem to get kamilio to except the parameter
>>> when I add the socket parameter in the kamctl mi t_uac_dlg command.
>>>
>>>
>>> If I add as below I get 404 invalid local socket;
>>>
>>>
>>>  kamctl mi t_uac_dlg INFO sip:3003@193.144.1.112 .
>>> udp:10.70.1.136:5060  
>>>  
>>> \"From:sip:1234@8.8.8.8"\r\nTo:sip:3003@193.144.1.112\r\nContact:sip:daemon@8.8.8.8\r\n\""
>>
>> do you run this command from command line or from kamailio.cfg? I
>> think it's good to be sure it works from command line.
>>
>> Also, can you try to enclose each parameter in single quotes -- then
>> it's easier for the command line parser to identify the parameters.
>>
>> Cheers,
>> Daniel
>>
>>> 404 Invalid local socket
>>>
>>> As its picking up the socket with the from address included as well,
>>> is this again around syntax?
>>>
>>> ERROR:  [main.c:1128]: parse_phostport(): too many colons in
>>> udp:10.70.1.136:5060"From:sip:1234@8.8.8.8
>>>
>>> As it seems to pick socket up ok;
>>>
>>> Nov 20 15:11:36 POC_ProxyA /usr/sbin/kamailio[23175]: DEBUG: mi_fifo
>>> [mi_parser.c:245]: mi_parse_tree(): adding node <> ; val 
>>> Nov 20 15:11:36 POC_ProxyA /usr/sbin/kamailio[23175]: DEBUG: mi_fifo
>>> [mi_parser.c:245]: mi_parse_tree(): adding node <> ; val
>>> 
>>> Nov 20 15:11:36 POC_ProxyA /usr/sbin/kamailio[23175]: DEBUG: mi_fifo
>>> [mi_parser.c:245]: mi_parse_tree(): adding node <> ; val <.>
>>> Nov 20 15:11:36 POC_ProxyA /usr/sbin/kamailio[23175]: DEBUG: mi_fifo
>>> [mi_parser.c:245]: mi_parse_tree(): adding node <> ; val
>>> 
>>> Nov 20 15:11:36 POC_ProxyA /usr/sbin/kamailio[23175]: DEBUG: mi_fifo
>>> [mi_parser.c:245]: mi_parse_tree(): adding node <> ; val
>>> >> Nov 20 15:11:36 POC_ProxyA /usr/sbin/kamailio[23175]: DEBUG: mi_fifo
>>> [mi_parser.c:84]: mi_parse_node(): end of fifo input tree
>>> Nov 20 15:11:36 POC_ProxyA /usr/sbin/kamailio[23175]: DEBUG: mi_fifo
>>> [fifo_fnc.c:507]: mi_fifo_server(): done parsing the mi tree
>>> Nov 20 15:11:36 POC_ProxyA /usr/sbin/kamailio[23175]: ERROR: 
>>> [main.c:1128]: parse_phostport(): too many colons in
>>> udp:10.70.1.136:5060"From:sip:1234@8.8.8.8
>>>
>>>
>
> -- 
> 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

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


[SR-Users] Change from in a failure route

2016-11-22 Thread Nelson Migliaro
Hello,

My sip vendor sends me a 403 error when the caller id (CLI) sent is not
valid.

I would like to set up a failure route to capture that 403 and set up a
default CLI.

I tried to use a uac_replace_from() in a failure route but I get:

"Command cannot be used in the block"

Does anyone know how can I change the CLI in a failure route how how can
achieve the default CLI?

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


[SR-Users] Message flags preservation for replies in onsend_route

2016-11-22 Thread Alex Balashov

Hi,

I have

--
   flags
  BLAH : 1,
  DUMMY : 12

   onsend_route_reply=yes

   route {
  ...

  setflag(BLAH);

  if(!t_relay())
 sl_reply_error();
   }

   onsend_route {
  if(is_reply() && isflagset(BLAH))
 do_things();
   }
--

My discovery has been that isflagset(BLAH) always == FALSE _unless_ an 
onreply_route has been armed for the request, regardless of whether it 
is necessary.


In other words, the following causes isflagset(BLAH) to == TRUE (if set, 
when appropriate) in the onsend_route for the reply:


--
   flags
  BLAH : 1,
  DUMMY : 12

   onsend_route_reply=yes

   onreply_route[BOGUS] {
  exit;
   }

   route {
  ...

  setflag(BLAH);

  t_on_reply("BOGUS");

  if(!t_relay())
 sl_reply_error();
   }

   onsend_route {
  if(is_reply() && isflagset(BLAH))
 do_things();
   }
--

But without the onreply_route, it doesn't work.

--
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] Registering Trunk help please

2016-11-22 Thread Daniel Tryba
On Mon, Nov 21, 2016 at 07:14:57PM +, Andrei Mahalean wrote:
> I have my pilot DID setup and registered with Kamailio ok and I can make
> calls in and out through my PSTN gateway, but I'm unsure how to group all
> the other DID's so they are matched against the pilot DID.

You can use dbaliases for that, something like this:

if (is_method("INVITE"))
{
 if(!lookup("location"))
 {
  if(!alias_db_lookup("dbaliases"))
  {
   send_reply("404","Not Found");
  }
 }
}

How to communicate the DID with the destination depends on how the
destinations want it. Easiest is to store $rU before
lookup/alias_db_lookup (which override $rU with the username) and simple
set $rU to stored value:

$avp(callednumber)=$rU;
lookup/dbaliases logic
$rU=$avp(callednumber);

If a destination want the number in the To: header, you probably don't
have to do anything.

All this is assuming trunk registers to kamailio.


___
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-11-22 Thread Jonathan Hunter
Hello,


One last question relating to this issue of sending SIP INFO within a dialog. 
(Sorry!)


As you know I now have t_uac_dlg working with the exec module to create the SIP 
INFO, however how do I inject it effectively within the dialog?


I have added event_route[dialog:start] as thought this would be a good point to 
send prior to the ACK and just checking I get all the tags for the dialog, 
however it doesnt seem to capture the to_tag when its hit, am I missing 
something in config here or am I calling in in wrong place?



event_route[dialog:start]
{
xlog("L_INFO", "We are getting here in event route\n")
xlog("L_INFO","We have here $dlg(to_uri) and $dlg(from_uri)\n");
xlog("L_INFO","to uri is $dlg(to_uri)\n");
xlog("L_INFO","to tag is $dlg(to_tag)\n");
xlog("L_INFO","from uri is $dlg(from_uri)\n");
xlog("L_INFO","from tag is $dlg(from_tag)\n");
xlog("L_INFO","callid is $dlg(callid)\n");



Nov 22 08:53:16 POC_ProxyA /usr/sbin/kamailio[9036]: INFO: 

[SR-Users] Force OpenSER to send a Stop radius accounting record in failure route.

2016-11-22 Thread Jan Hazenberg

Hi all,

I have a issue here on a old OpenSER 1.3 system. We have some clients 
that respond to a BYE message with a 481 resulting in a missing radius 
accounting record. I have added some code to the failure route to force 
accounting even if a 481 response in received:


 if (t_check_status("481") && $rm == "BYE")
 {
xlog("L_INFO", "INFO: [FAILURE] 481 response detected!! Forcing 
accounting! - SRC=$si:$sp R=$ru ID=$ci FU=$fu M=$rm S=$rs\n");

acc_rad_request("BYE with 481 response");
 }

Now OpenSER sends a accounting record, but this has the attribute 
Acct-Status-Type set to Failed. This gives a problem with our accounting 
service and i would like to change it to a normal Stop record.


Is there a way to change this and force OpenSER/Kamailio to send a Stop 
record instead of a Failed record?


Thanks,

Jan

___
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] presentity tabla, faster update when drop TCP/TLS connection

2016-11-22 Thread João Resende
Can be both option TCP or TLS

2016-11-21 11:26 GMT+00:00 Daniel-Constantin Mierla :

> Hello,
> are the clients connected over upd or tcp/tls?
>
> Cheers,
> Daniel
>
> On 21/11/16 12:13, João Resende wrote:
>
> I'm testing kamailio with a SIP client with presence support, when I get a
> connection drop from a client (i.e when the client lost the access to the
> Internet connection) I do not receive the change in the status to offline
> immediately, I just received when the timeout from the presentity database
> finishes. Exists a way to define this? or it is a bug? or should be a new
> feature?
>
> I know that I'm able to change the expiry parameter from the presentity
> table, but that increases my battery consumption and the data exchange, the
> same happens if I reduce the publish interval on the client side.
>
>
> --
> Daniel-Constantin Mierlahttp://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
>
>
___
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