[SR-Users] Re: kamailio sending from udp non-listening port

2024-10-03 Thread Ben Kaufman via sr-users
Following up here. On the host where I had the problem I changed from using 
docker's bridged network to using host mode networking, and the problem 
persisted, then matching your description.  I rebooted the host.  My only guess 
is that there was some type of state being inaccurately tracked by the host 
firewall as the underlying issue, because it happened with only one target, and 
the translated port was persistent across Kamailio restarts.  Did you find out 
anything more about your problem?

Regards,
Kaufman



From: David Villasmil 
Sent: Tuesday, September 10, 2024 9:26 AM
To: Ben Kaufman 
Cc: Kamailio (SER) - Users Mailing List 
Subject: Re: [SR-Users] kamailio sending from udp non-listening port


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Hello ben,

Yes it’s running on kubernetes, but I’m using host networking, so it shouldn’t 
do that.. I don’t think it’s on Kamailio’s side, but maybe someone has gone 
through this and can help us!

Regards,

David Villasmil
email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com>



On Tue, 10 Sep 2024 at 15:30, Ben Kaufman 
mailto:bkauf...@bcmone.com>> wrote:
I have a similar issue, but my case is even more simple in that I have only a 
single UDP socket.  Are you running Kamailio in docker?  In my case, I was able 
to observe that Kamailio was using the correct socket address and port, but 
docker's outbound NAT, was changing not only the source address of the packet, 
but also the source port as well.  Host is running Amazon Linux 2023, docker 
from their packages.


Kaufman
Senior Voice Engineer



E: bkauf...@bcmone.com<mailto:bkauf...@bcmone.com>





SIP.US<http://sip.us/> Client Support: 800.566.9810  |  SIPTRUNK Client 
Support: 800.250.6510  |  Flowroute Client Support: 855.356.9768

[img]<https://www.sip.us/>
[img]<https://www.siptrunk.com/>
[img]<https://www.flowroute.com/>



From: David Villasmil via sr-users 
mailto:sr-users@lists.kamailio.org>>
Sent: Tuesday, September 10, 2024 5:31 AM
To: Kamailio (SER) - Users Mailing List 
mailto:sr-users@lists.kamailio.org>>
Cc: David Villasmil 
mailto:david.villasmil.w...@gmail.com>>
Subject: [SR-Users] kamailio sending from udp non-listening port


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Hello guys,

i'm seeing something weird, and i'm working if you can let me know.
I have a kamailio in AWS with a private IP listening on several sockets:

Listening on
 udp: 10.1.2.36:5070<http://10.1.2.36:5070/>
 udp: 10.1.2.36:5080<http://10.1.2.36:5080/>
 udp: 10.1.2.36:5160<http://10.1.2.36:5160/> advertise 
4.3.2.1:5160<http://4.3.2.1:5160/>
 udp: 0.0.0.0:5066<http://0.0.0.0:5066/>
 tls: 10.1.2.36:443<http://10.1.2.36:443/> advertise 
sip.something.com:443<http://sip.something.com:443/>
 tls: 10.1.2.36:444<http://10.1.2.36:444/> advertise 
sip.something.com:444<http://sip.something.com:444/>
 tls: 10.1.2.36:5061<http://10.1.2.36:5061/>

When forwarding a udp invite received on 10.1.2.36:5080<http://10.1.2.36:5080/> 
to a public ip provider say on 8.8.8.8:5060<http://8.8.8.8:5060/>, i'm forcing 
the outgoing socket with force_socket via 
10.1.2.36:5160<http://10.1.2.36:5160/>. But the outgoing invite does NOT use 
5160, it uses some random port...

Anybody knows why this might be?

my problem is, that call goes to freeswitch... call is setup properly and 
connects fine. But 15 minutes later the end provider sends back a reINVITE, 
which freeswitch then sends TO THE RANDOM PORT kamailio used to send the 
INVITE... but by this time kamailio doesn't seem to even see the packet...

help is greatly appreciated!

David

Regards,

David Villasmil
email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com>

__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Honor Retry-After

2024-09-23 Thread Ben Kaufman via sr-users
The most direct and "correct" answer is that the failure reply with the 
Retry-After header should be passed back to the UAC, and the UAC should be 
handling this - not the proxy.  This is why there's not a "direct" way of doing 
it in Kamailio, as it's not really a proxy function.

With that said, you can probably achieve what you're looking for by adding the 
call id and time you wish to resume to mqueue, suspending the call, and having 
a task run with rtimer at a relatively small interval (every second) to check 
the message queue to see if there is a transaction to resume.

But really, it should go back to the UAC.

Regards,
Kaufman


From: Knserbrave via sr-users 
Sent: Monday, September 23, 2024 11:25 AM
To: Kamailio (SER) - Users Mailing List 
Cc: Knserbrave 
Subject: [SR-Users] Honor Retry-After


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Hi Community,

Any advice on how to handle a Retry-After header locally without sleeping? I 
would like to suspend the transaction, schedule an event, wake up the 
transaction after the event timer triggers, and resume the transaction.  I 
don't believe this is possible though.
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: kamailio sending from udp non-listening port

2024-09-10 Thread Ben Kaufman via sr-users
I have a similar issue, but my case is even more simple in that I have only a 
single UDP socket.  Are you running Kamailio in docker?  In my case, I was able 
to observe that Kamailio was using the correct socket address and port, but 
docker's outbound NAT, was changing not only the source address of the packet, 
but also the source port as well.  Host is running Amazon Linux 2023, docker 
from their packages.


Kaufman
Senior Voice Engineer



E: bkauf...@bcmone.com





SIP.US Client Support: 800.566.9810  |  SIPTRUNK Client Support: 800.250.6510  
|  Flowroute Client Support: 855.356.9768

[img]<https://www.sip.us/>
[img]<https://www.siptrunk.com/>
[img]<https://www.flowroute.com/>



From: David Villasmil via sr-users 
Sent: Tuesday, September 10, 2024 5:31 AM
To: Kamailio (SER) - Users Mailing List 
Cc: David Villasmil 
Subject: [SR-Users] kamailio sending from udp non-listening port


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Hello guys,

i'm seeing something weird, and i'm working if you can let me know.
I have a kamailio in AWS with a private IP listening on several sockets:

Listening on
 udp: 10.1.2.36:5070<http://10.1.2.36:5070/>
 udp: 10.1.2.36:5080<http://10.1.2.36:5080/>
 udp: 10.1.2.36:5160<http://10.1.2.36:5160/> advertise 
4.3.2.1:5160<http://4.3.2.1:5160/>
 udp: 0.0.0.0:5066<http://0.0.0.0:5066/>
 tls: 10.1.2.36:443<http://10.1.2.36:443/> advertise 
sip.something.com:443<http://sip.something.com:443/>
 tls: 10.1.2.36:444<http://10.1.2.36:444/> advertise 
sip.something.com:444<http://sip.something.com:444/>
 tls: 10.1.2.36:5061<http://10.1.2.36:5061/>

When forwarding a udp invite received on 10.1.2.36:5080<http://10.1.2.36:5080/> 
to a public ip provider say on 8.8.8.8:5060<http://8.8.8.8:5060/>, i'm forcing 
the outgoing socket with force_socket via 
10.1.2.36:5160<http://10.1.2.36:5160/>. But the outgoing invite does NOT use 
5160, it uses some random port...

Anybody knows why this might be?

my problem is, that call goes to freeswitch... call is setup properly and 
connects fine. But 15 minutes later the end provider sends back a reINVITE, 
which freeswitch then sends TO THE RANDOM PORT kamailio used to send the 
INVITE... but by this time kamailio doesn't seem to even see the packet...

help is greatly appreciated!

David

Regards,

David Villasmil
email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com>

__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: http_async and tm

2024-08-29 Thread Ben Kaufman via sr-users
Semantics aside, the issue from the original post isn't so much that "the http 
request blocks processing the SIP message", but that "the http request blocks 
processing the SIP message for about a second, during which time the process 
cannot do anything else".  If the original poster's web server responded in 
less than 5ms, we wouldn't be having this conversation.

So, using kamailio's ASYNC module, the pattern would be to call 
async_task_route() in listener process A. This passes the transaction to 
async_worker process A.  Then, in the async_worker process, the http request is 
made and that async worker process is blocked until the web server responds.  
And yes, if that's what is happening it is just moving the wait time from one 
process to another.

With the http async client, however, my understanding is that the request is 
sent from listener process A, and then the transaction is suspened. The http 
async worker process, which not the same as async workers, is running an event 
loop (libevent is a requirement for http async client).  When a http reply is 
received, the http async worker will resume the transaction that sent the 
request.

The difference is that with the http async client, waiting for the http reply 
doesn't block anything.  Supposing we have a single listener process and a 
single http async worker process.  In very quick succession, 5 SIP requests are 
received, all requiring an http request.  If the 5th http request is the first 
to receive an http response, then that response will be handled immediately - 
it's not blocked waiting for the prior 4 http replies.




Kaufman
Senior Voice Engineer



E: bkauf...@bcmone.com





SIP.US Client Support: 800.566.9810  |  SIPTRUNK Client Support: 800.250.6510  
|  Flowroute Client Support: 855.356.9768

[img]<https://www.sip.us/>
[img]<https://www.siptrunk.com/>
[img]<https://www.flowroute.com/>



From: Alex Balashov via sr-users 
Sent: Thursday, August 29, 2024 4:30 PM
To: Kamailio (SER) - Users Mailing List 
Cc: Alex Balashov 
Subject: [SR-Users] Re: http_async and tm

CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


> On Aug 29, 2024, at 5:05 PM, Ben Kaufman  wrote:
>
> • so it looks like success.
>
> How is it not success?  It is not just "not dropping messages".  All messages 
> are responded to in only slightly longer than the 1 second delay provided by 
> the web server. How is handling 300 request per second rather than 2 (the 
> number of children) not an improvement in throughput?

"Looks like success [with the tacit insinuation that it's actually not]" was 
probably uncharitable. You're right that

However, it's not an increase in _throughput_. It's a work around Kamailio's 
concurrency architecture vis-a-vis HTTP. You've just created an elastic buffer 
for slow HTTP requests. There is, essentially, process A (SIP worker) and 
process B (async worker), and they both process the request the same way.

Moving the work to process B is beneficial because it's not exposed to incoming 
SIP packets, while process A is. Instead of waiting on HTTP requests in 
processes of type A, you're waiting on them in processes of type B. You're 
still blocking a process and waiting. Vitally, the throughput is still bounded 
by process B and by available memory, and, more to the point, the 
considerations, and limitations, around increasing the number of processes, of 
either the A or B type, are the same.

The picture I painted was:

   "asynchronous processing just means liberating the transaction
from the main worker processes, which are part of a relatively
small fixed-size pool, by suspending it and shipping it to
another set of ancillary worker processes"

Your critique of this was, as I understood it:

   "this does not simply 'hand off the transaction' to another
pool of workers which then accumulate load."

My only aim here is to say that this is, in fact, an accurate characterisation 
of what is happening. You are handing off the transaction to another pool of 
workers. I also meant to convey that Kamailio's async model is more coarse than 
that of async I/O in other execution environments.

-- Alex

--
Alex Balashov
Principal Consultant
Evariste Systems LLC
Web: 
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fevaristesys.com%2F&data=05%7C02%7Cbkaufman%40bcmone.com%7Ca2bdc9e44c6e46c296a008dcc8730ddf%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C638605643717791558%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=GWxDbgBAWAGGA5tNycV%2Flieul9O55ejRIi%2FWWE83eMY%3D&reserved=0&

[SR-Users] Re: http_async and tm

2024-08-29 Thread Ben Kaufman via sr-users
  *
so it looks like success.

How is it not success?  It is not just "not dropping messages".  All messages 
are responded to in only slightly longer than the 1 second delay provided by 
the web server. How is handling 300 request per second rather than 2 (the 
number of children) not an improvement in throughput?




Kaufman
Senior Voice Engineer



E: bkauf...@bcmone.com





SIP.US Client Support: 800.566.9810  |  SIPTRUNK Client Support: 800.250.6510  
|  Flowroute Client Support: 855.356.9768

[img]<https://www.sip.us/>
[img]<https://www.siptrunk.com/>
[img]<https://www.flowroute.com/>



From: Alex Balashov via sr-users 
Sent: Thursday, August 29, 2024 3:45 PM
To: Kamailio (SER) - Users Mailing List 
Cc: Alex Balashov 
Subject: [SR-Users] Re: http_async and tm

CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


You might be thinking about it backwards. The throughput is the same in process 
A as it is in process B. The difference is that process B isn't in the critical 
path of new SIP packets, so it looks like success.

