Re: [OpenSIPS-Users] question on core statistics.

2024-04-18 Thread Wadii ELMAJDI | Evenmedia
Calling exit() during the initial request and right before creating the dialog 
also increments the drop_requests statistic

De : Users  De la part de Ben Newlin
Envoyé : jeudi 18 avril 2024 15:59
À : OpenSIPS users mailling list 
Objet : Re: [OpenSIPS-Users] question on core statistics.

Are you calling drop() anywhere in your script?

https://www.opensips.org/Documentation/Script-CoreFunctions-3-4#toc13

Ben Newlin

From: Users 
mailto:users-boun...@lists.opensips.org>> on 
behalf of Johan De Clercq mailto:jo...@democon.be>>
Date: Thursday, April 18, 2024 at 5:27 AM
To: OpenSIPS users mailling list 
mailto:users@lists.opensips.org>>
Subject: Re: [OpenSIPS-Users] question on core statistics.
 EXTERNAL EMAIL - Please use caution with links and attachments


would it make sense to recompile with other flags ? And how do I set them  (I 
don't find these of menuconfig's compile options)?
Currently it has MAX_RECV_BUFFER_SIZE 262144 and BUF_SIZE 65535.

Can somebody explain also what both flags mean.

Op do 18 apr 2024 om 11:07 schreef Johan De Clercq 
mailto:jo...@democon.be>>:
would it make sense to recompile with other flags ?
Currently it has MAX_RECV_BUFFER_SIZE 262144 and BUF_SIZE 65535.

Can somebody explain also what both flags mean.


flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC, F_MALLOC, 
FAST_LOCK-ADAPTIVE_WAIT
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, 
MAX_URI_SIZE 1024, BUF_SIZE 65535
poll method support: poll, epoll, sigio_rt, select.

Op do 18 apr 2024 om 10:32 schreef Johan De Clercq 
mailto:jo...@democon.be>>:

Guys,

I have an opensips instance running with 24 worker children.
The worker load is very low.
UDP queues are on 50 megs.

when i query via the OS
cat /proc/net/udp
  sl  local_address rem_address   st tx_queue rx_queue tr tm->when retrnsmt   
uid  timeout inode ref pointer drops
  590: 03231D0A:13C4 : 07 : 00: 
 00 413684019 2 880074820bc0 0
  591: 03231D0A:13C5 : 07 : 00: 
 00 413766438 2 880465e4a440 0
  592: 03231D0A:13C6 : 07 : 00: 
 00 412035865 2 8803e5a56b80 0
  934: 01231D0A:151C : 07 : 00: 
 00 26790 2 88046c054840 0
  935: 0201FFEF:151D : 07 : 00: 
 00 26787 2 88046c054bc0 0
  935: 01231D0A:151D : 07 : 00: 
 00 26791 2 88046c0544c0 0
 1972: :D92A : 07 : 00: 
 00 15506 2 88046dce5040 0
 5479: :E6DD : 07 : 00: 
 00 22811 2 880465e4ab40 0
12075: AA0914AC:00A1 : 07 : 00: 
 00 20572 2 88086d020800 0
12075: 017F:00A1 : 07 : 00: 
 00 20571 2 88086d020b80 0
13320: :857E : 07 : 00:    
1000 17515 2 8800368ac780 0
15661: :CEA3 : 07 : 00: 
 00 15505 2 8800368acb00 0

=> no drops

what worries me is that there are drop requests and they  go up when I query 
via the mi interface
opensipsctl fifo get_statistics drop_requests
core:drop_requests:: 198107
opensipsctl fifo get_statistics drop_requests
core:drop_requests:: 199157
opensipsctl_reg fifo get_statistics drop_requests
core:drop_requests:: 204116

I don't see any memory issue, also the processload is low.


so 3 questions:
- what exactly is drop_request.
- do I need to worry about this
- how can I make them go lower.
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] RE : Reset session timers via re-invite // update

2024-03-04 Thread Wadii ELMAJDI | Evenmedia
hi Stefan

your question is far from stupid

have you tried manipulating the SIP headers to influence the negotiation 
process between the provider and your PBX ?
you can do that by adjusting the Supported/Require headers in SIP messages 
within OpenSIPS to indicate that only re-INVITE is supported for session timers
this might prompt your new operator system to fallback to using re-INVITE 
instead of UPDATE
Additionally check if your PBX can be configured to prefer re-INVITEs


De : Users  de la part de Stefan Carlsson 

Envoyé : Monday, March 4, 2024 10:52:58 PM
À : users@lists.opensips.org 
Objet : [OpenSIPS-Users] Reset session timers via re-invite // update


Hi !



We have a problem regarding session timers.One operator runs it via 
re-invite and the new one via update.



All our PBX’s “inside” and UA’s runs re-invite and we have the Opensips as a 
proxy that routes all the traffic to the right UA, Trunks.



So my question is,   is it even possibly to handle both types of session timers 
methods in Opensips if endpoints only handles re-invite



