Re: [OpenSIPS-Users] Staless mode in opensips

2023-12-05 Thread amel . guesmi
Hello
Sorry if I wasn’t clear.
We would like to implement a dialog stateless SIP proxy. Once the correct SIP 
routing is found, we would like to allow the SIP-based elements to perform 
midcall signaling directly with one another.
Best regards,


De : Users  De la part de Bogdan-Andrei Iancu
Envoyé : mardi 5 décembre 2023 12:17
À : OpenSIPS users mailling list ; GUESMI Amel 
SOFRECOM 
Cc : BARKAOUI Chaker SOFRECOM ; DESGEORGE 
Guillaume INNOV/IT-S 
Objet : Re: [OpenSIPS-Users] Staless mode in opensips

Hi,

Your post is a bit confusing when comes to state (and statefull) - are you 
talking about transaction statefull or dialog statefull ?

Regards,


Bogdan-Andrei Iancu



OpenSIPS Founder and Developer

  https://www.opensips-solutions.com

  https://www.siphub.com
On 05.12.2023 13:01, amel.gue...@sofrecom.com 
wrote:

Hi opensips experts,

We have always worked Opensips in a statefull mode and the first words in the 
routing module description are “OpenSIPS is basically only a transaction 
statefull proxy”.

I’ve also seen that there was a stateless module “The SL module allows OpenSIPS 
to act as a stateless UA server and generate replies to SIP requests without 
keeping state” but is it possible to use functionality of Opensips like 
dialplan and dispatcher without keeping state of the dialog ?

Thanks for your help

On belhalf of my colleague Guillaume

BR, Amel




___

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


Re: [OpenSIPS-Users] Help dropping SQL injection attacks

2023-12-05 Thread Gregory Massel via Users

Thank you Bogdan!

It's worth noting that, if using {s.escape.user}, it won't detect a SQL 
injection, however, it may detect other potentially problematic 
characters, so one then has to apply both checks individually, e.g.


if ( $fU != $(fU{s.escape.common}) || $tU != $(tU{s.escape.common}) ) {
xlog ("Rejecting SQL injection attempt received from 
$socket_in(proto):$si:$sp (Method: $rm; From: $fu; To: $tu; Contact: $ct).");
send_reply (403,"Forbidden");
exit;
}
if ( $fU != $(fU{s.escape.user}) || $tU != $(tU{s.escape.user}) ) {
xlog ("Rejecting request with unusual characters received from 
$socket_in(proto):$si:$sp (Method: $rm; From: $fu; To: $tu; Contact: $ct).");
send_reply (403,"Forbidden");
exit;
}

So above doesn't block UTF-8; it just enforces that it must be received 
from the client in fully escaped form.


I'm gathering that UTF-8 is actually acceptable for the user part (and 
most other parts) of the URI, provided that it's encoded with '%'? I 
work with purely ASCII user parts however, out of interest, was 
wondering if it is allowable and/or commonplace to use Unicode extended 
character sets for any portions of the URI in parts of the world where 
other character sets are more frequently used? From what I could find, 
it seems that UTF16 is not allowed in the User Part and that the domain 
would be internationalised using Punycode, so the full URI should always 
be encoded in ASCII but with UTF-8 (but not UTF-16) permitted in 
%-encoded form for the user part?


With respect to the Contact header, I'm struggling a bit. Is the syntax 
below correct?


if ( $(ct.fields(uri){uri.user}) != 
$(ct.fields(uri){uri.user}{s.escape.common}) ) {
send_reply (403,"Forbidden");
exit;
}

--
Thanks
*Gregory Massel*

On 2023-12-05 11:33, Bogdan-Andrei Iancu wrote:

Hi Gregory,

As it is said, there is no single way to skin the cat :). Your 
approach is a valid one, by using the escaping transformation. Maybe 
you should check the s.escape.user [1].


Such checks make sense when using avp_db_query(), so raw queries. The 
internal queries (like auth, etc) are done via prepared statements, so 
safe to injections.


[1] https://www.opensips.org/Documentation/Script-Tran-3-2#s.escape.user

Regards,
Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   https://www.opensips-solutions.com
   https://www.siphub.com
On 30.11.2023 02:34, Gregory Massel via Users wrote:


Hi all

I'm wondering what the best practice is in terms of detection and 
dropping attempted SQL injection attacks?


Is something like the following adequate or can this be enhanced:

if ( $fU != $(fU{s.escape.common}) || $tU != $(tU{s.escape.common}) ) {
drop();
}