Consider a config in which you take every request, put it on an mqueue, dequeue 
it inside an async worker (i.e. while(mq_fetch(...)), and then do a blocking 
HTTP query inside that loop instead. You would get the same throughput, which 
is to say that the resumption of the transaction upon HTTP reply is just an 
implementational detail, not a saliently throughput-boosting feature.

I suppose "not dropping SIP messages" can be viewed as a separate dimension of 
work from the call processing, and in that sense, you're freeing up the main 
SIP workers to consume more packets. I just have a problem with this take 
because the packets are then all bound for the same pipeline, and ultimately, 
the same async worker(s).

The throughput-enhancing value of async depends on liberating workers to do 
_other_ things while $slow_workload unspools. If the $slow_workload _is_ the 
work, you're just moving food around on the plate. Whether you're marching 
straight from Maogong or stop at Songpan, you still end up at Yan'an.

-- Alex

> On Aug 29, 2024, at 4:18 PM, Ben Kaufman  wrote:
>
> I'm not sure I understand how it's not getting more throughput.  Every 
> request got its reply in only a little over a second, from the first request 
> to the 18,000 request.  Using a blocking http request this config (low number 
> of workers) died quickly.
>
> The original post in this thread (i.e. the real-world example) was a 
> 302-redirect server.  My example traded that for a 404, because it was easier 
> to implement than returning values from the web server to make a 302 reply, 
> but certainly extracting information from the http reply and putting it into 
> the SIP reply is trivial.
>
>
> Kaufman
> Senior Voice Engineer
>
>
>
> E: bkauf...@bcmone.com
>
>
>  SIP.US Client Support: 800.566.9810  |  SIPTRUNK Client Support: 
> 800.250.6510  |  Flowroute Client Support: 855.356.9768
>
>
> From: Alex Balashov via sr-users 
> Sent: Thursday, August 29, 2024 2:41 PM
> To: Kamailio (SER) - Users Mailing List 
> Cc: Alex Balashov 
> Subject: [SR-Users] Re: http_async and tm
>  CAUTION: This email originated from outside the organization. Do not click 
> links or open attachments unless you recognize the sender and know the 
> content is safe.
>
>
> Ben,
>
> You're absolutely correct that the transaction is resumed upon receipt of an 
> HTTP reply, and that the async workers do not block on this event.
>
> This is also true of a variety of other patterns and workflows which shuttle 
> the transactions off to an async process pool, not really specific to the 
> HTTP client modules. `tsilo` comes to mind.
>
> My overview was meant to make a more general point: once the transaction is 
> resumed, the processing is otherwise linear and identical in every other 
> respect to how it would unfold in the main SIP worker process. This is what I 
> meant when I said:
>
>"This does not cause the processing to enter some generally more
>asynchronous mode in any other respect, and in that sense, is quite
>different to what most people have in mind when they think of
>asynchronous processing in the context of general-purpose
>programming runtimes."
>
> My over-arching point is that throughput is still limited by the (fixed) size 
> of the async worker pool, and that the same considerations about its sizing 
> apply in async land as in regular child process land.
>
> For this reason, I don't think you are correct to conclude from this exercise 
> that using asynchronous mode / `htt

[SR-Users] Re: http_async and tm

2024-08-29 Thread Ben Kaufman via sr-users
I'm not sure I understand how it's not getting more throughput.  Every request 
got its reply in only a little over a second, from the first request to the 
18,000 request.  Using a blocking http request this config (low number of 
workers) died quickly.

The original post in this thread (i.e. the real-world example) was a 
302-redirect server.  My example traded that for a 404, because it was easier 
to implement than returning values from the web server to make a 302 reply, but 
certainly extracting information from the http reply and putting it into the 
SIP reply is trivial.



Kaufman
Senior Voice Engineer



E: bkauf...@bcmone.com





SIP.US Client Support: 800.566.9810  |  SIPTRUNK Client Support: 800.250.6510  
|  Flowroute Client Support: 855.356.9768

[img]<https://www.sip.us/>
[img]<https://www.siptrunk.com/>
[img]<https://www.flowroute.com/>



From: Alex Balashov via sr-users 
Sent: Thursday, August 29, 2024 2:41 PM
To: Kamailio (SER) - Users Mailing List 
Cc: Alex Balashov 
Subject: [SR-Users] Re: http_async and tm

CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


Ben,

You're absolutely correct that the transaction is resumed upon receipt of an 
HTTP reply, and that the async workers do not block on this event.

This is also true of a variety of other patterns and workflows which shuttle 
the transactions off to an async process pool, not really specific to the HTTP 
client modules. `tsilo` comes to mind.

My overview was meant to make a more general point: once the transaction is 
resumed, the processing is otherwise linear and identical in every other 
respect to how it would unfold in the main SIP worker process. This is what I 
meant when I said:

   "This does not cause the processing to enter some generally more
   asynchronous mode in any other respect, and in that sense, is quite
   different to what most people have in mind when they think of
   asynchronous processing in the context of general-purpose
   programming runtimes."

My over-arching point is that throughput is still limited by the (fixed) size 
of the async worker pool, and that the same considerations about its sizing 
apply in async land as in regular child process land.

For this reason, I don't think you are correct to conclude from this exercise 
that using asynchronous mode / `http_async_client` increases _throughput_. Your 
example config has one async worker, and that worker can only handle one 
resumed transaction at a time. This is not a net increase in throughput. You 
say in your documentation: "Re-running the load test will result in heavily 
blocked and dropped SIP requests", which is absolutely true; in this paradigm, 
you are liberating the SIP workers from the congestion that would cause 
"blocked and dropped SIP requests", by doing what I described in my original 
message: "suspending it and shipping it to another set of ancillary worker 
processes".

The real conflation here is between "not dropping SIP requests" and "increased 
throughput". There is no increased throughput, only a deep queue of suspended 
transactions lined up at the async worker pool. This goes back to the question 
I raised in a previous message: what exactly is meant by "handle"? Are you "not 
dropping" 300 CPS, or are you relaying 300 CPS worth of requests? I fully 
believe that one async worker can churn through hundreds of resumed 
transactions per second, driven by near-simultaneous HTTP replies, when the 
effect is simply to send a '404 Not Found', as in your config. Real-world 
workloads don't particularly resemble that in most cases.

You're not getting more _throughput_. You're changing where the blocking occurs 
so as to not obstruct receipt of further SIP messages, which is precisely what 
I meant when I said: "suspending it and shipping it to another set of ancillary 
worker processes".

From the perspective of not dropping SIP messages, sweeping these transactions 
out of the main worker pool is indeed quite effective, and if it is in that 
narrow sense of "not dropping" that you meant "keeping up with the requests", 
then you are quite right. I was thinking about bottom-line throughput capacity. 
I think there is a misconception out there that other config script operations 
also acquire an asynchronous character, beyond the initial "shipping", as it 
were, and this is the idea I meant to single out.

-- Alex

> On Aug 29, 2024, at 3:13 PM, Ben Kaufman  wrote:
>
> I believe that there's a conflation of the http_async_client module and the 
> async module going on here.  My understanding (and testing bears out), that 
> the http async client module works in the manner 

[SR-Users] Re: http_async and tm

2024-08-29 Thread Ben Kaufman via sr-users
I believe that there's a conflation of the http_async_client module and the 
async module going on here.  My understanding (and testing bears out), that the 
http async client module works in the manner you describe as being "mediated by 
external events" in that the http reply is the external trigger that resumes 
the transaction.  It appears that the module abstracts any actual calls to 
suspend/resume.

I created a test project that demonstrates this:
https://github.com/whosgonna/kamailio_http_async

Using the container 
deminy/delayed-http-response<https://registry.hub.docker.com/r/deminy/delayed-http-response>
 to create an http service that sleeps 1 second and then replies, and having 
Kamailio set with 2 child listening processes, and 1 http_async_client worker, 
a simple use of the http_async_query() function handles
300 cps sustained over a minute with no problems.  This passes all of the 
latency load onto the http server.  Yes, if the http server cannot handle the 
request load as the requests increase, that will be a problem, but I think the 
understanding of how this module works is incorrect.




Kaufman
Senior Voice Engineer



E: bkauf...@bcmone.com





SIP.US Client Support: 800.566.9810  |  SIPTRUNK Client Support: 800.250.6510  
|  Flowroute Client Support: 855.356.9768

[img]<https://www.sip.us/>
[img]<https://www.siptrunk.com/>
[img]<https://www.flowroute.com/>



From: Alex Balashov via sr-users 
Sent: Tuesday, August 27, 2024 6:57 AM
To: Kamailio (SER) - Users Mailing List 
Cc: Alex Balashov 
Subject: [SR-Users] Re: http_async and tm

CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


> On Aug 27, 2024, at 4:17 AM, Henning Westerholt via sr-users 
>  wrote:
>
>  The asynchronous HTTP client only helps you if you are having other traffic 
> that can be handled without the need for HTTP API calls, and/or if you are 
> having traffic fluctuations, so you can prevent blocking by buffering 
> requests in memory basically.

Indeed. It's also worth reiterating that the meaning of "asynchronous" is 
somewhat environmentally and implementationally specific.

As the term has entered general use with the popularity of single-threaded / 
single event loop multiplexing systems, such as Node and JavaScript, it has 
come to refer to a programming and processing pattern in which the waiting and 
detection of I/O is delegated to the OS kernel network stack. The OS takes care 
of this juggling and calls event hooks or callbacks in your program when there 
is I/O to consume, or sets some flag or condition to indicate this so that you 
can read the I/O from some OS buffer at your convenience. In this way, your 
program is able to proceed executing other kinds of things while the OS is 
taking care of waiting on I/O. Provided that the workload consists of waiting 
on I/O and also other things, this is to the general benefit of "other things", 
not the I/O.

In Kamailio, asynchronous processing just means liberating the transaction from 
the main worker processes, which are part of a relatively small fixed-size 
pool, by suspending it and shipping it to another set of ancillary worker 
processes, also part of a relatively small, fixed-size pool. Within those 
ancillary worker processes, the execution is as linear, synchronous and 
blocking as it would be in the main worker processes. This does not cause the 
processing to enter some generally more asynchronous mode in any other respect, 
and in that sense, is quite different to what most people have in mind when 
they think of asynchronous processing in the context of general-purpose 
programming runtimes.

The only real footnote to this is about situations in which the resumption of 
the transaction in the async workers is mediated by external events, e.g. a 
POST-back into Kamailio's `xhttp` server. While this does not change the nature 
of the subsequent synchronous execution of the route logic, it does mean that 
neither a core CIP worker nor an async worker is tied up while some kind of 
external processing is playing out.

-- Alex

--
Alex Balashov
Principal Consultant
Evariste Systems LLC
Web: 
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fevaristesys.com%2F&data=05%7C02%7Cbkaufman%40bcmone.com%7C870a790256344872731208dcc68ffcab%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C638603568952398508%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=Baqrm4TWB8dZrVKaeh87CcswweXIzP7OPdTN%2BJRpH9k%3D&reserved=0<https://evaristesys.com/>
Tel: +1-706-510-6800

__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@l

[SR-Users] Re: http_async and tm

2024-08-29 Thread Ben Kaufman via sr-users
To the original question posted here about the reply retransmission - is your 
testing client SIPp?  SIPp seems to have an odd behavior where the branch value 
in it's via increases with each request.  There is the ability to set 
[branch-N], where N is the value to decrement this.  Since every message (both 
request and replies) increments this, if your pattern is INVITE, 100, 302, ACK, 
the ACK's branch value would need to be decremented by 3.

https://sipp.readthedocs.io/en/latest/scenarios/keywords.html?highlight=%5Bbranch%5D#branch


Kaufman
Senior Voice Engineer



E: bkauf...@bcmone.com





SIP.US Client Support: 800.566.9810  |  SIPTRUNK Client Support: 800.250.6510  
|  Flowroute Client Support: 855.356.9768

[img]<https://www.sip.us/>
[img]<https://www.siptrunk.com/>
[img]<https://www.flowroute.com/>



From: alexis via sr-users 
Sent: Saturday, August 24, 2024 5:48 PM
To: sr-users@lists.kamailio.org 
Cc: alexis 
Subject: [SR-Users] http_async and tm


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Hello all, context first, we have an REST API that performs queries to external 
devices in the network (diameter to DRA's, REST to different servers) and based 
on n conditions returns the content for a Contact header to be used in a SIP 
302.

Now we're consuming this API with http_client (synchronously) and as there's no 
way to speed up the API (pipeline executions, delays on external api's etc etc) 
we're hitting a limit where all children become busy waiting for the API to 
answer.

So i decided to move to http_async_client and started working on it on the lab 
with this first and base concept to test.

request_route {


#for testing purposes only
if(is_method("ACK")){
exit;
}
$http_req(all) = $null;
$http_req(suspend) = 1;
$http_req(timeout) = 500;
$http_req(method) = "POST";
$http_req(hdr) = "Content-Type: application/json";
jansson_set("string", "event", "sip-routing", "$var(cre_query)");
xlog("L_INFO","API ASYNC ROUTING REQUEST: $var(cre_query)\n");
$http_req(body) = $var(cre_query);
t_newtran();
http_async_query("http://192.168.86.128:8000/";, "CRE_RESPONSE");
}

http://192.168.86.128:8000/ receives the POST, randomly creates a delay between 
0.5 and 1 second and responds (simulating the real api with an excess delay to 
probe the concept)

Then

route[CRE_RESPONSE] {
if ($http_ok && $http_rs == 200) {
xlog("L_INFO","CRE RESPONSE: $http_rb\n");
# for testing purpose, Contact content will be replaced from the received api 
response
append_to_reply("Contact: 
mailto:sip%3a1...@google.com>>\r\n");
send_reply(302,"Moved Temporarily");
exit;
}
send_reply(500, "Internal error");
exit;
}

INVITE is received and processed, API is called, after API response, 302 is 
replied and then an ACK (ignored by now).

Situation is that the 302 retransmitted

   37 1519.846253067 192.168.86.34 → 192.168.86.128 SIP/SDP 585 Request: INVITE 
sip:service@192.168.86.128:5060<http://sip:service@192.168.86.128:5060/> |
   38 1519.848100380 192.168.86.128 → 192.168.86.34 SIP 318 Status: 100 Trying |
   39 1520.094997642 192.168.86.128 → 192.168.86.34 SIP 407 Status: 302 Moved 
Temporarily |
   40 1520.102323728 192.168.86.34 → 192.168.86.128 SIP 453 Request: ACK 
sip:service@192.168.86.128:5060<http://sip:service@192.168.86.128:5060/> |
   41 1520.591300933 192.168.86.128 → 192.168.86.34 SIP 407 Status: 302 Moved 
Temporarily |
   42 1521.591061065 192.168.86.128 → 192.168.86.34 SIP 407 Status: 302 Moved 
Temporarily |
   43 1523.591227956 192.168.86.128 → 192.168.86.34 SIP 407 Status: 302 Moved 
Temporarily |


18(24) DEBUG: tm [t_reply.c:1703]: t_retransmit_reply(): reply retransmitted. 
buf=0x7f6d79745dc0: SIP/2.0 3..., shmem=0x7f6d75187fd8: SIP/2.0 3
18(24) DEBUG: tm [t_reply.c:1703]: t_retransmit_reply(): reply retransmitted. 
buf=0x7f6d79745dc0: SIP/2.0 3..., shmem=0x7f6d75187fd8: SIP/2.0 3
18(24) DEBUG: tm [t_reply.c:1703]: t_retransmit_reply(): reply retransmitted. 
buf=0x7f6d79745dc0: SIP/2.0 3..., shmem=0x7f6d75187fd8: SIP/2.0 3
18(24) DEBUG: tm [timer.c:634]: wait_handler(): finished transaction: 
0x7f6d75184cc8 (p:0x7f6d74f600c8/n:0x7f6d74f600c8)
18(24) DEBUG: tm [h_table.c:132]: free_cell_helper(): freeing transaction 
0x7f6d75184cc8 from timer.c:643

Any help to avoid the retransmission and make the transaction just finish right 
after the 302 will be appreciated.

regards





__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: http_async and tm

2024-08-26 Thread Ben Kaufman via sr-users
Does the analogy apply here? Assuming a steady traffic rate and that the http 
request takes a consistent amount of time, all that's added is PDD as long as 
latency doesn't increase in the http request with load.

With a blocking HTTP request, then the number of requests that Kamailio can 
handle becomes limited by the number of children.  If it's not blocking, then 
the limit becomes memory bound, but if the request rate is static, then the 
memory limit is also static.




Kaufman
Senior Voice Engineer



E: bkauf...@bcmone.com





SIP.US Client Support: 800.566.9810  |  SIPTRUNK Client Support: 800.250.6510  
|  Flowroute Client Support: 855.356.9768

[img]<https://www.sip.us/>
[img]<https://www.siptrunk.com/>
[img]<https://www.flowroute.com/>


From: Alex Balashov via sr-users 
Sent: Saturday, August 24, 2024 7:02 PM
To: Kamailio (SER) - Users Mailing List 
Cc: Alex Balashov 
Subject: [SR-Users] Re: http_async and tm

CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


Not overtly related to your most immediate question, but:

1) "we're hitting a limit where all children become busy waiting for the API to 
answer."

2) "So i decided to move to http_async_client"

I'm not sure this is really going to solve your problem. You've hit 
fundamental, thermodynamic kind of limits here. Using async here just squeezes 
the balloon in one place and causes it to inflate in another.

It would be different if some of your workload were HTTP-dependent and other 
parts of the workload were not. Doing the HTTP queries would free up the core 
SIP workers to process other kinds of requests. That doesn't sound like it's 
the case, so all you're really liberating is reply processing, which, if this 
is a redirect server, is nonexistent anyway.

This matter might occasion some deeper reflection.

-- Alex

> On Aug 24, 2024, at 6:48 PM, alexis via sr-users 
>  wrote:
>
> Hello all, context first, we have an REST API that performs queries to 
> external devices in the network (diameter to DRA's, REST to different 
> servers) and based on n conditions returns the content for a Contact header 
> to be used in a SIP 302.
>
> Now we're consuming this API with http_client (synchronously) and as there's 
> no way to speed up the API (pipeline executions, delays on external api's etc 
> etc) we're hitting a limit where all children become busy waiting for the API 
> to answer.
>
> So i decided to move to http_async_client and started working on it on the 
> lab with this first and base concept to test.
>
> request_route {
>
>
> #for testing purposes only
> if(is_method("ACK")){
> exit;
> }
> $http_req(all) = $null;
> $http_req(suspend) = 1;
> $http_req(timeout) = 500;
> $http_req(method) = "POST";
> $http_req(hdr) = "Content-Type: application/json";
> jansson_set("string", "event", "sip-routing", "$var(cre_query)");
> xlog("L_INFO","API ASYNC ROUTING REQUEST: $var(cre_query)\n");
> $http_req(body) = $var(cre_query);
> t_newtran();
> 
> http_async_query("https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2F192.168.86.128%3A8000%2F&data=05%7C02%7Cbkaufman%40bcmone.com%7Cbb95cbcc458744f2b3fa08dcc49aee7a%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C638601416959677303%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C6%7C%7C%7C&sdata=022%2FjZEmUuj2RpGEkQiGfLeVHMp30X1jjT3sf3%2FWLRc%3D&reserved=0<http://192.168.86.128:8000/>",
>  "CRE_RESPONSE");
> }
>
> https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2F192.168.86.128%3A8000%2F&data=05%7C02%7Cbkaufman%40bcmone.com%7Cbb95cbcc458744f2b3fa08dcc49aee7a%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C638601416959686162%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C6%7C%7C%7C&sdata=AtjUzO8P4HAO2%2F%2Fh5a5obm9QDAGpNOj7aIx0ofOLe2w%3D&reserved=0<http://192.168.86.128:8000/>
>  receives the POST, randomly creates a delay between 0.5 and 1 second and 
> responds (simulating the real api with an excess delay to probe the concept)
>
> Then
>
> route[CRE_RESPONSE] {
> if ($http_ok && $http_rs == 200) {
> xlog("L_INFO","CRE RESPONSE: $http_rb\n");
> # for testing purpose, Contact content will be replaced from the received api 
> response
> append_to_reply("Contact: \r\n");
> send_reply(302,"Moved Temporarily");
> exit;
>

[SR-Users] Re: low performance with udp_children and async_workers

2024-08-16 Thread Ben Kaufman via sr-users
TL;DR;  There's not enough information provided to give any real feedback.



First, to address the elephant in the room, this is a bizarre business 
requirement:


  *   35% of invites should be handled by async_workers and 65% with be handled 
by main children

Business requirements should concern scalability, security, technology stack 
(i.e. If their environment uses postgres,  that could be a business 
requirement).  The internals of *how* kamailio processes a message shouldn't be 
relevant to a business requirement (it may be necessary to achieve a business 
requirement, but that's not the same thing).


With that said, sometimes requirements like this get stated and that's the 
world we live in.

Next, It's not really clear from your description how you're using the async 
workers here.  Consider the following psuedo kamalio config:

#!KAMAILIO
loadmodule "sl"
children=64
async_worker=128

request_route {
sl_send_reply("404", "Not Found");
}

In that config, simply stating async_workers won't cause anything here to be 
handled by those workers.  There's also the fact that the config itself bears 
massively on how many CPS can be handled.  The config above, while not 
particularly useful, will handle way more than 1500 CPS (or more accurately 
requests per second).

You state that "when I updated the data in database to not use anymore async 
workers", but what is changing in the database, etc?  You can't really show two 
lines of your configuration and expect anyone to know where you have processing 
latency, etc.

Finally, I'd point out that this is a very number of worker processes, and that 
children gets applied to every listener.  You don't state what your private 
memory size is, but assuming that Kamailio starts on the loopback address and a 
single network interface as both TCP and UDP, you'd have 192 processes for your 
listeners (tcp workers are global instead of per listener, iirc), another 128 
processes for your async workers, and about a dozen more default processes 
(main process, timers, etc).  Assuming that you are using the default private 
memory allocation of 8 MB/process, that makes 2.8 GB for private memory alone.  
While that's not a massive amount of memory on a modern system, it's also 
likely you'd want to bump up that 8 MB setting, too.

Regards,
Kaufman



From: elhar.mohamed--- via sr-users 
Sent: Friday, August 16, 2024 4:24 AM
To: sr-users@lists.kamailio.org 
Cc: elhar.moha...@gmail.com 
Subject: [SR-Users] low performance with udp_children and async_workers

CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


Hello,

Based on business requirements, 35% of invites should be handled by 
async_workers and 65% with be handled by main children.
The target is 1500cps.
I'm using the following conf :
children=64
async_worker=128

when doing performance tests using SIPp, I figured out the 1500cps is well 
supported by the conf above, but when I updated the data in database to not use 
anymore async workers, the cps is getting decreased and it was between 200 and 
500.

This a client requirements is to be able to enable/disable feature that needs 
to be handled by async workers.

Could you please help me on this?

Thanks in advance
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Dns record not alone?

2024-07-17 Thread Ben Kaufman via sr-users
Hi,

I had observed the same thing a few weeks ago and asked in the Matrix chat.  
Daniel indicated that the warnings are safe, and will be changed to debug level 
in the near future:

On Wed, June 26th:


  1.
miconda: I pushed a commit to make them debug. I added the warnings when 
invastigated a reported potential leak in dns cache
  I will backport soon

I encountered the warning again myself this morning, and it took a little bit 
of searching to find this answer, so I'm replying here for transparency to the 
mailing list.


From: Pyry Aaltonen via sr-users 
Sent: Tuesday, May 21, 2024 1:50 AM
To: Kamailio (SER) - Users Mailing List 
Cc: Pyry Aaltonen 
Subject: [SR-Users] Dns record not alone?


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


Hi,



I recently updated my testing env to 5.8.1 and after that I’ve been receiving 
dns_cache.c warning “record not alone”.

I found out that it’s been added to quite recent commit: 
https://github.com/kamailio/kamailio/commit/d8a35b3b6c837b36779e232b65fce61c3aa93387

And that’s probably the why I haven’t seen it before.

As far as I know, I have no other problem with dns or anything else than the 
warning appearing in the logs 😊



I can’t quite get what the warning is about?

Clearly refers to dns queries, and with debug I found out that maybe its 
somehow related to ip which has several domains to pointing it (and queried by 
one of those domains by this kamailio).  Can it be something with the 
PTR-record?

And this warning comes ones every hour, so probably when some ttl expires, and 
meanwhile the cache is ok with the situation.



And as a background, I haven’t done any specific dns-configurations in my 
config, so settings should be pretty much in defaults.



Any advice what I should fix here to get the warning disappear?







-Pyry






__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Change the To Header in the failure_route

2024-07-12 Thread Ben Kaufman via sr-users
The manner in which this reply is "confidently wrong" makes it looks like it 
may have been pulled directly from AI?

-Original Message-
From: Henning Westerholt via sr-users  
Sent: Friday, July 12, 2024 9:04 AM
To: Kamailio (SER) - Users Mailing List 
Cc: Maria Jonas ; Henning Westerholt 

Subject: [SR-Users] Re: Change the To Header in the failure_route

CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


Hello,

the $ct pseudo-variable is for accessing the Contact header, I don't understand 
how this is related to retrieving a To tag.

Cheers,

Henning

-Original Message-
From: Maria Jonas via sr-users 
Sent: Friday, July 12, 2024 11:24 AM
To: sr-users@lists.kamailio.org
Cc: Maria Jonas 
Subject: [SR-Users] Re: Change the To Header in the failure_route

To ensure the reply in failure_route[ID] uses the correct "to tag" from 
previous SIP messages, you need to manually add the "to tag" parameter from the 
180 Ringing or other related responses. Since uac_replace_to() doesn't work in 
failure_route, you can use the $ct variable to access and modify the "To" 
header. Here's an example:

failure_route[ID] {
# Extract the to-tag from the previous response (e.g., 180 Ringing)
$avp(to_tag) = $(ct{uri.param,tag});

# Process and send a reply with the extracted to-tag
append_to_reply("To: $ct{uri.param.tag}\r\n");
t_send_reply(486, "Busy Here");
}

Make sure you adjust the script according to your specific requirements and the 
context of your SIP message handling.
__
Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send 
an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
__
Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send 
an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: SRV in advertise?

2024-07-01 Thread Ben Kaufman via sr-users
While I don't know if it will or won't cause the failure, you shouldn't have a 
port number in something you're intending to use as a SRV record.

- Kaufman


From: David Villasmil 
Sent: Monday, July 1, 2024 9:19 AM
To: Ben Kaufman 
Cc: Kamailio (SER) - Users Mailing List 
Subject: Re: [SR-Users] SRV in advertise?


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Hey all,

Joel, it's failing saying the destination is unresolvable and Ben, I'm setting 
it like

Listen=tls:1.2.3.4:5061<http://1.2.3.4:5061/> advertise 
mydomain.com:5061<http://mydomain.com:5061/>

My domain.com<http://domain.com/> srv is like

_sips._tcp.domain.com<http://tcp.domain.com/> resolving to 
sip.domain.com<http://sip.domain.com/> (among others like udp, etc)

I would expect Kamailio to resolve its own srv, or have an option NOT to 
attempt to resolve and just the set host in the record-route, but maybe that's 
just not how it works. Yes, setting 
sip.domain.com:5061<http://sip.domain.com:5061/> works but the the record-route 
would have that (sip.domain.com<http://sip.domain.com/>) exact same host and 
the client might disconnect and reconnect to that dns instead of the actual SRV.

Regards,

David Villasmil
email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com>



On Mon, 1 Jul 2024 at 15:46, Ben Kaufman 
mailto:bkauf...@bcmone.com>> wrote:
Are you using a hostname that should resolve as srv , for example, 
sip.domain.com<http://sip.domain.com/>, or are you using the underscore, 
scheme, underscore transport protocol, hostname type like 
_sip._udp.domain.com<http://udp.domain.com/> ?

Regards,
Kaufman

From: David Villasmil via sr-users 
mailto:sr-users@lists.kamailio.org>>
Sent: Sunday, June 30, 2024 6:02 PM
To: Kamailio (SER) - Users Mailing List 
mailto:sr-users@lists.kamailio.org>>
Cc: David Villasmil 
mailto:david.villasmil.w...@gmail.com>>
Subject: [SR-Users] SRV in advertise?


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Hello guys,

I'm trying to use an SRV as an advertised address but kamailio fails to start. 
Is this not possible?

Thanks,

David Villasmil
email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com>

__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: SRV in advertise?

2024-07-01 Thread Ben Kaufman via sr-users
Are you using a hostname that should resolve as srv , for example, 
sip.domain.com, or are you using the underscore, scheme, underscore transport 
protocol, hostname type like _sip._udp.domain.com ?

Regards,
Kaufman

From: David Villasmil via sr-users 
Sent: Sunday, June 30, 2024 6:02 PM
To: Kamailio (SER) - Users Mailing List 
Cc: David Villasmil 
Subject: [SR-Users] SRV in advertise?


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Hello guys,

I'm trying to use an SRV as an advertised address but kamailio fails to start. 
Is this not possible?

Thanks,

David Villasmil
email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com>

__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: SecSIPID Assistance

2024-06-20 Thread Ben Kaufman via sr-users
Except for `expire` and `timeout`, those parameters don't exist for secsip id- 
at least according to the module documentation: 
https://kamailio.org/docs/modules/stable/modules/secsipid

Regards,
Kaufman

From: Blake Ivey 
Sent: Thursday, June 20, 2024 3:39 PM
To: Ben Kaufman 
Cc: sr-users@lists.kamailio.org
Subject: Re: [SR-Users] SecSIPID Assistance


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


Sorry for the formatting:

ERROR:  [core/modparam.c:185]: set_mod_param_regex(): parameter 
 of type <1:string> not found in module 
kamailio: CRITICAL:  [core/cfg.y:4011]: yyerror_at(): parse error in 
config file /etc/kamailio/kamailio.cfg, line 71, column 73: Can't set module 
parameter
kamailio: CRITICAL:  [core/cfg.y:4011]: yyerror_at(): parse error in 
config file /etc/kamailio/kamailio.cfg, line 71, column 70: Can't set module 
parameter
kamailio: ERROR:  [core/modparam.c:185]: set_mod_param_regex(): parameter 
 of type <1:string> not found in module 

On Thu, Jun 20, 2024, 4:31 PM Ben Kaufman 
mailto:bkauf...@bcmone.com>> wrote:
What is the error you're getting?

Regards,
Kaufman


From: Blake Ivey via sr-users 
mailto:sr-users@lists.kamailio.org>>
Sent: Thursday, June 20, 2024 3:14 PM
To: Kamailio (SER) - Users Mailing List 
mailto:sr-users@lists.kamailio.org>>
Cc: Blake Ivey mailto:uga5...@gmail.com>>
Subject: [SR-Users] SecSIPID Assistance


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Hi everyone. Wanting to see if someone could point me in the right direction. 
Still very knew to Kamailio but I am beginning to understand it better. I'm 
making an outbound proxy and have everything working well besides stir/shaken. 
I'm looking at the module page and have went back and forth with chatGPT and 
can't seem to figure this part out. I keep getting errors on the modparam lines.

Obviously this is a self signed cert because I'm just testing. I am able to 
reach and download the cert from the Web server.

Thank you for any assistance.

# SECSIPID for Stir/Shaken
modparam("secsipid", "private_key", "/etc/kamailio/secsipid/private.key")
modparam("secsipid", "certificate", "/etc/kamailio/secsipid/cert.crt")
modparam("secsipid", "authority_cert", "/etc/kamailio/secsipid/ca.crt")
modparam("secsipid", "expire", 600) modparam("secsipid", "timeout", 2)

route[STIRSHAKEN] {
if (is_method("INVITE")) {
if (!secsipid_add_identity("$fU", "$rU", "A", "", 
"http://myIPaddress.com/stir_shaken_cert.crt<http://myipaddress.com/stir_shaken_cert.crt>",
 "/etc/kamailio/secsipid/private.key")) {
xlog("L_ERR", "Failed to sign call with ID: $ci - From: $fU\n");
send_reply("500", "Internal Server Error");
exit;
} else {
xlog("L_INFO", "Successfully signed call with ID: $ci - From: 
$fU\n");
}
}

# Relay the call after signing
route(RELAY);
}

__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: SecSIPID Assistance

2024-06-20 Thread Ben Kaufman via sr-users
What is the error you're getting?

Regards,
Kaufman


From: Blake Ivey via sr-users 
Sent: Thursday, June 20, 2024 3:14 PM
To: Kamailio (SER) - Users Mailing List 
Cc: Blake Ivey 
Subject: [SR-Users] SecSIPID Assistance


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Hi everyone. Wanting to see if someone could point me in the right direction. 
Still very knew to Kamailio but I am beginning to understand it better. I'm 
making an outbound proxy and have everything working well besides stir/shaken. 
I'm looking at the module page and have went back and forth with chatGPT and 
can't seem to figure this part out. I keep getting errors on the modparam lines.

Obviously this is a self signed cert because I'm just testing. I am able to 
reach and download the cert from the Web server.

Thank you for any assistance.

# SECSIPID for Stir/Shaken
modparam("secsipid", "private_key", "/etc/kamailio/secsipid/private.key")
modparam("secsipid", "certificate", "/etc/kamailio/secsipid/cert.crt")
modparam("secsipid", "authority_cert", "/etc/kamailio/secsipid/ca.crt")
modparam("secsipid", "expire", 600) modparam("secsipid", "timeout", 2)

route[STIRSHAKEN] {
if (is_method("INVITE")) {
if (!secsipid_add_identity("$fU", "$rU", "A", "", 
"http://myIPaddress.com/stir_shaken_cert.crt<http://myipaddress.com/stir_shaken_cert.crt>",
 "/etc/kamailio/secsipid/private.key")) {
xlog("L_ERR", "Failed to sign call with ID: $ci - From: $fU\n");
send_reply("500", "Internal Server Error");
exit;
} else {
xlog("L_INFO", "Successfully signed call with ID: $ci - From: 
$fU\n");
}
}

# Relay the call after signing
route(RELAY);
}

__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Assistance Needed: Converting 11-Digit US Numbers to E.164 in Kamailio

2024-06-05 Thread Ben Kaufman via sr-users
….  Until you encounter something like STIR/SHAKEN (as implemented in the USA 
and Canada) which requires the e.164 globalized format which is without the 
leading “+”.

Sometimes it’s impossible to win.

Regards,
Kaufman


From: David Villasmil 
Sent: Tuesday, June 4, 2024 6:53 AM
To: Kamailio (SER) - Users Mailing List 
Cc: Ben Kaufman ; Fred Posner ; Pavan Kumar 

Subject: Re: [SR-Users] Re: Assistance Needed: Converting 11-Digit US Numbers 
to E.164 in Kamailio


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Hello guys,

My advice, always use e.164 with "+", your life will be easier if you normalise 
to something.


Regards,

David Villasmil
email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com>
phone: +34669448337


On Sat, Jun 1, 2024 at 6:10 AM Pavan Kumar via sr-users 
mailto:sr-users@lists.kamailio.org>> wrote:
Thank you, everyone, for your responses.

Benoît, thank you for providing the sample code. My concern is that the code 
may become complex as it needs to be both transaction and dialog aware. For 
example, it needs to be transaction-aware when sending a 100 or 200 response 
back and conversion from E.164 to 11 digits should happen. It needs to be 
dialog-aware when FreeSWITCH initiates a BYE request so that the conversion to 
11 digits occurs. Additionally, we need to handle cases where FreeSWITCH (on 
behalf of the user) initiates a call by sending an INVITE. In these instances, 
I need to identify if the request is going to a trunk that doesn't accept the 
"+" prefix and strip it accordingly, potentially using a database to assist in 
this identification.

Ben, thank you for providing more information on the E.164 format and 
clarifying that the "+" prefix is not mandatory in some cases. Yes, when I 
referred to an 11-digit US number, I meant the NANP without the "+" prefix. 
Replacing "+1" with "1" is sufficient for my needs, and there is no need to 
identify the country.

Thanks & Regards,
Pavan Kumar

On Fri, May 31, 2024 at 8:05 PM Ben Kaufman 
mailto:bkauf...@bcmone.com>> wrote:
> the phonenum module is pretty decent for helping with NANP numbers and
  deciphering if one is let’s say US vs Canada vs Jamaica, etc.

Absolutely. And if his use case is to actually get the political country,
it's a great choice. With that said, I'm guessing that in his case the
vendor wants the + removed for all NANP numbers, so my point was to only
use libphonenumber for this if was critical to differentiate the USA
from the rest of the NANP.



-Original Message-
From: Fred Posner mailto:f...@pgpx.io>>
Sent: Friday, May 31, 2024 8:35 AM
To: Kamailio (SER) - Users Mailing List 
mailto:sr-users@lists.kamailio.org>>
Cc: Pavan Kumar mailto:pavanput...@gmail.com>>; Ben 
Kaufman mailto:bkauf...@bcmone.com>>
Subject: Re: [SR-Users] Assistance Needed: Converting 11-Digit US Numbers to 
E.164 in Kamailio

CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


> On May 31, 2024, at 9:20 AM, Ben Kaufman via sr-users 
> mailto:sr-users@lists.kamailio.org>> wrote:
>
> Answered in order of easiest answer to most complex:
>
>> Does it start with a 0?
>  No.  I've never encountered any US number requiring a prefix of "0"
> nor a US number being  written that way.
>
>
>> US numbers are fixed lenght 11 digits?
>
>  The USA is in the North American Numbering Plan (NANP).  This
> includes USA, Canada, much of the  Caribbean (Cuba, Jamaica, Barbados
> for example), some US territories in the Pacific (Guam,  American
> Samoa).  The NANP's "Country Code" is 1.  In the USA and Canada (I
> think the entirety  of the NANP) this is followed with a 3 digit area code 
> (National Destination Number) followed  by a 7 digit subscriber number.
>
>
>> What is the usual representation of a 'local' US number?
>  There is no consistent answer.  Consider that the oldest phone
> network is in the USA, and the  unplanned initial growth and many
> historic regional governing bodies it varies massively.  It  has also
> changed greatly over time. GENERALLY speaking people will use the 11
> digit number or  the 10 digit number (without the "1" country code), but 
> there's not a lot of rhyme or reason  as to which is preferred in one case vs 
> another.



It was mentioned previously, and requires libphonenumber, but the phonenum 
module is pretty decent for helping with NANP numbers and deciphering if one is 
let’s say US vs Canada vs Jamaica, etc.


Regards,

Fred Posner
p: +1 (352) 664-3733
https://fred.tel/


[SR-Users] Re: Assistance Needed: Converting 11-Digit US Numbers to E.164 in Kamailio

2024-05-31 Thread Ben Kaufman via sr-users
> the phonenum module is pretty decent for helping with NANP numbers and
  deciphering if one is let’s say US vs Canada vs Jamaica, etc.

Absolutely. And if his use case is to actually get the political country,
it's a great choice. With that said, I'm guessing that in his case the
vendor wants the + removed for all NANP numbers, so my point was to only
use libphonenumber for this if was critical to differentiate the USA
from the rest of the NANP.



-Original Message-
From: Fred Posner 
Sent: Friday, May 31, 2024 8:35 AM
To: Kamailio (SER) - Users Mailing List 
Cc: Pavan Kumar ; Ben Kaufman 
Subject: Re: [SR-Users] Assistance Needed: Converting 11-Digit US Numbers to 
E.164 in Kamailio

CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


> On May 31, 2024, at 9:20 AM, Ben Kaufman via sr-users 
>  wrote:
>
> Answered in order of easiest answer to most complex:
>
>> Does it start with a 0?
>  No.  I've never encountered any US number requiring a prefix of "0"
> nor a US number being  written that way.
>
>
>> US numbers are fixed lenght 11 digits?
>
>  The USA is in the North American Numbering Plan (NANP).  This
> includes USA, Canada, much of the  Caribbean (Cuba, Jamaica, Barbados
> for example), some US territories in the Pacific (Guam,  American
> Samoa).  The NANP's "Country Code" is 1.  In the USA and Canada (I
> think the entirety  of the NANP) this is followed with a 3 digit area code 
> (National Destination Number) followed  by a 7 digit subscriber number.
>
>
>> What is the usual representation of a 'local' US number?
>  There is no consistent answer.  Consider that the oldest phone
> network is in the USA, and the  unplanned initial growth and many
> historic regional governing bodies it varies massively.  It  has also
> changed greatly over time. GENERALLY speaking people will use the 11
> digit number or  the 10 digit number (without the "1" country code), but 
> there's not a lot of rhyme or reason  as to which is preferred in one case vs 
> another.



It was mentioned previously, and requires libphonenumber, but the phonenum 
module is pretty decent for helping with NANP numbers and deciphering if one is 
let’s say US vs Canada vs Jamaica, etc.


Regards,

Fred Posner
p: +1 (352) 664-3733
https://fred.tel/



__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Assistance Needed: Converting 11-Digit US Numbers to E.164 in Kamailio

2024-05-31 Thread Ben Kaufman via sr-users
Answered in order of easiest answer to most complex:

> Does it start with a 0?
  No.  I've never encountered any US number requiring a prefix of "0" nor a US 
number being
  written that way.


> US numbers are fixed lenght 11 digits?

  The USA is in the North American Numbering Plan (NANP).  This includes USA, 
Canada, much of the
  Caribbean (Cuba, Jamaica, Barbados for example), some US territories in the 
Pacific (Guam,
  American Samoa).  The NANP's "Country Code" is 1.  In the USA and Canada (I 
think the entirety
  of the NANP) this is followed with a 3 digit area code (National Destination 
Number) followed
  by a 7 digit subscriber number.


> What is the usual representation of a 'local' US number?
  There is no consistent answer.  Consider that the oldest phone network is in 
the USA, and the
  unplanned initial growth and many historic regional governing bodies it 
varies massively.  It
  has also changed greatly over time. GENERALLY speaking people will use the 11 
digit number or
  the 10 digit number (without the "1" country code), but there's not a lot of 
rhyme or reason
  as to which is preferred in one case vs another.




-Original Message-
From: Benoît Panizzon via sr-users 
Sent: Friday, May 31, 2024 2:52 AM
To: Pavan Kumar via sr-users 
Cc: Pavan Kumar ; Benoît Panizzon 

Subject: [SR-Users] Re: Assistance Needed: Converting 11-Digit US Numbers to 
E.164 in Kamailio

CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


Hi Kumar

> Before writing the code, I want to know if there is already a solution
> to this problem in one of the modules, so that I won't reinvent the
> wheel.

US numbers are fixed lenght 11 digits? What is the usual representation of a 
'local' US number? Does it start with a 0?

I do this (to translate Swiss local numbers to e164):

$var(check_number) = "012 345 67 89" # local number example, use $rU or $fU or 
whatever you want to translate.
route(TRANSLATE_TO_e164);
$rU = $var(result);

route[TRANSLATE_TO_e164]
{
$var(result) = 'invalid';
$var(check_number) = $(var(check_number){s.rmws}); # Remove spaces
if ($var(check_number) =~ "^\+") {
$var($result) = $var(check_number); # Already e164
} else if ($var(check_number) =~ "^00") {
# international number in local notation replace 00 by +
$var(result) = "+" + $(var(check_number){s.substr,2,0});
} else if ($var(check_number) =~ "^0") {
# Swiss number in local notation replace 0 by +41
$var(result) = "+41" + $(var(check_number){s.substr,1,0});
}
}

And of course I have a corresponding TRANSLATE_TO_LOCAL to display numbers to 
the customer in a format they are used to in Switzerland.

--
Mit freundlichen Grüssen

-Benoît Panizzon- @ HomeOffice und normal erreichbar
--
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch/
__
__
Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send 
an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Assistance Needed: Converting 11-Digit US Numbers to E.164 in Kamailio

2024-05-31 Thread Ben Kaufman via sr-users
A few points, and reasons why the issue is both more simple and more complex 
than indicated:


  1.  The definition of E.164 isn’t clear here.  My assumption is that you mean 
a digit string that starts with a plus character.  There is no requirement in 
the E.164 specification that a leading plus character is represented. E.164 
(https://www.itu.int/rec/T-REC-E.164-201011-I/en) section 12 “International 
prefix”:

> In accordance with [ITU-T E.123], the symbol "+" is recommended to indicate 
> that an international prefix is required.

This means that if you are indicating an international prefix is required, then 
use a “+”.  It doesn’t mandate that a plus be present.  Moreover Annex B part 7 
indicates that in calling line information the leading plus should NOT be used 
(of course, it’s probably a bad idea to reject calls where the From: URI user 
starts with a plus).

  2.  The term “11-digit US format” might be better defined as “North American 
Numbering Plan” format (NANP). “1” is the country code (the first of the 11 
digits) and covers more than just the USA. It includes Canada, most of the 
Caribbean, etc.  I’m not just being “picky” here – some of the recommended 
modules in this thread (e.g. phonenumber) should have a number beginning with 
1617 showing not as US but as Guam.  This may or may not be what you want so 
it’s worth pointing out.
  3.  Performing the digit manipulation in Kamailio is simple, and there’s a 
few ways to do it.  `strip()`, prefix()`, and regex transformations will all 
work and are in the core.  But implied in your diagram is a single Kamailio 
proxy that connects to both users, who presumably you do want to send/receive 
numbers with a leading plus, as well “Trunk”, which might be multiple vendors 
some of whom might want a leading plus, and others who might not.  There are 
several modules (dispatcher, carrierroute, lcr…) that combine prefixing 
stripping and appending to the destination.  If you are already using one of 
these modules to select your destination it’s probably best to use one of them.



From: Pavan Kumar via sr-users 
Sent: Thursday, May 30, 2024 8:58 PM
To: Kamailio (SER) - Users Mailing List 
Cc: Pavan Kumar 
Subject: [SR-Users] Assistance Needed: Converting 11-Digit US Numbers to E.164 
in Kamailio


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Hey everyone,

I have the following setup:

External User/Trunk <===> Kamailio <===> FreeSWITCH

I have configured FreeSWITCH and Kamailio to work only with phone numbers in 
E.164 format. Recently, I needed to integrate a new SIP trunk that sends phone 
numbers in an 11-digit US format.

My initial idea to solve this is to use Kamailio as a translator that converts 
11-digit numbers to E.164 when sending to FreeSWITCH, and back to 11-digit when 
sending to the trunk.

Before writing the code, I want to know if there is already a solution to this 
problem in one of the modules, so that I won't reinvent the wheel.

Thanks,
Pavan Kumar
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: libstirshaken installation issues

2024-05-29 Thread Ben Kaufman via sr-users
I'd recommend libsecsipid over stirshaken.  It's more flexible (stirshaken only 
allows for SHAKEN passports), and from an STI-AS standpoint, it can only append 
the Identity header to the request, so if you're implementing signing as a 
redirect server you have to then do a little extra work to extract it.  It also 
seems to get less development attention.  If you're running Debian on x86, 
libsecsipid can be entirely installed from packages as well.

Regards,
Kaufman


-Original Message-
From: Daniel-Constantin Mierla via sr-users  
Sent: Wednesday, May 29, 2024 12:52 AM
To: Kamailio (SER) - Users Mailing List 
Cc: tfay...@untangledtechnology.com; Daniel-Constantin Mierla 

Subject: [SR-Users] Re: libstirshaken installation issues

CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


Hello,

this looks like related only to the libstirshaken project, nothing to do with 
Kamailio module. Apparently is about deprecated functions treated as errors, 
but you have to address the issue to the libstirshaken project.

Alternatively, in Kamailio you can use secsipid module, which also offers 
STIR/SHAKEN functionality.

Cheers,
Daniel

On 28.05.24 23:20, tfayomi--- via sr-users wrote:
> Hi All,
>
> I am attempting to install the stirshaken module for kamailio and I ran into 
> a couple issues installing the open source c library for libstirshaken. When 
> I use the make command, I'm getting this error:
>
> src/stir_shaken.c: In function 'stir_shaken_is_key_trusted':
> src/stir_shaken.c:726:9: error: 'EVP_PKEY_cmp' is deprecated: Since OpenSSL 
> 3.0 [-Werror=deprecated-declarations]
>   726 | if (!EVP_PKEY_cmp(pkey, candidate_pkey)) {
>   | ^~
> In file included from /usr/include/openssl/x509.h:29,
>  from /usr/include/openssl/ssl.h:31,
>  from /usr/include/libks2/libks/ks_ssl.h:25,
>  from /usr/include/libks2/libks/ks.h:80,
>  from include/stir_shaken.h:15,
>  from src/stir_shaken.c:1:
> /usr/include/openssl/evp.h:1418:5: note: declared here
>  1418 | int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b);
>   | ^~~~
> At top level:
> cc1: note: unrecognized command-line option 
> '-Wno-gnu-zero-variadic-macro-arguments' may have been intended to 
> silence earlier diagnostics
> cc1: all warnings being treated as errors
> make: *** [Makefile:1337: src/stir_shaken.lo] Error 1
>
> I tried going into the stir_shaken file and changing EVP_PKEY_cmp to 
> EVP_PKEY_eq, but it just brings up more deprecation errors. I also tried 
> rolling back the openssl version on my machine to openssl version 1.1 and 
> changing EVP_PKEY_eq back to EVP_PKEY_cmp, but the same error persists. Is 
> there any way to resolve this error, or is there another library that can be 
> used to get the stirshaken module for kamailio?
>
> Thanks in advance,
> Temi
> __
> Kamailio - Users Mailing List - Non Commercial Discussions To 
> unsubscribe send an email to sr-users-le...@lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to the 
> sender!
> Edit mailing list options or unsubscribe:

--
Daniel-Constantin Mierla (@ asipto.com)
twitter.com/miconda -- linkedin.com/in/miconda Kamailio Consultancy, Training 
and Development Services -- asipto.com

__
Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send 
an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: q_malloc.c:520 WARNINGs

2024-05-15 Thread Ben Kaufman via sr-users
The issue is trivial to reproduce.  I didn’t test every dialplan module 
function, but it occurs with both dp_transalate() and dp_match().

I’ve opened an issue in GitHub:  
https://github.com/kamailio/kamailio/issues/3851

Regards,
Kaufman

From: Ben Kaufman via sr-users 
Sent: Monday, May 13, 2024 5:05 PM
To: Kamailio (SER) - Users Mailing List 
Cc: Ben Kaufman 
Subject: [SR-Users] Re: q_malloc.c:520 WARNINGs


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

I’ve just noticed a similar behavior in kamailio 5.8.1 after upgrading from 
5.6.3.  I haven’t had time to poke around on it much yet.  Wondering if anyone 
found the root cause?  In my case I’m calling just `dp_match("1", "$rU");`

I’ll try to update with a simplified scenario, etc.


From: Joel Serrano via sr-users 
mailto:sr-users@lists.kamailio.org>>
Sent: Saturday, March 9, 2024 9:30 AM
To: Kamailio (SER) - Users Mailing List 
mailto:sr-users@lists.kamailio.org>>
Cc: Joel Serrano mailto:j...@textplus.com>>
Subject: [SR-Users] Re: q_malloc.c:520 WARNINGs


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

I've tried setting corelog=L_INFO but I can still see the WARNINGS.

Also, one correction in my previous msg, I don't have 2 "debug" lines, I have 
them defined within a condition:

#!ifdef WITH_DEBUG
debug=L_DBG
#!else
debug=L_NOTICE
#!endif
...
...


Joel.




On Fri, Mar 8, 2024 at 9:54 PM Joel Serrano 
mailto:j...@textplus.com>> wrote:
Hi,

Does anyone know what this WARNING means or how to fix it?

2024-03-09T00:39:15.406674-05:00 csbc03 csbc[33024]: WARNING: {1 1 INVITE 
CALL-ID}  [core/mem/q_malloc.c:520]: qm_free(): WARNING: free(0) called 
from dialplan: dp_db.c: pcre2_free(206)
2024-03-09T00:39:15.406823-05:00 csbc03 csbc[33024]: WARNING: {1 1 INVITE 
CALL-ID}  [core/mem/q_malloc.c:520]: qm_free(): WARNING: free(0) called 
from dialplan: dp_db.c: pcre2_free(206)
2024-03-09T00:39:15.406973-05:00 csbc03 csbc[33024]: WARNING: {1 1 INVITE 
CALL-ID}  [core/mem/q_malloc.c:520]: qm_free(): WARNING: free(0) called 
from dialplan: dp_db.c: pcre2_free(206)
2024-03-09T00:39:15.407089-05:00 csbc03 csbc[33024]: WARNING: {1 1 INVITE 
CALL-ID}  [core/mem/q_malloc.c:520]: qm_free(): WARNING: free(0) called 
from dialplan: dp_db.c: pcre2_free(206)
2024-03-09T00:39:15.407178-05:00 csbc03 csbc[33024]: WARNING: {1 1 INVITE 
CALL-ID}  [core/mem/q_malloc.c:520]: qm_free(): WARNING: free(0) called 
from dialplan: dp_db.c: pcre2_free(206)
2024-03-09T00:39:15.407278-05:00 csbc03 csbc[33024]: WARNING: {1 1 INVITE 
CALL-ID}  [core/mem/q_malloc.c:520]: qm_free(): WARNING: free(0) called 
from dialplan: dp_db.c: pcre2_free(206)
2024-03-09T00:39:15.407375-05:00 csbc03 csbc[33024]: WARNING: {1 1 INVITE 
CALL-ID}  [core/mem/q_malloc.c:520]: qm_free(): WARNING: free(0) called 
from dialplan: dp_db.c: pcre2_free(206)
It happens after running dp_translate().

These are my settings:

debug=L_DBG
debug=L_NOTICE
memdbg=L_INFO
memlog=L_INFO
corelog=L_ERR
mem_summary=12
log_stderror=no
log_facility=LOG_LOCAL0
log_name="csbc"
log_prefix="{$mt $hdr(CSeq) $ci} "
mem_join=1


Any ideas?

Thanks,
Joel.


__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: q_malloc.c:520 WARNINGs

2024-05-13 Thread Ben Kaufman via sr-users
I’ve just noticed a similar behavior in kamailio 5.8.1 after upgrading from 
5.6.3.  I haven’t had time to poke around on it much yet.  Wondering if anyone 
found the root cause?  In my case I’m calling just `dp_match("1", "$rU");`

I’ll try to update with a simplified scenario, etc.


From: Joel Serrano via sr-users 
Sent: Saturday, March 9, 2024 9:30 AM
To: Kamailio (SER) - Users Mailing List 
Cc: Joel Serrano 
Subject: [SR-Users] Re: q_malloc.c:520 WARNINGs


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

I've tried setting corelog=L_INFO but I can still see the WARNINGS.

Also, one correction in my previous msg, I don't have 2 "debug" lines, I have 
them defined within a condition:

#!ifdef WITH_DEBUG
debug=L_DBG
#!else
debug=L_NOTICE
#!endif
...
...


Joel.




On Fri, Mar 8, 2024 at 9:54 PM Joel Serrano 
mailto:j...@textplus.com>> wrote:
Hi,

Does anyone know what this WARNING means or how to fix it?

2024-03-09T00:39:15.406674-05:00 csbc03 csbc[33024]: WARNING: {1 1 INVITE 
CALL-ID}  [core/mem/q_malloc.c:520]: qm_free(): WARNING: free(0) called 
from dialplan: dp_db.c: pcre2_free(206)
2024-03-09T00:39:15.406823-05:00 csbc03 csbc[33024]: WARNING: {1 1 INVITE 
CALL-ID}  [core/mem/q_malloc.c:520]: qm_free(): WARNING: free(0) called 
from dialplan: dp_db.c: pcre2_free(206)
2024-03-09T00:39:15.406973-05:00 csbc03 csbc[33024]: WARNING: {1 1 INVITE 
CALL-ID}  [core/mem/q_malloc.c:520]: qm_free(): WARNING: free(0) called 
from dialplan: dp_db.c: pcre2_free(206)
2024-03-09T00:39:15.407089-05:00 csbc03 csbc[33024]: WARNING: {1 1 INVITE 
CALL-ID}  [core/mem/q_malloc.c:520]: qm_free(): WARNING: free(0) called 
from dialplan: dp_db.c: pcre2_free(206)
2024-03-09T00:39:15.407178-05:00 csbc03 csbc[33024]: WARNING: {1 1 INVITE 
CALL-ID}  [core/mem/q_malloc.c:520]: qm_free(): WARNING: free(0) called 
from dialplan: dp_db.c: pcre2_free(206)
2024-03-09T00:39:15.407278-05:00 csbc03 csbc[33024]: WARNING: {1 1 INVITE 
CALL-ID}  [core/mem/q_malloc.c:520]: qm_free(): WARNING: free(0) called 
from dialplan: dp_db.c: pcre2_free(206)
2024-03-09T00:39:15.407375-05:00 csbc03 csbc[33024]: WARNING: {1 1 INVITE 
CALL-ID}  [core/mem/q_malloc.c:520]: qm_free(): WARNING: free(0) called 
from dialplan: dp_db.c: pcre2_free(206)
It happens after running dp_translate().

These are my settings:

debug=L_DBG
debug=L_NOTICE
memdbg=L_INFO
memlog=L_INFO
corelog=L_ERR
mem_summary=12
log_stderror=no
log_facility=LOG_LOCAL0
log_name="csbc"
log_prefix="{$mt $hdr(CSeq) $ci} "
mem_join=1


Any ideas?

Thanks,
Joel.


__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Retransmission behaviour after ACK

2024-05-06 Thread Ben Kaufman via sr-users
To be a bit more specific, the issue would appear to be that Kamailio is not 
correlating the ACK with the transaction.   Compare the ACK sent by Asterisk to 
the ACK sent by SIPp to see what is wrong with the SIPp ACK.


From: Sergio Charrua 
Sent: Monday, May 6, 2024 10:39 AM
To: Ben Kaufman 
Cc: Kamailio (SER) - Users Mailing List 
Subject: Re: [SR-Users] Retransmission behaviour after ACK


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Thanks Ben1

that did not make it!
Just to be clear, there is no UAS scenario for SIPp running. The call is 
generated by SIPp scenario, in "UAC mode", to Kamailio and Kamailio will reply 
back to the originating SIPp instance with a 300 Multiple Choices message. 
Setting the "rrs" attribute in the "recv" element doesn't work.
As for next_url, it did not help either


Sérgio Charrua

On Mon, May 6, 2024 at 3:46 PM Ben Kaufman 
mailto:bkauf...@bcmone.com>> wrote:
SIPp’s syntax for handling record route and setting ACK request lines correctly 
kinda sucks.


Try setting `rrs` in your `recv` element 
(https://sipp.readthedocs.io/en/latest/scenarios/ownscenarios.html?highlight=rrs#list-of-commands-with-their-attributes),
 and then use `next_url` as the contact in your ACK:  
(https://sipp.readthedocs.io/en/latest/scenarios/keywords.html#next-url)


Kaufman


From: Sergio Charrua via sr-users 
mailto:sr-users@lists.kamailio.org>>
Sent: Monday, May 6, 2024 6:57 AM
To: Kamailio (SER) - Users Mailing List 
mailto:sr-users@lists.kamailio.org>>
Cc: Sergio Charrua mailto:sergio.char...@voip.pt>>
Subject: [SR-Users] Retransmission behaviour after ACK


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Hi all!

I'm testing some redirect scenarios with Kamailio 5.7.4 and using Astterisk 13 
and SIPp for unit testing.

The kamailio's script is simple and uses TM, HTTP_ASYNC_MODULE, JSONRPC, 
JANSSON, RTJSON and XLog modules.

Request route is simple:
request_route {

  route(HANDLE_OPTIONS);
  route(HANDLE_RETRANS);
  route(HANDLE_CANCEL);
  route(REQINIT);
  route(HANDLE_INVITE);

}

where HANDLE_RETRANS is:

route[HANDLE_RETRANS]{
# handle retransmissions
xlog("L_INFO","HANDLE_RETRANS - message type is $mt for method $rm");
if (!is_method("ACK")) {
if(t_precheck_trans()) {
xlog("L_INFO","HANDLE_RETRANS - Precheck Trans");
t_check_trans();
xlog("L_INFO", "HANDLE_RETRANS - Exiting after 
Retransmission check - method $rm");
exit;
}
xlog("L_INFO","HANDLE_RETRANS - Check Trans");
t_check_trans();
}
}


and HANDLE INVITE is:

route[HANDLE_INVITE]{
if (is_method("INVITE"))
{
xlog("L_INFO","MAIN - calling TO_CARRIER");
setflag(FLT_ACC);
route(TO_CARRIER);
exit;
}
}

The HTTP requests call a REST API returning a JSON object, that is iterated and 
produces a CONTACT header containing multiple choices using the append_branch() 
command.
The RELAY route is :

route[RELAY] {
  # Sends a 300 Multiple Choices back to the proxy that requested the routing 
lookup
  xlog("L_INFO","REPLY_302 - send reply");
  send_reply("300", "Multiple Choices");
  xlog("L_INFO","REPLY_302 - exit");
  exit;
}

Which returns indeed a Contact header with multiple contact choices.

When using Asterisk to originate a call to Kamailio, the SIP call flow is as 
follows and terminates (SNGrep and TCPDump do not detect anything else):

SRC DST
INVITE (SDP)
 ──>
  100 trying -- your call is
 <──
300 Multiple Choices
 <──
 ACK
 ──>

However when using SIPp I get some retransmissions after the final ACK.
SRC DST
INVITE (SDP)
 ──>
  100 trying -- your call is
 <──
300 Multiple Choices
 <──
 ACK
 ──>
300 Multiple Choices
 <<<
300 Multiple Choices
 <<<
300 Multiple Choices
 <<<

SIPp scenario is :









 



  
  
  


  





  










The question is : is there anything wrong with my kam

[SR-Users] Re: Retransmission behaviour after ACK

2024-05-06 Thread Ben Kaufman via sr-users
SIPp’s syntax for handling record route and setting ACK request lines correctly 
kinda sucks.


Try setting `rrs` in your `recv` element 
(https://sipp.readthedocs.io/en/latest/scenarios/ownscenarios.html?highlight=rrs#list-of-commands-with-their-attributes),
 and then use `next_url` as the contact in your ACK:  
(https://sipp.readthedocs.io/en/latest/scenarios/keywords.html#next-url)


Kaufman


From: Sergio Charrua via sr-users 
Sent: Monday, May 6, 2024 6:57 AM
To: Kamailio (SER) - Users Mailing List 
Cc: Sergio Charrua 
Subject: [SR-Users] Retransmission behaviour after ACK


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Hi all!

I'm testing some redirect scenarios with Kamailio 5.7.4 and using Astterisk 13 
and SIPp for unit testing.

The kamailio's script is simple and uses TM, HTTP_ASYNC_MODULE, JSONRPC, 
JANSSON, RTJSON and XLog modules.

Request route is simple:
request_route {

  route(HANDLE_OPTIONS);
  route(HANDLE_RETRANS);
  route(HANDLE_CANCEL);
  route(REQINIT);
  route(HANDLE_INVITE);

}

where HANDLE_RETRANS is:

route[HANDLE_RETRANS]{
# handle retransmissions
xlog("L_INFO","HANDLE_RETRANS - message type is $mt for method $rm");
if (!is_method("ACK")) {
if(t_precheck_trans()) {
xlog("L_INFO","HANDLE_RETRANS - Precheck Trans");
t_check_trans();
xlog("L_INFO", "HANDLE_RETRANS - Exiting after 
Retransmission check - method $rm");
exit;
}
xlog("L_INFO","HANDLE_RETRANS - Check Trans");
t_check_trans();
}
}


and HANDLE INVITE is:

route[HANDLE_INVITE]{
if (is_method("INVITE"))
{
xlog("L_INFO","MAIN - calling TO_CARRIER");
setflag(FLT_ACC);
route(TO_CARRIER);
exit;
}
}

The HTTP requests call a REST API returning a JSON object, that is iterated and 
produces a CONTACT header containing multiple choices using the append_branch() 
command.
The RELAY route is :

route[RELAY] {
  # Sends a 300 Multiple Choices back to the proxy that requested the routing 
lookup
  xlog("L_INFO","REPLY_302 - send reply");
  send_reply("300", "Multiple Choices");
  xlog("L_INFO","REPLY_302 - exit");
  exit;
}

Which returns indeed a Contact header with multiple contact choices.

When using Asterisk to originate a call to Kamailio, the SIP call flow is as 
follows and terminates (SNGrep and TCPDump do not detect anything else):

SRC DST
INVITE (SDP)
 ──>
  100 trying -- your call is
 <──
300 Multiple Choices
 <──
 ACK
 ──>

However when using SIPp I get some retransmissions after the final ACK.
SRC DST
INVITE (SDP)
 ──>
  100 trying -- your call is
 <──
300 Multiple Choices
 <──
 ACK
 ──>
300 Multiple Choices
 <<<
300 Multiple Choices
 <<<
300 Multiple Choices
 <<<

SIPp scenario is :









 



  
  
  


  





  










The question is : is there anything wrong with my kamailio script? or with SIPp 
scenario? why does kamailio have different behaviours between Asterisk and SIPp?
Any option to disable retransmissions on Kamailio ? (using UDP)

Thanks in advance,


Sérgio Charrua


__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: compile without downtime

2024-04-17 Thread Ben Kaufman via sr-users
You can definitely compile (`make`) without downtime.
Installation without downtime is likely safe, but I don't think you'll find 
many people willing to give you a guarantee on it.  The biggest problems with 
just running `make install` blindly are the potential to clobber config files 
or anything continuously run.  If memory serves, there is a "make deinstall" 
(or similar) option that doesn't actually execute anything but will generate a 
list of files to be deleted. The last time I did an upgrade that required 
recompilation I used this to create a small shell script of things to delete.  
I then upgraded like:

service kamaliio stop && cp /etc/kamailio /etc/kamailio.bak && 
kamailio_uninstall.sh && make install && mv /etc/kamailio /etc/kamailio.orig && 
mv /etc/kamailio.bak /etc/kamailio && service kamailio start

This is probably overkill, but I think it took less than a minute to actually 
run.


From: satyaprakash ch via sr-users 
Sent: Wednesday, April 17, 2024 11:19 AM
To: Kamailio (SER) - Users Mailing List 
Cc: satyaprakash ch 
Subject: [SR-Users] compile without downtime


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

HI

I currently have two proxy servers running in my environment, and I want to 
upgrade Kamailio from version 5.4.7 to 5.6.

Can I recompile the Kamailio service before restarting it without downtime ? 
Will there be any impact on my production environment if I recompile Kamailio 
to the newer version? If there is no impact, I expect approximately 2 minutes 
of downtime during the service restart.

Here's the scenario:

No Downtime:
Clone the Kamailio repository with git clone 
https://github.com/kamailio/kamailio.git
Navigate to the Kamailio directory with cd kamailio
Update the modules.lst file with any necessary additions
Compile with make
Install with make install
Downtime:
Restart the Kamailio service.


Please advise on this.

Thanks.
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Newbie looking for advice

2024-04-09 Thread Ben Kaufman via sr-users
> I have a single freepbx machine that is using inbound routes to send calls to 
> the proper school district

This is just routing "PSTN" calls to/from the correct PBX, and you're looking 
for a box to distribute calls to the correct location (along with some 'on net' 
routing to avoid sending calls that should be from one pbx to another to the 
actual PSTN)?

There are some modules like dbalias, dialplan, carrierroute, dispatcher, etc. 
that can be used for this, but you can use sqlops to write arbitrary queries to 
your DB for call routing.

First assess the source of the initialI NVITE - is this from a PSTN or one of 
your PBXs? This is the first of the three A's (Authentication, Authorization, 
and Accounting).  You can do this by IP address (the permissions module is 
helpful here, or again, roll your own),  If it's from one of your PBXs,  you'll 
know who to account the call to. It's also possible to issue an authentication 
challenge (auth and auth_db modules) rather than authenticating by IP address.  
Usually you'd peer with PSTN  carriers by IP address.

Next, determine the destination and if the calling party has permissions to 
reach it.  For inbound calls from the PSTN, this is looking up the RURI user in 
a table (try the alias_db module) to determine if the number belongs to one of 
your PBXs, and if so which one.  If it's from the PSTN and isn't a known number 
reject it (404 not found), and if it is for a PBX, relay it to the PBX.  If the 
initial invite is from one of your PBXs, still check to see if it's in your DB 
(an on-net number) and if so, route it.  If it's destined for the PSTN, then 
check any rules on whether or not the call is allowed (i.e. international 
calling might not be allowed to every country), and route it.

That's the general jumping of point.  You might have other needs (failover 
routing, caller id dips, etc), but that should get you started.

Regards,
Kaufman

From: Wayne Wenthin via sr-users 
Sent: Tuesday, April 9, 2024 3:06 PM
To: sr-users@lists.kamailio.org
Cc: Wayne Wenthin 
Subject: [SR-Users] Newbie looking for advice


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Hi All,

I'm new to Kamailio but have been running dozens of Freepbx systems for the 
last 10 years.   We are an Education Service District and service K-12 schools. 
Many of these we provide dial tone to, the rest we have connections to to 
provide for toll avoidance and backup outbound calling when the LEC fails. Our 
main focus is to save schools money that can be used for education instead of 
infrastructure.

Right now I have a single freepbx machine that is using inbound routes to send 
calls to the proper school district. I would like to replace this with a 
Kamailio server instead but can't seem to get my mind around the best way to do 
this.
I have 119 inbound routes in my current system with 22 trunks to the other 
districts. This may increase in the future as we try to migrate districts off 
of the expensive systems to a more open source way of calling.
Currently calls between districts take the route out of the system just to come 
right back in to be routed to a different district.   I would like to avoid 
that if possible.
I've been trying to educate myself on the best practice in this type of 
structure but can't seem to figure out the best way to make this work. Most of 
the videos and websites assume a pretty intimate knowledge of Kamailio. That 
and the database structure doesn't make sense to me.
I would like to keep each freepbx as its own registrar as we have lots of 
crossover with extensions and a few of the districts have their own staff that 
manage that aspect of the machines. .
Any suggestions would be appreciated.  Please ask questions if this just looks 
like I'm rambling.

--
Wayne Wenthin
Wide Area Network Administrator | CTA@MESD
503.257.1562  Phone/Fax
www.cascadetech.org<http://www.cascadetech.org/>

__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: making HTTP requests in stateless redirects

2024-04-08 Thread Ben Kaufman via sr-users
> The kamailio script, completely stateless as I do not need to keep track of 
> the sessions, iterates through one of the JSON branches and adds the 
> destination URLs to the Contact header and replies a SIP 300 Multiple Choices.


The term 'stateless' in the scope of a SIP proxy doesn't mean to keep track of 
the session (or the dialog).  It means tracking the state of the transaction.  
In order to pause the current transaction and resume it (using 
http_async_query()), a stateful transaction must be created within Kamailio - 
and you've done this when you call `t_newtran()`.  As a recommendation, rather 
than using `sl_send_reply()`, `t_reply()`, or `t_send_reply()`, just  use 
`send_reply()`, which will send the reply statelessly if there's no 
transaction, and statefully if there is a transaction.


If you want to make your replies LOOK stateless to request source, disable 
automatic 100 Trying from the TM module.



Kaufman
Senior Voice Engineer



E: bkauf...@bcmone.com




SIP.US Client Support: 800.566.9810  |  SIPTRUNK Client Support: 800.250.6510  
|  Flowroute Client Support: 855.356.9768
[img]<https://www.sip.us/>
[img]<https://www.siptrunk.com/>
[img]<https://www.flowroute.com/>


From: Sergio Charrua via sr-users 
Sent: Monday, April 8, 2024 10:13 AM
To: Kamailio (SER) - Users Mailing List 
Cc: Sergio Charrua 
Subject: [SR-Users] making HTTP requests in stateless redirects


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Hi all!


For testing purposes, while I am waiting for the ST/SH REST API to be available 
from other teams, I developed a small python REST API that returns a mockup of 
a JSON object with some of the required values.
The kamailio script, completely stateless as I do not need to keep track of the 
sessions, iterates through one of the JSON branches and adds the destination 
URLs to the Contact header and replies a SIP 300 Multiple Choices.
This works: the UAC does receive the SIP response with the Contacts , but it 
also receives a SIP 500 error message right after, and I can't figure out why. 
And i bet this is simple to solve
Any clue? I'm aware I'm not processing ACK messages, but the sl_send_reply 403 
should do the trick right? ... at least while testing

Also, as this is a stateless script, is there another way of using async http 
or making http requests to a REST API without having to use TM Module?

Thanks in advance.

The kamailio script is has follows:

#!KAMAILIO
/* add API http timeout */
#!define HTTP_API_TIMEOUT 5000
#!define HTTP_API_ROUTING_ENDPOINT "http://some_python_rest_api/get_route";
### LOG Levels: 3=DBG, 2=INFO, 1=NOTICE, 0=WARN, -1=ERR
debug=4
log_stderror=no
memdbg=5
memlog=5
log_facility=LOG_LOCAL0
log_prefix="{$mt $hdr(CSeq) $ci} "
/* number of SIP routing processes */
children=2
/* set paths to location of modules */
loadmodule "tm.so"
loadmodule "jsonrpcs.so"
loadmodule "kex.so"
loadmodule "corex.so"
loadmodule "sl.so"
loadmodule "db_mysql.so"
loadmodule "rr.so"
loadmodule "pv.so"
loadmodule "maxfwd.so"
loadmodule "ipops.so"
loadmodule "textops.so"
loadmodule "siputils.so"
loadmodule "xlog.so"
loadmodule "sanity.so"
loadmodule "ctl.so"
loadmodule "cfg_rpc.so"
loadmodule "uac.so"
loadmodule "counters.so"
loadmodule "http_async_client.so"
loadmodule "jansson.so"
loadmodule "usrloc.so"
/* listen addresses */
listen=udp:10.20.0.2:5060
<http://10.20.0.2:5060/>listen=udp:10.20.0.2:5062
<http://10.20.0.2:5062/>advertised_address="10.20.0.2";
# - http_async_client params -
modparam("http_async_client", "workers", HTTP_ASYNC_CLIENT_WORKERS)
modparam("http_async_client", "connection_timeout", 2000)
request_route {
  #route(HANDLE_DMQ);
  route(HANDLE_OPTIONS);
  if (is_method("INVITE"))
  {
xlog("L_INFO","MAIN - calling TO_CARRIER");
route(TO_CARRIER);
exit;
  }
  else{
sl_send_reply("401","UNAUTHORIZED");
  }
}
route[TO_CARRIER]{
xlog("L_INFO","TO_CARRIER - calling RELAY_API");
route(RELAY_API);   #Route relay
xlog("L_INFO","TO_CARRIER - return");
return;
}
# Relay request using the API (response)
route[RELAY_API_RESPONSE] {
xlog("L_INFO","RELAY_API_RESPONSE - got response from REST API");
if ($http_ok==1 && $http_rs==200)
{
xlog("L_INFO","RELAY_API_RESPONSE - HTTP RESPONSE: $http_rb\n");

[SR-Users] Re: RFC: uptime metric for xhttp_prom module

2024-04-05 Thread Ben Kaufman via sr-users
I've only ever used "all" as well, and never tried anything else until writing 
this response yesterday.  I think separate param names is fine.


-Original Message-
From: Ovidiu Sas 
Sent: Thursday, April 4, 2024 6:58 PM
To: Ben Kaufman 
Cc: Kamailio (SER) - Users Mailing List ; Henning 
Westerholt 
Subject: Re: [SR-Users] Re: RFC: uptime metric for xhttp_prom module

CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


Hi Ben,

You made me discover that the xhttp_prom_stats modparam doesn't work the way I 
thought it would work :) I was always using all and I didn't check the scenario 
that you described.
I was under the impression that xhttp_prom_stats is accepting a csv with all 
the stats to be collected.
So this calls for a feature request :)
We could call the modparam several times or we could pass a list.

I think it would make sense to keep a specific modparam for each corresponding 
RPC command to avoid ambiguities and keep a clean implementation.
If all is provided for stats, then all the other values should be ignored.
If a group is provided, all explicit statistics that belong to that group 
should be ignored.
modparam("xhttp_prom", "stats", "stats.get_statistics sl:") # this entry 
should be ignored based on the previous entry
modparam("xhttp_prom", "stats", "stats.get_statistics 1xx_replies")
modparam("xhttp_prom", "stats", "stats.get_statistics core:")
modparam("xhttp_prom", "stats", "pkg.stats")
modparam("xhttp_prom", "stats", "core.uptime")

Based on the above I think it's better (and maybe easier to implement) to keep 
a specific modparam for each RPC:
# This is the modparam for stats stats
# kamcmd stats.get_statistics sl:
modparam("xhttp_prom", "stats_stats", "get_statistics sl:") # kamcmd 
stats.get_statistics 1xx_replies
modparam("xhttp_prom", "stats_stats", "get_statistics 1xx_replies") # This 
is the modparam for pkg stats # kamcmd pkg.stats
modparam("xhttp_prom", "stats_pkg", "stats") # This is the modparam for 
core stats # kamcmd core.uptime
modparam("xhttp_prom", "stats_core", "uptime")

Moving the RPC module name inside the name of the modapram provides the first 
level of internal indexation (inside the xhttp_prom module) making it easier to 
implement.
I'm open to suggestions :)
Implementing the logic for dealing with all the statistics provided by the 
stats.get_statistics RPC command should not be very complicated, but it 's not 
trivial either :)

The xhttp_prom_ prefix was there before and the new xhttp_prom_pkg_stats 
modparam was implemented the same way to be consistent.

The current implementation is described here:
https://www.kamailio.org/docs/modules/devel/modules/xhttp_prom.html


SUMMARY:
We are dealing with two issues here:
 1. Refactoring the modparam names
 2. Implementing support for a given set of statistics provided by the 
'stats.get_statistics' RPC command


Regards,
Ovidiu Sas


On Thu, Apr 4, 2024 at 6:12 PM Ben Kaufman  wrote:
>
> Is this a variable named "xhttp_prom_stats", or the modparam key 
> "xhttp_prom_stats"? There's already two separate parameters, right:
>
> - xhttp_prom_stats - corresponds to the rpc stats.get_statistics, thus
> it's argument corresponds to that RPC call
> - xhttp_prom_pkg_stats - Corresponds to the rpc pkg.stats, takes a
> Boolean argument
>
>
> A few thoughts:
>
> - The leading 'xhttp_prom_' prefix on the modparam key is unnecessary, since 
> the first argument to modparam is the module itself.  I point this out 
> because if the issue is backwards compatibility, then my recommendation would 
> be to keep 'xhttp_prom_stats' as is, and introduce a param 'stats' that can 
> introduce new syntax in the third parameter.  As an idea, the third parameter 
> could be literally what would be passed to RPC.  Not every possible RPC 
> command would need to be implemented (many wouldn't make sense), but this 
> would keep the syntax predictable:
> modparam("xhttp_prom", "stats", "corex.uptime");  ## Would 
> provide uptime
> modparam("xhttp_prom", "stats", "stats.get_statistics all:")  ## Same 
> result as modparam("xhttp_prom", "xhttp_prom_stats", "all")
> modparam("xhttp_prom", "stats", "pkg.stats"); ## Same 
> result as modparam("xhttp_prom", &qu

[SR-Users] Re: Kamailio Visions 2030 for Appalachia

2024-04-05 Thread Ben Kaufman via sr-users
The release was from April 1st – April Fool’s day. ;)

Regards,
Kaufman


From: Alexandru Covalschi via sr-users 
Sent: Thursday, April 4, 2024 11:38 PM
To: Kamailio (SER) - Users Mailing List 
Cc: Tom Lynn ; Alexandru Covalschi <568...@gmail.com>
Subject: [SR-Users] Re: Kamailio Visions 2030 for Appalachia


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Okay so is that some secret voip lore im missing on? What's the market value?

пн, 1 апр. 2024 г. в 23:25, Tom Lynn via sr-users 
mailto:sr-users@lists.kamailio.org>>:
But is it organic?

On Mon, Apr 1, 2024 at 11:59 AM Alex Balashov via sr-users 
mailto:sr-users@lists.kamailio.org>> wrote:
For immediate release:

HAZARD, Kentucky (1 April 2024)--Evariste Systems LLC, Georgia-based veteran
brokers of international charity partnerships, are pleased to announce the
conclusion of lengthy trilateral negotiations among Taylor Swift, the Public
Investment Fund (the sovereign wealth fund of the Kingdom of Saudi Arabia), and
the Kamailio open-source community to bring Kamailio to underserved areas of
the US Appalachia region.

In a concert in Lexington, Kentucky last Sunday evening, and in her signature
style of mystical "reveals" through equivocal song lyrics, Swift auspiciously
inaugurated to her Swifties, as die-hard fans of the pop star are known, the
beginning of Kamailio Visions 2030.

(Editorial note: Swift's agent has threatened copyright litigation in the event
that our press agency were to reproduce her meaning-rich lyrics directly,
driven by the contention that fair use considerations do not apply to lyrics so
"deep" as Swift's.  At press time, the matter is being reviewed by our
counsel.)

Alex Balashov, principal of Evariste, praised Kamailio Visions 2030 as a
continuation of Swift's long-standing commitment to forward thinking and
innovation:

"Taylor has been the driving force behind the use of sustainable, plant-based
materials in her 'merch. Today, aided by the internationalisation of Saudi
capital, she is helping to bring that same kind of ethical prosperity to
Eastern Kentucky, West Virginia and the wider Appalachian coal country."

Continued Balashov:

"Between Alan Maimon and J.D. Vance, and the revelations of the Purdue Pharma
litigation, it's fair to say that the plight of Appalachia, with its high
structural unemployment, declining economic base, and the ravages of the opioid
epidemic and deaths of despair, has been exposed to a broader audience than
ever before. And with that knowledge comes responsibility, because we live with
that knowledge now, and we can no longer turn a blind eye. The SIP and VoIP
industries have always been a force of conscientious capitalism, and Kamailio a
beacon of rectitude in a jaded, amoral, cynical world. A world in which
Appalachian children are denied the SIP proxy is not a just world, and we
cannot any longer live in such a world."

Fred Posner, a deputy Evariste negotiator who was said to have thrived in the
pressure of high-stakes negotiations with PIF governor Yasir Al-Rumayyan over
the exact implementational modalities of the deal, reviewed the high notes of
the landmark economic development accord:

"It was a good start to defund the police. But with the unique social
challenges of Appalachia, what every struggling family in the ruins of coal
country really needs is access to clean, ethically sourced, fair-trade SIP
proxies. That is why I am uplifted to say that we will be dropping, through a
coordinated, large-scale airlift operation, a Raspberry Pi with Kamailio
pre-installed, to every household with an income at or below 250% of the Federal
Poverty Level (FPL) in the Appalachian region. The Pi chassis will be dye-free,
BPA-free, and will be held together with a plant-based, biodegradable, non-toxic
glue that does not produce intoxicating effects when sniffed. By 2030, every
child alive in Appalachia today will have had several years to benefit from the
power of a miniaturised SIP proxy appliance, and that is why we are calling it
Kamailio Visions 2030."

When pressed by us, Balashov noted that the prosocial objectives and economic
development potential of Kamailio Visions 2030 has drawn scepticism from some
quarters.

"These are those people who think that Rasperry Pi devices preloaded with
Kamailio are not what Appalachia most needs today. Those people would be wrong.
As any metaphysicist can tell you, causes do not necessarily resemble their
effects."

"Taylor and her people know that Kamailio Visions 2030 draws on a long
history of highly effective technological and app-based interventions in
economically underprivileged areas, such as Nicholas Negroponte's One Laptop
per Child (OLPC) scheme, and the famous carpet-bombing of Eritrea with
second-generat

[SR-Users] Re: RFC: uptime metric for xhttp_prom module

2024-04-04 Thread Ben Kaufman via sr-users
Is this a variable named "xhttp_prom_stats", or the modparam key 
"xhttp_prom_stats"? There's already two separate parameters, right:

- xhttp_prom_stats - corresponds to the rpc stats.get_statistics, thus it's 
argument corresponds to that RPC call
- xhttp_prom_pkg_stats - Corresponds to the rpc pkg.stats, takes a Boolean 
argument


A few thoughts:

- The leading 'xhttp_prom_' prefix on the modparam key is unnecessary, since 
the first argument to modparam is the module itself.  I point this out because 
if the issue is backwards compatibility, then my recommendation would be to 
keep 'xhttp_prom_stats' as is, and introduce a param 'stats' that can introduce 
new syntax in the third parameter.  As an idea, the third parameter could be 
literally what would be passed to RPC.  Not every possible RPC command would 
need to be implemented (many wouldn't make sense), but this would keep the 
syntax predictable:
modparam("xhttp_prom", "stats", "corex.uptime");  ## Would 
provide uptime
modparam("xhttp_prom", "stats", "stats.get_statistics all:")  ## Same 
result as modparam("xhttp_prom", "xhttp_prom_stats", "all")
modparam("xhttp_prom", "stats", "pkg.stats"); ## Same 
result as modparam("xhttp_prom", "xhttp_prom_pkg_stats", "1")

- My current test env is 5.7.3, but it looks like the existing ' 
xhttp_prom_stats' parameter can only be declared once, thus there's no syntax 
for selecting multiple specific items.  In other words this configuration 
doesn't give counters for the sl module and the core module. It only provides 
the counters from which ever is declared last (core in this case).

modparam("xhttp_prom", "xhttp_prom_stats", "sl:")
modparam("xhttp_prom", "xhttp_prom_stats", "core:")


Rather than changing the existing module parameters, the new "stats" parameter 
could be called multiple times, so:
modparam("xhttp_prom", "stats", "stats.get_statistics sl:")
modparam("xhttp_prom", "stats", "stats.get_statistics core:")
modparam("xhttp_prom", "stats", "pkg.stats")
modparam("xhttp_prom", "stats", "corex.uptime")

Would get all sl module counters, all core module counters, the uptime and the 
package memory stats for each child process.  An advantage here is that other 
counters can be implemented without any real thought to syntax.  For example, 
shared memory stats would predicably be added as:
modparam("xhttp_prom", "stats", "shm.stats")



-Original Message-
From: Ovidiu Sas via sr-users 
Sent: Thursday, April 4, 2024 1:40 PM
To: Henning Westerholt 
Cc: Kamailio (SER) - Users Mailing List ; Ovidiu 
Sas 
Subject: [SR-Users] Re: RFC: uptime metric for xhttp_prom module

CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


Hello Henning,

I have nothing against using a single variable, except that it is confusing.
It is not backward compatible. If you enable all vars, then all new stats will 
be enabled by default.
In the current stable version, the names of the stats vars and stats groups are 
inherited from the "stats.get_statistics" RPC command.
That's why we don't have explicit documentation for them in the README file.
For the new stats we don't have a group and the stats vars have sort of 
arbitrary names.

Having dedicated modparams for all these new stats not covered by the generic 
ones require a simple and clean implementation along with an easy way to switch 
them on and off while keeping backward compatibility.
If more kamailio admin feel that we should merge them, we could :)

-ovidiu


On Thu, Apr 4, 2024 at 1:45 PM Henning Westerholt  wrote:
>
> Hello Ovidiu,
>
> nothing against it from my side. I would recommend using the existing 
> variable " xhttp_prom_stats" for activating/deactivation. Just think we 
> should not introduce to many single purpose variables, especially for a value 
> which is always available without any dependencies.
>
> Cheers,
>
> Henning
>
> > -Original Message-
> > From: Ovidiu Sas via sr-users 
> > Sent: Donnerstag, 4. April 2024 18:54
> > To: Kamailio (SER) - Users Mailing List
> > 
> > Cc: Ovidiu Sas 
> > Subject: [SR-Users] RFC: uptime metric for xhttp_prom module
> >
> > Hello all,
> >
> > The xhttp_module can export all stats under "stats.get_statistics"
> > RPC command.
> > I was thinking of adding an optional "uptime" stat that will return
> > the kamailio server uptime (like the "core.uptime" RPC command).
> > This will make it easier to add an uptime panel in grafana.
> > The new stat would be controlled by a module parameter (by default
> > disabled).
> > Something like:
> > modparam("xhttp_prom", "xhttp_prom_uptime_stat" 1) And this will
> > generate something like:
> > kam_uptime 671 1712249054631
> >
> > This can be already implemented in the script using the "prom_gauge_set()"
> > and retrieving the uptime via "jsonrpc_exec()", but it would be
> > nicer and

[SR-Users] Re: append_hf not working

2024-03-11 Thread Ben Kaufman via sr-users
There's also the question of when the header was appended as well, right?  
Calling append_hf() after creating a transaction will only apply that header to 
the current branch, not to subsequent branches.


-Original Message-
From: James Browne via sr-users 
Sent: Monday, March 11, 2024 7:03 AM
To: Kamailio (SER) - Users Mailing List 
Cc: James Browne 
Subject: [SR-Users] Re: append_hf not working

CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


One pitfall would be to think that this function would add this header field to 
any reply that kamailio would send. This append_hf() function should add a 
header field to a SIP request that it *relays*, but would not add it to a 
response that kamailio *generates* (for that, you would use the 
append_to_reply() function).

James

On Mon, 11 Mar 2024 at 11:26, Alex Balashov via sr-users 
 wrote:
>
> Indeed, it has become a bit of a cliché that msg_apply_changes() should be 
> called after append_hf(), uac_replace_from(), etc.
>
> This should be dispelled. In the vast majority of use-cases, it is not only 
> unnecessary, but highly undesirable.
>
> -- Alex
>
> > On 11 Mar 2024, at 06:45, Henning Westerholt via sr-users 
> >  wrote:
> >
> > Hello,
> >  the usage of msg_apply_changes is not necessary (not even recommended) for 
> > append_hf (and other functions) to work. The OP was talking about a packet 
> > capture, so I assume that he got the capture after the proxy send out the 
> > message.
> >  Cheers,
> >  Henning
> >   -- Henning Westerholt -
> > https://sk/
> > alatan.de%2Fblog%2F&data=05%7C02%7Cbkaufman%40bcmone.com%7Cb9eabef23
> > 1974f061db008dc41c47c6b%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7
> > C638457559371077852%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQ
> > IjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=IUKBac
> > HQspO1gtJ5B3ZULUOt6oAJKaTMBWM6R%2FDiq1Y%3D&reserved=0
> > Kamailio services - https://gilawa.com/
> >   From: Unai Rodriguez via sr-users 
> > Sent: Montag, 11. März 2024 09:33
> > To: Calvin E. via sr-users ; Kamailio
> > (SER) - Users Mailing List 
> > Cc: Unai Rodriguez 
> > Subject: [SR-Users] Re: append_hf not working  Using
> > https://kamailio.org/docs/modules/stable/modules/textopsx.html#textopsx.f.msg_apply_changes
> >  might be relevant in your case...
> >  With best wishes, Unai Rodriguez
> > On 11 Mar 2024 at 09:22 +0100, Benoit Panizzon via sr-users 
> > , wrote:
> >
> > Hi Calvin
> >
> >
> > I'm trying to add something simple like the following:
> >
> > append_hf("X-testheader: True\r\n", "From");
> >
> > However, I don't see my X-testheader in a packet capture. Are there
> > any common pitfalls that would prevent append_hf from working as
> > expected?
> >
> > Weird, I use this a lot and it always works. But I never attempted
> > to specify the header after which it should be appended. Does it
> > work if you don't specifiy "From"?
> >
> > Mit freundlichen Grüssen
> >
> > -Benoît Panizzon-
> > --
> > I m p r o W a r e A G - Leiter Commerce Kunden
> > __
> >
> > Zurlindenstrasse 29 Tel +41 61 826 93 00
> > CH-4133 Pratteln Fax +41 61 826 93 01 Schweiz Web
> > http://www/
> > .imp.ch%2F&data=05%7C02%7Cbkaufman%40bcmone.com%7Cb9eabef231974f061d
> > b008dc41c47c6b%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C63845755
> > 9371097127%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luM
> > zIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=fOFt%2BsXu%2FDg
> > 3EeKqhoRlybWURiVXfz%2B0Di8aSYFWxvQ%3D&reserved=0
> > __
> > __
> > Kamailio - Users Mailing List - Non Commercial Discussions To
> > unsubscribe send an email to sr-users-le...@lists.kamailio.org
> > Important: keep the mailing list in the recipients, do not reply only to 
> > the sender!
> > Edit mailing list options or unsubscribe:
> > __
> > Kamailio - Users Mailing List - Non Commercial Discussions To
> > unsubscribe send an email to sr-users-le...@lists.kamailio.org
> > Important: keep the mailing list in the recipients, do not reply only to 
> > the sender!
> > Edit mailing list options or unsubscribe:
>
>
> --
> Alex Balashov
> Principal Consultant
> Evariste Systems LLC
> Web:
> https://evar/
> istesys.com%2F&data=05%7C02%7Cbkaufman%40bcmone.com%7Cb9eabef231974f06
> 1db008dc41c47c6b%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C63845755
> 9371101627%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzI
> iLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=YfdvEmQ5OWU4MOZ6dcj
> rEP657%2FZ5A0ZA4lDz%2FeWSU2Q%3D&reserved=0
> Tel: +1-706-510-6800
>
> __
> Kamailio - Users Mailing List - Non Commercial Discussions To
> unsubscribe send an email t

[SR-Users] Re: SIP Redirect Server

2024-03-10 Thread Ben Kaufman via sr-users
Kind of depends on which RFC you’re talking about.

As Fred asked – do you have `force_rport` set?  This is defined in 
RFC3581<https://www.ietf.org/rfc/rfc3581.txt>.  In an *ideal* world, your UAC 
would put the `rport` parameter (without value) in it’s Via header.   Kamailio 
can be told to “consider this request like there’s an `rport` in the top most 
via header” by setting `force_rport`.  This is what you want based on your 
description below.

Regards,
Kaufman



From: Antonio via sr-users 
Sent: Sunday, March 10, 2024 11:08 AM
To: Fred Posner 
Cc: Kamailio (SER) - Users Mailing List ; Antonio 

Subject: [SR-Users] Re: SIP Redirect Server


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Please close request as I found out that this is required behaviour according 
to RFC




[https://www.gravatar.com/avatar/3cad51c8c080640120f89eb5b895ad21/?s=160&msw=160&msh=160]
Antony
satski...@gmail.com<mailto:satski...@gmail.com>
+380669197533
+48727830247


On Sun, 10 Mar 2024 at 15:00, Fred Posner mailto:f...@pgpx.io>> 
wrote:
Do you have force_rport anywhere in the config?

-- Fred Posner
Sent from mobile
Phone: +1 (352) 664-3733
qxork.com<http://qxork.com/>




On Mar 10, 2024, at 8:37 AM, Antonio via sr-users 
mailto:sr-users@lists.kamailio.org>> wrote:

Hi everyone
I have a small question:
i want to set up a basic SIP Redirect Server
so I install Kamailio v5.3
and  comment  default  request route and set simple

request_route {
rewritehostport("1.2.3.4");
sl_send_reply("302", "Moved Temporarily");
}

but for some reason, Kamailio does not care about the port and sends a reply to 
5060


i also tried to delete   rewritehostport
but it only deletes Contact: from the reply
but reply  itself is still sent to  5060 port



--
[https://www.gravatar.com/avatar/3cad51c8c080640120f89eb5b895ad21/?s=160&msw=160&msh=160]
Antony
satski...@gmail.com<mailto:satski...@gmail.com>
+380669197533
+48727830247
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to 
sr-users-le...@lists.kamailio.org<mailto:sr-users-le...@lists.kamailio.org>
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: High CPU with DMQ on ARM64 (graviton) - Tuning values for DMQ worker_usleep

2024-02-09 Thread Ben Kaufman via sr-users
For real-usage it's all the same versions.  But, I get the behavior even in 
synchronizing with nothing - making it the only pool member.  It seems to be 
consistent with the behavior in the mailing list link in my original post.  
Changing from locking to polling (at 1000us) has dropped the CPU utilization to 
a normal level, but I don't have any idea if 1000us is a "good" value - it's 
just the value that's in the example in the documentation.


Kaufman
Senior Voice Engineer



E: bkauf...@bcmone.com




SIP.US Client Support: 800.566.9810  |  SIPTRUNK Client Support: 800.250.6510  
|  Flowroute Client Support: 855.356.9768
[img]<https://www.sip.us/>
[img]<https://www.siptrunk.com/>
[img]<https://www.flowroute.com/>


From: David Villasmil 
Sent: Friday, February 9, 2024 10:28 AM
To: Kamailio (SER) - Users Mailing List 
Cc: Ben Kaufman 
Subject: Re: [SR-Users] Re: High CPU with DMQ on ARM64 (graviton) - Tuning 
values for DMQ worker_usleep


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

What is it synchronizing with? Bear in mind you can't mix Kamailio versions 
when doing DMQ

Regards,

David Villasmil
email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com>
phone: +34669448337


On Fri, 9 Feb 2024 at 17:17, Ben Kaufman via sr-users 
mailto:sr-users@lists.kamailio.org>> wrote:
Just checking to see if anyone had any ideas about tuning on this feature.


From: Ben Kaufman via sr-users 
mailto:sr-users@lists.kamailio.org>>
Sent: Thursday, February 1, 2024 8:38 AM
To: Kamailio (SER) - Users Mailing List 
mailto:sr-users@lists.kamailio.org>>
Cc: Ben Kaufman mailto:bkauf...@bcmone.com>>
Subject: [SR-Users] High CPU with DMQ on ARM64 (graviton) - Tuning values for 
DMQ worker_usleep


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

I encountered a behavior with DMQ using excessive CPU when running kamailio 5.8 
on AWS Graviton processors (running in Docker on Amazon Linux 2023), even on an 
otherwise idle system.  Finding the issue below pointed me towards using 
polling. I set the value for worker_usleep to 1000 as a test, and that seems to 
have resolved the CPU issue, but I have no idea of what a "good" value is for 
this setting, and 1000 was simply the example present in the documentation.  My 
specific use case for DMQ is synchronizing USRLOC data for ~7,500 users, 
registering with expiration times of 60 - 300 seconds with 7 - 9 nodes on the 
DMQ bus.  Any general recommendations on tuning values for this setting?

https://github.com/kamailio/kamailio/issues/822

Regards,
Kaufman
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to 
sr-users-le...@lists.kamailio.org<mailto:sr-users-le...@lists.kamailio.org>
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: High CPU with DMQ on ARM64 (graviton) - Tuning values for DMQ worker_usleep

2024-02-09 Thread Ben Kaufman via sr-users
Just checking to see if anyone had any ideas about tuning on this feature.


From: Ben Kaufman via sr-users 
Sent: Thursday, February 1, 2024 8:38 AM
To: Kamailio (SER) - Users Mailing List 
Cc: Ben Kaufman 
Subject: [SR-Users] High CPU with DMQ on ARM64 (graviton) - Tuning values for 
DMQ worker_usleep


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

I encountered a behavior with DMQ using excessive CPU when running kamailio 5.8 
on AWS Graviton processors (running in Docker on Amazon Linux 2023), even on an 
otherwise idle system.  Finding the issue below pointed me towards using 
polling. I set the value for worker_usleep to 1000 as a test, and that seems to 
have resolved the CPU issue, but I have no idea of what a "good" value is for 
this setting, and 1000 was simply the example present in the documentation.  My 
specific use case for DMQ is synchronizing USRLOC data for ~7,500 users, 
registering with expiration times of 60 - 300 seconds with 7 - 9 nodes on the 
DMQ bus.  Any general recommendations on tuning values for this setting?

https://github.com/kamailio/kamailio/issues/822

Regards,
Kaufman
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] High CPU with DMQ on ARM64 (graviton) - Tuning values for DMQ worker_usleep

2024-02-01 Thread Ben Kaufman via sr-users
I encountered a behavior with DMQ using excessive CPU when running kamailio 5.8 
on AWS Graviton processors (running in Docker on Amazon Linux 2023), even on an 
otherwise idle system.  Finding the issue below pointed me towards using 
polling. I set the value for worker_usleep to 1000 as a test, and that seems to 
have resolved the CPU issue, but I have no idea of what a "good" value is for 
this setting, and 1000 was simply the example present in the documentation.  My 
specific use case for DMQ is synchronizing USRLOC data for ~7,500 users, 
registering with expiration times of 60 - 300 seconds with 7 - 9 nodes on the 
DMQ bus.  Any general recommendations on tuning values for this setting?

https://github.com/kamailio/kamailio/issues/822

Regards,
Kaufman
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: trigger different branch route on branch added with append_branch

2024-01-18 Thread Ben Kaufman via sr-users
I think what you want is PATH:

https://www.kamailio.org/docs/modules/devel/modules/path.html


-Original Message-
From: Benoit Panizzon via sr-users 
Sent: Thursday, January 18, 2024 10:02 AM
To: sr-users@lists.kamailio.org
Cc: Benoit Panizzon 
Subject: [SR-Users] trigger different branch route on branch added with 
append_branch

CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


Hi List

Imagine the following situation:

Two Kamailio registrar proxies handling the same domain. Location Information 
synced via DMQ.

So if a device registers we don't know on which of the two registrar proxies.

Core proxy is dispatching calls to either one of those registrars.

Core also performs AOR database lookup and adds an X- header telling which AOR 
the call is destined to.

Registrar performs lookup of that AOR in the location database and routes the 
call to destination.

Problem: The call could be routed to the the registrar which does not hold the 
active socket to that client.

Solution: reg_fetch_contacts, cycle the contacts and append_branch if
the contact has a local socket.

Next Problem: I use a failure_route to sent the call to voicemail, if
not registered, busy etc. This would trigger, if we have no
local socket for the registration which is on the other
registrar. So I have to find a way to send the call to the
other registrar.

I guess I can append_branch a branch pointing to the URI of the
other registrar. This would then succeed in reaching the
device. Also using the failure_route would work this way if
we get a remote error from behind the other registrar or no
registration at all.

Next Problem: I use a branch trigger to remove undesired header I do
not want to send to the customer. Now imagine that AOR has two
contacts, one on registered on each registrar proxy.

So I end up with two destinations added with append_branch to
the destination set.

One points to the device of the locally registered customer
device, the other one points to the other registrar where to
find the other device.

I use a branch route trigger to remove the X- Headers towards
the customer.
But I need to X- Header containing the destination AOR to still
be sent to the other registrar.

Is there a way to trigger a branch route for only some of the
destinations added with append_branch? Or to trigger different
branch routes for different destinations in one set added with
append_branch?

Or am I doing this completely wrong and there is an easier way? ;-)

Mit freundlichen Grüssen

-Benoît Panizzon-
--
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch/
__
__
Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send 
an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Using http_async_query - transaction seems "reused" for subsequent SIP INVITE requests received ? (Kamailio 5.7.3)

2024-01-12 Thread Ben Kaufman via sr-users
I think you can remove the warning simply by "touching" the ruri:

$ru = $ru;



-Original Message-
From: Chaigneau, Nicolas via sr-users 
Sent: Friday, January 12, 2024 8:26 AM
To: Kamailio (SER) - Users Mailing List 
Cc: Chaigneau, Nicolas 
Subject: [SR-Users] Re: Using http_async_query - transaction seems "reused" for 
subsequent SIP INVITE requests received ? (Kamailio 5.7.3)

CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


Thanks for the clarification. So "branches" is not what I need.

So I should do something like that:

append_to_reply("Contact: <...>\r\n");
sl_send_reply("302", "Moved Temporarily"); exit;

(I do have an "exit" immediately after all calls to "sl_send_reply")


I tried with a minimalist request_route, as follows:

request_route {
if (is_method("INVITE")) {
append_to_reply("Contact: 
\r\n");
xlog("L_INFO", "Calling sl_send_reply then exit\n");
sl_send_reply("302", "Moved Temporarily");
exit;
}
}


But I still have this WARNING message logged by Kamailio when handling a SIP 
INVITE:

WARNING:  [core/dset.c:690]: print_dset(): no r-uri or branches



Regards,
Nicolas.

-Message d'origine-
De : Alex Balashov via sr-users  Envoyé : vendredi 
12 janvier 2024 13:44 À : Kamailio - Users Mailing List Cc : Alex Balashov 
Objet : [SR-Users] Re: Using http_async_query - transaction seems "reused" for 
subsequent SIP INVITE requests received ? (Kamailio 5.7.3)

**This mail has been sent from an external source. Do not reply to it, or 
open any links/attachments unless you are sure of the sender's identity.**

Hi Nicolas,

Yes, I think that unfortunately this is the outcome of some confusion. Apart 
from the word "append", there is nothing in common between the concepts of 
append_branch() and append_to_reply().

I'm not sure why you are getting the messages you are just sending redirects, 
but the prime suspicion is that the execution of your configuration contains 
additional steps beyond just sending stateless replies, e.g. that you call 
sl_send_reply(), but do not call 'exit' afterward, and so the config execution 
progresses to a step where some kind of relay is attempted.

Conceptually, sending redirects is as simple as:

request_route {
...

# Maybe some sanity-checking or request boilerplate here.

if(method == "INVITE") {
   # some DB ops or whatever, yielding $var(val).

   append_to_reply("Contact: \r\n");
   sl_send_reply("302", "Moved Temporarily");
   exit;
}

# Anything else that might occur in this config should not
# occur if an INVITE was received--note the 'exit' step above.
}

It may not be quite as simple as that, but hopefully this gives the right idea.

-- Alex

> On 12 Jan 2024, at 03:16, Chaigneau, Nicolas 
>  wrote:
>
> Hello Alex,
>
>
> The confusion is probably on my part.
>
> Reading this:
> https://kama/
> ilio.org%2Fdocs%2Fmodules%2Fdevel%2Fmodules%2Fsl.html%23sl.f.sl_send_r
> &data=05%7C02%7Cbkaufman%40bcmone.com%7Ccf2236879144419e18de08dc137b17
> 19%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C63840649573742%7CU
> nknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1ha
> WwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=yAITfh%2F8iqcRf0XWbhyNW2fLi9JI
> u7vwWA%2FADkdpQHs%3D&reserved=0
> eply
>
> 3.1.  sl_send_reply(code, reason)
> For the current request, a reply is sent back having the given code and text 
> reason. The reply is sent stateless, totally independent of the Transaction 
> module and with no retransmission for the INVITE's replies.
>
> If the code is in the range 300-399 (redirect reply), the current destination 
> set is appended to the reply as Contact headers. The destination set contains 
> the request URI (R-URI), if it is modified compared to the received one, plus 
> the branches added to the request (e.g., after an append_branch() or 
> lookup("location")). If the R-URI was changed but it is not desired to be 
> part of the destination set, it can be reverted using the function 
> revert_uri().
>
> Custom headers to the reply can be added using append_to_reply() function 
> from textops module.
>
>
>
> I thought that I needed to use append_branch before calling sl_send_reply to 
> control the Contact headers in the reply.
>
> I tried to use "append_to_reply" instead to add the Contact headers, like 
> this:
> append_to_reply("Contact: <...>\r\n");
>
> This works, but then I get WARNING messages in the logs:
> WARNING:  [core/dset.c:690]: print_dset(): no r-uri or branches
>
> Which is also why I was confused...
> You're telling me I should not create branches... but if I don't, I get these 
> messages.
>
> Could you please clarify ?
>
>
> Thanks a lot.
>
> Regards,
> Nicolas.
>
>
> -Message d'origine-
> De : Alex

[SR-Users] Re: No access to variables within timer route

2023-11-30 Thread Ben Kaufman via sr-users
What I'm not clear on from your example is the use of the timer:

- Kamailio gets an invite, write a record to redis where the key identifies the 
user.
- On call teardown, find the key and delete it.

What is the timer route doing?  It should be able to read redis.

-Original Message-
From: dries--- via sr-users  
Sent: Thursday, November 30, 2023 8:30 AM
To: sr-users@lists.kamailio.org
Cc: dr...@degendt.com
Subject: [SR-Users] Re: No access to variables within timer route

CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


Hi Ben,

I'll try my best to explain the use case here.

I have a direct trunk between our Asterisk and Kamailio servers. My goal is 
that when an agent is already in call, he doesn't get prompted with another 
incoming call on either of his devices. So Asterisk is supposed to perform a 
redis check each time a call goes through the Asterisk queue.

Since Asterisk can't determine the device state here, I've set up a redis 
cluster which is supposed to keep track of the agent's call state. For each 
INVITE in Kamilio, I'm storing a key into redis based on the agent's number, 
for example "callstate_242680". The value is the call-id.
When a BYE/CANCEL is received, I'm retrieving the particular key and comparing 
the current call-id agains the call-id in the redis object. If it matches, I'm 
deleting the object so the extension is "available" again.

This works pretty good but sometimes the keys are stored way too long in case a 
BYE/CANCEL was missed (for example, restart of Kamailio process, network 
interruptions, ...).
I was thinking of setting a redis expiration time for each key, which would be 
prolonged by the timer running in each call transaction. That way I could 
retrieve the agent's number and increase the expiration of the matching redis 
key. I don't think shared memory would be possible since I can't identify the 
call here.

As an alternative, I'm thinking of keeping track of dialogs using dlg_manage() 
and also store these into a local redis server (since db_redis doesn't seem to 
have redis cluster support). That way I can use a timer block to retrieve all 
the stored dialogs and compare them to the stored callstate keys. I've noticed 
however that the tracking of dialogs also depends of that BYE/CANCEL however so 
I don't think it's very usefull.

An alternative method could be to update the redis object in case of a periodic 
ACK but that's no guaruantee. I also don't want the agent to be wrongfully 
"busy" for too long.

I'm still trying to fit all the pieces together, I was just hoping if anyone 
could confirm this is a correct approach?
__
Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send 
an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: No access to variables within timer route

2023-11-30 Thread Ben Kaufman via sr-users
>From the rtimer documentation overview:

>   The module executes route blocks on a timer base. It can create new timer 
> processes and execute many route blocks on same timer.
>   A static faked SIP message is given as parameter to called functions, so 
> all functions available for REQUEST_ROUTE can be used.


It runs in it's own processes, and as Alex noted $var() is per process.  It's 
not clear if the process re-spawns so setting a variable inside the timer 
action will be retained through multiple executions or not.
As for $avp()s, along with $xavp()s and their assorted variants, these are 
scoped to a SIP transaction, and the timer shouldn't be handling a transaction.

Shared variables and hashtables should be available inside this route, though.

It might be good to clarify what your goal is (why you expect the variables to 
have values in this route).


-Original Message-
From: dries--- via sr-users  
Sent: Wednesday, November 29, 2023 3:36 PM
To: sr-users@lists.kamailio.org
Cc: dr...@degendt.com
Subject: [SR-Users] Re: No access to variables within timer route

CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


Sorry, please ignore the variable name typo in the "REFRESH_CALLSTATE_TIMER" 
route in my initial post.

The issue still stands however.

route[REFRESH_CALLSTATE_TIMER] {
xlog("L_INFO", "Testvariable: $var(testvar)\n"); }

I've also tried enabling the timer on start as well  as attempting to use $avp 
instead. All called variables within the route are either 0 or null?
__
Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send 
an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Sharing load between rtpengine servers

2023-11-10 Thread Ben Kaufman via sr-users
>From a strictly linguistic point of view the sentence, "This is supported by 
>all rtpengine commands except rtpengine_manage()" is at the end of the second 
>paragraph, which is in reference to the second argument.  I would take it to 
>mean that the second argument is not supported by rtpengine_manage() - not 
>that the entire function is not supported.  Does that seem correct?


As reference the full section:

---
5.1.  set_rtpengine_set(setid[, setid])

Sets the ID of the RTP proxy set to be used for the next rtpengine_delete(), 
rtpengine_offer(), rtpengine_answer() or rtpengine_manage() command. The 
parameter can be an integer or a config variable holding an integer.

A second set ID can be specified to daisy-chain two RTP proxies. The two set 
IDs must be distinct from each other and there must not be any overlap in the 
proxies present in both sets. In this use case, the request (offer, answer, 
etc) is first sent to an RTP proxy from the first set, which rewrites the SDP 
body and sends it back to the module. The rewritten SDP body is then used to 
make another request to an RTP proxy from the second set, which rewrites the 
SDP body another time and sends it back to the module to be placed back into 
the SIP message. This is useful if you have a set of RTP proxies that the 
caller must use, and another distinct set of RTP proxies that the callee must 
use. This is supported by all rtpengine commands except rtpengine_manage().
---



From: Daniel-Constantin Mierla via sr-users 
Sent: Thursday, November 9, 2023 2:25 AM
To: Kamailio (SER) - Users Mailing List 
Cc: Daniel-Constantin Mierla 
Subject: [SR-Users] Re: Sharing load between rtpengine servers


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


Hello,

not sure why that remark is there, because contradicts with the first paragraph 
that has:

"Sets the ID of the RTP proxy set to be used for the next rtpengine_delete(), 
rtpengine_offer(), rtpengine_answer() or rtpengine_manage() command."

  - 
https://www.kamailio.org/docs/modules/stable/modules/rtpengine.html#rtpengine.f.set_rtpengine_set

I don't think that the last statement is good, maybe it propagated without 
notice from a very old version. From code point of view, there is no reason for 
set_rtpengine_set() not to work for rtpengine_manage(), this function is a 
pretty simple wrapper for rtpengine_offer()/_answer()/_delete().

I am going to remove that last statement from docs.

Cheers,
Daniel

On 09.11.23 01:06, David Cunningham via sr-users wrote:
Hi Alex,

It's on the page that you linked to: "This is supported by all rtpengine 
commands except rtpengine_manage()."

Thanks.


On Thu, 9 Nov 2023 at 12:55, Alex Balashov 
mailto:abalas...@evaristesys.com>> wrote:
Hi David,

Whence the impression that sets aren't compatible with rtpengine_manage()?

https://kamailio.org/docs/modules/5.7.x/modules/rtpengine.html#rtpengine.f.set_rtpengine_set

   "Sets the ID of the RTP proxy set to be used for the next rtpengine_delete(),
rtpengine_offer(), rtpengine_answer() or rtpengine_manage() command. The 
parameter
can be an integer or a config variable holding an integer."

Or are you using an earlier version of Kamailio in which this may not have been 
true?

-- Alex

> On 8 Nov 2023, at 18:52, David Cunningham 
> mailto:dcunning...@voisonics.com>> wrote:
>
> Hi Alex,
>
> Thank you for the reply. We use a large weight of  to send almost all 
> calls to the 22.x and 33.x servers without using sets. We avoided sets 
> because our Kamailio configuration uses rtpengine_manage(), which according 
> to the documentation is not compatible with set_rtpengine_set(). I'll try it 
> without the 11.x server and the large weights, and see if the calls are 
> evenly distributed between the 22.x and 33.x servers then.
>
> Thanks again.
>
>
> On Thu, 9 Nov 2023 at 10:25, Alex Balashov via sr-users 
> mailto:sr-users@lists.kamailio.org>> wrote:
> Hi,
>
> From the docs:
>
> "The balancing inside a set is done automatically by the module based on the 
> weight of each RTPEngine from the set. The default weight is 1, if another 
> RTPEngine should be used twice as often as the first one, one would specify 
> the weight 2 for this server, for example."
>
> I am unsure as to what effect such large values as  might have on 
> this arithmetic.
>
> It seems to me that if what you really want to accomplish is to evenly 
> distribute calls between 22.22.22.22 and 33.33.33.33, with 11.11.11.11 only 
> as a last-resort backup, then you should put the first two into one naive set 
> without any weights, e.g.
>
>modparam("rtpengine_sock", "1 == 
> udp:22.22.22.22:7724 
> udp:33.33.33.33:7724")
>
> Then put 11.11.11.11 into a set of its own:
>
>modparam("rtpengine_sock", "2 == 
> udp:11.11.11.11:22724

[SR-Users] Re: Sequential fork with different Call-Ids

2023-11-07 Thread Ben Kaufman via sr-users
The short answer is that Kamailio is a SIP proxy, and what you're describing is 
a Back to Back User Agent (B2BUA), so there's no easy direct way to do this.  
It's also worth noting that the default config for kamailio's max_branches is 
12 and has an upper limit of 31.

A better question might be why you need a separate call-id for each call.  
Kamailio will generate a new branch parameter for the via's that it adds, so 
this shouldn't be necessary.

Regards,
Kaufman.


From: Vanderlei Torres Batistela via sr-users 
Sent: Tuesday, November 7, 2023 11:36 AM
To: sr-users@lists.kamailio.org
Cc: Vanderlei Torres Batistela 
Subject: [SR-Users] Sequential fork with different Call-Ids


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Hello all,

I have a scenario on wich requires sequential fork (up to 30 possible 
destinations) with different
Call-ID for each leg. I am using topoh module enabled, but it always puts the 
same Call-ID.
Someone have a solution for this scenario?

Regards

__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: STIR/SHAKEN with Kamailio

2023-10-20 Thread Ben Kaufman via sr-users
My point was simply that there's more challenge in the bureaucracy than 
technical implementation.

>From a technical standpoint, the corner cases to consider are:

1. Number validity. Sure things that fit into an e.164 and/or recognizable 
number patterns are simple.  What happens when someone sends a From: URI of 
`sip:anonym...@domain.com` - IIRC, the orig_tn field within the identity header 
is supposed to be numeric.  Do you reject the call?  Attest it as "C" and 
provide this in the `orig_tn` field or in a separate field?

2. Handling of forwarded calls - If you're sending a Diversion: header, do you 
also add an Identity header with a `div` passport?  Rewrite the From header?  
How do you determine the attestation in that case?

3. Known customers sending numbers for which you're not the provider?  Strictly 
speaking this should attest as "B", but supposing that you're a secondary 
vendor for the customer, and they're sending their primary number which is with 
a different provider?  Do you then allow them to submit an LOA (or whatever 
your jurisdictional equivalent is) and attest as A?

The questions above are strictly for STI Authentication.  Verification has some 
other idiosyncrasies.   Consider that there's three attestation levels for 
authentication, and normally as a carrier it is not desirable to pass the 
Identity header to the customer (consider if Privacy: is on).  The general 
practice is to assign this to a verstat parameter to the user portion of a PAI 
header's **USER** field, which is syntactically awkward in Kamailio.  Also 
strictly speaking AFAIK, the verstat only has two values - passed or failed - 
so there's three possible attestation levels but they only map to two 
verification levels.  Therea are suggestions on how to deal with this, but I'm 
not sure on their official status.

This brings up the final complexity:  It's a rapidly evolving system without a 
high degree of consistency vendor to vendor, so there's as much of a challenge 
of staying on top of things as anything else.

-Original Message-
From: Olle E. Johansson via sr-users  
Sent: Friday, October 20, 2023 2:08 AM
To: Kamailio (SER) - Users Mailing List 
Cc: Olle E. Johansson 
Subject: [SR-Users] Re: STIR/SHAKEN with Kamailio

CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


> On 19 Oct 2023, at 18:46, Alex Balashov via sr-users 
>  wrote:
>
> Would join Kaufman here to say that free-range STIR/SHAKEN 
> implementations in the US are limited by the small number of certified 
> authentication providers, but presumably the EU version will to some 
> extent avoid US-style Guilded Age corporate welfare...
Sadly that's my view of the US implementation. I can't say if it solved the 
problem, but I can see that a lot of new and old actors got an oppurtunity to 
earn more money.

There's no EU-wide implementation or regulation at this point. I am aware of 
France. There are certainly discussions.
/O
>
> -- Alex
>
>> On 19 Oct 2023, at 09:33, Ben Kaufman via sr-users 
>>  wrote:
>>
>> Like some of the other posters here, we've implemented it as a 302-redirect 
>> server. This was the primary reason for using the secsipid rather than 
>> stirshaken module.  Both modules have a function to append an Identity 
>> header, but secsipid also has functions to simply build the identity header 
>> which can then easily be appended to the reply, rather than only appending 
>> to the request and plucking the Identity header from there.  Secsipid also 
>> has a function secsipid_sign() which allows for creating your own JWT.  This 
>> is useful if you want to create some variations on the Identity header - we 
>> use this to create div passports (as opposed to shaken passports) in some 
>> situations.
>>
>> Not sure how it will be implemented there, but the biggest challenge for me 
>> in the US was acquiring certificates because there is a very limited number 
>> of regulatory approved vendors.
>
> --
> Alex Balashov
> Principal Consultant
> Evariste Systems LLC
> Web: 
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fevar
> istesys.com%2F&data=05%7C01%7Cbkaufman%40bcmone.com%7C31a9da72c1db4b26
> 7ff308dbd13cd073%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C63833383
> 1362925788%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzI
> iLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=w9TCfesrCll46onz
> GqiIndpnonmKJpi06JrS1s3FJK4%3D&reserved=0
> Tel: +1-706-510-6800
>
> __
> Kamailio - Users Mailing List - Non Commercial Discussions To

[SR-Users] Re: STIR/SHAKEN with Kamailio

2023-10-19 Thread Ben Kaufman via sr-users
Like some of the other posters here, we’ve implemented it as a 302-redirect 
server. This was the primary reason for using the secsipid rather than 
stirshaken module.  Both modules have a function to append an Identity header, 
but secsipid also has functions to simply build the identity header which can 
then easily be appended to the reply, rather than only appending to the request 
and plucking the Identity header from there.  Secsipid also has a function 
secsipid_sign() which allows for creating your own JWT.  This is useful if you 
want to create some variations on the Identity header - we use this to create 
div passports (as opposed to shaken passports) in some situations.

Not sure how it will be implemented there, but the biggest challenge for me in 
the US was acquiring certificates because there is a very limited number of 
regulatory approved vendors.

Regards,
Kaufman
 

-Original Message-
From: Olle E. Johansson via sr-users  
Sent: Wednesday, October 18, 2023 2:24 AM
To: Leonardo Arena via sr-users 
Cc: Olle E. Johansson 
Subject: [SR-Users] STIR/SHAKEN with Kamailio

CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


Hello Kamailians!

As STIR/SHAKEN seems to cross the ocean and arrive on the European shores, I’m 
curious on how you’ve implemented it with Kamailio. I asked on our Matrix chat 
and got two responses that seems to not use the Kamailio STIR/SHAKEN support 
but rather a 3rd party service that they’ve integrated using restful APIs.

Please help me and share how you’re implementing STIR/SHAKEN with Kamailio.

I’m not shaken, nor stirred. yet.

Regards,
/O
__
Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send 
an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Using DMQ to sync the TM module.

2023-10-11 Thread Ben Kaufman via sr-users
It would seem the best solution is to use something that can use the SIP 
protocol for making routing decisions - for example, Kamailio acting as a 
stateless load balancer, either as a replacement for your load balancer or 
between your layer4 load balancer (just doing pure round-robin of received 
packets) and your stateful SIP endpoint.  A simple deterministic algorithm 
(like modulo over a hash of the called) will ensure that a CANCEL will reach 
the same stateful SIP endpoint as the INVITE.



-Original Message-
From: Alex Balashov via sr-users 
Sent: Tuesday, October 10, 2023 12:31 PM
To: Kamailio (SER) - Users Mailing List 
Cc: Alex Balashov 
Subject: [SR-Users] Re: Using DMQ to sync the TM module.

CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


But I should add: do you actually need state? All replies can be routed back 
based on the content of SIP headers alone -- that is to say, statelessly. Most 
simple load balancers remain stateless for this very reason.

> On 10 Oct 2023, at 13:09, Alex Balashov  wrote:
>
> There is not.
>
>> On 10 Oct 2023, at 12:50, Michel Pelletier via sr-users 
>>  wrote:
>>
>> Hi,
>>
>> I have 2 kamailio instances behind a load balancer.  The problem I have is 
>> that the load balancer can only track TCP connections, but not UDP.  So one 
>> Kamailio instance might send a request using UDP, while the corresponding 
>> UDP reply arrives on the other.  This doesn't play well with the (stateful) 
>> TM module.  Is there a way to synchronize the TM module accross Kamailio 
>> instances using DMQ?
>>
>> Cheers,
>>
>> Michel Pelletier
>> __
>> Kamailio - Users Mailing List - Non Commercial Discussions To
>> unsubscribe send an email to sr-users-le...@lists.kamailio.org
>> Important: keep the mailing list in the recipients, do not reply only to the 
>> sender!
>> Edit mailing list options or unsubscribe:
>
> --
> Alex Balashov
> Principal Consultant
> Evariste Systems LLC
> Web:
> https://evar/
> istesys.com%2F&data=05%7C01%7Cbkaufman%40bcmone.com%7Ce635413347124b00
> 36fc08dbc9b7857f%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C63832556
> 2303100216%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzI
> iLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=6GfRy1N%2BIYEob%
> 2FXoMnrfBnWUYQePN6SJVCRYuV6czPQ%3D&reserved=0
> Tel: +1-706-510-6800
>

--
Alex Balashov
Principal Consultant
Evariste Systems LLC
Web: https://evaristesys.com/
Tel: +1-706-510-6800

__
Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send 
an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Serial Forking with differing next hop for each branch?

2023-10-10 Thread Ben Kaufman via sr-users
Probably better to use an xavp with the ruri as the key.

-Original Message-
From: Alex Balashov via sr-users 
Sent: Tuesday, October 10, 2023 9:53 AM
To: Kamailio (SER) - Users Mailing List 
Cc: Alex Balashov 
Subject: [SR-Users] Re: Serial Forking with differing next hop for each branch?

CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


> On 10 Oct 2023, at 10:17, Barry Flanagan via sr-users 
>  wrote:
>
> On 10/10/2023 15:09, Ben Kaufman wrote:
>> Would this work:  use append_branch() in the request_route, then in your 
>> failure route:
>>
>>
>>
>> $var(temp_ru) = $ru;
>> t_next_contacts();
>> $du = $ru;
>> $ru = $var(temp_ru);
>
> Unfortunately not, because the $du next hop can be different for each branch, 
> but $ru can be the same.
>
> Gives me an idea though - perhaps when I call append_branch I can add a tag 
> to the $ru like ';nexthop=XXX.XXX.XXX.XXX:' and then extract that in my 
> failure route.

This is good if $du is the _only_ branch-specific attribute you need to change 
besides R-URI, but would be poor solution if you need support for arbitrary, 
shifting parameters. Most call routing systems eventually evolve such.

-- Alex

--
Alex Balashov
Principal Consultant
Evariste Systems LLC
Web: https://evaristesys.com/
Tel: +1-706-510-6800

__
Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send 
an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Serial Forking with differing next hop for each branch?

2023-10-10 Thread Ben Kaufman via sr-users
Would this work:  use append_branch() in the request_route, then in your 
failure route:



$var(temp_ru) = $ru;
t_next_contacts();
$du = $ru;
$ru = $var(temp_ru);



-Original Message-
From: Barry Flanagan  
Sent: Tuesday, October 10, 2023 8:24 AM
To: Ben Kaufman ; Kamailio (SER) - Users Mailing List 

Subject: Re: [SR-Users] Re: Serial Forking with differing next hop for each 
branch?

CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


On 10/10/2023 14:20, Ben Kaufman wrote:
> append_branch() will automatically sort by q value.

Yes, but I also need to specify a next hop, which append_branch does not 
support. There does not appear to be any mechanism for defining both a q-value 
and the d-uri. I can do one or the other but not both.

I think I will use KEMI and app_jsdt to sort them into the order I need.

-Barry

>
> -Original Message-
> From: Barry Flanagan via sr-users 
> Sent: Tuesday, October 10, 2023 5:15 AM
> To: sr-users 
> Cc: Barry Flanagan 
> Subject: [SR-Users] Re: Serial Forking with differing next hop for each 
> branch?
>
> CAUTION: This email originated from outside the organization. Do not click 
> links or open attachments unless you recognize the sender and know the 
> content is safe.
>
>
> On Fri, 6 Oct 2023, at 18:55, Alex Balashov via sr-users wrote:
>>> On 6 Oct 2023, at 10:39, Barry Flanagan via sr-users 
>>>  wrote:
>>>
>>> On 06/10/2023 15:23, Alex Balashov via sr-users wrote:
>>>> Hello,
>>>>
>>>> If you can't key by R-URI, perhaps then just store a list of routes in a 
>>>> database table or similar?
>>> Thanks. The routes are received via an API call, and are dynamic. Trying to 
>>> avoid the overhead of a database.
>> Ah. Then the easiest approach is probably to buffer them into an XAVP 
>> array and just iterate through them. R-URI can be one attribute of 
>> each, while the destination URI/next-hop can be another.
>>
>> $var(i) = 0;
>>
>> while(defined $xavp(route_set[$var(i)])) {
>> $ru = $xavp(route_set[$var(i)]=>ruri);
>> $du = $xavp(route_set[$var(i)]=>duri);
>>
>> $var(i) = $var(i) + 1;
>> }
> Yes, but I also need to first sort the list by weight and priority (q-value). 
> For the life of me I can't find any way to sort an array in Kamailio. Will I 
> have to use KEMI for that?
>
> Thanks
>
> -Barry
> __
> Kamailio - Users Mailing List - Non Commercial Discussions To 
> unsubscribe send an email to sr-users-le...@lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to the 
> sender!
> Edit mailing list options or unsubscribe:

--
-Barry

__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Serial Forking with differing next hop for each branch?

2023-10-10 Thread Ben Kaufman via sr-users
append_branch() will automatically sort by q value.  


-Original Message-
From: Barry Flanagan via sr-users  
Sent: Tuesday, October 10, 2023 5:15 AM
To: sr-users 
Cc: Barry Flanagan 
Subject: [SR-Users] Re: Serial Forking with differing next hop for each branch?

CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


On Fri, 6 Oct 2023, at 18:55, Alex Balashov via sr-users wrote:
>> On 6 Oct 2023, at 10:39, Barry Flanagan via sr-users 
>>  wrote:
>>
>> On 06/10/2023 15:23, Alex Balashov via sr-users wrote:
>>> Hello,
>>>
>>> If you can't key by R-URI, perhaps then just store a list of routes in a 
>>> database table or similar?
>>
>> Thanks. The routes are received via an API call, and are dynamic. Trying to 
>> avoid the overhead of a database.
>
> Ah. Then the easiest approach is probably to buffer them into an XAVP 
> array and just iterate through them. R-URI can be one attribute of 
> each, while the destination URI/next-hop can be another.
>
>$var(i) = 0;
>
>while(defined $xavp(route_set[$var(i)])) {
>$ru = $xavp(route_set[$var(i)]=>ruri);
>$du = $xavp(route_set[$var(i)]=>duri);
>
>$var(i) = $var(i) + 1;
>}

Yes, but I also need to first sort the list by weight and priority (q-value). 
For the life of me I can't find any way to sort an array in Kamailio. Will I 
have to use KEMI for that?

Thanks

-Barry
__
Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send 
an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: CANCEL first, then INVITE.

2023-10-09 Thread Ben Kaufman via sr-users
TM should be able to different between the 200 reply to the locally generated 
CANCEL and the 200 OK for the relayed INVITE.  You shouldn't have a problrm. 
Can you post your config?

Kaufman

From: James Lipski via sr-users 
Sent: Saturday, October 7, 2023 9:01:03 AM
To: Kamailio (SER) - Users Mailing List 
Cc: James Lipski 
Subject: [SR-Users] Re: CANCEL first, then INVITE.


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.



Hello,

Thanks for the reply. Would there be a way to prevent a situation where 
kamailio would receive 2 200OKs from being received (1 200OK for CSeq INVITE 
and 1 200OK for CSeq CANCEL)? As of right now, at least with my test 
configuration (using the skeleton configuration) it seems to be easily 
replicable. I'm trying to prevent a situation where "t_set_fr" and the UA's 
internal timeout fire at the same time causing 2 200OKs from sent by the UA (as 
described on my previous message).

Thank you.
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: CANCEL first, then INVITE.

2023-09-28 Thread Ben Kaufman via sr-users
Also, since a picture is worth a thousand words, it can be seen here that the 
INVITE for the new branch is sent before the CANCEL of the earlier branch.  
Again, I'm not sure why this would make any difference, but it does seem to be 
the current behavior.


[A screenshot of a computer screen  Description automatically generated]




-Original Message-
From: Ben Kaufman via sr-users 
Sent: Thursday, September 28, 2023 5:05 PM
To: Kamailio (SER) - Users Mailing List 
Cc: James Lipski ; Ben Kaufman 
Subject: [SR-Users] Re: CANCEL first, then INVITE.



CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.





I can reproduce this behavior easily with the config below, but I'm not quite 
sure how/why it matters.







request_route {

xinfo("[$ru] recieved\n");



$rd = "target2";

append_branch("sip:$rU@target1", "1.0");



t_load_contacts();

t_next_contacts();



t_on_failure("MANAGE_FAILURE");

t_on_branch("MANAGE_BRANCH");

t_set_fr(5000);

t_relay();

exit;

}



branch_route[MANAGE_BRANCH] {

xinfo("Sending [$ru]\n");

}



failure_route[MANAGE_FAILURE] {

if ( t_branch_timeout() ) {

xinfo("Branch timed out.\n");

}



if ( !t_next_contacts() ) {

send_reply("503", "Server Error");

exit;

}



t_on_failure("MANAGE_FAILURE");

t_relay();

}



-Original Message-

From: James Lipski via sr-users 
mailto:sr-users@lists.kamailio.org>>

Sent: Thursday, September 28, 2023 3:08 PM

To: Kamailio (SER) - Users Mailing List 
mailto:sr-users@lists.kamailio.org>>

Cc: James Lipski mailto:jameslip...@protonmail.com>>

Subject: [SR-Users] Re: CANCEL first, then INVITE.



CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.





Hello,



As with my previous update, I'm using the skeleton configurations (with minor 
changes, such as defining an external voicemail destination) just for testing 
purposes. With the skeleton configurations, I'm still seeing that the INVITE 
packet to the voicemail server sent first, and then the CANCEL to the second 
endpoint (please see SIP trace below). In this call example the second endpoint 
is a PBX, and is configured to route unanswered calls towards it's own local 
voicemail system. Is there a way to switch the behaviour so that the CANCEL 
packet towards endpoint 2 is sent FIRST; and then the INVITE to the voicemail 
system second? Thank you.



10.0.0.117 --- snom (endpoint 1)

10.0.0.177 --- kamailio

10.0.0.188 --- PBX (endpoint 2)

10.0.0.26 --- external voicemail system.



2023/09/28 15:41:39.122897 10.0.0.117:40274 -> 10.0.0.177:5060 INVITE 
sip:1010@10.0.0.177 SIP/2.0

v: SIP/2.0/UDP 10.0.0.117:40274;branch=z9hG4bK-30wsteb4v1cl;rport

f: ;tag=pqxa29jt8v

t: 

i: f1d61565275f-tqgd64ng8qmq

CSeq: 2 INVITE

Max-Forwards: 70

User-Agent: snomD785/10.1.159.12

m: ;reg-id=1

Accept: application/sdp

Allow: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, NOTIFY, SUBSCRIBE, PRACK, 
MESSAGE, INFO, UPDATE

Allow-Events: talk, hold, refer, call-info

Supported: timer, replaces, from-change

Session-Expires: 3600

Min-SE: 90

Proxy-Authorization: Digest 
username="1006",realm="10.0.0.177",nonce="ZRXYH2UV1vNTJ01Zmy97xZsd43iZmRNW",uri="sip:1010@10.0.0.177",response="4a1d80ae375ae8d56d7b7c602e5bbcd4

",algorithm=MD5

c: application/sdp

l: 315



v=0

o=root 1457342879 1457342879 IN IP4 10.0.0.117 s=call c=IN IP4 10.0.0.117

t=0 0

m=audio 61370 RTP/AVP 9 0 8 18 101

a=rtpmap:9 G722/8000

a=rtpmap:0 PCMU/8000

a=rtpmap:8 PCMA/8000

a=rtpmap:18 G729/8000

a=fmtp:18 annexb=no

a=rtpmap:101 telephone-event/8000

a=fmtp:101 0-15

a=ptime:20

a=sendrecv



2023/09/28 15:41:39.124438 10.0.0.177:5060 -> 10.0.0.117:40274

SIP/2.0 100 trying -- your call is important to us

v: SIP/2.0/UDP 
10.0.0.117:40274;branch=z9hG4bK-30wsteb4v1cl;rport=40274;received=10.0.0.117

f: ;tag=pqxa29jt8v

t: 

i: f1d61565275f-tqgd64ng8qmq

CSeq: 2 INVITE

Content-Length: 0





2023/09/28 15:41:39.125338 10.0.0.177:5060 -> 10.0.0.188:5678 INVITE 
sip:1010@10.0.0.188:5678;transport=udp;line=aab32389;alias=10.0.0.188~5678~1
 SIP/2.0

Record-Route: 

Via: SIP/2.0/UDP 
10.0.0.177;branch=z9hG4bK87d3.36c49e4bbd41f8c5625007842e35ce3a.0

v: SIP/2.0/UDP 
10.0.0.117:40274;received=10.0.0.117;branch=z9hG4bK-30wsteb4v1cl;rport=40274

f: ;tag=pqxa29jt8v

t: 

i: f1d61565275f-tqgd64ng8qmq

CSeq: 2 INVITE

Max-Forwards: 69

User-Agent: snomD785/10.1.159.12

m: 
;reg-id=1

Accept: application/sdp

Allow: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, NOTIFY, SUBSCRIBE, PRACK, 
M

[SR-Users] Re: CANCEL first, then INVITE.

2023-09-28 Thread Ben Kaufman via sr-users
I can reproduce this behavior easily with the config below, but I'm not quite 
sure how/why it matters.



request_route {
xinfo("[$ru] recieved\n");

$rd = "target2";
append_branch("sip:$rU@target1", "1.0");

t_load_contacts();
t_next_contacts();

t_on_failure("MANAGE_FAILURE");
t_on_branch("MANAGE_BRANCH");
t_set_fr(5000);
t_relay();
exit;
}

branch_route[MANAGE_BRANCH] {
xinfo("Sending [$ru]\n");
}

failure_route[MANAGE_FAILURE] {
if ( t_branch_timeout() ) {
xinfo("Branch timed out.\n");
}

if ( !t_next_contacts() ) {
send_reply("503", "Server Error");
exit;
}

t_on_failure("MANAGE_FAILURE");
t_relay();
}

-Original Message-
From: James Lipski via sr-users  
Sent: Thursday, September 28, 2023 3:08 PM
To: Kamailio (SER) - Users Mailing List 
Cc: James Lipski 
Subject: [SR-Users] Re: CANCEL first, then INVITE.

CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


Hello,

As with my previous update, I'm using the skeleton configurations (with minor 
changes, such as defining an external voicemail destination) just for testing 
purposes. With the skeleton configurations, I'm still seeing that the INVITE 
packet to the voicemail server sent first, and then the CANCEL to the second 
endpoint (please see SIP trace below). In this call example the second endpoint 
is a PBX, and is configured to route unanswered calls towards it's own local 
voicemail system. Is there a way to switch the behaviour so that the CANCEL 
packet towards endpoint 2 is sent FIRST; and then the INVITE to the voicemail 
system second? Thank you.

10.0.0.117 --- snom (endpoint 1)
10.0.0.177 --- kamailio
10.0.0.188 --- PBX (endpoint 2)
10.0.0.26 --- external voicemail system.

2023/09/28 15:41:39.122897 10.0.0.117:40274 -> 10.0.0.177:5060 INVITE 
sip:1010@10.0.0.177 SIP/2.0
v: SIP/2.0/UDP 10.0.0.117:40274;branch=z9hG4bK-30wsteb4v1cl;rport
f: ;tag=pqxa29jt8v
t: 
i: f1d61565275f-tqgd64ng8qmq
CSeq: 2 INVITE
Max-Forwards: 70
User-Agent: snomD785/10.1.159.12
m: ;reg-id=1
Accept: application/sdp
Allow: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, NOTIFY, SUBSCRIBE, PRACK, 
MESSAGE, INFO, UPDATE
Allow-Events: talk, hold, refer, call-info
Supported: timer, replaces, from-change
Session-Expires: 3600
Min-SE: 90
Proxy-Authorization: Digest 
username="1006",realm="10.0.0.177",nonce="ZRXYH2UV1vNTJ01Zmy97xZsd43iZmRNW",uri="sip:1010@10.0.0.177",response="4a1d80ae375ae8d56d7b7c602e5bbcd4
",algorithm=MD5
c: application/sdp
l: 315

v=0
o=root 1457342879 1457342879 IN IP4 10.0.0.117 s=call c=IN IP4 10.0.0.117
t=0 0
m=audio 61370 RTP/AVP 9 0 8 18 101
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:20
a=sendrecv

2023/09/28 15:41:39.124438 10.0.0.177:5060 -> 10.0.0.117:40274
SIP/2.0 100 trying -- your call is important to us
v: SIP/2.0/UDP 
10.0.0.117:40274;branch=z9hG4bK-30wsteb4v1cl;rport=40274;received=10.0.0.117
f: ;tag=pqxa29jt8v
t: 
i: f1d61565275f-tqgd64ng8qmq
CSeq: 2 INVITE
Content-Length: 0


2023/09/28 15:41:39.125338 10.0.0.177:5060 -> 10.0.0.188:5678 INVITE 
sip:1010@10.0.0.188:5678;transport=udp;line=aab32389;alias=10.0.0.188~5678~1
 SIP/2.0
Record-Route: 
Via: SIP/2.0/UDP 
10.0.0.177;branch=z9hG4bK87d3.36c49e4bbd41f8c5625007842e35ce3a.0
v: SIP/2.0/UDP 
10.0.0.117:40274;received=10.0.0.117;branch=z9hG4bK-30wsteb4v1cl;rport=40274
f: ;tag=pqxa29jt8v
t: 
i: f1d61565275f-tqgd64ng8qmq
CSeq: 2 INVITE
Max-Forwards: 69
User-Agent: snomD785/10.1.159.12
m: 
;reg-id=1
Accept: application/sdp
Allow: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, NOTIFY, SUBSCRIBE, PRACK, 
MESSAGE, INFO, UPDATE
Allow-Events: talk, hold, refer, call-info
Supported: timer, replaces, from-change
Session-Expires: 3600
Min-SE: 90
c: application/sdp
l: 315

v=0
o=root 1457342879 1457342879 IN IP4 10.0.0.117 s=call c=IN IP4 10.0.0.117
t=0 0
m=audio 61370 RTP/AVP 9 0 8 18 101
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:20
a=sendrecv

2023/09/28 15:41:39.126941 10.0.0.188:5678 -> 10.0.0.177:5060
SIP/2.0 100 Trying
v: SIP/2.0/UDP 10.0.0.177;branch=z9hG4bK87d3.36c49e4bbd41f8c5625007842e35ce3a.0
v: SIP/2.0/UDP 
10.0.0.117:40274;received=10.0.0.117;branch=z9hG4bK-30wsteb4v1cl;rport=40274
Record-Route: 
f: ;tag=pqxa29jt8v
t: ;tag=c3579c1a01
i: f1d61565275f-tqgd64ng8qmq
CSeq: 2 INVITE
l: 0

2023/09/28 15:41:39.171314 10.0.0.188:5678 -> 10.0.0.177:5060
SIP/2.0 183 Session Progress
v: SIP/2.0/UDP 10.0.0.177;branch=z9hG4bK87d3.36c49e4bbd41f8c5625007842e35ce3a.0
v: SIP/2.0/UDP 
10.0.0.117:40274;received=10.0.0.117;branch=z9hG4bK-30wsteb4v1cl;rport=40274
Record-Route: 
f: ;tag=pqxa29jt8v
t: ;tag=c3579c1a01
i: f1d61565275f-tqgd64ng8qmq
CSeq: 2 INVIT

[SR-Users] Re: Multi-dimensional data in htable

2023-09-22 Thread Ben Kaufman via sr-users
I was just checking to make sure that there wasn't an easy and obvious solution 
I was overlooking.

Depending on the depth of the data I can use xavp_implode() or jansson. The 
structures I'm working with should be predictable enough to do this.  I think 
the "solution to simplify serialization" long term is probably using KEMI, 
whereby the more robust scripting languages have better functionality for that 
sort of thing.


-Original Message-
From: Alex Balashov via sr-users 
Sent: Friday, September 22, 2023 12:18 PM
To: Kamailio (SER) - Users Mailing List 
Cc: Alex Balashov 
Subject: [SR-Users] Re: Multi-dimensional data in htable

CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


I have extensively invented this kind of serialisation scheme over the years, 
and it's just very tedious. Turn-key nonscalar support would be a lot easier.

> On Sep 22, 2023, at 12:16 PM, David Villasmil via sr-users 
>  wrote:
>
> Why not just use a hash and separate fields by ; ? You can then just join or 
> split as you set or get?
>
> On Fri, 22 Sep 2023 at 08:20, Ben Kaufman via sr-users 
>  wrote:
> Thank you.  I'll look into that!
>  Kaufman
> __
> Kamailio - Users Mailing List - Non Commercial Discussions To
> unsubscribe send an email to sr-users-le...@lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to the 
> sender!
> Edit mailing list options or unsubscribe:
> __
> Kamailio - Users Mailing List - Non Commercial Discussions To
> unsubscribe send an email to sr-users-le...@lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to the 
> sender!
> Edit mailing list options or unsubscribe:

--
Alex Balashov
Principal Consultant
Evariste Systems LLC
Web: https://evaristesys.com/
Tel: +1-706-510-6800

__
Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send 
an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Multi-dimensional data in htable

2023-09-22 Thread Ben Kaufman via sr-users
Thank you.  I'll look into that!

Kaufman
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Multi-dimensional data in htable

2023-09-17 Thread Ben Kaufman
What's the best way to store multi-dimensional data within an htable?  For 
example, storing an avp stack:

$avp(foo) = "first";
$avp(foo) = "second";

$sht(bar=>foo) = $avp(foo);

The result of which is that only $avp(foo[0]) is stored in the htable:

kamcmd htable.dump bar
{
entry: 2
size: 1
slot: {
{
name: bar
value: second
type: str
}
}
}



The htable documentation shows support for lists, but it doesn't make clear if 
this is really usable outside of loading from a database, and looks like it's 
short hand for managing/creating linked lists.  The other option would be to 
simply serialize the data before storing it in the htable - which is fine, I 
just want to be sure I'm not overlooking a more convenient method.

Regards,
Kaufman


__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: load_module(): could not find module in

2023-09-08 Thread Ben Kaufman
More specifically, it's the entire mi_* interface.  Use the rpc interfaces 
instead.  Refer to the 4.4 to 5.0 upgrade guide


https://www.kamailio.org/wiki/install/upgrade/4.4.x-to-5.0.0



-Original Message-
From: Ben Kaufman 
Sent: Friday, September 8, 2023 3:18 PM
To: Kamailio (SER) - Users Mailing List 
Subject: RE: [SR-Users] load_module(): could not find module  in 


The fifo module was deprecated in 5.0

-Original Message-
From: a...@cosmicinfotech.com  
Sent: Friday, September 8, 2023 5:07 AM
To: sr-users@lists.kamailio.org
Subject: [SR-Users] load_module(): could not find module  in 


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


using kamailio 5.3.9

[244@root ~]$ kamailio -f /etc/kamailio/kamailio.cfg -E loading modules under 
config path: /usr/lib64/kamailio/modules/
 0(1071336) ERROR:  [core/sr_module.c:500]: load_module(): could not find 
module  in 
 0(1071336) CRITICAL:  [core/cfg.y:3543]: yyerror_at(): parse error in 
config file /etc/kamailio/kamailio.cfg, line 294, column 12-23: failed to load 
module
 0(1071336) ERROR:  [core/modparam.c:176]: set_mod_param_regex(): No 
module matching  found
 0(1071336) CRITICAL:  [core/cfg.y:3546]: yyerror_at(): parse error in 
config file /etc/kamailio/kamailio.cfg, line 582, column 63: Can't set module 
parameter
ERROR: bad config file (2 errors)
 0(1071336) INFO:  [core/sctp_core.c:53]: sctp_core_destroy(): SCTP API 
not initialized

please help!
__
Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send 
an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: load_module(): could not find module in

2023-09-08 Thread Ben Kaufman
The fifo module was deprecated in 5.0

-Original Message-
From: a...@cosmicinfotech.com  
Sent: Friday, September 8, 2023 5:07 AM
To: sr-users@lists.kamailio.org
Subject: [SR-Users] load_module(): could not find module  in 


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


using kamailio 5.3.9

[244@root ~]$ kamailio -f /etc/kamailio/kamailio.cfg -E loading modules under 
config path: /usr/lib64/kamailio/modules/
 0(1071336) ERROR:  [core/sr_module.c:500]: load_module(): could not find 
module  in 
 0(1071336) CRITICAL:  [core/cfg.y:3543]: yyerror_at(): parse error in 
config file /etc/kamailio/kamailio.cfg, line 294, column 12-23: failed to load 
module
 0(1071336) ERROR:  [core/modparam.c:176]: set_mod_param_regex(): No 
module matching  found
 0(1071336) CRITICAL:  [core/cfg.y:3546]: yyerror_at(): parse error in 
config file /etc/kamailio/kamailio.cfg, line 582, column 63: Can't set module 
parameter
ERROR: bad config file (2 errors)
 0(1071336) INFO:  [core/sctp_core.c:53]: sctp_core_destroy(): SCTP API 
not initialized

please help!
__
Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send 
an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: use_dns_failover default value

2023-08-23 Thread Ben Kaufman
I'd argue that even *IF* name resolution became increasingly common, that 
changing defaults would tend to break existing configs and is not something 
that should be done lightly.  In this case, general practice is to handle the 
failure in the script logic on branch failure, and so the feature is disabled.  
 If it was decided that the default were to be changed in 5.8, how many 
deployments would break as a result of this?

If this was a greenfield new piece of software, I think that having DNS 
failover enabled by default might not be a bad decision.  But this isn't 
net-new software.  It's something that has existing expectations.

-Original Message-
From: Olle E. Johansson 
Sent: Wednesday, August 23, 2023 1:54 AM
To: Kamailio (SER) - Users Mailing List 
Cc: Silvan Nagl 
Subject: [SR-Users] Re: use_dns_failover default value

CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


I agree with Daniel here. Within the platforms we rarely use DNS as most 
systems are fixed (not moving around, have a permanent IP address) and we 
handle failover and load balancing using solutions like the Kamailio dispatcher.

>From the client side, like softphones or desktop phones, I personally use a 
>lot of DNS to find the first hop SIP server. This way I can manage the 
>clients, control load balancing, provider failover and make sure they always 
>reach the service.

Cheers,
/O

> On 22 Aug 2023, at 21:14, Daniel-Constantin Mierla  wrote:
>
> Hello,
>
> DNS-based routing is not very common in telecommunications, most of
> the interconnects being done based on IP routing and IP-trusted rules.
> Because DNS is usually a blocking operation that involves network
> communication (therefore can introduce delays), many of the dns
> features are turned off by default. When one has to build a system
> that relies significantly on DNS-based routing, those features can be
> turned on via config.
>
> Cheers,
> Daniel
>
> On 22.08.23 17:07, Silvan Nagl wrote:
>> Hi,
>>
>> I would like to know the reason for having "off" as default value for
>> use_dns_failover.
>> https://git/
>> hub.com%2Fkamailio%2Fkamailio%2Fissues%2F3547&data=05%7C01%7Cbkaufman
>> %40bcmone.com%7C5cd1830270534a45fd9708dba3a7652d%7Cafc1818e7b68485689
>> 13201b9396c4fc%7C1%7C0%7C638283711594119946%7CUnknown%7CTWFpbGZsb3d8e
>> yJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3
>> 000%7C%7C%7C&sdata=4GaP2jVvIMMFXi1f5nWMRt3KF6F723rPZUbNuDzyU%2Bw%3D&r
>> eserved=0
>>
>> Greetings,
>> Silvan
>>
> --
> Daniel-Constantin Mierla --
> http://www.a/
> sipto.com%2F&data=05%7C01%7Cbkaufman%40bcmone.com%7C5cd1830270534a45fd
> 9708dba3a7652d%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C6382837115
> 94119946%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiL
> CJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=8fi7fgZqNKMbb67Vm7
> X0TlI1B5BGk8QzS5kiiE3WvPw%3D&reserved=0
> http://www.t/
> witter.com%2Fmiconda&data=05%7C01%7Cbkaufman%40bcmone.com%7C5cd1830270
> 534a45fd9708dba3a7652d%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C63
> 8283711594119946%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV
> 2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=5g6rGiCfkG
> Yrd7l5XnJdjqNbzL27pnax3WdoSksHThU%3D&reserved=0 --
> http://www.l/
> inkedin.com%2Fin%2Fmiconda&data=05%7C01%7Cbkaufman%40bcmone.com%7C5cd1
> 830270534a45fd9708dba3a7652d%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C
> 0%7C638283711594119946%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJ
> QIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=8tVs
> EpkONunTFeq1KJdn4FPCXWUhm2vEpIsOmAuEMSU%3D&reserved=0
> Kamailio World Conference -
> http://www.k/
> amailioworld.com%2F&data=05%7C01%7Cbkaufman%40bcmone.com%7C5cd18302705
> 34a45fd9708dba3a7652d%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C638
> 283711594119946%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2
> luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=PjA3NmvxI9E
> 7l88a7nux21mHdnRs0ajPDxUTShKrvds%3D&reserved=0
>
> __
> Kamailio - Users Mailing List - Non Commercial Discussions To
> unsubscribe send an email to sr-users-le...@lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to the 
> sender!
> Edit mailing list options or unsubscribe:

__
Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send 
an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not

[SR-Users] Re: change A number using a pool of numbers

2023-08-03 Thread Kaufman
Certainly app_lua (or any scripting language plugin, or KEMI, or system call) 
can do this, but that quickly falls out of scope of "Kamailio doing it" and 
into having an external program do it.  Most modules that would have 
functionality that requires "look up criteria based on a value" rely on a 
database. The specific request (grab a random entry based on criteria) is a 
combination of easily achieved with an order by some type of DB and not a 
common enough scenario for someone to have build a dediated module.

As far as speed goes, I'm not really sure what you could make that would be 
faster than pulling a random member out of redis.

Kaufman


From: Ali Taher 
Sent: Thursday, August 3, 2023 1:32 AM
To: Kamailio (SER) - Users Mailing List 
Subject: [SR-Users] Re: change A number using a pool of numbers


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Thanks Kaufman,

Relying on DB is of course one way to do it, but I thought that there are some 
modules that could be used and are faster, like app_lua but I'm not sure if it 
can be used to select a number randomly from a pool saved in a file.

Regards,


From: Kaufman mailto:bkauf...@bcmone.com>>
Sent: Wednesday, August 2, 2023 7:36 PM
To: Kamailio (SER) - Users Mailing List 
mailto:sr-users@lists.kamailio.org>>
Subject: [SR-Users] Re: change A number using a pool of numbers

There's functionally two parts to this question:


  1.  How to change a number
  2.  How to select a random number

For selection of the number it's probably easiest to rely on DB lookup. With 
one column as the original number and another column as the possible 
replacement numbers, then just select with an order by random to get the 
replacement number.

As far as changing the number, it can depend on specifically what number you're 
trying to change.  The RURI can be changed just by setting $rU.  Values in the 
To: or From: headers should be changed with the functions from the UAC module 
so that replies can have the original values restored.  For other miscellaneous 
headers like P-Asserted-Identity, just remove the old header and append a new 
one.

Regards,
Kaufman


From: Ali Taher mailto:ata...@vanrise.com>>
Sent: Wednesday, August 2, 2023 1:20 AM
To: Kamailio (SER) - Users Mailing List 
mailto:sr-users@lists.kamailio.org>>
Subject: [SR-Users] change A number using a pool of numbers


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Hello,

I'm looking to change the A number (from number) to a number selected randomly 
from a pool of existing numbers (hundreds) and then relay the call to a certain 
gateway.

What is the best and more efficient way to do it in kamailio?

Thanks in advance
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: change A number using a pool of numbers

2023-08-02 Thread Kaufman
There's functionally two parts to this question:


  1.  How to change a number
  2.  How to select a random number

For selection of the number it's probably easiest to rely on DB lookup. With 
one column as the original number and another column as the possible 
replacement numbers, then just select with an order by random to get the 
replacement number.

As far as changing the number, it can depend on specifically what number you're 
trying to change.  The RURI can be changed just by setting $rU.  Values in the 
To: or From: headers should be changed with the functions from the UAC module 
so that replies can have the original values restored.  For other miscellaneous 
headers like P-Asserted-Identity, just remove the old header and append a new 
one.

Regards,
Kaufman


From: Ali Taher 
Sent: Wednesday, August 2, 2023 1:20 AM
To: Kamailio (SER) - Users Mailing List 
Subject: [SR-Users] change A number using a pool of numbers


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Hello,

I'm looking to change the A number (from number) to a number selected randomly 
from a pool of existing numbers (hundreds) and then relay the call to a certain 
gateway.

What is the best and more efficient way to do it in kamailio?

Thanks in advance
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Saving credentials in yaml/txt format

2023-07-31 Thread Kaufman
Without getting too pendantic, isn't saving this data into a "yaml/txt" file 
just changing where it's hard coded?

Generally, Kamailio will store information like this in a database.  Someone 
pointed you to the db_text module, but I'd recommend db_sqlite although for the 
purpose of your question, this is a rather moot distinction.  If you're looking 
to omit any possibly confidential information from being hard coded in your 
"main" config file to avoid having credentials, etc. stored in git, etc., I'd 
recommend using the `import_file` option and gitignoring your "confidential" 
files.

With that said there's no current yaml module.  There are modules for working 
with json, but I don't think any of them have "load serizlized data from a 
file" options.

-Original Message-
From: m...@telemessage.com  
Sent: Sunday, July 30, 2023 2:06 AM
To: sr-users@lists.kamailio.org
Subject: [SR-Users] Saving credentials in yaml/txt format

CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


Hello all, I want to save some credentials for different users I have that are 
being used in a digest authorization (INVITE), with different realms (I don't 
want the credentials to be hardcoded).
I tried to look at how can I read into my kamalio.cfg from yaml/txt file, but 
haven't found the right module for this.

Thanks in advance,
Max
__
Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send 
an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: event_route[tm:local-response] only executes a few times

2023-07-07 Thread Kaufman
Following up here.  Shouldn't event_route[tm:local-response] be executed for 
every locally generated request, not just the first few after Kamailio start?

Kaufman

From: Kaufman 
Sent: Wednesday, July 5, 2023 11:14 AM
To: Kamailio (SER) - Users Mailing List 
Subject: [SR-Users] event_route[tm:local-response] only executes a few times


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Hello,

I'm writing a 302 redirect server and wanting to capture some events on all 
replies, so I'm trying to do this in event_route[tm:local-response], but I 
noticed that the event route is only called a few times for the first few 
requests, and then never gets executed again.  This is the simplest case in 
which I can reproduce the issue:

#!KAMAILIO

loadmodule "pv"
loadmodule "tm"
loadmodule "xlog"

route {
xinfo("[$rm $ci-$cs] Src:[$si:$sp] RURI:[$ru] To:[$tu] From:[$fu]\n");

t_send_reply("404", "Not Found");
exit;
}

event_route[tm:local-response] {
xcrit("[$rm $ci-$cs] tm:local-response replied locally\n");
}
If I start Kamailio with kamailio -ddDDeE it has 8 children.  If I use sipp to 
send 10 requests, this is what I see in the kamailio logs. The critical line in 
the event route is only printed four times.  This is tested on 5.7.0 and 5.6.4

9(66) INFO: 

[SR-Users] event_route[tm:local-response] only executes a few times

2023-07-05 Thread Kaufman
Hello,

I'm writing a 302 redirect server and wanting to capture some events on all 
replies, so I'm trying to do this in event_route[tm:local-response], but I 
noticed that the event route is only called a few times for the first few 
requests, and then never gets executed again.  This is the simplest case in 
which I can reproduce the issue:

#!KAMAILIO

loadmodule "pv"
loadmodule "tm"
loadmodule "xlog"

route {
xinfo("[$rm $ci-$cs] Src:[$si:$sp] RURI:[$ru] To:[$tu] From:[$fu]\n");

t_send_reply("404", "Not Found");
exit;
}

event_route[tm:local-response] {
xcrit("[$rm $ci-$cs] tm:local-response replied locally\n");
}

If I start Kamailio with kamailio -ddDDeE it has 8 children.  If I use sipp to 
send 10 requests, this is what I see in the kamailio logs. The critical line in 
the event route is only printed four times.  This is tested on 5.7.0 and 5.6.4


9(66) INFO: 

[SR-Users] Re: SL absorbed ACK is counted as dropped by core.drop_requests

2023-07-04 Thread Kaufman
Daniel,

Thank you. That answers the question.  Knowing this, I can just get the 
difference between the dropped and absorbed counter and go with that to get the 
number of "dropped, but not dropped by SL ACK handling" count.

Kaufman
Sr. VoIP Engineer - BCM One

+1.612.735.9309
bkauf...@bcmone.com<mailto:bkauf...@bcmone.com>
24 hour client support: +1.855.639.6300

From: Daniel-Constantin Mierla 
Sent: Monday, July 3, 2023 9:24 AM
To: Kamailio (SER) - Users Mailing List ; Kaufman 

Subject: Re: [SR-Users] Re: SL absorbed ACK is counted as dropped by 
core.drop_requests


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Hello,

this is a design limitation of the internal callbacks for pre-config 
processing, where "selected" modules can get the request before config is 
executed and they can return back if the processing of the request should 
continue or not. This mechanism is used by sl module to detect the ACKs and in 
such cases it returns "do not process the request further" and the core stats 
count it as dropped request.

I expect that this behaviour is there more or less from the beginning of 
core:drop_requests, but I also get the point of view that is not really the 
case of dropping the request because of error, it is just processing as it is 
supposed to be.

Now, as with every "un/expected" behaviour that is there for very very long 
time, it is the question about what people consider to be the right way to move 
on: keep it as it is (eventually with better docs about it) because it is what 
people got use to (and expect to have) or simply change it ... plus the variant 
to make a param to control it  :-) ...

Cheers,
Daniel

On 03.07.23 15:51, Kaufman wrote:
Just following up on this;  Should an ACK absorbed by the SL module get counted 
as a dropped request?

Kaufman

From: Kaufman <mailto:bkauf...@bcmone.com>
Sent: Tuesday, June 27, 2023 6:52 PM
To: Kamailio (SER) - Users Mailing List 
<mailto:sr-users@lists.kamailio.org>
Subject: [SR-Users] SL absorbed ACK is counted as dropped by core.drop_requests


Just checking to see if this is the designed behavior.  The SL module will 
attempt to match ACKs for stateless replies and handle them (absorb them?).

The question I have is that it looks as though this ACK gets counted as dropped 
by the core.drop_requests from the KEX module.   Tested using this config:

#!KAMAILIO

loadmodule "pv"
loadmodule "sl"
loadmodule "xlog"
loadmodule "kex"
loadmodule "corex"
loadmodule "ctl"

modparam("sl", "bind_tm", 0)

route {
xinfo("[$ci] $rm Request. Src:[$si:$sp] RURI:[$ru] To:[$tu] From:[$fu]\n");
sl_send_reply("404", "Not Found");
}

event_route[sl:filtered-ack] {
xnotice("sl:filtered-ack ACK [$ci] to local reply absorbed\n");
}

Then validate by kamcmd stats.fetch core:drop_requests

Is this the designed and "correct" behavior?

Kaufman




__

Kamailio - Users Mailing List - Non Commercial Discussions

To unsubscribe send an email to 
sr-users-le...@lists.kamailio.org<mailto:sr-users-le...@lists.kamailio.org>

Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Edit mailing list options or unsubscribe:



--

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

www.twitter.com/miconda<http://www.twitter.com/miconda> -- 
www.linkedin.com/in/miconda<http://www.linkedin.com/in/miconda>

Kamailio World Conference - www.kamailioworld.com<http://www.kamailioworld.com/>
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: SL absorbed ACK is counted as dropped by core.drop_requests

2023-07-03 Thread Kaufman
Just following up on this;  Should an ACK absorbed by the SL module get counted 
as a dropped request?

Kaufman

From: Kaufman 
Sent: Tuesday, June 27, 2023 6:52 PM
To: Kamailio (SER) - Users Mailing List 
Subject: [SR-Users] SL absorbed ACK is counted as dropped by core.drop_requests


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Just checking to see if this is the designed behavior.  The SL module will 
attempt to match ACKs for stateless replies and handle them (absorb them?).

The question I have is that it looks as though this ACK gets counted as dropped 
by the core.drop_requests from the KEX module.   Tested using this config:

#!KAMAILIO

loadmodule "pv"
loadmodule "sl"
loadmodule "xlog"
loadmodule "kex"
loadmodule "corex"
loadmodule "ctl"

modparam("sl", "bind_tm", 0)

route {
xinfo("[$ci] $rm Request. Src:[$si:$sp] RURI:[$ru] To:[$tu] From:[$fu]\n");
sl_send_reply("404", "Not Found");
}

event_route[sl:filtered-ack] {
xnotice("sl:filtered-ack ACK [$ci] to local reply absorbed\n");
}

Then validate by kamcmd stats.fetch core:drop_requests

Is this the designed and "correct" behavior?

Kaufman

__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] SL absorbed ACK is counted as dropped by core.drop_requests

2023-06-27 Thread Kaufman
Just checking to see if this is the designed behavior.  The SL module will 
attempt to match ACKs for stateless replies and handle them (absorb them?).

The question I have is that it looks as though this ACK gets counted as dropped 
by the core.drop_requests from the KEX module.   Tested using this config:

#!KAMAILIO

loadmodule "pv"
loadmodule "sl"
loadmodule "xlog"
loadmodule "kex"
loadmodule "corex"
loadmodule "ctl"

modparam("sl", "bind_tm", 0)

route {
xinfo("[$ci] $rm Request. Src:[$si:$sp] RURI:[$ru] To:[$tu] From:[$fu]\n");
sl_send_reply("404", "Not Found");
}

event_route[sl:filtered-ack] {
xnotice("sl:filtered-ack ACK [$ci] to local reply absorbed\n");
}

Then validate by kamcmd stats.fetch core:drop_requests

Is this the designed and "correct" behavior?

Kaufman

__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Kamailio - could not allocate private memory from pkg pool

2023-06-06 Thread Kaufman
While it's not "official" my recollection is that `make uninstall` will provide 
a list of the files to be removed to uninstall kamailio.  I've done this and 
validated what I want to keep/delete to make a simple 'uninstall' shell script 
(i.e. I'd want to keep my config files in /etc/kamailio).

You should be able to git pull the desired branch/tag into your working 
directory, run `make distclean`, rerun `./configure` with whatever parameters 
you want, and `make` all without any impact to the running software at all. The 
bulk of the compilation time is running `make`,  so there's no reason this 
can't be done ahead of time.

I have, at various times, run the uninstall script and `make install` before 
restarting kamailio and had success, but I would guess the "correct" way to do 
this is to stop kamailio, run the uninstall script, run `make install`, then 
start Kamailio.

You might also consider building packages from source depending if there's 
supporting code for your distribution.  While this is slightly more work, it 
does leave you with a simpler installation pattern.


- Kaufman

-Original Message-
From: Muhammad Danish Moosa  
Sent: Tuesday, June 6, 2023 7:26 AM
To: Henning Westerholt 
Cc: Kamailio (SER) - Users Mailing List 
Subject: [SR-Users] Re: Kamailio - could not allocate private memory from pkg 
pool

CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


Hi Henning,

All good,I will re-examine the changes. There were positive changes after that. 
Before that , I had to restart kamailio around every week,

Quick question, is there any cleaner procedure  to upgrade from 5.5.3 to 5.5.6. 
I have compiled from sources. Please understand these are production systems 
and should be done with 0 or minimal outage.

Danish



On Tue, Jun 6, 2023 at 10:14 PM Henning Westerholt  wrote:
>
> Hello Muhammad,
>
> maybe its related to the changes you've done, maybe its some load increase or 
> similar, but hard to say from the outside.
>
> As said, maybe try the minor update first, and then if its persists, lets go 
> the memory debugging route.
>
> Cheers,
>
> Henning
>
> --
> Henning Westerholt – 
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fskal
> atan.de%2Fblog%2F&data=05%7C01%7Cbkaufman%40bcmone.com%7C1c9af403b8b14
> 266a53608db668a59c4%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C63821
> 6516674656903%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2lu
> MzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=irgb9nc1zWh0X
> Ssq5JuKlApvUZBlT5nvwpzYKwjHFOg%3D&reserved=0
> Kamailio services – 
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgila
> wa.com%2F&data=05%7C01%7Cbkaufman%40bcmone.com%7C1c9af403b8b14266a5360
> 8db668a59c4%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C6382165166746
> 56903%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJB
> TiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=KhlWLRiIZwEAb2JvgfUaS
> gX7kk5WKTWUAfJGiE%2BhLGo%3D&reserved=0
>
> > -Original Message-
> > From: Muhammad Danish Moosa 
> > Sent: Dienstag, 6. Juni 2023 13:58
> > To: Henning Westerholt 
> > Cc: Kamailio (SER) - Users Mailing List 
> > 
> > Subject: Re: [SR-Users] Re: Kamailio - could not allocate private 
> > memory from pkg pool
> >
> > Thanks for the response. I really appreciate it.
> >
> > This system was tested thoroughly in the lab but problems only 
> > appeared in production. Actually it was working smoothly for 3 
> > months after I fixed some issues like external system calls etc  and this 
> > appeared all of sudden.
> >
> >
> >
> >
> >
> > On Tue, Jun 6, 2023 at 9:40 PM Henning Westerholt  wrote:
> > >
> > > Hello,
> > >
> > > first step should be probably to update to the latest version of 
> > > the 5.5.x branch,
> > e.g., 5.5.6. There have been several fixes, some also related to 
> > memory leaks included if I remember correctly.
> > >
> > > If the problem persists, it might be a new memory leak. This can 
> > > be found by
> > enabling memory debugging, preferable on a test system or lab system.
> > > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2F
> > > www.kamailio.org%2Fwiki%2Ftutorials%2Ftroubleshooting%2Fmemory&dat
> > > a=05%7C01%7Cbkaufman%40bcmone.com%7C1c9af403b8b14266a53608db668a59
> > > c4%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C638216516674656903
> > > %7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBT
> > &

[SR-Users] Missing transformations for {val.*}?

2023-06-02 Thread Kaufman
Beginning in 5.6 new {val.*} transformations are documented as being exported 
by the pv module, however if I try using it Kamailio fails to start.  Wondering 
if maybe it's actually imported by another module and the documentation is 
wrong or something like that?

This configuration in 5.6.3 on Alpine Linux installed from packages:

#!KAMAILIO

loadmodule "pv"
loadmodule "xlog"

request_route {
xlog("Null val: $(avp(nothing){val.ne})\n");
exit;
}


Fails to start with the following:

0(114) INFO:  [main.c:3055]: main(): processes (at least): 29 - shm size: 
67108864 - pkg size: 8388608
0(114) ERROR:  [core/pvapi.c:1774]: tr_lookup(): unknown transformation: 
[val] in [{val.ne}]
0(114) ERROR:  [core/pvapi.c:1799]: tr_lookup(): error parsing [{val.ne}]
0(114) ERROR:  [core/pvapi.c:1106]: pv_parse_spec2(): bad tr in pvar name 
"avp"
0(114) ERROR:  [core/pvapi.c:1131]: pv_parse_spec2(): invalid parsing in 
[$(avp(nothing){val.ne})] at (4)
0(114) ERROR: xlog [xlog.c:551]: xdbg_fixup_helper(): wrong format[Null val: 
$(avp(nothing){val.ne})]
0(114) ERROR:  [core/route.c:1169]: fix_actions(): fixing failed 
(code=-1) at cfg:/etc/kamailio/kamailio.cfg:7



Kaufman
Sr. VoIP Engineer - BCM One

+1.612.735.9309
bkauf...@bcmone.com<mailto:bkauf...@bcmone.com>
24 hour client support: +1.855.639.6300

[https://www.bcmone.com/files/bcmone-logo.png]<https://www.bcmone.com/>   
[https://www.bcmone.com/files/twitter-icon-circle.png] 
<https://www.facebook.com/bcmonenyc/>   
[https://www.bcmone.com/files/twitter-icon-circle.png] 
<https://twitter.com/bcm_one/>   
[https://www.bcmone.com/files/linkedin-icon-circle.png] 
<https://www.linkedin.com/company/business-communications-management/>

NOTE: This e-mail and any attachments are from BCM One, Inc. and are intended
solely for the use and review of the individual(s) to whom it is addressed.
If you believe you received this e-mail in error, please notify the sender
immediately, delete the e-mail (and any attachments) from your computer and do
not copy or disclose it to anyone else.

__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Docker repository removed

2023-04-14 Thread Kaufman
Was Alpine ever used for the official images?

Given the modular nature of Kamailio it's probably difficult even deciding 
which modules to put into an "official" image as it is without making the image 
bloated. For example, the dependencies for DB modules are relatively large, and 
it's uncommon to need multiple DB types.

Generally speaking there are published alpine packages for Kamailio, and as of 
right now, pulling `alpine:latest` the package version is 5.6.3 - only one 
minor version behind the current release - not to bad!

As a matter of personal usage, I do create my own alpine packages in a scratch 
container.  I then bind-mount this when building my runtime container, which 
will result in a hopefully as small as possible container with whichever 
packages I choose. If you'd like to use my packages, feel free, as they're on 
Docker Hub, along with a simple example.  A side note, for dependency reasons 
it's challenging to build some modules for alpine.  If anyone knows how to 
build and package secsipid for alpine, I'd love to know! :)

https://hub.docker.com/repository/docker/whosgonna/kamailio-apks/general

Kaufman


From: Manel Villar 
Sent: Friday, April 14, 2023 4:06 AM
To: mico...@gmail.com
Cc: Kamailio (SER) - Users Mailing List 
Subject: [SR-Users] Re: Docker repository removed


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Thanks a lot for your answer.

I see that that registry is used for the Debian based images. Do you know if 
there's any reason why Alpine images are not used anymore?

Regards,
  Manel

O xov., 13 de abr. de 2023 ás 15:57, Daniel-Constantin Mierla 
(mailto:mico...@gmail.com>>) escribiu:

Hello,

not much using docker myself, so I don't have the full context, but because 
recently there was some controversy with the docker hub free service for open 
source service (iirc, they announced the free services is going to an end), 
some of the developers were looking for alternatives and I think Victor Seva 
started to work on that.

Because of Catholic/Protestant and Orthodox Easters, many people are in 
vacation during this frame time, so it may take a bit to get all done and 
publish news about.

I noticed the work being done on the repo:

  - https://github.com/kamailio/kamailio-docker

With packages being published via that repo at:

  - https://github.com/kamailio/kamailio-docker/pkgs/container/kamailio/versions

Cheers,
Daniel
On 12.04.23 16:21, Manel Villar wrote:
Hi,

I was using the kamailio/kamailio docker repository in one of my projects, and 
now the image is not available as the repo has been removed. Is the 
"kamailio-ci" repo a replacement for it?

Thanks!

--
Manel Villar
Steegerstr. 59
13359 Berlin
Germany
Tel: (+49) (0)162 6574604
skype: manel.villar
mane...@gmail.com<mailto:mane...@gmail.com>
"Ars longa, vita brevis"



__

Kamailio - Users Mailing List - Non Commercial Discussions

To unsubscribe send an email to 
sr-users-le...@lists.kamailio.org<mailto:sr-users-le...@lists.kamailio.org>

Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Edit mailing list options or unsubscribe:

--

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

www.twitter.com/miconda<http://www.twitter.com/miconda> -- 
www.linkedin.com/in/miconda<http://www.linkedin.com/in/miconda>

Kamailio World Conference - June 5-7, 2023 - 
www.kamailioworld.com<http://www.kamailioworld.com/>


--
Manel Villar
Steegerstr. 59
13359 Berlin
Germany
Tel: (+49) (0)162 6574604
skype: manel.villar
mane...@gmail.com<mailto:mane...@gmail.com>
"Ars longa, vita brevis"
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: CLI & destination based LCR

2023-04-13 Thread Kaufman
SQLOPS would work.  The difficulty is in writing your rules in your query.  
Implementing the query and getting results in Kamailio is trivial if that's 
done.  If your rules are strictly based on matching prefixes (which is pretty 
common in telephony) and you're using postgres, the prefix opclass is pretty 
helpful in making the queries more efficient:

https://github.com/dimitri/prefix


Kaufman

From: John Cahill 
Sent: Thursday, April 13, 2023 4:57 AM
To: sr-users@lists.kamailio.org
Subject: [SR-Users] CLI & destination based LCR


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Hi,

I'd like to build an LCR solution that routes on both CLI & destination e.g.

CLI matches ^\+49*, destinations matches ^\+44* => route to gateway 5

for a large rule set (~ tens of thousands). Any recommendations for which 
modules to use? Can kamailio perform this particular task well or should I look 
at another solution? I'd be very grateful to hear about any experience of doing 
this. Many Thanks.

Regards,
John
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Three year old issue with a new CVE vulnerability report being reported

2023-03-28 Thread Kaufman
Sorry - for clarification, this issue is or is not fixed in Kamailio v5.6.4?


> The latest stable branch is 5.6, with v5.6.4 released out of it.


Kaufman



-Original Message-
From: Olle E. Johansson  
Sent: Tuesday, March 28, 2023 9:47 AM
To: sr-users@lists.kamailio.org
Subject: [SR-Users] Three year old issue with a new CVE vulnerability report 
being reported

CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


Hi Kamailians!

A new CVE with a critical severity level was published recently for an almost 
three year old bug, which was also fixed and released three years ago 
(CVE-2020-27507).

The issue was fixed in Kamailio 5.4.2 and is not present in newer releases.

The Kamailio project has unfortunately not been involved in the CVE process or 
been informed about this old issue being published at this time.

We take vulnerability handling seriously and our process is documented at:
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.kamailio.org%2Fwikidocs%2Fsecurity%2Fpolicy%2F&data=05%7C01%7Cbkaufman%40bcmone.com%7C125de78e21734f4c7b6f08db2f9c2a50%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C638156120016691188%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=31Lfy%2BGx4CJCxBlhMsjHbuXDuUNhkPikwgMMMukR0Cs%3D&reserved=0

The latest stable branch is 5.6, with v5.6.4 released out of it.

Reference:

https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcve.mitre.org%2Fcgi-bin%2Fcvename.cgi%3Fname%3D2020-27507&data=05%7C01%7Cbkaufman%40bcmone.com%7C125de78e21734f4c7b6f08db2f9c2a50%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C638156120016691188%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=VqjYleZzphNmTFlEdvLbKR%2B%2BZDiTFnJOtG%2FrSz0N94A%3D&reserved=0

Best regards and thanks for flying Kamailio!

The Kamailio dev team

through
/Olle
__
Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send 
an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: DB_CLUSTER failure with carrierroute (and others?)

2023-02-08 Thread Kaufman
In this case, though the underlying connection supports it - if I use a 
db_sqlite connection directly, it works.  It fails when abstracted by 
db_cluster.

As Henning said, I'll try to the debug logging from it as well (and compare it 
to using sqlite directly).

Kaufman
Sr. VoIP Engineer - BCM One

+1.612.735.9309
bkauf...@bcmone.com<mailto:bkauf...@bcmone.com>
24 hour client support: +1.855.639.6300

From: Carsten Bock 
Sent: Wednesday, February 8, 2023 12:36 PM
To: Kamailio (SER) - Users Mailing List 
Subject: [SR-Users] Re: DB_CLUSTER failure with carrierroute (and others?)

Hi,

It could also be the case, that carrierroute uses Rawquery, which is not 
supported by all database modules. However, when using db_cluster, the 
db_cluster module claims to support "any" DB operation, even though the 
underlying db-module may not support all DB operations.

Thanks,
Carsten

Henning Westerholt mailto:h...@gilawa.com>> schrieb am Mi., 8. 
Feb. 2023, 19:07:
Hello,

if you can not reproduce it with db_mysql, it might be indeed some issue 
specific related to sqlite. Executing the tests with debug log level should 
give you more information about the internal database operations, in case you 
like to look more into it.

Cheers,

Henning

--
Henning Westerholt - 
https://skalatan.de/blog/<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fskalatan.de%2Fblog%2F&data=05%7C01%7Cbkaufman%40bcmone.com%7Cd16fe577dc8949bfc62208db0a043786%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C638114785467715544%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=auuj2qIgpXe1FsPCH9QJrvgJdT3tgCg9bed81MYll0E%3D&reserved=0>
Kamailio services - 
https://gilawa.com<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgilawa.com%2F&data=05%7C01%7Cbkaufman%40bcmone.com%7Cd16fe577dc8949bfc62208db0a043786%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C638114785467715544%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=7GW9mZ3TjCmc333xZj5GWqODjEWqTQPcxkbwGGu6j%2Fc%3D&reserved=0>

From: Kaufman mailto:bkauf...@bcmone.com>>
Sent: Wednesday, February 8, 2023 6:04 PM
To: Kamailio (SER) - Users Mailing List 
mailto:sr-users@lists.kamailio.org>>
Subject: [SR-Users] Re: DB_CLUSTER failure with carrierroute (and others?)

I cannot reproduce this issue against mysql, so perhaps it is just something 
related to abstraction and concurrent access with sqlite.

Kaufman

From: Kaufman mailto:bkauf...@bcmone.com>>
Sent: Wednesday, February 8, 2023 10:48 AM
To: Kamailio (SER) - Users Mailing List 
mailto:sr-users@lists.kamailio.org>>
Subject: [SR-Users] DB_CLUSTER failure with carrierroute (and others?)

All,

I've been trying to chase down an issue with db_cluster and permissions in 
combination with something else, where with my full configuration using the 
same cluster in multiple modules has failures.  I've been trying to create a 
simplified configuration to consistently reproduce the problem without much 
success, however I did stumble upon THIS particular problem.  The configuration 
here works fine as is - avpops uses the cluster URL, and carrierroute uses the 
direct SQLite URL.  If I define WITH_DBCLUSTER, then carrierroute fails 
fetching rows using the cluster connection.  Note that AVPOPS is only used as a 
general test to see if the cluster config works. If I remove references to 
avpops , carrierroute still fails loading from the cluster URL.   Thoughts?




#!KAMAILIO

loadmodule "db_sqlite"
loadmodule "pv"
loadmodule "db_cluster"
loadmodule "carrierroute"
loadmodule "avpops"

modparam("db_cluster", "connection", "db1=>sqlite:etc/db.sqlite")
modparam("db_cluster", "cluster", "cl1=>db1=9s9s")
modparam("db_cluster", "inactive_interval", 30)

#!ifdef WITH_DBCLUSTER
modparam("carrierroute", "db_url", "cluster://cl1")
#!else
modparam("carrierroute", "db_url", "sqlite:etc/db.sqlite")
#!endif
modparam("carrierroute", "config_source", "db")

modparam("avpops", "db_url", "cluster://cl1")
modparam("avpops", "avp_table", "usr_preferences")

request_route {
exit;
}



Failure log:

0(1) ERROR: carrierroute [cr_db.c:345]: load_route_data_db(): Fetching rows 
failed
0(1) ERROR: carrierroute [cr_data.c:179]: reload_route_data(): could not load 
routing data
0(1) ERROR: carrierroute [carrierroute.c:240]: mod_init(): could not prepare 
route data
0(1) ERROR:  [core/sr_module.c:942]: init_mod(): Error while initializing 
module carrierroute (/usr/lib/kamailio/modu

[SR-Users] Re: DB_CLUSTER failure with carrierroute (and others?)

2023-02-08 Thread Kaufman
I cannot reproduce this issue against mysql, so perhaps it is just something 
related to abstraction and concurrent access with sqlite.

Kaufman

From: Kaufman 
Sent: Wednesday, February 8, 2023 10:48 AM
To: Kamailio (SER) - Users Mailing List 
Subject: [SR-Users] DB_CLUSTER failure with carrierroute (and others?)

All,

I've been trying to chase down an issue with db_cluster and permissions in 
combination with something else, where with my full configuration using the 
same cluster in multiple modules has failures.  I've been trying to create a 
simplified configuration to consistently reproduce the problem without much 
success, however I did stumble upon THIS particular problem.  The configuration 
here works fine as is - avpops uses the cluster URL, and carrierroute uses the 
direct SQLite URL.  If I define WITH_DBCLUSTER, then carrierroute fails 
fetching rows using the cluster connection.  Note that AVPOPS is only used as a 
general test to see if the cluster config works. If I remove references to 
avpops , carrierroute still fails loading from the cluster URL.   Thoughts?




#!KAMAILIO

loadmodule "db_sqlite"
loadmodule "pv"
loadmodule "db_cluster"
loadmodule "carrierroute"
loadmodule "avpops"

modparam("db_cluster", "connection", "db1=>sqlite:etc/db.sqlite")
modparam("db_cluster", "cluster", "cl1=>db1=9s9s")
modparam("db_cluster", "inactive_interval", 30)

#!ifdef WITH_DBCLUSTER
modparam("carrierroute", "db_url", "cluster://cl1")
#!else
modparam("carrierroute", "db_url", "sqlite:etc/db.sqlite")
#!endif
modparam("carrierroute", "config_source", "db")

modparam("avpops", "db_url", "cluster://cl1")
modparam("avpops", "avp_table", "usr_preferences")

request_route {
exit;
}



Failure log:

0(1) ERROR: carrierroute [cr_db.c:345]: load_route_data_db(): Fetching rows 
failed
0(1) ERROR: carrierroute [cr_data.c:179]: reload_route_data(): could not load 
routing data
0(1) ERROR: carrierroute [carrierroute.c:240]: mod_init(): could not prepare 
route data
0(1) ERROR:  [core/sr_module.c:942]: init_mod(): Error while initializing 
module carrierroute (/usr/lib/kamailio/modules/carrierroute.so)

Kaufman
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] DB_CLUSTER failure with carrierroute (and others?)

2023-02-08 Thread Kaufman
All,

I've been trying to chase down an issue with db_cluster and permissions in 
combination with something else, where with my full configuration using the 
same cluster in multiple modules has failures.  I've been trying to create a 
simplified configuration to consistently reproduce the problem without much 
success, however I did stumble upon THIS particular problem.  The configuration 
here works fine as is - avpops uses the cluster URL, and carrierroute uses the 
direct SQLite URL.  If I define WITH_DBCLUSTER, then carrierroute fails 
fetching rows using the cluster connection.  Note that AVPOPS is only used as a 
general test to see if the cluster config works. If I remove references to 
avpops , carrierroute still fails loading from the cluster URL.   Thoughts?




#!KAMAILIO

loadmodule "db_sqlite"
loadmodule "pv"
loadmodule "db_cluster"
loadmodule "carrierroute"
loadmodule "avpops"

modparam("db_cluster", "connection", "db1=>sqlite:etc/db.sqlite")
modparam("db_cluster", "cluster", "cl1=>db1=9s9s")
modparam("db_cluster", "inactive_interval", 30)

#!ifdef WITH_DBCLUSTER
modparam("carrierroute", "db_url", "cluster://cl1")
#!else
modparam("carrierroute", "db_url", "sqlite:etc/db.sqlite")
#!endif
modparam("carrierroute", "config_source", "db")

modparam("avpops", "db_url", "cluster://cl1")
modparam("avpops", "avp_table", "usr_preferences")

request_route {
exit;
}




Failure log:

0(1) ERROR: carrierroute [cr_db.c:345]: load_route_data_db(): Fetching rows 
failed
0(1) ERROR: carrierroute [cr_data.c:179]: reload_route_data(): could not load 
routing data
0(1) ERROR: carrierroute [carrierroute.c:240]: mod_init(): could not prepare 
route data
0(1) ERROR:  [core/sr_module.c:942]: init_mod(): Error while initializing 
module carrierroute (/usr/lib/kamailio/modules/carrierroute.so)

Kaufman
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Setting socket_workers does not work if using interface name

2023-01-18 Thread Kaufman
Not using IPv6.  I've created a contianer to easily identify this. After 
starting the rpc command core.psx is called and it's output printed.

By default eth0 will be used:

docker run --rm -it whosgonna/kamsockets


To use a specific address (and 0.0.0.0 is the easiest), pass it as an 
environmental variable:

docker run --rm -it -e INTERFACE=0.0.0.0 whosgonna/kamsockets


The script, etc. can be found here:
https://github.com/whosgonna/kam_sockets



Kaufman


From: Karsten Horsmann 
Sent: Friday, January 13, 2023 12:45 PM
To: Kamailio (SER) - Users Mailing List 
Subject: [SR-Users] Re: Setting socket_workers does not work if using interface 
name

Hi Kaufmann,


did you run ipv6 and the extra listener are ipv6?

Kind regards
Karsten Horsmann
Kaufman mailto:bkauf...@bcmone.com>> schrieb am Fr., 13. 
Jan. 2023, 04:09:
At a quick glance it looks like using socket_workers when the listen parameter 
uses the interface name does not work.  For example:

children = 4
socket_workers=2
listen=udp:10.10.10.10:5060<https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2F10.10.10.10%3A5060%2F&data=05%7C01%7Cbkaufman%40bcmone.com%7C0d2a7522366647c29eb908daf597c453%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C638092329436846029%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=e1msmpVcoTvDt5ptypJdKPCBI54%2BxH79g7mlFfip%2Bek%3D&reserved=0>

Gives two listeners on 
udp:10.10.10.10:5060<https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2F10.10.10.10%3A5060%2F&data=05%7C01%7Cbkaufman%40bcmone.com%7C0d2a7522366647c29eb908daf597c453%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C638092329436846029%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=e1msmpVcoTvDt5ptypJdKPCBI54%2BxH79g7mlFfip%2Bek%3D&reserved=0>


children = 4
socket_workers=2
listen=udp:eth0:5060

Gives four listeners on the socket.

Note this is just a quick cursory observation.  Is it by design or a design 
limitation?

Kaufman

__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to 
sr-users-le...@lists.kamailio.org<mailto:sr-users-le...@lists.kamailio.org>
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Setting socket_workers does not work if using interface name

2023-01-12 Thread Kaufman
At a quick glance it looks like using socket_workers when the listen parameter 
uses the interface name does not work.  For example:

children = 4
socket_workers=2
listen=udp:10.10.10.10:5060

Gives two listeners on udp:10.10.10.10:5060


children = 4
socket_workers=2
listen=udp:eth0:5060

Gives four listeners on the socket.

Note this is just a quick cursory observation.  Is it by design or a design 
limitation?

Kaufman

__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Direct Routing, SIP, INVITE TO TEAMS (400 BAD REQUEST)

2022-12-29 Thread Kaufman
In your top Record-Route you have:

socket=;

Not sure if that is legal. 

Kaufman

-Original Message-
From: Alex Balashov  
Sent: Thursday, December 29, 2022 9:02 AM
To: Kamailio (SER) - Users Mailing List 
Subject: [SR-Users] Re: Direct Routing, SIP, INVITE TO TEAMS (400 BAD REQUEST)

Sorry to hear you're having to interoperate with Teams. It's a unique form of 
sadism I wouldn't wish upon anyone.

A few theories:

1) Microsoft doesn't like the "bare" Contact header-value here:

   Contact: sip:+MY_FROM_PHONE_NUMBER_HERE@MY_FQDN_WAS_HERE:5061;transport=tls

Unlike the careted one right above:

   P-Asserted-Identity: 

A bare URI absent other header-params is of course completely legal, but I'm 
really trying to get inside the imaginary world of antisocial "Microsoft SIP" 
here. 

2) Could it be that antisocial "Microsoft SIP" sends 400 as a way of objecting 
to something in the SDP, e.g. where a non-demented SIP stack would send "488 
Not Acceptable Here" or "415 Unsupported Media Type"?

I know you've said you tried multiple clients to rule that out, but I wonder if 
the thing it's objecting to hasn't been ruled out that way.

3) I saw this media line in the SDP:

   m=application 41356  

What's that?

-- Alex

> On Dec 29, 2022, at 9:51 AM, Brandon Armstead  wrote:
> 
> Outbound calls from my SBC into Teams (Polycom -> SBC -> Teams) always result 
> in a 400 BAD REQUEST.
> Example invite below:
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpast
> ebin.com%2FF1G1Ce59&data=05%7C01%7Cbkaufman%40bcmone.com%7C55672dbf739
> a4ff447f008dae9b0c9b2%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C638
> 079242759152531%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2
> luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Cbff6B4gNr8
> A9zs89smJ129y8IyNM9%2B3zVkGhlzpa54%3D&reserved=0
> I've taken care to make sure numbers are all E.164 format in From/To/Contact. 
> I've also taken care to make sure that FQDN is used in Contact and 
> Record-Route header.
> I've tried many different variations and have followed the SIP information 
> here:
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flear
> n.microsoft.com%2Fen-us%2Fmicrosoftteams%2Fdirect-routing-protocols-si
> p&data=05%7C01%7Cbkaufman%40bcmone.com%7C55672dbf739a4ff447f008dae9b0c
> 9b2%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C638079242759152531%7C
> Unknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1h
> aWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=GO26A9FOOoS42yMCWPPGo5PkKo75c
> kjSJSkjAeYRsU0%3D&reserved=0 I've also tried several different clients 
> (Bria, Polycom CCX 600, Grandstream, etc) to see if maybe it was something in 
> the SDP or otherwise causing an issue.
> SIP Transport is TLS, RTP is SRTP
> I might also add that OPTION pings are active and Direct Routing Endpoint is 
> active, so this is successful. I also am able to receive calls FROM teams to 
> my IP phone(s) without issue. It is only when I try and call INTO teams 
> (INVITE -> Microsoft Teams) that I always receive a 400 BAD REQUEST to my 
> INVITE.
> Any help is appreciated, thank you!
> 
> - Brandon
> 
> __
> Kamailio - Users Mailing List - Non Commercial Discussions To 
> unsubscribe send an email to sr-users-le...@lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to the 
> sender!
> Edit mailing list options or unsubscribe:

--
Alex Balashov | Principal | Evariste Systems LLC

Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free)
Web: 
https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.evaristesys.com%2F&data=05%7C01%7Cbkaufman%40bcmone.com%7C55672dbf739a4ff447f008dae9b0c9b2%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C638079242759152531%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=ItYjjYmm0QcD0vuQ4KamCrHtIF7UiukxxAp6zfrEgXQ%3D&reserved=0,
 
https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.csrpswitch.com%2F&data=05%7C01%7Cbkaufman%40bcmone.com%7C55672dbf739a4ff447f008dae9b0c9b2%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C638079242759152531%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=DRWZOre6j7XZQhkCcKUvD%2B5dXH%2B4i3M2S5kz%2FleEJuo%3D&reserved=0

__
Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send 
an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsub

[SR-Users] Re: How to make a branch trigger persistent (still being active after failure route is triggered)?

2022-12-20 Thread Kaufman
> Does this make he variable more 'constant'? :-)

No - without quotes you're declaring it as though it were a constant.  Put it 
in quotes to indicate that it is a variable.

Kaufman

-Original Message-
From: Benoît Panizzon  
Sent: Tuesday, December 20, 2022 11:05 AM
To: Kaufman 
Cc: Kamailio (SER) - Users Mailing List 
Subject: Re: [SR-Users] Re: How to make a branch trigger persistent (still 
being active after failure route is triggered)?

Hi

> Try quoting the pseudovariable?
> 
>t_on_branch("$avp(broute_trigger)");

Does this make he variable more 'constant'? :-)

I already built a switch/case contruct around it on a REARM_B_TRIGGER route 
which I now call in every failure route.

--
Mit freundlichen Grüssen

-Benoît Panizzon- @ HomeOffice und normal erreichbar
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  
https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.imp.ch%2F&data=05%7C01%7Cbkaufman%40bcmone.com%7C498395d08d6d4f85273108dae2ac66d0%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C638071527335909559%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Uaf1Fk6P2x41%2FYuyaCOaNE9o7fbYuNBhTAAy9bWMXbE%3D&reserved=0
__
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: How to make a branch trigger persistent (still being active after failure route is triggered)?

2022-12-20 Thread Kaufman
Try quoting the pseudovariable?

   t_on_branch("$avp(broute_trigger)");


Kaufman

-Original Message-
From: Benoît Panizzon  
Sent: Friday, December 16, 2022 10:28 AM
To: Kamailio (SER) - Users Mailing List 
Subject: [SR-Users] Re: How to make a branch trigger persistent (still being 
active after failure route is triggered)?

I tought I had found the solution:

 request_route
{

$avp(dispgroup) = 2001;
$avp(broute_trigger) = "BR_TO_NATIONAL";
t_on_branch($avp(broute_trigger));
route(DISPATCHCALL);

[...]

$avp(dispgroup) = 2002;
$avp(broute_trigger) = "BR_TO_INT";
t_on_branch($avp(broute_trigger));
route(DISPATCHCALL);
}

failure_route[DISPATCH_FAILURE]
{
[...]
# Set desired Branch Trigger again to try next
# dispatcher in list.
t_on_branch($avp(broute_trigger));
route(RELAY);
exit;
}

But no...

function t_on_branch: parameter 1 is not constant

Any 'tricks'?

--
Mit freundlichen Grüssen

-Benoît Panizzon- @ HomeOffice und normal erreichbar
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  
https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.imp.ch%2F&data=05%7C01%7Cbkaufman%40bcmone.com%7C7e7160292c034f881bea08dadfb3ad50%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C638068260065887727%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=yfhnAfcj91Mk3cX7VwgpD9qIx3gZl0NEUTuLK%2Fy8HPo%3D&reserved=0
__
__
Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send 
an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


Re: [SR-Users] Database Failure Detection at runtime

2022-12-05 Thread Kaufman
DB_CLUSTER module, perhaps?

Kaufman

From: sr-users  On Behalf Of Waqar 40
Sent: Monday, December 5, 2022 6:49 AM
To: Kamailio (SER) - Users Mailing List 
Subject: [SR-Users] Database Failure Detection at runtime

Hello Everyone,

I am using Kamailio sqlops module to write to a remote database which is not 
the database of Kamailio. It is working fine. But for redundancy purpose, if 
this database goes down, I want the Kamailio to detect the failure at runtime 
and write the data to another database (standby database).
Is it possible? Can anybody please guide me on this asap?

Regards,
Vicky
__
Kamailio - Users Mailing List - Non Commercial Discussions
sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] USRLOC module - Not all records are written to the db with db_mode 2

2022-11-09 Thread Kaufman
I encountered a similar problem and I believe that the issues wass with 
something causing an inconsistent state where kamailio was attempting to UPDATE 
a row that doesn't exist.. Try setting db_check_update to 1.

Kaufman


-Original Message-
From: sr-users  On Behalf Of Markus Bönke
Sent: Wednesday, November 9, 2022 5:01 AM
To: Kamailio (SER) - Users Mailing List 
Subject: [SR-Users] USRLOC module - Not all records are written to the db with 
db_mode 2


Hello NG,

we are using Kamailio 5.4.2 with the USRLOC module configured with db_mode 2 
(Write-Back scheme). The database is Postgres 11. Sometimes some records are 
not written to the database, however I can lookup them by "kamcmd ul.lookup 
..." . There are no database errors (like constraint violations or value too 
large errors) to see in the postgres.log. Not even when I execute "kamcmd 
ul.flush" manually. There are also no related error messages to see in the 
Kamailio.log during "kamcmd ul.flush".