I’ve tested to send the update with all headers intact back to the operator but 
then I receive 481 unknown dialog.



I’ve tried to read the RFC 3311 but I can’t find any examples that is so clear 
as re-invite …  (tags)



Do I need to change/add some headervalues such as the did i’ve got in the 200 
message after the invite to build  up

the complete Update response to the operator.



Please bear with me regarding with my “stupid” questions …  understanding sip 
is really hard ……



// Regards …



Stefan




___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Ratelimit usage

2023-10-27 Thread Wadii ELMAJDI | Evenmedia
Hello Adrien

Try :

if (!rl_check("test1", 1, "RED"))
{
   rl_dec_count("test1")
   send_reply(487, "Request Terminated: CPS limit exceeded");
   exit;
}

* If you are using ratelimit to limit only successful traffic, you need to 
explicitely decrease the counter for the declined calls using the 
rl_dec_count() function
also I’m not sure RED is the best algorithm for your usecase.

De : Users  De la part de Adrien LACOMME
Envoyé : vendredi 27 octobre 2023 17:06
À : users@lists.opensips.org
Objet : [OpenSIPS-Users] Ratelimit usage

Hi,

I'm trying to implement CPS limitation on OpenSIPS and I got some difficulties 
to understand how ratelimit module works.

Here is the setup (I want to limit cps to 1) :

if (!rl_check("test1", 1, "RED")) {
  send_reply(487, "Request Terminated: CPS limit exceeded");
}

I tried to make few calls simultaneously but rl_check return is always FALSE.

Here is the log I got :

2023-10-27T16:52:19.792337 SBC /usr/sbin/opensips[137782]: 
DBG:ratelimit:w_rl_check: Pipe test1 counter:1 load:0 limit:1 should NOT be 
blocked (0x7fcae1504888)
2023-10-27T16:52:19.804064 SBC /usr/sbin/opensips[137781]: 
DBG:ratelimit:w_rl_check: Pipe test1 counter:2 load:0 limit:1 should NOT be 
blocked (0x7fcae1504888)
2023-10-27T16:52:22.872991 SBC /usr/sbin/opensips[137782]: 
DBG:ratelimit:w_rl_check: Pipe test1 counter:3 load:0 limit:1 should NOT be 
blocked (0x7fcae1504888)
2023-10-27T16:52:22.918123 SBC /usr/sbin/opensips[137781]: 
DBG:ratelimit:w_rl_check: Pipe test1 counter:4 load:0 limit:1 should NOT be 
blocked (0x7fcae1504888)

Shouldn't the module block calls when the counter goes to 2 ? Or is he checking 
the load value to block ? If yes, why the load value isn't incremented ?

Regards,

Adrien LACOMME


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] RE : Stir ans Shaken - number is not in E.164 format

2023-09-06 Thread Wadii ELMAJDI | Evenmedia
Hello Michael,

Are you sure about that ?

As per the French implementation, it's essential to ensure that when an 
operator processes an Identity Shaken call, they do not modify the "User" 
section of the SIP From, To, and PAI headers.

Regarding portability, it's important to note that any addition of a 
portability prefix should exclusively occur at the SIP Request-URI header level.

Source Doc: MAN_Regles-techniques / 2.5.3 Persistance du header Identity.

In simpler terms, this means that the openips stir_shaken_verify function 
should validate the telephone number found in the TO header which must be in 
the E.164 format. Any necessary additional prefix should only be present within 
the RURI

De : Mickael Hubert
Envoyé le :Wednesday, September 6, 2023 3:12 PM
À : OpenSIPS users mailling list
Objet :Re: [OpenSIPS-Users] Stir ans Shaken - number is not in E.164 format

Nop Daren, in France it's possible to sign with a portability prefix :(

Le mer. 6 sept. 2023 à 14:53, David Villasmil 
mailto:david.villasmil.w...@gmail.com>> a écrit 
:
damn... it seems there's a new law in France to do stir/shaken...
Regards,

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


On Wed, Sep 6, 2023 at 2:38 PM Mickael Hubert 
mailto:mick...@winlux.fr>> wrote:
We are deploying it in France.
In France on providers interconnections, we can see a format (made in France 
maybe ;) )
prefix: +33
portability prefix: 10200
phonenumber national format without 0: 123456789

++


Le mer. 6 sept. 2023 à 14:30, David Villasmil 
mailto:david.villasmil.w...@gmail.com>> a écrit 
:
Is ST/SH being used other than the US? AFAIK it only applies to US numbers, 
thus 10 digits, no?

On Wed, 6 Sep 2023 at 14:27, Mickael Hubert 
mailto:mick...@winlux.fr>> wrote:
yep I found...

if (end - start < 2 || end - start > 15)
return -1;

I have to modify this code.
I will propose a PR.

Thanks a lot
++

Le mer. 6 sept. 2023 à 14:25, Marcin Groszek 
mailto:mar...@voipplus.net>> a écrit :