Obviously this does not remove the need to escape anything passed to 
avp_db_query(), however, what I want to do is identify these sorts of 
attacks at the top of the script and avoid processing.


To date all the attacks I've seen focus on the contact and from user, 
e.g.:

INVITEsip:00111390237920793@x.x.x.x:5060;transport=UDP  SIP/2.0
Contact:
To:
From:;tag=v2pjtxqb
I'm not quite sure how to match the Contact user. Would the following 
work?

if ( $(ct.fields(uri){uri.user}) != 
$(ct.fields(uri){uri.user}{s.escape.common}) ) {
drop();
}
--
Regards
*Gregory Massel*

___
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


Re: [OpenSIPS-Users] Dialplan

2023-12-05 Thread Prathibha B
Thanks, I'll check it out.

On Tue, 5 Dec 2023 at 16:29, Bogdan-Andrei Iancu 
wrote:

> Then take a look at the call_center module:
> https://opensips.org/html/docs/modules/3.4.x/call_center.html
>
> Regards
>
> Bogdan-Andrei Iancu
>
> OpenSIPS Founder and Developer
>   https://www.opensips-solutions.com
>   https://www.siphub.com
>
> On 05.12.2023 12:49, Prathibha B wrote:
>
> Yes, you are right.
>
> On Tue, 5 Dec 2023 at 15:04, Bogdan-Andrei Iancu 
> wrote:
>
>> What do you mean by "free call taker in the group" ? something like in
>> call centers?
>>
>> Bogdan-Andrei Iancu
>>
>> OpenSIPS Founder and Developer
>>   https://www.opensips-solutions.com
>>   https://www.siphub.com
>>
>> On 04.12.2023 14:30, Prathibha B wrote:
>>
>> How to identify a free call taker in the group?
>>
>> On Mon, 4 Dec 2023 at 17:57, Prathibha B 
>> wrote:
>>
>>> How to write dialplan to route the calls coming to 112, to one of the
>>> free call takers?
>>>
>>> --
>>> Regards,
>>> B.Prathibha
>>>
>>
>>
>> --
>> Regards,
>> B.Prathibha
>>
>> ___
>> Users mailing 
>> listUsers@lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>>
>
> --
> Regards,
> B.Prathibha
>
>
>

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


Re: [OpenSIPS-Users] Staless mode in opensips

2023-12-05 Thread Bogdan-Andrei Iancu

Hi,

Your post is a bit confusing when comes to state (and statefull) - are 
you talking about transaction statefull or dialog statefull ?


Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
  https://www.siphub.com

On 05.12.2023 13:01, amel.gue...@sofrecom.com wrote:


Hi opensips experts,

We have always worked Opensips in a statefull mode and the first words 
in the routing module description are “OpenSIPS is basically /only/ a 
transaction statefull proxy”.


I’ve also seen that there was a stateless module “The SL module allows 
OpenSIPS to act as a stateless UA server and generate replies to SIP 
requests without keeping state” but is it possible to use 
functionality of Opensips like dialplan and dispatcher without keeping 
state of the dialog ?


Thanks for your help

On belhalf of my colleague Guillaume

BR, Amel


___
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


Re: [OpenSIPS-Users] Strange Nat issue

2023-12-05 Thread Bogdan-Andrei Iancu

Andrew,

Please capture (or xlog the Contact hdr) the 200 OK reply you receive 
from the callee. Most probably there is something weird with it, making 
the ACK to be badly routed.


Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
  https://www.siphub.com

On 05.12.2023 12:36, Andrew Colin via Users wrote:


Hi Razvan

The error I see is

No ack received for an extended period of time


___
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


Re: [OpenSIPS-Users] Staless mode in opensips

2023-12-05 Thread Johan De Clercq
I usually make a mix f.e. on OPTIONS, subscribe, notify I send 200 OK with
sl_send_reply.
INVITE handling I always do stateful.
Normally, the dependencies of a module are described in the module
documentation.
I hope this helps.

BR, Johan.

Op di 5 dec 2023 om 12:04 schreef :

> Hi opensips experts,
>
> We have always worked Opensips in a statefull mode and the first words in
> the routing module description are “OpenSIPS is basically *only* a
> transaction statefull proxy”.
>
> I’ve also seen that there was a stateless module “The SL module allows
> OpenSIPS to act as a stateless UA server and generate replies to SIP
> requests without keeping state” but is it possible to use functionality of
> Opensips like dialplan and dispatcher without keeping state of the dialog ?
>
> Thanks for your help
>
> On belhalf of my colleague Guillaume
>
> BR, Amel
>
>
> ___
> 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] Staless mode in opensips