Has anyone else seen that issue or is this might already fixed in a newer 
version?

Thanks and regards

Markus


__
Kamailio - Users Mailing List - Non Commercial Discussions 
sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.kamailio.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fsr-users&data=05%7C01%7Cbkaufman%40bcmone.com%7C689296da8ce04ff6d9f808dac242662f%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C638035887693322938%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=UHNOJsR%2F%2FAyNdwypXLZbMa%2FsuE6dsCydpkKOxagQ7sY%3D&reserved=0

__
Kamailio - Users Mailing List - Non Commercial Discussions
sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] About kamailio + freeswitch issue on Kamailio v5.6

2022-10-11 Thread Kaufman
As a note, a quick way to debug more interactively (then checking out the 
syslog, which may or may not be well configured for Kamailio), run Kamailio in 
the foreground:

Kamailio -ddDDeE

Explanation of the switches here:

-dd  A good debug level (info and higher)
-DD  Do not daemonize creator; (run in the foreground)
-E   Log to stderr
-e   Log messages printed in terminal colors (requires -E)


Most likely problems you’ll encounter here are situations where one module has 
been replaced/renamed with another and some module param requirement changes, 
but the startup output should give decent clues.


Kaufman
Sr. VoIP Engineer - BCM One

+1.612.735.9309
bkauf...@bcmone.com<mailto:bkauf...@bcmone.com>
24 hour client support: +1.855.639.6300