Correction : maximum of 15 digits .
On 9/6/2023 7:21 AM, Marcin Groszek wrote:

Your number is to long

E.164 is + [1-9]  and  {1-14} digits for total of 15 digits NOT starting with 0
On 9/6/2023 7:16 AM, Mickael Hubert wrote:
Hi all,
I have an issue, when I verify a call with no E164 format (dest: 
+3310200123456789)

logs:
Sep  6 13:39:48 am-scr-001 /usr/local/sbin/opensips[622409]: 
ERROR:stir_shaken:check_passport_phonenum: number is not in E.164 format: 
3310200123456789
Sep  6 13:39:48 am-scr-001 /usr/local/sbin/opensips[622409]: 
ERROR:stir_shaken:w_stir_verify: failed to validate Destination number 
(3310200123456789)

My configuration:
# - module  stir_shaken ---
loadmodule "stir_shaken.so"
#--- stir_shaken params -
modparam("stir_shaken", "ca_list", "/usr/local/etc/opensips/man_ca.pem")
modparam("stir_shaken", "require_date_hdr", 0)
modparam("stir_shaken", "verify_date_freshness", 60)

According to the doc e164_strict_mode is disabled by default, so I don't know 
why it doesn't work.

source of code:
if (_is_e164(num, e164_strict_mode) == -1) {
LM_GEN(log_lev, "number is not in E.164 format: %.*s\n", 
num->len, num->s);
return -1;
}


Do you have any help for me please ? I have to validate this format of dest 
number.

Thanks in advance




___

Users mailing list

Users@lists.opensips.org

http://lists.opensips.org/cgi-bin/mailman/listinfo/users

--

Best Regards:

Marcin Groszek

Business Phone Service

https://www.voipplus.net



___

Users mailing list

Users@lists.opensips.org

http://lists.opensips.org/cgi-bin/mailman/listinfo/users

--

Best Regards:

Marcin Groszek

Business Phone Service

https://www.voipplus.net
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

___
Users mailing list

[OpenSIPS-Users] Issue with CRL Validation in French STIR/SHAKEN Implementation

2023-08-07 Thread Wadii ELMAJDI | Evenmedia
Hello

I have run into a problem with the STIR/SHAKEN verification process.
In the French implementation of StirShaken, the CRL of the operator 
certificates is signed with a certificate that is different from the one used 
to sign providers certificates.
and in such case, OpenSSL does not allow in one command to validate the entire 
certification chain.

Also, OPENSIPS stirshaken module's stir_shaken_verify function fails to 
validate providers certificate (with CRL Loaded)

Error : certificate validation failed: unable to get certificate CRL

For now, following the guidelines suggested by the French authority handling 
STIR/SHAKEN, we are planning to implement a two-step approach to check CRL 
before stir_shaken_verify kicks in (w/o CRL loaded)
First, we verify the certification chain of the provider's certificate, plus 
making sure CA's certificates are not revoked. We do this using a command like:

openssl verify -CAfile /etc/opensips/example_certs/ca_list.pem -untrusted 
/etc/opensips/example_certs/example_pa.pem -extended_crl -crl_check_all 
-CRLfile /etc/opensips/example_certs/crl_list.pem 
/etc/opensips/example_certs/ProviderCertificate.cer

Where example_pa.pem is the certificate used to sign CRL of providers 
certificates, and crl_list : the concatenation of both providers and CA's CRLs 
in PEM format.
The second step involves a separate check to verify if the provider's 
certificate is revoked :

openssl crl -in /etc/opensips/example_certs/crl_list.pem -noout -text | grep 
$(openssl x509 -in /etc/opensips/example_certs/ProviderCertificate.cer -noout 
-serial | cut -d '=' -f 2)

This will add an extra processing time due to a double certification validation 
(ran by both by openssl and stir_shaken_verify)  + reading crls from disk.

Given this situation, it would be highly beneficial if Opensips could 
accommodate cases where revocation lists are signed with a different 
certificate. This would not only simplify the verification process but also 
improve compatibility for similar future scenarios (like a complex certificate 
hierarchy)

Suggestion :

Consider adding an exported parameter, such as :
modparam("stir_shaken", "crl_signing_certs", 
"/stir_certs/crl_signing_certs.pem")

This parameter would allow users to specify a list of separate certificates 
used to sign the CRLs, in cases where the CRLs and the provider certificates 
are not signed by the same certificate.
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Stir Shaken: Failed to load certificate

2023-05-29 Thread Wadii ELMAJDI | Evenmedia
Hello Mickael

if the goal is only to keep your key out of opensips plain sight, the simplest 
way is using exec.so module, load the private key from a local file or an 
external data source with an external command, and then store it securely in 
the local cache for future calls stirshaken signing.
you could also use the rest_client.so module and get your key/certificate from 
a secure external webservice (my personal fav)
another option is avpops module to get your private key from a sql database on 
demand (or sqlcacher to full cache your table on script startup)
in case you're considering using the avpops module with its default table, the 
value column can by default only hold 128 characters. for an RSA private key in 
PEM format, it can go up to 800 chars.
hope this helps