2023-12-05 Thread amel . guesmi
Hi opensips experts,

We have always worked Opensips in a statefull mode and the first words in the 
routing module description are "OpenSIPS is basically only a transaction 
statefull proxy".

I've also seen that there was a stateless module "The SL module allows OpenSIPS 
to act as a stateless UA server and generate replies to SIP requests without 
keeping state" but is it possible to use functionality of Opensips like 
dialplan and dispatcher without keeping state of the dialog ?

Thanks for your help

On belhalf of my colleague Guillaume

BR, Amel

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


Re: [OpenSIPS-Users] Dialplan

2023-12-05 Thread Bogdan-Andrei Iancu

Then take a look at the call_center module:
https://opensips.org/html/docs/modules/3.4.x/call_center.html

Regards

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
  https://www.siphub.com

On 05.12.2023 12:49, Prathibha B wrote:

Yes, you are right.

On Tue, 5 Dec 2023 at 15:04, Bogdan-Andrei Iancu  
wrote:


What do you mean by "free call taker in the group" ? something
like in call centers?

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   https://www.opensips-solutions.com
   https://www.siphub.com

On 04.12.2023 14:30, Prathibha B wrote:

How to identify a free call taker in the group?

On Mon, 4 Dec 2023 at 17:57, Prathibha B
 wrote:

How to write dialplan to route the calls coming to 112, to
one of the free call takers?

-- 
Regards,

B.Prathibha



-- 
Regards,

B.Prathibha

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




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


Re: [OpenSIPS-Users] CANCEL handling issue

2023-12-05 Thread Bogdan-Andrei Iancu

Hi,

Could you please detail a bit your case? what kind of advertising are 
you using? per socket, global? ALso, an off-list pcap (covering both in 
and out traffic for opensips) will help.


In regards the t_relay, as per docs, just do t_relay("no-auto-477")

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
  https://www.siphub.com

On 05.12.2023 11:40, Jehanzaib Younis wrote:

Hi Bogdan,

I have the same issue, i have just upgraded the opensips to 3.4.2 
version.  It did not fix the issue but the other issue iam getting is 
t_relay is not accepting any parameter.
The documentation is not clearly saying how to put /no-auto-477/ - 
(old /0x02/ flag). in my old 3.3.2 version i used to t_relay(2) but it 
is not working in the 3.4.2 version anymore. i tried all the options 
but none of them is working.



Regards,
Jehanzaib


On Tue, Nov 28, 2023 at 10:54 PM Jehanzaib Younis 
 wrote:


I have the exact same issue. I am also not able to change the Via
header.

Regards,
Jehanzaib


On Tue, Nov 28, 2023 at 10:48 PM Jehanzaib Younis
 wrote:

Hi Bogdan,

The only difference is, I am receiving traffic on UDP and
sending on TCP socket.
sorry i forgot to mention before the advertised_address is
globally defined (public ip)


Regards,
Jehanzaib


On Tue, Nov 28, 2023 at 10:26 PM Bogdan-Andrei Iancu
 wrote:

Hi,

I just made a simple test using only `advertised_address`
and calling from A to B and cancelling from A. The CANCEL
from OpenSIPS to B obeys the advertising. I used the
latest 3.3 :
    version: opensips 3.3.8 (x86_64/linux)

Tested with both UDP and TCP, worked in both cases.

SO, try also the latest 3.3, to see if it works for you
too. If not, try to put together a minimal cfg to support
user registration + calls between users, cfg to show the
problem.

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   https://www.opensips-solutions.com
   https://www.siphub.com

On 27.11.2023 13:44, nz deals wrote:

Hi Bogdan,
No other advertisement via socket definition or any
script function.

Thank you

On Fri, 24 Nov 2023 at 05:47, Bogdan-Andrei Iancu
 wrote:

Just checking, only the `advertised_address` global
param [1], no other kind of advertising (via socket
definition or script function) ?

[1]

https://www.opensips.org/Documentation/Script-CoreParameters-3-3#advertised_address

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   https://www.opensips-solutions.com
   https://www.siphub.com

On 11/22/23 10:47 PM, nz deals wrote:

Hi Bogdan,
My opensips version is opensips 3.3.5 (x86_64/linux)

Regards,
Jason

On Thu, 23 Nov 2023 at 01:49, Bogdan-Andrei Iancu
 wrote:

What is your exact opensips version ( `opensips
-V` ) ?

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   https://www.opensips-solutions.com
   https://www.siphub.com

On 11/22/23 12:24 PM, nz deals wrote:

Thanks Bogdan,

It is due to receiving CANCEL from the caller.
Yes using an advertised_address globally. One
of our public addresses.

Thanks

On Wed, 22 Nov 2023 at 23:08, Bogdan-Andrei
Iancu  wrote:

Hi Jason,

The CANCEL generated by OpenSIPS, is it due
to a received CANCEL or due to an internal
timeout / forking? ALso do you use any
advertising in your setup? if yes, is it
per socket, global or ?

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   https://www.opensips-solutions.com
   https://www.siphub.com

On 11/22/23 7:04 AM, nz deals wrote:

Hi folks,

Is there any bug in the CANCEL handling in
the version 3.3.x?
I have a weird issue,
The INVITE have a VIA header as my private ip
Via: S

Re: [OpenSIPS-Users] Dialplan

2023-12-05 Thread Prathibha B
Yes, you are right.

On Tue, 5 Dec 2023 at 15:04, Bogdan-Andrei Iancu 
wrote:

> What do you mean by "free call taker in the group" ? something like in
> call centers?
>
> Bogdan-Andrei Iancu
>
> OpenSIPS Founder and Developer
>   https://www.opensips-solutions.com
>   https://www.siphub.com
>
> On 04.12.2023 14:30, Prathibha B wrote:
>
> How to identify a free call taker in the group?
>
> On Mon, 4 Dec 2023 at 17:57, Prathibha B  wrote:
>
>> How to write dialplan to route the calls coming to 112, to one of the
>> free call takers?
>>
>> --
>> Regards,
>> B.Prathibha
>>
>
>
> --
> Regards,
> B.Prathibha
>
> ___
> Users mailing 
> listUsers@lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
>

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


Re: [OpenSIPS-Users] Strange Nat issue

2023-12-05 Thread Andrew Colin via Users
Hi Razvan

The error I see is

No ack received for an extended period of time

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


Re: [OpenSIPS-Users] CANCEL handling issue

2023-12-05 Thread Jehanzaib Younis
Hi Bogdan,

I have the same issue, i have just upgraded the opensips to 3.4.2 version.
It did not fix the issue but the other issue iam getting is t_relay is not
accepting any parameter.
The documentation is not clearly saying how to put *no-auto-477* - (old
*0x02* flag). in my old 3.3.2 version i used to t_relay(2) but it is not
working in the 3.4.2 version anymore. i tried all the options but none of
them is working.


Regards,
Jehanzaib


On Tue, Nov 28, 2023 at 10:54 PM Jehanzaib Younis 
wrote:

> I have the exact same issue. I am also not able to change the Via header.
>
> Regards,
> Jehanzaib
>
>
> On Tue, Nov 28, 2023 at 10:48 PM Jehanzaib Younis <
> jehanzaib.ki...@gmail.com> wrote:
>
>> Hi Bogdan,
>>
>> The only difference is, I am receiving traffic on UDP and sending on TCP
>> socket.
>> sorry i forgot to mention before the advertised_address is
>> globally defined (public ip)
>>
>>
>> Regards,
>> Jehanzaib
>>
>>
>> On Tue, Nov 28, 2023 at 10:26 PM Bogdan-Andrei Iancu 
>> wrote:
>>
>>> Hi,
>>>
>>> I just made a simple test using only `advertised_address` and calling
>>> from A to B and cancelling from A. The CANCEL from OpenSIPS to B obeys the
>>> advertising. I used the latest 3.3 :
>>> version: opensips 3.3.8 (x86_64/linux)
>>>
>>> Tested with both UDP and TCP, worked in both cases.
>>>
>>> SO, try also the latest 3.3, to see if it works for you too. If not, try
>>> to put together a minimal cfg to support user registration + calls between
>>> users, cfg to show the problem.
>>>
>>> Regards,
>>>
>>> Bogdan-Andrei Iancu
>>>
>>> OpenSIPS Founder and Developer
>>>   https://www.opensips-solutions.com
>>>   https://www.siphub.com
>>>
>>> On 27.11.2023 13:44, nz deals wrote:
>>>
>>> Hi Bogdan,
>>> No other advertisement via socket definition or any script function.
>>>
>>> Thank you
>>>
>>> On Fri, 24 Nov 2023 at 05:47, Bogdan-Andrei Iancu 
>>> wrote:
>>>
 Just checking, only the `advertised_address` global param [1], no other
 kind of advertising (via socket definition or script function) ?

 [1]
 https://www.opensips.org/Documentation/Script-CoreParameters-3-3#advertised_address

 Regards,

 Bogdan-Andrei Iancu

 OpenSIPS Founder and Developer
   https://www.opensips-solutions.com
   https://www.siphub.com

 On 11/22/23 10:47 PM, nz deals wrote:

 Hi Bogdan,
 My opensips version is opensips 3.3.5 (x86_64/linux)

 Regards,
 Jason

 On Thu, 23 Nov 2023 at 01:49, Bogdan-Andrei Iancu 
 wrote:

> What is your exact opensips version ( `opensips -V` ) ?
>
> Regards,
>
> Bogdan-Andrei Iancu
>
> OpenSIPS Founder and Developer
>   https://www.opensips-solutions.com
>   https://www.siphub.com
>
> On 11/22/23 12:24 PM, nz deals wrote:
>
> Thanks Bogdan,
>
> It is due to receiving CANCEL from the caller. Yes using an
> advertised_address globally. One of our public addresses.
>
> Thanks
>
> On Wed, 22 Nov 2023 at 23:08, Bogdan-Andrei Iancu 
> wrote:
>
>> Hi Jason,
>>
>> The CANCEL generated by OpenSIPS, is it due to a received CANCEL or
>> due to an internal timeout / forking? ALso do you use any advertising in
>> your setup? if yes, is it per socket, global or ?
>>
>> Regards,
>>
>> Bogdan-Andrei Iancu
>>
>> OpenSIPS Founder and Developer
>>   https://www.opensips-solutions.com
>>   https://www.siphub.com
>>
>> On 11/22/23 7:04 AM, nz deals wrote:
>>
>> Hi folks,
>>
>> Is there any bug in the CANCEL handling in the version 3.3.x?
>> I have a weird issue,
>> The INVITE have a VIA header as my private ip
>> Via: SIP/2.0/TCP 192.XX.XX.XX:5060;branch=XXX
>>
>> But when i CANCEL the call, the CANCEL have my public ip in the VIA
>> header.
>> Via: SIP/2.0/TCP 104.xx.xx.xx:5060;branch=xxx
>>
>> Anyway can I change the via in the cancel?
>>
>> Regards,
>> Jason
>>
>> ___
>> Users mailing 
>> listUsers@lists.opensips.orghttp://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


Re: [OpenSIPS-Users] Dialplan

2023-12-05 Thread Bogdan-Andrei Iancu
What do you mean by "free call taker in the group" ? something like in 
call centers?


Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
  https://www.siphub.com

On 04.12.2023 14:30, Prathibha B wrote:

How to identify a free call taker in the group?

On Mon, 4 Dec 2023 at 17:57, Prathibha B  wrote:

How to write dialplan to route the calls coming to 112, to one of
the free call takers?

-- 
Regards,

B.Prathibha



--
Regards,
B.Prathibha

___
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


Re: [OpenSIPS-Users] Help dropping SQL injection attacks

2023-12-05 Thread Bogdan-Andrei Iancu

Hi Gregory,

As it is said, there is no single way to skin the cat :). Your approach 
is a valid one, by using the escaping transformation. Maybe you should 
check the s.escape.user [1].


Such checks make sense when using avp_db_query(), so raw queries. The 
internal queries (like auth, etc) are done via prepared statements, so 
safe to injections.


[1] https://www.opensips.org/Documentation/Script-Tran-3-2#s.escape.user

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
  https://www.siphub.com

On 30.11.2023 02:34, Gregory Massel via Users wrote:


Hi all

I'm wondering what the best practice is in terms of detection and 
dropping attempted SQL injection attacks?


Is something like the following adequate or can this be enhanced:

if ( $fU != $(fU{s.escape.common}) || $tU != $(tU{s.escape.common}) ) {
drop();
}

Obviously this does not remove the need to escape anything passed to 
avp_db_query(), however, what I want to do is identify these sorts of 
attacks at the top of the script and avoid processing.


To date all the attacks I've seen focus on the contact and from user, 
e.g.:

INVITEsip:00111390237920793@x.x.x.x:5060;transport=UDP  SIP/2.0
Contact:
To:
From:;tag=v2pjtxqb
I'm not quite sure how to match the Contact user. Would the following 
work?

if ( $(ct.fields(uri){uri.user}) != 
$(ct.fields(uri){uri.user}{s.escape.common}) ) {
drop();
}
--
Regards
*Gregory Massel*

___
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