From: sr-users  On Behalf Of Henning 
Westerholt
Sent: Monday, October 10, 2022 5:57 AM
To: Kamailio (SER) - Users Mailing List 
Cc: SparkleZou 
Subject: Re: [SR-Users] About kamailio + freeswitch issue on Kamailio v5.6

Hello,

as you already noticed, this tutorial was about an older version of Kamailio so 
its probably needs some adaptions.
Regarding the startup errors you are facing, please have a look to the system 
log files to get more information on the probable causes.

Cheers,

Henning

--
Henning Westerholt - 
https://skalatan.de/blog/<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fskalatan.de%2Fblog%2F&data=05%7C01%7Cbkaufman%40bcmone.com%7C6d07d11d7bb04e6e4bcf08d5d577%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C638009926490175611%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=wMQWVnjy44yG3zprtLUKglir%2BO8GHoaK3HuwbGrsuWA%3D&reserved=0>
Kamailio services - 
https://gilawa.com<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgilawa.com%2F&data=05%7C01%7Cbkaufman%40bcmone.com%7C6d07d11d7bb04e6e4bcf08d5d577%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C638009926490175611%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2FiYXh18%2FH%2BupBryfgqpnHnTbyp56Kx4lwTG12HJo3%2B0%3D&reserved=0>