De : Users  De la part de Mickael Hubert
Envoyé : lundi 29 mai 2023 14:55
À : OpenSIPS users mailling list 
Objet : Re: [OpenSIPS-Users] Stir Shaken: Failed to load certificate

Hi,
Can you tell me what is the best way to load our private key please ?
It would be great not to have it as clear text in opensips's configuration.

thanks in advance

Le lun. 21 nov. 2022 à 13:39, ryan embgrets 
mailto:rembgr...@gmail.com>> a écrit :
That was it.

Working flawlessly.Thanks Vlad Patrascu

Ryan

On Mon, 21 Nov 2022 at 17:24, Vlad Patrascu 
mailto:vl...@opensips.org>> wrote:
Hi Ryan,

You have to provide to the stir_shaken_auth() function the actual
content of the certificate file and not just the path. The same goes for
the private key.

Regards,

--
Vlad Patrascu
OpenSIPS Core Developer
http://www.opensips-solutions.com

On 21.11.2022 14:02, ryan embgrets wrote:
> Greetings
>
> I am trying to generate an Identity header by using the stir_shaken
> module of the opensips.
>
> But I am encountering the below error each time upon call.
>
> Nov 21 11:15:20 local /usr/sbin/opensips[5051]:
> ERROR:stir_shaken:w_stir_verify: Failed to load certificate
> Nov 21 11:15:20 local /usr/sbin/opensips[5051]:
> ERROR:stir_shaken:load_cert: Failed to parse certificate
>
> #Module section.
> loadmodule "stir_shaken.so"
>
> route{
>
>   $var(cert) = "/etc/opensips/certs.pem";
>$var(privKey) = "/etc/opensips/key.pem";
>   stir_shaken_auth("A", "",$var(cert), $var(privKey),
> "https://domain.org/cert.pem;);
> }
>
> Though the cert looks valid, has proper permission for the opensips to
> access them and cross checked with openssl for the verification.
>
> Any pointer on what might be causing this?
>
> Ryan
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] Question related to sst module

2023-03-03 Thread Wadii ELMAJDI | Evenmedia
Hello,

I noticed a segmentation fault is caused by sst module :
Client B2BUA (UAC) invite has : Session-Expires: 1000 Min-SE: 90
Opensips SST min_se configured at 1800s, dialog has sst_flag.
This causes Opensips to crash :

opensips log :

Mar  3 13:06:10 test-boxopensips /usr/sbin/opensips[6088]: 
CRITICAL:core:sig_usr: segfault in process pid: 6088, id: 6
Mar  3 13:06:11 test-boxopensips /usr/sbin/opensips[6082]: 
INFO:core:handle_sigs: child process 6088 exited by a signal 11
Mar  3 13:06:11 test-boxopensips /usr/sbin/opensips[6082]: 
INFO:core:handle_sigs: core was not generated
Mar  3 13:06:11 test-boxopensips /usr/sbin/opensips[6082]: 
INFO:core:handle_sigs: terminating due to SIGCHLD

Sys log :

Mar  3 13:06:58 test-boxopensips kernel: [ 9969.171168] opensips[6185]: 
segfault at 968 ip 7f3da464b901 sp 7ffe8aec6f00 error 4 in 
tm.so[7f3da4617000+46000]
Mar  3 13:06:58 test-boxopensips kernel: [ 9969.173758] Code: 89 44 24 68 31 c0 
81 fa c7 00 00 00 0f 87 17 02 00 00 41 8d 84 24 d4 fe ff ff 83 f8 63 0f 86 0e 
01 00 00 48 8b 85 f0 00 00 00 <8b> 80 68 09 00 00 41 33 85 68 09 00 00 a8 01 0f 
85 39 01 00 00 4c

I have already solved the scripting problem by using sstCheckIn to adapt 
SessionExpire value to Opensips's min_se value.
Also, if the the UAC changes its session expires value to any value identical 
or higher than the one configured in OpenSIPS min_se value solves the problem.

My question : is this a normal behavior for opensips to completely crash ?

Opensips version :

version: opensips 3.2.11 (x86_64/linux)
flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC, Q_MALLOC, 
F_MALLOC, HP_MALLOC, DBG_MALLOC, FAST_LOCK-ADAPTIVE_WAIT
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, 
MAX_URI_SIZE 1024, BUF_SIZE 65535
poll method support: poll, epoll, sigio_rt, select.
main.c compiled on  with gcc 10

Thank you.


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] SST min_se lower than both UA Session-Expires

2023-02-28 Thread Wadii ELMAJDI | Evenmedia
Hello, question related to sst module.
Suppose a use case on which the UAC (A) offers during the invite 
Session-Expires : 4000, MIN-SE :90
UAS (B) configured sessions-expires=5000s but responds : "Session-Expires : 
4000, refresher=uas" to match UAC's request.
That means at roughly 2000 seconds the refresher (UAS (B) in our example) must 
send a re-invite request to keep the dialog alive. (halftime as expected #RFC 
4028#)
In the middle of both UAS and UAC an opensips box acting as a proxy running sst 
module and min_se configured on default value (1800s) (no sstCheckMin)
Opensips won't change anything related to the use of session times headers 
since the UAC requested it already, but still will set the dialog expiry date 
to initial invite time + 1800s, expecting a re invite before timeout, But since 
both UA agreed on 4000s SE, the reinvite will happen at +2000s. This will cause 
opensips upon reaching dialog lifetime (1800s), to trigger BYEs both ways 
hanging up the call.
Is this normal behavior ?

Thank you.

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] rabbitMq_publish (async ?)

2023-01-17 Thread Wadii ELMAJDI | Evenmedia
Hello,

I am using the new rabbitmq module to send some informations as AMQP messages 
to a rabbitmq server. Mostly fraud detection + CDR.

I wanted to know if rabbitmq_publish is considered a blocking function? for 
example in the case of fraud detection warning, my use case is to publish the 
message to rabbitmq server and continue the sip routing decision without 
hanging up the call.

Should i use the launch statement , or is rabbitmq_publish not a blocking 
function already ?

Ex : launch(rabbitmq_publish(...));

Thank you
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Media server communication with OpenSIPS

2022-12-29 Thread Wadii ELMAJDI | Evenmedia
Hello,

The invite is relayed from OpenSIPS to Asterisk. Asterisk has UAS role here.
The data i'm hoping to transfer to OPENSIPS should be sent either with the 200 
OK (Asterisk to OpenSIPS), during the call, or via BYE.
So neither PJSIP_HEADER nor PJSIP_RESPONSE_HEADER can help with my usecase.
I have already used  pjsip session refresh to renegotiate media codecs during a 
call, but i've never tried adding an extraheader to the re-invite/update method.
I will try this asap, thank you for the detailed answer.



De : Users  de la part de Gregory Massel 

Envoyé : jeudi 29 décembre 2022 20:28
À : users@lists.opensips.org 
Objet : Re: [OpenSIPS-Users] Media server communication with OpenSIPS


You can send custom headers from Asterisk to OpenSIPS using:

https://wiki.asterisk.org/wiki/display/AST/Asterisk+18+Function_PJSIP_HEADER

If you need Asterisk to receive customer headers from OpenSIPS, you can read 
custom headers added by OpenSIPS to its 200 response using:

https://wiki.asterisk.org/wiki/display/AST/Asterisk+18+Function_PJSIP_RESPONSE_HEADER


If you are already midway through a call, you can force an UPDATE or re-INVITE 
using:

https://wiki.asterisk.org/wiki/display/AST/Asterisk+18+Function_PJSIP_SEND_SESSION_REFRESH


While I haven't personally tested, I'd expect that you should be able to signal 
custom information midway through a call with a 
Set(PJSIP_HEADER(add,X-MyHeader)=myvalue) followed by a 
Set(PJSIP_SEND_SESSION_REFRESH()=invite). This should then trigger a re-INVITE 
carrying the new X-MyHeader within it.

Similarly, after triggering the a re-INVITE or UPDATE, you should then be able 
to do a Set(MYVAR=PJSIP_RESPONSE_HEADER(read,X-MyHeader)) to extract what 
OpenSIPS has sent back to Asterisk in its 200 response.


Although more messy, there are also other tricks that you can use, including 
the CONNECTEDLINE function:

https://wiki.asterisk.org/wiki/display/AST/Manipulating+Party+ID+Information

https://wiki.asterisk.org/wiki/display/AST/Asterisk+18+Function_CONNECTEDLINE

e.g. If you did a 
Set(CONNECTEDLINE(name)=Information_I_wish_to_share_with_OpenSIPS), then this 
will, in one step, trigger an UPDATE or re-INVITE carrying the new connected 
party name in the SIP headers, detail which you can then extract from OpenSIPS. 
Similarly, you can also use this approach read information that OpenSIPS has 
sent to Asterisk, with a Set(MYVAR=CONNECTEDLINE(name)).

I mention this in case, for whatever reason, the first approach (described 
above) doesn't work as planned, however, the first approach is definitely 
preferable as you can carry the information in your own X- header, making it 
far easier to send/receive multiple headers.

On Tue, Dec 27, 2022 at 8:55 AM Wadii ELMAJDI | Evenmedia 
mailto:wa...@evenmedia.fr>> wrote:
>
> Hello,
>
>
> I am using Asterisk as a media server behind OpenSIPS.
> I need to send some additional data to opensips during the call or at the 
> latest during the hangup. For instance a custom hang up reason.
> Asterisk does not allow neither to send a sequential request withing an 
> ongoing dialog, nor add headers to a BYE method.
> The current solution I’m using is pushing a dialog var (dlg_push_var) using 
> Call-ID via (mi_http), but that means I rely on a curl http request during my 
> call…
> Is there any better option for a direct communication between the two boxes 
> during a call ? without any intermediate server (Redis DB …)
>
> Thank you
>
> ___
> Users mailing list
> Users@lists.opensips.org<mailto:Users@lists.opensips.org>
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users