From: sr-users 
mailto:sr-users-boun...@lists.kamailio.org>>
 On Behalf Of SparkleZou
Sent: Monday, October 10, 2022 4:25 AM
To: sr-users@lists.kamailio.org<mailto:sr-users@lists.kamailio.org>
Subject: [SR-Users] About kamailio + freeswitch issue on Kamailio v5.6

Hi Sir/Mada,

I'm trying to integrate kamailio + freeswitch, according to the manual 
http://kb.asipto.com/freeswitch:kamailio-3.3.x-freeswitch-1.2.x-sbc<https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fkb.asipto.com%2Ffreeswitch%3Akamailio-3.3.x-freeswitch-1.2.x-sbc&data=05%7C01%7Cbkaufman%40bcmone.com%7C6d07d11d7bb04e6e4bcf08d5d577%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C638009926490175611%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=RMsyZyhWZAjCuWZpUp72BAGz6eWNwCe1luJfr%2FzDm40%3D&reserved=0>
 on Kamailio v5.6

modified the kamailio.cfg file, add WITH_FREESWITCH parts, then kamailio could 
NOT start up.

Could you please help check, what should be modified to fit the version 5.6?

Thanks!

BR,
Sparkle Zou

__
Kamailio - Users Mailing List - Non Commercial Discussions
sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Intermittent delays relaying BYE (up to 1s)