___
Users mailing list
Users@lists.opensips.org<mailto:Users@lists.opensips.org>
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Media server communication with OpenSIPS

2022-12-28 Thread Wadii ELMAJDI | Evenmedia
Hello,

I must send more data than just a hangup code:  a duration,  a text value..
X-Asterisk-HangupCauseCode is only sent when a called is hung up after being 
answered. Plus, it isn’t really a custom header. It must be an int value. Same 
for Q.850 reason header.
I will maintain my current solution then (the in-dialog request via mi_http)

Thank you


De : Users  De la part de Brett Nemeroff
Envoyé : mardi 27 décembre 2022 16:18
À : OpenSIPS users mailling list 
Objet : Re: [OpenSIPS-Users] Media server communication with OpenSIPS

If your UAC doesn't have the capabilities of sending it in the BYE or an 
in-dialog request, then you'll have to do something out of band like HTTPS, 
Redis, etc, which are not bad options. Have you looked into 
"X-Asterisk-HangupCauseCode" to see if that can help you out?


On Tue, Dec 27, 2022 at 8:55 AM Wadii ELMAJDI | Evenmedia 
mailto:wa...@evenmedia.fr>> wrote:
>
> Hello,
>
>
> I am using Asterisk as a media server behind OpenSIPS.
> I need to send some additional data to opensips during the call or at the 
> latest during the hangup. For instance a custom hang up reason.
> Asterisk does not allow neither to send a sequential request withing an 
> ongoing dialog, nor add headers to a BYE method.
> The current solution I’m using is pushing a dialog var (dlg_push_var) using 
> Call-ID via (mi_http), but that means I rely on a curl http request during my 
> call…
> Is there any better option for a direct communication between the two boxes 
> during a call ? without any intermediate server (Redis DB …)
>
> Thank you
>
> ___
> Users mailing list
> Users@lists.opensips.org<mailto:Users@lists.opensips.org>
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] Media server communication with OpenSIPS

2022-12-27 Thread Wadii ELMAJDI | Evenmedia
Hello,

I am using Asterisk as a media server behind OpenSIPS.
I need to send some additional data to opensips during the call or at the 
latest during the hangup. For instance a custom hang up reason.
Asterisk does not allow neither to send a sequential request withing an ongoing 
dialog, nor add headers to a BYE method.
The current solution I'm using is pushing a dialog var (dlg_push_var) using 
Call-ID via (mi_http), but that means I rely on a curl http request during my 
call...
Is there any better option for a direct communication between the two boxes 
during a call ? without any intermediate server (Redis DB ...)

Thank you
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] RTPPROXY / OPENSIPS

2022-12-23 Thread Wadii ELMAJDI | Evenmedia
hello , i do have a question related to rtpproxy module documentation.

The doc describes that rewriting sdp body should happen during either INVITE , 
200 OK or ACK.
In the case of SDP presence on invite <=> 200 , one should rtpproxy_offer 
during the invite and rtpproxy_answer during the 200 OK.

"Documentation : Rewrites SDP body to ensure that media is passed through an 
RTP proxy. To be invoked on INVITE for the cases the SDPs are in INVITE and 200 
OK and on 200 OK when SDPs are in 200 OK and ACK."

But sometimes opensips receives a 183 Session Progress containing SDP before 
the 200 which i think is related to earlymedia .
I think those sdp packets should also be rewritten with the right rtp proxy 
ip/port. In which case the doc should mention "SDPs are in INVITE and 200 OK 
/183 Session Progress".

My second question : since we can handle most cases with rtpproxy_offer/answer 
methods, what is the purpose of rtpproxy_engage ? is it to ease the management 
i described above ?

Thank you


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] REPLICATION / SQL_CACHER / Local CacheDB Collection

2022-12-19 Thread Wadii ELMAJDI | Evenmedia
I ended up using dialplan module with a new partition dedicated to CLID.


De : Users  De la part de Wadii ELMAJDI | 
Evenmedia
Envoyé : lundi 19 décembre 2022 15:44
À : OpenSIPS users mailling list 
Objet : [OpenSIPS-Users] REPLICATION / SQL_CACHER / Local CacheDB Collection

Hello ,

I am trying to cache an entire MySQL table containing CLIDs/Clients Mapping.
My use case is to check pre every call , if the $fU used belongs to the client 
(via its ip source).
I am using SQL CACHER (ondemand = 0) mode module, my opensips box is clustered.
the cached_url for SQL_CACHER is a local collection (cachedb_url=local:///clid)
I am getting an error that I cannot use an opensips replicatedcache db :


Dec 19 15:31:18 primary /usr/sbin/opensips[41751]: 
ERROR:sql_cacher:db_init_test_conn: Cannot use an OpenSIPS replicated cached
Dec 19 15:31:18 primary /usr/sbin/opensips[41751]: ERROR:sql_cacher:mod_init: 
Failed to validate db conns for cache entry
Dec 19 15:31:18 primary /usr/sbin/opensips[41751]: ERROR:core:init_mod: failed 
to initialize module sql_cacher
Dec 19 15:31:18 primary /usr/sbin/opensips[41751]: ERROR:core:main: error while 
initializing modules

I can use cachedb_local module elsewhere, all cached data is replicated via the 
cluster with no problem. I don’t see why it causes such problem only when using 
SQLCACHER.

Is there anyway to exclude one specific collection from the replication mode ?  
is there any better approach for my use case ?

I know I can use REDIS or MongoDB for such use case, but I’m trying to lower 
the numbers of servers to monitor 


Thank you




___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] REPLICATION / SQL_CACHER / Local CacheDB Collection

2022-12-19 Thread Wadii ELMAJDI | Evenmedia
Hello ,

I am trying to cache an entire MySQL table containing CLIDs/Clients Mapping.
My use case is to check pre every call , if the $fU used belongs to the client 
(via its ip source).
I am using SQL CACHER (ondemand = 0) mode module, my opensips box is clustered.
the cached_url for SQL_CACHER is a local collection (cachedb_url=local:///clid)
I am getting an error that I cannot use an opensips replicatedcache db :

Dec 19 15:31:18 primary /usr/sbin/opensips[41751]: 
ERROR:sql_cacher:db_init_test_conn: Cannot use an OpenSIPS replicated cached
Dec 19 15:31:18 primary /usr/sbin/opensips[41751]: ERROR:sql_cacher:mod_init: 
Failed to validate db conns for cache entry
Dec 19 15:31:18 primary /usr/sbin/opensips[41751]: ERROR:core:init_mod: failed 
to initialize module sql_cacher
Dec 19 15:31:18 primary /usr/sbin/opensips[41751]: ERROR:core:main: error while 
initializing modules

I can use cachedb_local module elsewhere, all cached data is replicated via the 
cluster with no problem. I don’t see why it causes such problem only when using 
SQLCACHER.

Is there anyway to exclude one specific collection from the replication mode ?  
is there any better approach for my use case ?

I know I can use REDIS or MongoDB for such use case, but I’m trying to lower 
the numbers of servers to monitor 


Thank you



___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] Erasing statistics groups from memory

2022-12-02 Thread Wadii ELMAJDI | Evenmedia
Hello,

I am using statistics module to store CPS data on demand (via an external 
variable shv_set), keys are current seconds ,example :

opensips-cli -x mi get_statistics cps:
{
"cps:2:20221202143557": 1,
"cps:2:20221202143613": 1,
"cps:2:20221202143616": 1
}

The data is stored on the server memory, and then reset via a time_route 
everyday (reset_stat) which updates the counters to 0 but the keys persist on 
my server.
Is there anyway to erase those keys from the memory "cps:2" Without 
restarting my server ?
I know I can use an external Redis or MYSQL servers for such purpose , but I'm 
trying as much as possible to keep everything inside opensips.

Thank you


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] Opensips-CLI Upgrade

2022-11-30 Thread Wadii ELMAJDI | Evenmedia
Hello,

After running a system upgrade opensips-cli package was upgraded.
Since then, no opensips mi commands is working , error :

Nov 30 13:54:07 1 /usr/sbin/opensips[2484]: ERROR:mi_fifo:get_reply_filename: 
forbidden filename: opensips_fifo_reply_1669816447.3951223:{"jsonrpc": "2.0", 
"id": "8296", "method": "which", "params": []}
Nov 30 13:54:07 1 /usr/sbin/opensips[2484]: ERROR:mi_fifo:mi_fifo_callback: 
error trimming filename: opensips_fifo_reply_1669816447.3951223

lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:Debian GNU/Linux 11 (bullseye)
Release:11
Codename:   bullseye

opensips -V
version: opensips 3.2.9 (x86_64/linux)
flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC, Q_MALLOC, 
F_MALLOC, HP_MALLOC, DBG_MALLOC, FAST_LOCK-ADAPTIVE_WAIT
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, 
MAX_URI_SIZE 1024, BUF_SIZE 65535
poll method support: poll, epoll, sigio_rt, select.
main.c compiled on  with gcc 10

Opensips-cli version : OpenSIPS CLI 0.1.0
Config  file (~/.opensips-cli.cfg) :

[default]
log_level: WARNING
prompt_name: opensips-cli
prompt_intro: Welcome to OpenSIPS Command Line Interface!
prompt_emptyline_repeat_cmd: False
history_file: ~/.opensips-cli.history
history_file_size: 1000
output_type: pretty-print
communication_type: fifo
fifo_file: /var/run/opensips/opensips_fifo
fifo_reply_dir: /var/run/opensips/