2022-08-25 Thread Kaufman
The `benchmark` module allows you to create points can be used to generate 
comparative timestamps for desired parts of your code.  I'm not sure if using 
it on a production server adds much overhead or not, though.  Look to set 
points before and after things like database calls that are blocking operation. 
 As a possible reason, if you're doing accounting and the db is blocked you may 
have latency in processing the BYE.

Kaufman
Sr. VoIP Engineer - BCM One

From: sr-users  On Behalf Of Lewis 
Hutchinson
Sent: Thursday, August 25, 2022 8:37 AM
To: sr-users@lists.kamailio.org
Subject: [SR-Users] Intermittent delays relaying BYE (up to 1s)

I have a situation where I am seeing intermittently Kamailio having delays when 
relaying the BYE received from an external party

This is only affecting the BYE

We have 6 Kamailios stood up

3 linked to the SIP Providers (SBC)
3 for Registration (REG)
Language KEMI | Python

version: kamailio 5.5.1 (x86_64/linux) 278772-dirty
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, 
USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, 
DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, 
USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLOCKLIST, HAVE_RESOLV_RES, 
TLS_PTHREAD_MUTEX_SHARED
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, 
BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: 278772 -dirty
compiled with gcc 9.3.0

Simplified Flow
PSTN >>>> Kamailio SBC >>>> FREESWITCH >>>> Kamailio REG >>>> SIP DEVICE