database_modules: ALL
database_name: opensips
database_admin_url: mysql://DB
database_url: mysql://DB

Thank you
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] Opensips 3.2 Ratecacher

2022-11-28 Thread Wadii ELMAJDI | Evenmedia
Hello,

I was able to install ratecacher module and make it work.
But editing the clients hash size parameter generates an error.
"ERROR:core:set_mod_param_regex: parameter  not found in 
module "
however vendors_hash_size is correctly identified as a rate_cacher parameter
Everything works when removing clients one
I am running opensips :

version: opensips 3.2.9 (x86_64/linux)
flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC, Q_MALLOC, 
F_MALLOC, HP_MALLOC, DBG_MALLOC, FAST_LOCK-ADAPTIVE_WAIT
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, 
MAX_URI_SIZE 1024, BUF_SIZE 65535
poll method support: poll, epoll, sigio_rt, select.
main.c compiled on  with gcc 10

### RATECACHER module
loadmodule "rate_cacher.so"
modparam("rate_cacher", "clients_db_url", "mysql://DB_STRING/opensips")
modparam("rate_cacher", "clients_db_table", "rc_clients")
modparam("rate_cacher", "rates_db_url", "mysql://DB_STRING/opensips")
modparam("rate_cacher", "rates_db_table", "rc_ratesheets")
modparam("rate_cacher", "vendors_db_url", "mysql://DB_STRING/opensips")
modparam("rate_cacher", "vendors_db_table", "rc_vendors")
modparam("rate_cacher", "vendors_hash_size", 1024)
modparam("rate_cacher", "clients_hash_size", 1024)
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] relay invites UAC

2022-11-20 Thread Wadii ELMAJDI | Evenmedia
I know i can route calls to any sip uri , i'm just trying to find the most 
suitable solution.

Its a usecase i never faced before, on which the sip trunk provider requires a 
registration and also challenging every outbound invite.

Do you confirm it wouldnt be a bad idea running a registration using 
uac_registrant module. which will allow me to receive calls from the sip 
provider endpoint.  At the same time add their host/ip as a gateway in order to 
route outbound calls to this same exact provider using DR module ?


De : Bogdan-Andrei Iancu 
Envoyé : vendredi 18 novembre 2022 11:27
À : OpenSIPS users mailling list ; Wadii ELMAJDI | 
Evenmedia 
Objet : Re: [OpenSIPS-Users] relay invites UAC

Hi Wadii,

You can route the call to any SIP URI you want :)

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
OpenSIPS Bootcamp 5-16 Dec 2022, online
  https://www.opensips.org/training/OpenSIPS_eBootcamp_2022/

On 11/15/22 10:14 PM, Wadii ELMAJDI | Evenmedia wrote:
Hello Everyone,

I am using opensips as sip proxy, receiving invites from my clients (mostly 
b2bua), that i should relay to some gateways.
I am using Dynamic route module for such purpose.
Some of those invites (depending on called DID or gateways probing) should be 
relayed to a sip trunk service provider.
My provider requires a registration, which i did using uac registrant module.
My question, is it possible to route calls to my sip provider knowing it is 
neither a Gateway, nor a subscriber ?

Thank you



___
Users mailing list
Users@lists.opensips.org<mailto:Users@lists.opensips.org>
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] relay invites UAC

2022-11-15 Thread Wadii ELMAJDI | Evenmedia
Hello Everyone,

I am using opensips as sip proxy, receiving invites from my clients (mostly 
b2bua), that i should relay to some gateways.
I am using Dynamic route module for such purpose.
Some of those invites (depending on called DID or gateways probing) should be 
relayed to a sip trunk service provider.
My provider requires a registration, which i did using uac registrant module.
My question, is it possible to route calls to my sip provider knowing it is 
neither a Gateway, nor a subscriber ?

Thank you
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] Best way to Route calls from pstn to registered pbx

2022-11-12 Thread Wadii ELMAJDI | Evenmedia
Hello ,

I would like to know what would be the best method for such use case :
My opensip box will play a sip proxy ROLE, handling inbound calls fom pstn to 
my clients (B2BUA PBXs).
My clients will have to register as some of them dont have a static ip.

Client (Asterisk) (A) < Registration => OPEN SIP (B)  <===> 
PSTN Trunk (C)

Call sequence is from C to A.

What i'm thinking is the best method, is to create my clients as subscribers 
with my server IP As the domain in order to skip the outbound_proxy config for 
my clients.

The PSTN trunk is using ip auth, i will just have to add its ip on my address 
table.

My question is  how am i supposed to route calls to my clients based on the 
called number ?
The only module that does routing rule processing with priorities, prefix 
etc... is DR, but it only route calls to gateways.

The alias_db is what is supposed to be used to route calls to subscribers, but 
it has no prefix, that means if i have 500Did , i have to add each one of them 
to dbaliases table.

Thanks for the help.


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users