SIP DEVICE >>>> Kamailio REG >>>> FREESWITCH >>>> Kamailio SBC >>>> PSTN

This happens on all of them intermittently when receiving the BYE from either a 
SIP trunk or a SIP Device Publicly, it can take upto 1s to pass this onto the 
next hope (Freeswitch) on the local network. All BYEs passed between the local 
network relay  in fractions of a second. All BYEs passed out of the KAMAILIO 
SBC or KAMAILIO REG to their respective public enpoints relay  in fractions of 
a second but BYEs received from public on advertised address take upto 1s for 
Kamailio to process and relay.

i.e

PSTN >>> BYE >>>> KAMAILIO SBC (kamailio will sometimes take upto 1 second to 
relay this on to other kit on the internal solution. Freeswitch etc)
SIP DEVICE  >>> BYE >>>> KAMAILIO REG (kamailio will sometimes take upto 1 
second to relay this on to other kit on the internal solution. Freeswitch etc)

I am basing these timings on SNgrep and PCAP traces from homer.

Does anyone have any hints and tips on how I can debug this issue. I have 
enabled debug logging and replicated the issue but it doesn't show anything 
from what I can see as to why there is delays.

Thanks in advance

lewis

__
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] proper way for infinite loop in event_route for evrexec module

2022-08-16 Thread Kaufman
I'm not clear - are you saying that you feel evrexec is well suited for on 
demand reloading of your htable?  It would see poorly suited to on demand tasks 
that are not trigged by SIP message handling (and triggering actions via SIP 
messages seems like an obtuse way of initiating these actions).  It should be 
easier to trigger an external script from your shell (or via web api, etc) than 
via kamcmd/kamcli, isn't it?

Kaufman
Sr. VoIP Engineer - BCM One

From: sr-users  On Behalf Of Patrick Karton
Sent: Tuesday, August 16, 2022 2:27 AM
To: Kamailio (SER) - Users Mailing List 
Subject: Re: [SR-Users] proper way for infinite loop in event_route for evrexec 
module

Hello lhor,

yes i will do some tests with cron to see if it suits well.

the scenario is we have kamailio connected to redis database.

redis store some configs for kamailio that we want to update (from redis to 
kamailio htable) let say every 5 hours.

but if some reason we need to update some new config values from redis to 
kamailio immediatly. i want a way to trigger that as soon as we need it.

and evrexec  suits well for that i think.

De : Patrick Karton mailto:patrickar...@hotmail.com>>
Envoyé : mardi 16 août 2022 08:25
À : Kamailio (SER) - Users Mailing List 
mailto:sr-users@lists.kamailio.org>>
Objet : RE: [SR-Users] proper way for infinite loop in event_route for evrexec 
module

Hello lhor,

yes i will do some tests with cron to see if it suits well.

the scenario is we have kamailio connected to redis database.

redis store some configs for kamailio that we want to update (from redis to 
kamailio htable) let say every 5 hours.

but if some reason we need to update some new config values from redis to 
kamailio. i want a way to trigger that as soon as we need it.

and evrexec  suits well for that i think.

De : sr-users 
mailto:sr-users-boun...@lists.kamailio.org>>
 de la part de Ihor Olkhovskyi 
mailto:igorolhovs...@gmail.com>>
Envoyé : mardi 16 août 2022 07:09
À : sr-users@lists.kamailio.org<mailto:sr-users@lists.kamailio.org> 
mailto:sr-users@lists.kamailio.org>>
Objet : Re: [SR-Users] proper way for infinite loop in event_route for evrexec 
module


Patrick,



Maybe I'm a bit out of context, but could some external process like cron suits 
better for this kind of tasks than internal job?


Le 14/08/2022 à 16:37, Patrick Karton a écrit :
Hello i would like to use the evrexec module to execute background jobs over 
exec module mainly because i want to be able to  trigger that route manually 
via rpc from time to time.

in the documentation its is stated we should use tasks that run forever and 
except using while loop i dont see another way.

and i dont to want to disable max_while_loops. but if i disable it i will get 
error message like runaway while (1091, 9): more then 100 loops.

so is there another way to do it properly ?

Thanks.



__

Kamailio - Users Mailing List - Non Commercial Discussions

  * sr-users@lists.kamailio.org<mailto:sr-users@lists.kamailio.org>

Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Edit mailing list options or unsubscribe:

  * 
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.kamailio.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fsr-users&data=05%7C01%7Cbkaufman%40bcmone.com%7Cf2ecc3d9d54e4da16f3708da7f596445%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C637962319158472423%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=jPN3VZNS0E%2B6X6Hy0re%2BxxBMPvutsHhrpU%2BqT1YWM4Y%3D&reserved=0>
__
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] remove_hf() does not remove the complete line

2022-08-11 Thread Kaufman
I would argue that this is the documented behavior.  The topmost via: is added 
during message assembly, and remove_hf() acts against the *received* message.  
The behavior of this is along the lines of:

append_hf("X-Fake-Header: Foo");
remove_hf("X-Fake-Header");


I don't think that the reason it can't be removed in the manner requested has 
to do directly with RFC compliance, but rather the way Kamailio's architecture 
processes messages.  Could we have more clarification and better documentation 
around this fact?  Sure.  Is it a bug?  Since Kamailio's reason for being is to 
function as a SIP proxy, and proper insertion of the Via: header is usually 
critical to that function it wouldn't seem so.

Kaufman

From: sr-users  On Behalf Of Federico 
Cabiddu
Sent: Thursday, August 11, 2022 6:31 AM
To: Kamailio (SER) - Users Mailing List 
Subject: Re: [SR-Users] remove_hf() does not remove the complete line

Hi Bernd,
as I said I am using it to remove Via headers inserted by previous hops since 
years with no issue.

Cheers,

Federico

On Thu, Aug 11, 2022 at 1:10 PM Bernd Krueger-Knauber 
mailto:b...@ednt.de>> wrote:
Hi,

if I remove only 1 of 2 it is not against the standard, because one Via
header line is still inside.

But if I modify the documentation I would write:

"Attention: it is not working with a Via header field"

Then everyone thinks: ok, that is the only point where it will not work.
But how can I, as not a kamailio programmer, can know if this is really
the only case?

So I would also write something which is not 100% correct.
This has to be done by a guy who knows this, and not by me as a kamailio
learner.

Best regards,

Bernd


Am 11.08.2022 um 12:56 schrieb Henning Westerholt:
> Hi Bernd,
>
> The Via header is mandatory according to RFC 3261, section 20, in Requests:
>
> Header field  where   proxy ACK BYE CAN INV OPT REG
> ___
> [..]
> Via R  amr   m   m   m   m   m   m
>
> You are asking Kamailio to do something that is against the standard. So, 
> some people might expect that it's not working in this case, and I personally 
> would not call it a Bug.
>
> Documentation would be never fully complete for a complex software like 
> Kamailio, sure.
> You could open a feature request or (even better) a pull request to improve 
> the documentation for the textops module in the Kamailio github.
>
> Cheers,
>
> Henning
>


--
EDNT GmbH
Werner-von-Siemens-Strasse 7
64625 Bensheim
www.ednt.de<https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.ednt.de%2F&data=05%7C01%7Cbkaufman%40bcmone.com%7C6f4c1458c1e94ec20e3208da7b8d21af%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C637958143348606038%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=B8QM%2BsRxyJNn6vRa8UnQEDs2bcfW1u4eaPdCOLGWVZY%3D&reserved=0>

Registergericht: Darmstadt
Registernummer: 24972

Geschäftsführerin: Kerstin Knapp



__
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org<mailto:sr-users@lists.kamailio.org>
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
  * 
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.kamailio.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fsr-users&data=05%7C01%7Cbkaufman%40bcmone.com%7C6f4c1458c1e94ec20e3208da7b8d21af%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C637958143348762293%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=vu1h6sAfgkNhcEHeBveSNyI%2BHV3c6OpYGzr7Fo6NgMo%3D&reserved=0>
__
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] recompute distribution list

2022-08-08 Thread Kaufman
With either module (Dispatcher or Carrierroute) , what would be the functional 
difference between 'reloading' and 'recalculating'?

Both modules can be controlled via RPC:

Dispatcher can be set to send OPTIONS messages to the hosts in it's tables to 
monitor endpoint status and dynamically bring the record in and out of service. 
 Additionally any target's state can be changed administratively to disabled.  
Finally, if you update your datasource, dispatcher can be reloaded.

Carrierroute doesn't have any keepalive options, but supports adding and 
removing hosts, activating  and deactivating hosts, and replacing hosts.  
Additionally, if carrierroute's data is updated (i.e. if reading from database) 
it can be completely reloaded.


Kaufman

From: sr-users  On Behalf Of David 
Villasmil
Sent: Monday, August 8, 2022 1:39 PM
To: Henning Westerholt 
Cc: Kamailio (SER) - Users Mailing List 
Subject: Re: [SR-Users] recompute distribution list

Hey Henning, thanks for replying. Quick question: Adding (or removing) in 
memory recalculates without reloading?

On Mon, 8 Aug 2022 at 19:47, Henning Westerholt 
mailto:h...@gilawa.com>> wrote:
Hello,

this is possible with carrierroute by RPC command: 
https://kamailio.org/docs/modules/5.5.x/modules/carrierroute.html#carrierroute.rpc.replace_host<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fkamailio.org%2Fdocs%2Fmodules%2F5.5.x%2Fmodules%2Fcarrierroute.html%23carrierroute.rpc.replace_host&data=05%7C01%7Cbkaufman%40bcmone.com%7Cdd11512c3b7f48deb52508da796d5884%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C637955807795997743%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=qtcVZl8iGypaFPL5lQ0UxMPKy1ipi%2B3WmJ1MkgXdNys%3D&reserved=0>

With dispatcher you could of course just adding one host two times by some 
script and reload the module, as a simple idea.

Cheers,

Henning

From: sr-users 
mailto:sr-users-boun...@lists.kamailio.org>>
 On Behalf Of David Villasmil
Sent: Monday, August 8, 2022 5:05 PM
To: Kamailio (SER) - Users Mailing List 
mailto:sr-users@lists.kamailio.org>>
Subject: [SR-Users] recompute distribution list

Hello guys,

Is it possible to have dispatcher recompute the distribution list? i.e. one 
server goes down, all traffic for that server goes to the next one, doubling 
traffic on that one. Is there a way of, when a host becomes unreachable, 
recompute the whole list?

Regards,

David Villasmil
email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com>
phone: +34669448337
--
Regards,

David Villasmil
email: david.villasmil.w...@gmail.com<mailto:david.villasmil.w...@gmail.com>
phone: +34669448337
__
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Newbie - Installation Issue - ERROR: could not load the script in /usr/lib/kamailio//kamctl/kamdbctl.mysql for database engine MYSQL

2022-08-02 Thread Kaufman
I believe you also need to:

apk add kamailio-mysql



Kaufman
Sr. VoIP Engineer - BCM One

+1.612.735.9309
bkauf...@bcmone.com<mailto:bkauf...@bcmone.com>
24 hour client support: +1.855.639.6300

From: sr-users  On Behalf Of Henning 
Westerholt
Sent: Monday, August 1, 2022 8:35 AM
To: Kamailio (SER) - Users Mailing List 
Cc: p.t.cross...@gmail.com
Subject: Re: [SR-Users] Newbie - Installation Issue - ERROR: could not load the 
script in /usr/lib/kamailio//kamctl/kamdbctl.mysql for database engine MYSQL

Hello,

indeed the package seems not to contain anything related to db_mysql or other 
SQL databases. Maybe somebody that knows more details can comment, it could be 
just not included there.

https://pkgs.alpinelinux.org/contents?repo=main&page=1&arch=x86_64&branch=edge&name=kamailio<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpkgs.alpinelinux.org%2Fcontents%3Frepo%3Dmain%26page%3D1%26arch%3Dx86_64%26branch%3Dedge%26name%3Dkamailio&data=05%7C01%7Cbkaufman%40bcmone.com%7Cc102b7573883486b06bb08da73c2c2b9%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C637949577588380431%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=JNA85YOtJYGrYkkoo%2BjYKLBc9EZR%2BboO%2F%2F1Hietk6gw%3D&reserved=0>

Maybe you can just try the official Debian or Ubuntu packages from 
deb.kamailio.org, they should work.

Cheers,

Henning

--
Henning Westerholt - 
https://skalatan.de/blog/<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fskalatan.de%2Fblog%2F&data=05%7C01%7Cbkaufman%40bcmone.com%7Cc102b7573883486b06bb08da73c2c2b9%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C637949577588380431%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=gQKR6PXElER8s8Q%2BJ1WVEWX4eqNkt4XrWMk1pAVVrCE%3D&reserved=0>
Kamailio services - 
https://gilawa.com<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgilawa.com%2F&data=05%7C01%7Cbkaufman%40bcmone.com%7Cc102b7573883486b06bb08da73c2c2b9%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C637949577588380431%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=4BJnEX5zGWKpia9rOGneU1mDOU6xYT9%2Fj60ck2nPOF4%3D&reserved=0>

From: sr-users 
mailto:sr-users-boun...@lists.kamailio.org>>
 On Behalf Of p.t.cross...@gmail.com<mailto:p.t.cross...@gmail.com>
Sent: Thursday, July 28, 2022 1:31 PM
To: sr-users@lists.kamailio.org<mailto:sr-users@lists.kamailio.org>
Subject: [SR-Users] Newbie - Installation Issue - ERROR: could not load the 
script in /usr/lib/kamailio//kamctl/kamdbctl.mysql for database engine MYSQL

I suspect this must have been addressed before but I couldn't find a way of 
searching Archives.

I'm using Alpine Linux.
Used "apk add kamailio"   to install  Kamailio 5.5.4-r1

Following the Instructions on 
https://kamailio.org/docs/tutorials/5.5.x/kamailio-install-guide-git/<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fkamailio.org%2Fdocs%2Ftutorials%2F5.5.x%2Fkamailio-install-guide-git%2F&data=05%7C01%7Cbkaufman%40bcmone.com%7Cc102b7573883486b06bb08da73c2c2b9%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C637949577588380431%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=wNmOtBazGJ0lsAF6Y6eBtdiyk7rvWNMaLL4ILWKji4M%3D&reserved=0>

At the section for "Creating MySQL database"  I modify the file and then run

kamdbctl create

ERROR: could not load the script in /usr/lib/kamailio//kamctl/kamdbctl.mysql 
for database engine MYSQL
ERROR: database engine not loaded - tried 'MYSQL'

I checked the /usr/lib/kamailio//kamctl/ directory and the file wasn't there

I suspect I'm missing a module but there aren't any other packages  listed for 
Kamailio   at pkgs.alpinelinux.org

Thanks for your help
P Crossley

__
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] issue using phonenum module

2022-06-13 Thread Ben Kaufman
How are you calling the function in Kamailio?  It's possible that the appspot 
app tries a few variations on formatting that result in success.  From the 
phonum module doc for phonenum_match_cn(num, cnc, pvc) :


Note from libphonenumber library docs: country name code is the region that is 
expected the number to be from. It is only used if the number being parsed is 
not written in international format. The country code for the number in this 
case would be stored as that of the region supplied. If the number is 
guaranteed to start with a '+' followed by the country calling code, then 
region 'ZZ'.



Kaufman

From: sr-users  On Behalf Of David Escartín
Sent: Monday, June 13, 2022 8:49 AM
To: Kamailio (SER) - Users Mailing List ; Vicente 
Hernando ; Javier Gallart 
Subject: [SR-Users] issue using phonenum module

Hello all

we are using the phonenum_match_cn function to detect valid phone numbers, but 
seems there are some numbers like 576015145834 which are no detected as valid 
ones,
$phn(ani=>valid) --> 0
$phn(ani=>ccname) --> 
$phn(ani=>cctel) --> 0
$phn(ani=>error) --> Invalid number

but using
https://libphonenumber.appspot.com/phonenumberparser?number=576015145834&country=CO<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flibphonenumber.appspot.com%2Fphonenumberparser%3Fnumber%3D576015145834%26country%3DCO&data=05%7C01%7Cbkaufman%40bcmone.com%7Cb2f5358948fa4e8c467508da4d43974a%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C637907249957000424%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=pLAOjgn9o61nk03k7%2FgRsLKinYDTnHTs2%2FNgd%2BK%2BG40%3D&reserved=0>
 seems it gives a valid result

Validation Results
Result from isPossibleNumber() true
Result from isValidNumber() true
Result from isValidNumberForRegion() true
Phone Number region CO
Result from getNumberType() FIXED_LINE

we are using kamailio 5.4 and libphonenumber tag v8.12.30 (also tested v8.9)
the command is used with 'ZZ' cnc and passing the number with +

maybe we are missing something in the configuration/setup?
thanks and regards
david

--
[https://www.sonoc.io/wp-content/uploads/2020/07/Logo_SONOC_emails.png]<https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.sonoc.io%2F&data=05%7C01%7Cbkaufman%40bcmone.com%7Cb2f5358948fa4e8c467508da4d43974a%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C637907249957000424%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=59dpA3rMEP1RnAWzDYwuNzdQ1zAbViC7yPjY26hgWGU%3D&reserved=0>
David Escartín
NOC engineer
www.sonoc.io<https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.sonoc.io%2F&data=05%7C01%7Cbkaufman%40bcmone.com%7Cb2f5358948fa4e8c467508da4d43974a%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C637907249957000424%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=59dpA3rMEP1RnAWzDYwuNzdQ1zAbViC7yPjY26hgWGU%3D&reserved=0>
[LinkedIn]<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.linkedin.com%2Fcompany%2Fsonoc&data=05%7C01%7Cbkaufman%40bcmone.com%7Cb2f5358948fa4e8c467508da4d43974a%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C637907249957000424%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=%2B%2BQrJtOr4eDeCStfkSqskYmKZKiry7WCgCTuUKUxCiU%3D&reserved=0>
[Twitter]<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2Fsonoc_&data=05%7C01%7Cbkaufman%40bcmone.com%7Cb2f5358948fa4e8c467508da4d43974a%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C637907249957000424%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=kWxD3cUTYKmEcKGcTka%2FwHQ%2FNpFjtDvrqQm%2BzwLqNH4%3D&reserved=0>
[Facebook]<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.facebook.com%2FSONOCio%2F&data=05%7C01%7Cbkaufman%40bcmone.com%7Cb2f5358948fa4e8c467508da4d43974a%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C637907249957000424%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=lv6mhnoPr0YOopcKSmH5PZw5nim2lAsxB0XqhLv65dw%3D&reserved=0>
This e-mail is for the exclusive use of its recipients and may contain business 
secrets or other confidential or privileged information. Any unauthorised use, 
copying, publication or distribution of this e-mail is strictly prohibited. If 
you are not the intended recipient, please inform us immediately by replying to 
this e-mail and delete it, including any attachments or copies on your system.

In accordance with the GDPR (EU) 2016/679 and the LOPDGDD 3/2018, we inform you 
that this e-mail address and/or any other personal data you have provided 

[SR-Users] Use of interface name or listening socket name as DMQ server_socket

2022-06-10 Thread Ben Kaufman
Kamailio allows the use of an interface name (eth0 for example), as the 
identifier for the listen directive.  Additionally it allows assignment of a 
name to be used as an identifier.  This can be used, as indicated in the 
documentation:

A unique name can be set for sockets to simplify the selection of the socket 
for sending out. For example, the rr and path modules can use the socket name 
to advertise it in header URI parameter and use it as a shortcut to select the 
corresponding socket for routing subsequent requests.

I'm wondering if there is a way to get allow either of these parameters to be 
used to define DMQ's server_socket parameter.  This would be useful in 
containerization situations where the local IP address is assigned dynamically. 
 Here's what I'm attempting:


#!KAMAILIO

loadmodule "tm"
loadmodule "sl"
loadmodule "dmq"
loadmodule "textops"

listen=udp:eth0:5060 name "sip5060"
listen=udp:eth0:5090 name "sip5090"

modparam("dmq", "server_address", "sip:dmq_quicktest:5090")
modparam("dmq", "notification_address", "sip:dmq-bus:5090")
modparam("dmq", "server_socket", "sip5090" )
## Above line doesn't work, neither does the line below:
#modparam("dmq", "server_socket", "udp:eth0:5090" )

modparam("dmq", "multi_notify", 1)
modparam("dmq", "num_workers", 3)
modparam("dmq", "ping_interval", 30)

request_route {
exit;
}

I get the following error during startup:

0(1) ERROR: dmq [dmq.c:241]: mod_init(): server_uri is not a socket the proxy 
is listening on

Thoughts?  I realize that I can configure and pass static networking with the 
containers, but I'm looking for a way to have this set on the fly - especially 
when testing, etc.


Ben Kaufman

__
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] remove headers with less than 5 characters with textops

2022-06-07 Thread Ben Kaufman
I know it's not really a direct answer to your question, but wouldn't that 
remove the Cseq: header.  Are you sure that's desirable?

Ben Kaufman

From: sr-users  On Behalf Of Patrick Karton
Sent: Tuesday, June 7, 2022 9:59 AM
To: sr-users@lists.kamailio.org
Subject: [SR-Users] remove headers with less than 5 characters with textops

Hello

im trying to textops module  to remove headers with name length less than 5 
characters with regular expression but it seems impossible or the module does 
not handle $ char


remove_hf_re("^.{1,5}$")

__
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Tips on picking random element from a list

2022-05-04 Thread Ben Kaufman
Without any external dependencies.  Not sure how you're populating your pool of 
numbers for the caller id, but this generally works:

```
## Populate your list however you want:
$(avp(cid)) = "1551000";
$(avp(cid)) = "1551001";
$(avp(cid)) = "1551002";
$(avp(cid)) = "1551003";
$(avp(cid)) = "1551004";
$(avp(cid)) = "1551005";
$(avp(cid)) = "1551006";
## $avp(cid) now holds 7 values.

## A random integer using the remainder $RANDOM divided by the number of
## elements:
$var(rand) = $RANDOM mod $cnt($avp(cid));

## Use the random integer to get the CID out of the list
$var(rand_cid) = $(avp(cid)[$var(rand)]);
```


Ben Kaufman
Sr. VoIP Engineer - BCM One

+1.612.735.9309
bkauf...@bcmone.com
24 hour client support: +1.855.639.6300

-Original Message-
From: sr-users  On Behalf Of Fred Posner
Sent: Wednesday, May 4, 2022 3:02 PM
To: sr-users@lists.kamailio.org
Subject: Re: [SR-Users] Tips on picking random element from a list

If you were choosing random numbers from a pool of numbers, you could always 
lets say store the caller-id's in redis, connect kamailio to redis, and just 
use the RANDOMKEY function of redis to return a caller id.

Fred Posner | palner.com
o: +1 (212) 937-7844

On 5/4/22 15:43, Ben Kaufman wrote:
> How "random" do you need to be here? Given your example, a quick 
> thought would be to just iterate over a list, using a counter and 
> calculating the modulo (remainder) when dividing it by the number of elements 
> you have.
> 
> Another thought would be to use the core_hash() function over the 
> call-id.
> https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.k
> amailio.org%2Fdocs%2Fmodules%2F5.6.x%2Fmodules%2Fcfgutils.html%23cfgut
> ils.f.core_hash&data=05%7C01%7Cbkaufman%40bcmone.com%7C233860f6470
> 7428040a008da2e090ef7%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C637
> 872913679726971%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2
> luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=zdoWq%2
> FANIgusBipnbAD4%2BJpDzMc6fNrilEawt5rV2f8%3D&reserved=0
> <https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.
> kamailio.org%2Fdocs%2Fmodules%2F5.6.x%2Fmodules%2Fcfgutils.html%23cfgu
> tils.f.core_hash&data=05%7C01%7Cbkaufman%40bcmone.com%7C233860f647
> 07428040a008da2e090ef7%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C63
> 7872913679726971%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV
> 2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=zdoWq%
> 2FANIgusBipnbAD4%2BJpDzMc6fNrilEawt5rV2f8%3D&reserved=0>
> 
> Of course, those aren't really "random" in the mathematical sense, but 
> if you're goal is "you have a pool of 10 numbers and want them to be 
> assigned to the p-asserted-identity URI user each one-tenth of the 
> time", either of the above methods should work.  Hashing the call-id 
> would even ensure that the same call will get the same value if you 
> have to recalculate it.
> 
> *Ben Kaufman*
> 
> /Sr. VoIP Engineer - BCM One/
> 
> +1.612.735.9309
> 
> bkauf...@bcmone.com <mailto:bkauf...@bcmone.com>
> 
> 24 hour client support: +1.855.639.6300
> 
> *From:* sr-users  *On Behalf Of 
> *Joel Serrano
> *Sent:* Tuesday, May 3, 2022 8:40 PM
> *To:* Henning Westerholt 
> *Cc:* Kamailio (SER) - Users Mailing List 
> 
> *Subject:* Re: [SR-Users] Tips on picking random element from a list
> 
> I did, but I don't see how to limit the range:
> 
>  From the docs: Returns a random value from the [0 - 2^31) range.
> 
> Is there a way to limit the range from 1-100 for example? Or maybe the 
> way is to use $RANDOM and just rely on the first/last 2 digits 
> (essentially a 00-99 range)?
> 
> On Tue, May 3, 2022 at 10:40 AM Henning Westerholt  <mailto:h...@gilawa.com>> wrote:
> 
> Hello,
> 
> what about just using this PV:
> 
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fkamailio.org%2Fdocs%2Fmodules%2F5.5.x%2Fmodules%2Fcfgutils.html%23idm438&data=05%7C01%7Cbkaufman%40bcmone.com%7C233860f64707428040a008da2e090ef7%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C637872913679726971%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=qW9OEMTf1MeQl%2FRKqRLah4WLQAogKViHQeS%2FRZTqgN0%3D&reserved=0
> 
> <https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fkam
> ailio.org%2Fdocs%2Fmodules%2F5.5.x%2Fmodules%2Fcfgutils.html%23idm438&
> amp;data=05%7C01%7Cbkaufman%40bcmone.com%7C233860f64707428040a008da2e0
> 90ef7%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C6378

Re: [SR-Users] Tips on picking random element from a list

2022-05-04 Thread Ben Kaufman
How "random" do you need to be here? Given your example, a quick thought would 
be to just iterate over a list, using a counter and calculating the modulo 
(remainder) when dividing it by the number of elements you have.

Another thought would be to use the core_hash() function over the call-id. 
http://www.kamailio.org/docs/modules/5.6.x/modules/cfgutils.html#cfgutils.f.core_hash

Of course, those aren't really "random" in the mathematical sense, but if 
you're goal is "you have a pool of 10 numbers and want them to be assigned to 
the p-asserted-identity URI user each one-tenth of the time", either of the 
above methods should work.  Hashing the call-id would even ensure that the same 
call will get the same value if you have to recalculate it.

Ben Kaufman
Sr. VoIP Engineer - BCM One

+1.612.735.9309
bkauf...@bcmone.com<mailto:bkauf...@bcmone.com>
24 hour client support: +1.855.639.6300

From: sr-users  On Behalf Of Joel Serrano
Sent: Tuesday, May 3, 2022 8:40 PM
To: Henning Westerholt 
Cc: Kamailio (SER) - Users Mailing List 
Subject: Re: [SR-Users] Tips on picking random element from a list

I did, but I don't see how to limit the range:

>From the docs: Returns a random value from the [0 - 2^31) range.

Is there a way to limit the range from 1-100 for example? Or maybe the way is 
to use $RANDOM and just rely on the first/last 2 digits (essentially a 00-99 
range)?


On Tue, May 3, 2022 at 10:40 AM Henning Westerholt 
mailto:h...@gilawa.com>> wrote:
Hello,

what about just using this PV: 
https://kamailio.org/docs/modules/5.5.x/modules/cfgutils.html#idm438<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fkamailio.org%2Fdocs%2Fmodules%2F5.5.x%2Fmodules%2Fcfgutils.html%23idm438&data=05%7C01%7Cbkaufman%40bcmone.com%7Cde7dd7f8eb504d2a662f08da2d6f2f33%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C637872252819501517%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=JRp6T14RXqTW26xFJ5DWcKPUEqqXy0hkQ1ecuCWyk10%3D&reserved=0>

Cheers,

Henning

--
Henning Westerholt - 
https://skalatan.de/blog/<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fskalatan.de%2Fblog%2F&data=05%7C01%7Cbkaufman%40bcmone.com%7Cde7dd7f8eb504d2a662f08da2d6f2f33%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C637872252819501517%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=l0%2FQ%2ByWZlVi4ZI5mxOrwD7153fNcP0%2FNmXXrd0YLg4g%3D&reserved=0>
Kamailio services - 
https://gilawa.com<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgilawa.com%2F&data=05%7C01%7Cbkaufman%40bcmone.com%7Cde7dd7f8eb504d2a662f08da2d6f2f33%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C637872252819501517%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=mgnKGkPniboT1FOSW7rC84SWWhJrNer3GlvlzZ72%2FDI%3D&reserved=0>

From: sr-users 
mailto:sr-users-boun...@lists.kamailio.org>>
 On Behalf Of Joel Serrano
Sent: Tuesday, May 3, 2022 6:20 PM
To: Kamailio (SER) - Users Mailing List 
mailto:sr-users@lists.kamailio.org>>
Subject: [SR-Users] Tips on picking random element from a list

Hi Everyone,

I have to implement a flow where outbound calls get their caller-id set with a 
random number from a pool.

I've been looking around and, as most of the time, there are tons of ways to 
implement something like this... This is a simple implementation, the number 
pool is fixed and will not change (so I could have it hard-coded in the config 
if required).

My initial approach was:

1- Try to keep it simple, with no dependencies, and all done in the config 
script.
2- If #1 is "ugly", then I'd probably go with some inline code using 
python/lua/etc
3- If #2 is "ugly", then I'd go with having the info in a DB and just run a 
query

I think #2 and #3 might be overkill for something so "simple" but I haven't had 
to work too much with randomness in Kamailio, so any tips/suggestions on where 
to store the number list and how to pick one randomly would be awesome!

Thanks!!
Joel.

__
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] How to submit updates for core documentation?

2022-04-11 Thread Ben Kaufman
I've added the doc for the two commands to the wiki. 
https://www.kamailio.org/wiki/cookbooks/devel/core#trydefenv

I wasn't sure if they should have been grouped near #!defenv or alphabetically. 
I decided on the latter - I hope that's good.

Ben Kaufman

From: sr-users  On Behalf Of Ben Kaufman
Sent: Thursday, March 24, 2022 10:19 AM
To: Kamailio (SER) - Users Mailing List 
Subject: [SR-Users] How to submit updates for core documentation?

Hello,


I had a small patch merged for 5.6 to add preprocessor macros #!trydefenv and 
#!trydefenvs.  
(https://github.com/kamailio/kamailio/issues/2967<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fkamailio%2Fkamailio%2Fissues%2F2967&data=04%7C01%7Cbkaufman%40bcmone.com%7Ca8dcab59260b47fc22ca08da0da9aac5%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C637837319626464509%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000&sdata=kWko0RUXUot8cEaPKP6EKIX4PO2PrS%2FXu9QqYHvXSHI%3D&reserved=0>),
 but they need documentation.  I believe that they should ultimately end up on 
this page: 
https://www.kamailio.org/wiki/cookbooks/devel/core<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.kamailio.org%2Fwiki%2Fcookbooks%2Fdevel%2Fcore&data=04%7C01%7Cbkaufman%40bcmone.com%7Ca8dcab59260b47fc22ca08da0da9aac5%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C637837319626464509%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000&sdata=W9oaa1my%2BHtnnq4dNaRRXqpYYkeZBPF7g04ezZ34joI%3D&reserved=0>.
  I don't see this in the /doc section of the repo.  What's the process for me 
to submit this documentation?


Ben Kaufman
Sr. VoIP Engineer - BCM One

+1.612.735.9309
bkauf...@bcmone.com<mailto:bkauf...@bcmone.com>
24 hour client support: +1.855.639.6300

[https://www.bcmone.com/files/bcmone-logo.png]<https://www.bcmone.com/>   
[https://www.bcmone.com/files/twitter-icon-circle.png] 
<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.facebook.com%2Fbcmonenyc%2F&data=04%7C01%7Cbkaufman%40bcmone.com%7Ca8dcab59260b47fc22ca08da0da9aac5%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C637837319626464509%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000&sdata=I8DcdgKr2vI3NhrR0spME2IsVgGJI%2FNHKS624JdBegs%3D&reserved=0>
   [https://www.bcmone.com/files/twitter-icon-circle.png] 
<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2Fbcm_one%2F&data=04%7C01%7Cbkaufman%40bcmone.com%7Ca8dcab59260b47fc22ca08da0da9aac5%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C637837319626464509%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000&sdata=vpmzo209ZndRiwIPS9QV0%2FNmWdATDzfgL%2BWYHK82%2BVI%3D&reserved=0>
   [https://www.bcmone.com/files/linkedin-icon-circle.png] 
<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.linkedin.com%2Fcompany%2Fbusiness-communications-management%2F&data=04%7C01%7Cbkaufman%40bcmone.com%7Ca8dcab59260b47fc22ca08da0da9aac5%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C637837319626464509%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000&sdata=ensUvBnTZoLy3xsvYK3AbbZ3WV7CfQouvmv60E7bY0Q%3D&reserved=0>

NOTE: This e-mail and any attachments are from BCM One, Inc. and are intended
solely for the use and review of the individual(s) to whom it is addressed.
If you believe you received this e-mail in error, please notify the sender
immediately, delete the e-mail (and any attachments) from your computer and do
not copy or disclose it to anyone else.

__
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Kamailio preprocessor to get hostname

2022-04-06 Thread Ben Kaufman
#!defenv HOSTNAME

Should work.

Ben Kaufman

From: sr-users  On Behalf Of David VILLAUME
Sent: Wednesday, April 6, 2022 2:00 PM
To: Kamailio (SER) - Users Mailing List 
Subject: [SR-Users] Kamailio preprocessor to get hostname

Hello all ,

Do you know any way to get the hostname of my server at kamailio runtime ?

The simple idea behind this would be ton import a specific environment file 
base on hostname.

Regards,
David

__
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] How to submit updates for core documentation?

2022-03-24 Thread Ben Kaufman
That would be nice if the self registration doesn't work (I don't think it 
does).

I'd prefer to not use a different email address, though, so I'll ping you 
individually.  Thank you.

Ben Kaufman
Sr. VoIP Engineer - BCM One

+1.612.735.9309
bkauf...@bcmone.com<mailto:bkauf...@bcmone.com>
24 hour client support: +1.855.639.6300

From: Henning Westerholt 
Sent: Thursday, March 24, 2022 10:31 AM
To: Kamailio (SER) - Users Mailing List 
Cc: Ben Kaufman 
Subject: RE: How to submit updates for core documentation?

Hello,

this is maintained in the wiki, so it can be directly edited there. If you need 
a user, just let me know. (Anonymous editing is disabled due to spam).

Cheers,

Henning

--
Henning Westerholt - 
https://skalatan.de/blog/<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fskalatan.de%2Fblog%2F&data=04%7C01%7Cbkaufman%40bcmone.com%7C4d2c29a9046d4fd0fc4f08da0dab575d%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C637837326824846937%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=QoPBP7idwSTBidaqhYtR7tYCzPnj1U6v8X%2FBeGiUJAU%3D&reserved=0>
Kamailio services - 
https://gilawa.com<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgilawa.com%2F&data=04%7C01%7Cbkaufman%40bcmone.com%7C4d2c29a9046d4fd0fc4f08da0dab575d%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C637837326824846937%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=Zy%2F1jhPbuqOrxRbdVxiAhcMjSU0GyTcLHL84L0GECNg%3D&reserved=0>

From: sr-users 
mailto:sr-users-boun...@lists.kamailio.org>>
 On Behalf Of Ben Kaufman
Sent: Thursday, March 24, 2022 4:19 PM
To: Kamailio (SER) - Users Mailing List 
mailto:sr-users@lists.kamailio.org>>
Subject: [SR-Users] How to submit updates for core documentation?

Hello,


I had a small patch merged for 5.6 to add preprocessor macros #!trydefenv and 
#!trydefenvs.  
(https://github.com/kamailio/kamailio/issues/2967<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fkamailio%2Fkamailio%2Fissues%2F2967&data=04%7C01%7Cbkaufman%40bcmone.com%7C4d2c29a9046d4fd0fc4f08da0dab575d%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C637837326824846937%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=1%2Bg6I%2FqRRRTSFdpyl8B%2BCjx1G94fJ07bbVrGNNYoGBE%3D&reserved=0>),
 but they need documentation.  I believe that they should ultimately end up on 
this page: 
https://www.kamailio.org/wiki/cookbooks/devel/core<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.kamailio.org%2Fwiki%2Fcookbooks%2Fdevel%2Fcore&data=04%7C01%7Cbkaufman%40bcmone.com%7C4d2c29a9046d4fd0fc4f08da0dab575d%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C637837326824846937%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=7rSkwcLYQiyOExy9%2FA%2BzSo1JlXM2wSN4qE6CaIzTHZs%3D&reserved=0>.
  I don't see this in the /doc section of the repo.  What's the process for me 
to submit this documentation?


Ben Kaufman
Sr. VoIP Engineer - BCM One

+1.612.735.9309
bkauf...@bcmone.com<mailto:bkauf...@bcmone.com>
24 hour client support: +1.855.639.6300

[https://www.bcmone.com/files/bcmone-logo.png]<https://www.bcmone.com/>   
[https://www.bcmone.com/files/twitter-icon-circle.png] 
<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.facebook.com%2Fbcmonenyc%2F&data=04%7C01%7Cbkaufman%40bcmone.com%7C4d2c29a9046d4fd0fc4f08da0dab575d%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C637837326824846937%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=WcmQAJKcYXkPKBuVf5DmpPCCdr%2B5%2Bgsa2PKM82Ok1xc%3D&reserved=0>
   [https://www.bcmone.com/files/twitter-icon-circle.png] 
<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2Fbcm_one%2F&data=04%7C01%7Cbkaufman%40bcmone.com%7C4d2c29a9046d4fd0fc4f08da0dab575d%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C637837326824846937%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=5n4f6bvCxrph9zWdUwHuF84CrbihjbAQ6epgBQtzDkc%3D&reserved=0>
   [https://www.bcmone.com/files/linkedin-icon-circle.png] 
<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.linkedin.com%2Fcompany%2Fbusiness-communications-management%2F&data=04%7C01%7Cbkaufman%40bcmone.com%7C4d2c29a9046d4fd0fc4f08da0dab575d%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C637837326824846937%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=J3XrIFx4cjir0J%2FBcmQSQ34tXn7zb9UoPdu8USv2vnc%3D&reserved=0>

NOTE: This e-mail and any attachments are from BCM One, Inc. and are intended
solely for the use and revi

[SR-Users] How to submit updates for core documentation?

2022-03-24 Thread Ben Kaufman
Hello,


I had a small patch merged for 5.6 to add preprocessor macros #!trydefenv and 
#!trydefenvs.  (https://github.com/kamailio/kamailio/issues/2967), but they 
need documentation.  I believe that they should ultimately end up on this page: 
https://www.kamailio.org/wiki/cookbooks/devel/core.  I don't see this in the 
/doc section of the repo.  What's the process for me to submit this 
documentation?


Ben Kaufman
Sr. VoIP Engineer - BCM One

+1.612.735.9309
bkauf...@bcmone.com<mailto:bkauf...@bcmone.com>
24 hour client support: +1.855.639.6300

[https://www.bcmone.com/files/bcmone-logo.png]<https://www.bcmone.com/>   
[https://www.bcmone.com/files/twitter-icon-circle.png] 
<https://www.facebook.com/bcmonenyc/>   
[https://www.bcmone.com/files/twitter-icon-circle.png] 
<https://twitter.com/bcm_one/>   
[https://www.bcmone.com/files/linkedin-icon-circle.png] 
<https://www.linkedin.com/company/business-communications-management/>

NOTE: This e-mail and any attachments are from BCM One, Inc. and are intended
solely for the use and review of the individual(s) to whom it is addressed.
If you believe you received this e-mail in error, please notify the sender
immediately, delete the e-mail (and any attachments) from your computer and do
not copy or disclose it to anyone else.

__
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] DMQ version compatability

2022-03-18 Thread Ben Kaufman
Daniel,

In a recent thread you stated the following regarding DMQ compatibility between 
versions:

"if you do dmq replication between kamailio systems running different major 
versions, then it is likely to get memory leaks due to replication of data and 
most probably cannot be fixed. This is because internal structures of modules 
(also dmq commands) can change, practically what an instance does is not 
ensured to happen on the other instance. Just for example, from my mind, htable 
got some changes during past releases, dmq also has significant enhancements by 
getting support for more transport protocols."
Is it possible to get a bit more clarification on this, particularly as it 
relates to DMQ_USRLOC?  I'm hoping to do rolling updates, but don't want to end 
up in a situation where I've caused myself more problems than I've solved.


Ben Kaufman
__
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] SQLOPS sql_query_async() not functioning in an async manner?

2022-02-23 Thread Ben Kaufman
Thank you for the clarification, though unfortunate for my use case, this does 
make sense.  And, from a confirmation standpoint, yes, the failure is if the 
initial connection is never made.  I'll have to go another option like 
mentioned.

Ben Kaufman
Sr. VoIP Engineer - BCM One

+1.612.735.9309
bkauf...@bcmone.com
24 hour client support: +1.855.639.6300

-Original Message-
From: sr-users  On Behalf Of 
Daniel-Constantin Mierla
Sent: Wednesday, February 23, 2022 1:36 AM
To: Kamailio (SER) - Users Mailing List 
Subject: Re: [SR-Users] SQLOPS sql_query_async() not functioning in an async 
manner?

Hello,

the current async query API requires that the connection is established, 
because it uses the database handle pointer as one of the parameter.
That means the process initiating sql_query_async() attempts to connect if the 
connection is not on, and can get stuck for a while if the database server is 
not available. Probably can be refactored to do connect in the async task 
worker, but it's a change that has to be propagated to other modules like 
db_mysql, db_postgres and any other module using the async query db api 
function. Not expecting to be complex coding, but requiring time to do it.

While I added the async query db api function, it was at the time when Kamailio 
would fail to run if connection could not be initialized at the start up. Later 
someone else added sqlops connect_mode, so the connect is delayed, no longer 
done at the start up if its value is 1, but it is done by the process running 
the async query function. In other words, only the query itself is executed by 
async task process. The connection must be active in the other process.

At this moment, an alternative is to use mqueue+rtimer, to pass the query from 
sip worker process to rtimer process, which then executes the query.

Cheers,
Daniel

On 23.02.22 03:06, Alex Balashov wrote:
> Is there a difference in how it behaves when:
>
> a) A database that was previously reachable becomes unreachable or 
> unresponsive? vs. 
>
> b) A db_url that is not reachable in principle?
>
> - Alex
>
>> On Feb 22, 2022, at 7:11 PM, Ben Kaufman  wrote:
>>
>> I'm not sure if this is by design or not.  I have things I want to log to a 
>> SQL DB, but it's not nearly as important as call handling, so the 
>> sql_query_async() function looked ideal, but in testing, if the DB is not 
>> responsive, the call processing gets blocked.  In the example below, I'm 
>> using just a short hostname which isn't resolvable, but if I have an IP 
>> address there that isn't really assigned (for example if the DB server is 
>> down), the same blocking behavior is exhibited, but the error is slightly 
>> different (can't connect instead of unknown host).  
>>  
>>  
>>  
>> Here's my config.  This specific simple config was tested on Kamailio 5.5, 
>> but I observe similar behavior (in a more complicated config) in the dev 
>> branch as well.
>>  
>>  
>> - - - -
>>  
>> #!KAMAILIO
>>  
>> async_workers=2
>>  
>> loadmodule "db_mysql"
>> loadmodule "sqlops"
>> loadmodule "sl"
>> loadmodule "xlog"
>> loadmodule "pv"
>>  
>> force_rport=yes
>>  
>> ## Host sql does not resolve.
>> modparam("sqlops","sqlcon","cb=>mysql://kamailio:kamailiorw@sql/kamai
>> lio")
>> ## But start anyways.
>> modparam("sqlops", "connect_mode", 1)
>>  
>> request_route {
>> sl_send_reply("100", "Trying"); ## Prevent re-transmissions from 
>> the UAC
>>  
>> xlog("L_NOTICE", "Time before sql_query_async(): [$TV(Sn)]\n");
>> sql_query_async("cb", "INSERT INTO table1 (col) VALUES ('val')");
>>  
>> xlog("L_NOTICE", "Time before sl_send_reply(): [$TV(Sn)]\n");
>> sl_send_reply("404", "Not found"); }
>>  
>>  
>> Here's the log if I send a simple INVITE with SIPp. Note the 
>> timestamps
>>  
>> 9(16) NOTICE: 

[SR-Users] SQLOPS sql_query_async() not functioning in an async manner?

2022-02-22 Thread Ben Kaufman
I'm not sure if this is by design or not.  I have things I want to log to a SQL 
DB, but it's not nearly as important as call handling, so the sql_query_async() 
function looked ideal, but in testing, if the DB is not responsive, the call 
processing gets blocked.  In the example below, I'm using just a short hostname 
which isn't resolvable, but if I have an IP address there that isn't really 
assigned (for example if the DB server is down), the same blocking behavior is 
exhibited, but the error is slightly different (can't connect instead of 
unknown host).



Here's my config.  This specific simple config was tested on Kamailio 5.5, but 
I observe similar behavior (in a more complicated config) in the dev branch as 
well.


- - - -

#!KAMAILIO

async_workers=2

loadmodule "db_mysql"
loadmodule "sqlops"
loadmodule "sl"
loadmodule "xlog"
loadmodule "pv"

force_rport=yes

## Host sql does not resolve.
modparam("sqlops","sqlcon","cb=>mysql://kamailio:kamailiorw@sql/kamailio")
## But start anyways.
modparam("sqlops", "connect_mode", 1)

request_route {
sl_send_reply("100", "Trying"); ## Prevent re-transmissions from the UAC

xlog("L_NOTICE", "Time before sql_query_async(): [$TV(Sn)]\n");
sql_query_async("cb", "INSERT INTO table1 (col) VALUES ('val')");

xlog("L_NOTICE", "Time before sl_send_reply(): [$TV(Sn)]\n");
sl_send_reply("404", "Not found");
}


Here's the log if I send a simple INVITE with SIPp. Note the timestamps

9(16) NOTICE: 

Re: [SR-Users] kamailio log dialog correlation

2022-01-21 Thread Ben Kaufman
For line number:


  xlogl([ [facility,] level,] format)

Similar to xlog(), in addition prints configuration file line number at the 
beginning of message. 
https://kamailio.org/docs/modules/5.5.x/modules/xlog.html#xlog.f.xlogl




Ben Kaufman


-Original Message-
From: sr-users  On Behalf Of Chad
Sent: Wednesday, January 19, 2022 9:17 AM
To: Kamailio (SER) - Users Mailing List ; marek 

Subject: Re: [SR-Users] kamailio log dialog correlation

I wanted the same thing only with line number, in the end I had to do a global 
search and replace, I could not get it to work via a global param.
I even tried xlogl which just threw errors that no such command existed (even 
though it is listed in the docs: 
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fkamailio.org%2Fdocs%2Fmodules%2F5.0.x%2Fmodules%2Fxlog.html%23xlog.f.xlogl&data=04%7C01%7Cbkaufman%40bcmone.com%7C2512b4a26acc44d8b3a408d9db5ecaf8%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C637782022465024397%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=uMbNUPXj2O0Z50s7JyzRldgsdjLliktD5%2FSmL32SLTw%3D&reserved=0).

Here is what I ended up with:
xlog("L_INFO", "### Something to log ### Line: $cfg(line)\n");

Maybe someone else knows more, but I could not get it to work without 
hardcoding it into every xlog call.

--
^C


On 1/19/22 7:06 AM, marek wrote:
> hi,
> 
> is it possible create log of SIP dialog like 
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwiki.asterisk.org%2Fwiki%2Fdisplay%2FAST%2FUnique%2BCall-ID%2BLogging&data=04%7C01%7Cbkaufman%40bcmone.com%7C2512b4a26acc44d8b3a408d9db5ecaf8%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C637782022465024397%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=9O6Y47QgTBJJdRL9NOUsAaIdNz3peQzoZes8E6%2BHZpE%3D&reserved=0
>  ?
> 
> it looks like its possible like this
> 
>   xlog("L_INFO", "D$dlg(h_id)   something to log \n");
> 
> but i must copy $dlg(h_id) in every xlog
> 
> tried this
> 
> modparam("xlog", "prefix", "D$dlg(h_id)")
> 
> but it not works with variables
> 
> any other tips/ideas?
> 
> goal is to correlate logs for one dialog (call)
> 
> 
> thanks
> 
> Marek
> 
> 
> __
> Kamailio - Users Mailing List - Non Commercial Discussions
>   * sr-users@lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to the 
> sender!
> Edit mailing list options or unsubscribe:
>   * 
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
> s.kamailio.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fsr-users&data=04%7
> C01%7Cbkaufman%40bcmone.com%7C2512b4a26acc44d8b3a408d9db5ecaf8%7Cafc18
> 18e7b6848568913201b9396c4fc%7C1%7C0%7C637782022465024397%7CUnknown%7CT
> WFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI
> 6Mn0%3D%7C3000&sdata=vKjIzrpD7meLnncocL81A%2FxYSV1g26HiTjZLjiNHejQ
> %3D&reserved=0

__
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
  * 
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.kamailio.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fsr-users&data=04%7C01%7Cbkaufman%40bcmone.com%7C2512b4a26acc44d8b3a408d9db5ecaf8%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C637782022465024397%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=vKjIzrpD7meLnncocL81A%2FxYSV1g26HiTjZLjiNHejQ%3D&reserved=0

__
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Kamailio Stop processing SIP traffic

2021-12-27 Thread Ben Kaufman
If you can't share your kamailio config for reasons of corporate policy, etc. 
that makes sense.  Perhaps you can share "the simplest configuration possible 
in which the error occurs"?  There shouldn't be any need within the 
troubleshooting to have the "secret recipe" of your LCR selections, etc. 
present.  Additionally, reducing the problem to the simplest configuration in 
which it can occur is usually an invaluable tool for problem isolation.

Regards,

Ben Kaufman

From: sr-users  On Behalf Of pwerspire
Sent: Monday, December 27, 2021 10:45 AM
To: Kamailio (SER) - Users Mailing List 
Subject: Re: [SR-Users] Kamailio Stop processing SIP traffic

Already checked with sngrep and the INVITES are arriving.

I don't believe that is something related to the server because is not normal 
that when the issue happens, dialog commands like "kamcmd dlg.list" stop 
returning any prompt. During the time that the issue is not happening yet, the 
command just returns that is too big, then when Kamailio stops processing the 
Sip messages, the command will not work anymore.

Unfortunately, I cannot share the kamailio.cfg file.

Thanks,
Tiago

Sergio Charrua mailto:sergio.char...@voip.pt>> escreveu 
no dia segunda, 27/12/2021 à(s) 14:12:
ok, let's go 1 step at a time.

stop all firewalls, if any.
install sngrep SIP monitoring tool on your server
start sngrep and then (re)start your test script until you see Kamailio stoping 
accepting calls
check if sngrep receives SIP Invites

Also, please share your kamailio.cfg . It might help too.

obrigado,


Sérgio Charrua

[http://cdn.shopify.com/s/files/1/0380/5305/t/11/assets/logo.png?11469850511917603945]

www.voip.pt<https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.voip.pt%2F&data=04%7C01%7Cbkaufman%40bcmone.com%7C8ec092506e064d10c44008d9c958c1a7%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C637762205311842061%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=i3fmRZp9Hzwt%2B6mlAotUaPiex3PrUz5NvlGOMJTkd7I%3D&reserved=0>
Tel.: +351  21 130 71 77

Email : sergio.char...@voip.pt<mailto:sergio.char...@voip.pt>
This message and any files or documents attached are strictly confidential or 
otherwise legally protected.
It is intended only for the individual or entity named. If you are not the 
named addressee or have received this email in error, please inform the sender 
immediately, delete it from your system and do not copy or disclose it or its 
contents or use it for any purpose. Please also note that transmission cannot 
be guaranteed to be secure or error-free.






On Mon, Dec 27, 2021 at 12:23 PM pwerspire 
mailto:pwersp...@gmail.com>> wrote:
Hi,

I just repeated the test and there is no Kamailio process at 100%, they are low 
all the time even when the issue starts to happen.

I went through the logs and couldn't find any error, unfortunately, with 100 
CPS I can't put it on debug mode but only in info.

Regards,
Tiago

Ovidiu Sas mailto:o...@voipembedded.com>> escreveu no 
dia quinta, 23/12/2021 à(s) 03:15:
Check with htop if you don't have any kamailio procs at 100% CPU (due
to a deadlock).
Do you see any errors in the logs?

-ovidiu


On Wed, Dec 22, 2021 at 11:44 AM pwerspire 
mailto:pwersp...@gmail.com>> wrote:
>
> The CPU is around 30% during the test, is always really stable and memory 
> doesn't increase much.
>
> I'm using children=8.
>
>
>
> Sergio Charrua mailto:sergio.char...@voip.pt>> 
> escreveu no dia quarta, 22/12/2021 à(s) 16:27:
>>
>> any statistics regarding CPU use? how many threads?
>>
>> Sérgio Charrua
>>
>>
>> www.voip.pt<https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.voip.pt%2F&data=04%7C01%7Cbkaufman%40bcmone.com%7C8ec092506e064d10c44008d9c958c1a7%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C637762205311842061%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=i3fmRZp9Hzwt%2B6mlAotUaPiex3PrUz5NvlGOMJTkd7I%3D&reserved=0>
>> Tel.: +351 21 130 71 77
>>
>> Email : sergio.char...@voip.pt<mailto:sergio.char...@voip.pt>
>>
>> This message and any files or documents attached are strictly confidential 
>> or otherwise legally protected.
>>
>> It is intended only for the individual or entity named. If you are not the 
>> named addressee or have received this email in error, please inform the 
>> sender immediately, delete it from your system and do not copy or disclose 
>> it or its contents or use it for any purpose. Please also note that 
>> transmission cannot be guaranteed to be secure or error-free.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> On Wed, Dec 22, 2021 at

  1   2   >