[OpenSIPS-Users] Value comparison issue

2023-05-31 Thread Michele Pinassi via Users

Hi all,

I am writing to you again after a long time for a strange issue in my 
Opensips 1.11 routing logic.


I have implemented a per-user call limit and i have to compare current 
call value with max calls allowed:


main() {
...
if (is_method("INVITE")) {
    if (!create_dialog()) {
    send_reply("500","Internal Server Error");
    exit;
    }

    set_dlg_profile("call", "$rU"); # caller
    set_dlg_profile("call", "$fU"); # called

    get_profile_size("call", "$rU", "$var(calls)"); # What's the call 
limit for $rU?

    ## <-- CONCURRENT CALLS LIMIT BASED ON DESTINATION
    if(avp_db_load("$ru/username","$avp(maxcalls)")) {
    if($var(calls)>$avp(maxcalls)) {
    xlog("L_INFO","$ci - User $rU has $var(calls) calls (max 
$avp(maxcalls) calls): BUSY\n");
    sl_send_reply("486", "Busy: try later");
    exit;
    } else {
    xlog("L_INFO","$ci - User $rU has $var(calls) calls (max 
$avp(maxcalls) calls): ALLOW\n");
    }
    } else {
    xlog("L_INFO","$ci - User $rU has $var(calls) calls. NO LIMIT 
HERE\n");
    }
        # -->
...

Seems that there's a problem with "if($var(calls)>$avp(maxcalls))" 
because in logs i got:


User  has 2 calls (max 10 calls): BUSY
...
User  has 1 calls (max 10 calls): ALLOW

Any hints or suggestion?

Thanks for your help.

--
Michele Pinassi
Università degli Studi di Siena



OpenPGP_0x14FC37E53C24B98E.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] Help with max concurrent call limit

2020-11-05 Thread Michele Pinassi
Hi all,

Opensips 1.11 here. I've tried implementing max concurrent calls
limitation for some of our users, inspired by tutorial found at
https://www.opensips.org/Documentation/Tutorials-ConcurrentCallsLimitation
and using AVP to set per-account calls limit.

In table usr_preferences i've a row like:

id
uuid
username
domain
attribute
type
value
1298

6911
voip..it
maxcalls
0
1

and on dialplan i've:

  AVP module
loadmodule "avpops.so"
modparam("avpops","db_url","mysql://voip:7PDzZ2ADNxZzmzfA@192.168.1.1/opensips")
modparam("avpops","avp_table","usr_preferences")
modparam("avpops","uuid_column", "uuid")
modparam("avpops","use_domain",0)
modparam("avpops","domain_column","domain")
modparam("avpops","attribute_column","attribute")
modparam("avpops","value_column","value")
modparam("avpops","type_column","type")

...

route() {
[...]
    if (is_method("INVITE")) {
        set_dlg_profile("caller", "$ru");
        get_profile_size("caller", "$ru", "$var(size)");

        ## <-- CONCURRENT CALLS LIMIT BASED ON DESTINATION
        if(avp_db_load("$ru/username","$avp(maxcalls)")) {
        if($var(size) > $avp(maxcalls)) {
            xlog("L_INFO","$ci - User $rU has $var(size) calls (max 
$avp(maxcalls) calls): BUSY\n");
            sl_send_reply("486", "Busy: try later");
            exit;
        } else {
            xlog("L_INFO","$ci - User $rU has $var(size) calls (max 
$avp(maxcalls) calls): ALLOW\n");
        }
     }
[...]
}

This way seems to work perfectly except when calls come from our
mediagateways, that append port to signals, like (captured with sngrep):

INVITE 333@172.20.1.4:506 5...@voip..it:5060   28
172.20.1.4:5060193.xxx:5060 REJECTED   28ad94e804782466 
 0:10

INVITE 5...@voip..it5...@voip.xxx.it20
193.205.4.182:5060 193.xxx:5060 CANCELLED 
455244b218fec81c1f90036f3890a...@voip.xxx.it0:05

INVITE 3527@172.20.1.4:5060  2...@voip.xxx.it:5060   20
172.20.1.4:5060193.xxx:5060 COMPLETED  7758dace18b36325 

I suppose, but maybe i'm wrong, that the problem is the domain part of
the RURI that were not correctly matched in dialog profile.

Any hint or help kindly appreciated


-- 
Michele Pinassi - Responsabile Cybersecurity Università di Siena
Ufficio Esercizio e Tecnologie - CSIRT
i...@unisi.it

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


Re: [OpenSIPS-Users] Upgrading from 1.11.11 to latest stable 2.4

2018-10-16 Thread Michele Pinassi
Hi Liviu,

my plan is to use a completely separate new server where to build new
2.4 system while older is still running. After a successfull upgrade,
move the new server to production and shut down the old one. So volatile
data should not be a problem because i can start with a fresh (empty) table.

Best regards,

Michele

On 16/10/18 10:06, Liviu Chircu wrote:
>
> Hi Michele,
>
> Before going deeper: what is your plan with regards to volatile DB
> data (dialogs, contacts, presence, etc.) on this server?  Can it be
> discarded, possibly during some maintenance window?
>
> Best regards,
>
> Liviu Chircu
> OpenSIPS Developer
> http://www.opensips-solutions.com
> On 16.10.2018 10:13, Michele Pinassi wrote:
>> Hi all,
>>
>> maybe a trivial question but i'm planning to upgrade my production
>> OpenSIPS server from latest 1.11 (1.11.11) to latest state and
>> production-ready 2.4 release.
>>
>> Obviously i have to make some minor changes to dialplan. No worry about
>> this.  But i'm quite scared about database migration. I'm still thinking
>> to do (after a backup, of course) a step-by-step migration, following
>> https://www.opensips.org/Documentation/Migration procedures, so moving
>> from 1.11 to 2.1, then from 2.1 to 2.2 and so on, until i reach 2.4.
>>
>> That's the best way or there is another, better, way ?
>>
>> Thanks for any hint :-)
>>
>> Michele
>>
>>
>>
>> ___
>> 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

-- 
Michele Pinassi
Responsabile Telefonia di Ateneo
Ufficio Esercizio e tecnologie - Università degli Studi di Siena
tel: 0577.(23)5000 - helpd...@unisi.it

Per trovare una soluzione rapida ai tuoi problemi tecnici consulta le FAQ di 
Ateneo, http://www.faq.unisi.it 



signature.asc
Description: OpenPGP digital signature
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] Upgrading from 1.11.11 to latest stable 2.4

2018-10-16 Thread Michele Pinassi
Hi all,

maybe a trivial question but i'm planning to upgrade my production
OpenSIPS server from latest 1.11 (1.11.11) to latest state and
production-ready 2.4 release.

Obviously i have to make some minor changes to dialplan. No worry about
this.  But i'm quite scared about database migration. I'm still thinking
to do (after a backup, of course) a step-by-step migration, following
https://www.opensips.org/Documentation/Migration procedures, so moving
from 1.11 to 2.1, then from 2.1 to 2.2 and so on, until i reach 2.4.

That's the best way or there is another, better, way ?

Thanks for any hint :-)

Michele

-- 
Michele Pinassi
Responsabile Telefonia di Ateneo
Ufficio Esercizio e tecnologie - Università degli Studi di Siena
tel: 0577.(23)5000 - helpd...@unisi.it

Per trovare una soluzione rapida ai tuoi problemi tecnici consulta le FAQ di 
Ateneo, http://www.faq.unisi.it 




signature.asc
Description: OpenPGP digital signature
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] OpenSIPS and REDIS

2017-06-14 Thread Michele Pinassi
Hi all,

i'm trying to setup a REDIS cache to share register data with my two
OpenSIPS server, to have some redundancy.

On opensips.cfg:

 AUTHentication modules
loadmodule "auth.so"
modparam("auth", "username_spec", "$var(username)")
modparam("auth", "password_spec", "$avp(password)")
modparam("auth", "disable_nonce_check", 1)

loadmodule "auth_db.so"
modparam("auth_db", "calculate_ha1", 1)
modparam("auth_db", "password_column", "password")
modparam("auth_db", "load_credentials", "$avp(password)=password")

[...]

 Redis module
loadmodule "cachedb_redis.so"
modparam("cachedb_redis", "cachedb_url", "redis:voip://192.168.1.1:6379/")

[...]

### REGISTER
if (is_method("REGISTER")) {
# Check for cache...
   if(cache_fetch("redis:voip","passwd_$tU",$avp(password))) {
   $var(username) = $tU;
   $var(rc) = pv_www_authorize("");
   } else {
   # or authenticate the REGISTER requests...
$var(rc) = www_authorize("","subscriber");
   }

switch($var(rc)) {
case 1 :
   xlog("L_INFO", "Registration SUCCESS $fu\n");
# Save credentials to REDIS cache
   
cache_store("redis:voip","passwd_$tU","$avp(password)",128000);
break;
case -1:
xlog("L_ERR","Auth error for $fU@$fd from $si:
INVALID USER");
break;
case -2:
xlog("L_ERR","Auth error for $fU@$fd from $si:
INVALID PASSWORD");
break;
case -3: # Stale nonce - This is not an error, so don't
print anything
break;
case -4:
www_challenge("", "0");
break;
default:
xlog("L_ERR","Auth error for $fU@$fd from $si cause
$var(rc)");
}

but i got an INVALID PASSWORD for all account stored in REDIS cache.
What's wrong ?

Thanks, Michele


-- 
Michele Pinassi
Responsabile Telefonia di Ateneo
Servizio Reti, Sistemi e Sicurezza Informatica - Università degli Studi di Siena
tel: 0577.(23)5000 - central...@unisi.it

Per trovare una soluzione rapida ai tuoi problemi tecnici consulta le FAQ di 
Ateneo, http://www.faq.unisi.it 




signature.asc
Description: OpenPGP digital signature
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Call Pickup feature in Opensips 1.11

2017-06-09 Thread Michele Pinassi
Maybe this could help:
http://www.tech-invite.com/fo-sip/tinv-fo-sip-service-16.html

As you can see, you need to receive SUBSCRIBE to receive dialog
information about incoming call, to generate an INVITE with replace...

Good luck !

Michele

On 07/06/2017 16:06, maatohewetbi wrote:
> Is it any way to upload whole script to test Call pickup with 2.3? I've
> installed this version and pasted pickup config from module event_routing
> documentation. Call Pickup doesn't work as it should. When I call one leg,
> and want to handle this call by third user I get only 480 message after
> dialing "33". When I delete this line it works ok but on third user phone
> (Grandstream) I get incomming call on second line whil first is still
> calling. When I answer it looks ok. But I feel it doesn't work as it should.
>
>
>
> --
> View this message in context: 
> http://opensips-open-sip-server.1449251.n2.nabble.com/Call-Pickup-feature-in-Opensips-1-11-tp7607496p7607647.html
> Sent from the OpenSIPS - Users mailing list archive at Nabble.com.
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users

-- 
Michele Pinassi
Responsabile Telefonia di Ateneo
Servizio Reti, Sistemi e Sicurezza Informatica - Università degli Studi di Siena
tel: 0577.(23)5000 - central...@unisi.it

Per trovare una soluzione rapida ai tuoi problemi tecnici consulta le FAQ di 
Ateneo, http://www.faq.unisi.it 


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


Re: [OpenSIPS-Users] CDR in Flat files

2017-06-06 Thread Michele Pinassi
Did you check your rsyslog (/etc/rsyslogd.conf) configuration ?

Michele


On 05/06/2017 10:52, Kirill Galinurov wrote:
> Hi ALL.
>  I try to store cdr in flat files.
> My config is
> loadmodule "acc.so"
> modparam("acc", "detect_direction", 0)
> modparam("acc", "extra_fields", "log: src_ip; dst_ip")
> modparam("acc", "leg_fields", "log: caller; callee")
> modparam("acc", "log_facility", "LOG_DAEMON")
>
>if(is_method("INVITE"))  {
>if (check_address("0","$si","$sp","any")){
>force_send_socket(udp:*Servizio Antispam attenzione!: i
> link numerici sono spesso insicuri!:* 172.20.20.30:5060
> <http://172.20.20.30:5060>);
>setflag(CALL_AST);
>create_dialog("B");
>do_accounting("log", "cdr");
> }
>
> in cosole debug I see
> ACC: call ended:
> created=1496654777;call_start_time=1496654780;duration=7;ms_duration=7393;setuptime=3;method=I
> NVITE;from_tag=SDipn2901-1544324631353641441C2115;to_tag=as51263d7c;call_id=SDipn2901-3f6bad0e2bf09ec16aeaedd37abb0661-v300g00030;code=
> 200;reason=OK;src_ip=;dst_ip=;caller=;callee=
>  
> But no records in log file
>

-- 
Michele Pinassi
Responsabile Telefonia di Ateneo
Servizio Reti, Sistemi e Sicurezza Informatica - Università degli Studi di Siena
tel: 0577.(23)5000 - central...@unisi.it

Per trovare una soluzione rapida ai tuoi problemi tecnici consulta le FAQ di 
Ateneo, http://www.faq.unisi.it 



signature.asc
Description: OpenPGP digital signature
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] opnsisps 2.3 routing config

2017-06-06 Thread Michele Pinassi
Hi Lorenzo,

if i figure out correcty, you want a context separation based on
network, right ? You can do it in some ways: for example, you can use
group module
(http://www.opensips.org/html/docs/modules/devel/group.html) and From
URI to detect to which group caller is belonging to:

if (db_get_user_group("Request-URI", "$avp(10)")) {
xdbg("User $ru belongs to $(avp(10)[*]) group(s)\n");

and doing the same with To URI, you can allow call routing only for
users in the same group.

Good luck.

Michele

On 01/06/2017 15:34, lorenzo tombini wrote:
> Hi all,
> I worked with asterisk for years but i'm really new in opensips.
> I've installed v. 2.3 on centos7 64bit with yum.
> Using mysql backend, i've configured 3 subscriber that can call and
> transfer calls each others.
> I'd like to configure it that users calling from NET1  just can call
> the users in the same net, users in NET2 can call just users in NET2
> and so on...
>  
> Could you please show me the correct way to realize it please?
>
> thanks a lot in advabced
>
> kind regards
>
> -- 
> Lorenzo Tombini
>
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users

-- 
Michele Pinassi
Responsabile Telefonia di Ateneo
Servizio Reti, Sistemi e Sicurezza Informatica - Università degli Studi di Siena
tel: 0577.(23)5000 - central...@unisi.it

Per trovare una soluzione rapida ai tuoi problemi tecnici consulta le FAQ di 
Ateneo, http://www.faq.unisi.it 



signature.asc
Description: OpenPGP digital signature
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] OpenSIPS and 256 MByte of RAM.

2017-03-22 Thread Michele Pinassi
I think that depends how many transaction you need to serve...


Just for example, i have almost 1 thousand of phones that generates
70-80 transaction per cycle and i have a AMD Opteron(tm) Processor 6128
2GHz with 2GByte of RAM, but consider that DBMS is on another machine...

Michele


On 22/03/2017 14:12, Rodrigo Pimenta Carvalho wrote:
>
> Hi.
>
>
> I was getting some problems with OpenSIPS and its performance in a
> hardware with 1 CPU and 256 MByte of RAM.
>
> When I moved my OpenSIPS to another hardware with 2 CPUs and 516 MByte
> of RAM it became working very well !
>
> But, I have to move back my OpenSIPS to the 'poor' hardware!
>
>
> So, what configurations in OpenSIPS files should I set, to get better
> performance?
>
>
> Any suggestion will be very helpful!
>
>
> Best regards.
>
>

-- 
Michele Pinassi
Responsabile Telefonia di Ateneo
Servizio Reti, Sistemi e Sicurezza Informatica - Università degli Studi di Siena
tel: 0577.(23)5000 - central...@unisi.it

Per trovare una soluzione rapida ai tuoi problemi tecnici consulta le FAQ di 
Ateneo, http://www.faq.unisi.it 



signature.asc
Description: OpenPGP digital signature
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] ERROR:presence:update_presentity cause OpenSIPS eat all memory and crash...

2017-03-16 Thread Michele Pinassi
s[1048]: ERROR:presence:update_presentity: No E_Tag
match [a.1489656643.1050.47435.20]



Michele

On 16/03/2017 09:05, Michele Pinassi wrote:
> Opensips 1.11.9-notls on a Debian 8.7 x64, with more that 700 phones
> registered.
>
> Sometimes, almost twice a week, i got a lot of:
>
> /usr/sbin/opensips[1585]: ERROR:presence:update_presentity: No E_Tag
> match [a.1489409482.1585.24993.147]
> /usr/sbin/opensips[1586]: ERROR:presence:update_presentity: No E_Tag
> match [a.1489409482.1584.24871.146]
> /usr/sbin/opensips[1584]: ERROR:presence:update_presentity: No E_Tag
> match [a.1489409482.1586.24799.146]
>
> that, after few hours, results in a:
>
> /usr/sbin/opensips[1585]: ERROR:tm:new_t: out of mem
> /usr/sbin/opensips[1584]: WARNING:core:fm_malloc: Not enough free
> memory, will attempt defragmentation
> /usr/sbin/opensips[1585]: ERROR:tm:t_newtran: new_t failed
> /usr/sbin/opensips[1584]: ERROR:tm:new_t: out of mem
>
> of course, users were not happy :-) so i need suggestions how to solve
> the problem or how to avoid that error cause opensips to eat all the
> memory available...
>
> Thanks, Michele
>
>
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users

-- 
Michele Pinassi
Responsabile Telefonia di Ateneo
Servizio Reti, Sistemi e Sicurezza Informatica - Università degli Studi di Siena
tel: 0577.(23)5000 - central...@unisi.it

Per trovare una soluzione rapida ai tuoi problemi tecnici consulta le FAQ di 
Ateneo, http://www.faq.unisi.it 



signature.asc
Description: OpenPGP digital signature
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] ERROR:presence:update_presentity cause OpenSIPS eat all memory and crash...

2017-03-16 Thread Michele Pinassi
Opensips 1.11.9-notls on a Debian 8.7 x64, with more that 700 phones
registered.

Sometimes, almost twice a week, i got a lot of:

/usr/sbin/opensips[1585]: ERROR:presence:update_presentity: No E_Tag
match [a.1489409482.1585.24993.147]
/usr/sbin/opensips[1586]: ERROR:presence:update_presentity: No E_Tag
match [a.1489409482.1584.24871.146]
/usr/sbin/opensips[1584]: ERROR:presence:update_presentity: No E_Tag
match [a.1489409482.1586.24799.146]

that, after few hours, results in a:

/usr/sbin/opensips[1585]: ERROR:tm:new_t: out of mem
/usr/sbin/opensips[1584]: WARNING:core:fm_malloc: Not enough free
memory, will attempt defragmentation
/usr/sbin/opensips[1585]: ERROR:tm:t_newtran: new_t failed
/usr/sbin/opensips[1584]: ERROR:tm:new_t: out of mem

of course, users were not happy :-) so i need suggestions how to solve
the problem or how to avoid that error cause opensips to eat all the
memory available...

Thanks, Michele

-- 
Michele Pinassi
Responsabile Telefonia di Ateneo
Servizio Reti, Sistemi e Sicurezza Informatica - Università degli Studi di Siena
tel: 0577.(23)5000 - central...@unisi.it

Per trovare una soluzione rapida ai tuoi problemi tecnici consulta le FAQ di 
Ateneo, http://www.faq.unisi.it 




signature.asc
Description: OpenPGP digital signature
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] uac_replace_from i'm doing something wrong..

2017-02-23 Thread Michele Pinassi
Hi all,

i need to remap "from" number prior to send call to a ToIP trunk

In my route[toip] i wrote:

route[toip] {
xlog("L_INFO","$ci - Route via TOIP from $fU to $tU (RURI: $ru)\n");

if (is_method("INVITE")) {
setflag(DB_FLAG);
setflag(ACC_DO); # do accounting
}

if($fU=~"6[0-9]{3}$")  {
# Change all 6xxx to 05771530xxx 
uac_replace_from("05771530"+$(fU{s.substr,1,0}),"sip:05771530"+$(fU{s.substr,1,0})+"@"+$Ri);
append_hf("P-Asserted-Identity:
<sip:05771530"+$(fU{s.substr,1,0})+"@"+$Ri+">\r\n");
}   

if(route_to_carrier("toip")) {
t_on_failure("next_gw");
t_relay();
exit;
}
}

but i got an error. Maybe i'm doing somewthing wrong with number
manipulation.

Suggestions how i can do the same thing in a more elegant manner are
welcome !

Thanks for any help, Michele

-- 
Michele Pinassi
Responsabile Telefonia di Ateneo
Servizio Reti, Sistemi e Sicurezza Informatica - Università degli Studi di Siena
tel: 0577.(23)5000 - central...@unisi.it

Per trovare una soluzione rapida ai tuoi problemi tecnici consulta le FAQ di 
Ateneo, http://www.faq.unisi.it 




signature.asc
Description: OpenPGP digital signature
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] preferred OS and version for OpenSIPS?

2017-02-21 Thread Michele Pinassi
My OpenSIPS run great on Debian 8 x64. I don't use OpenSIPS CP because i
wrote from scratch a complete telephone management system for our
istitution (you can change almost all of OpenSIPS configs simply
populating mysql DB tables).

Have fun.

MP


On 21/02/2017 15:08, Mundkowsky, Robert wrote:
>
> What is the preferred OS and version for OpenSIPS?
>
>  
>
> I installed it on newer version Ubtunu, but and it seems to work, but
> the Control Panel does not.  The Control Panel I am guessing expects
> an older version of Debian.
>
>  
>

-- 
Michele Pinassi
Responsabile Telefonia di Ateneo
Servizio Reti, Sistemi e Sicurezza Informatica - Università degli Studi di Siena
tel: 0577.(23)5000 - central...@unisi.it

Per trovare una soluzione rapida ai tuoi problemi tecnici consulta le FAQ di 
Ateneo, http://www.faq.unisi.it 



signature.asc
Description: OpenPGP digital signature
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] CRITICAL:core:timer_ticker: timer handler

2017-02-15 Thread Michele Pinassi
On my opensips log i got:

/usr/sbin/opensips[17639]: CRITICAL:core:timer_ticker: timer handler
 lasted (260 us) for more than timer tick (100
us) -> potential timer shifting

what's going on ?

Thanks, Michele


-- 
Michele Pinassi
Responsabile Telefonia di Ateneo
Servizio Reti, Sistemi e Sicurezza Informatica - Università degli Studi di Siena
tel: 0577.(23)5000 - central...@unisi.it

Per trovare una soluzione rapida ai tuoi problemi tecnici consulta le FAQ di 
Ateneo, http://www.faq.unisi.it 




signature.asc
Description: OpenPGP digital signature
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] WARNING:rr:after_strict:no socket found for match second RR

2017-02-08 Thread Michele Pinassi
Hi all,

i'm going crazy with an issue with WiFi VoIP users. Our VoIP server,
Opensips 1.11.9, was inside DMZ with public IP address 193.x.x.110 and
WiFi network is 10.x.x.x. VoIP fixed phone are inside a separated
network 172.20.x.x and firewall allowed traffic in both directions
between those nets.

When i call from a fixed phone (172.20.1.90, as example) to a client
connected to WiFi network (ex. 10.101.8.71) it works perfectly. But, on
other side, SIP signalling fail on a PRACK sent to 193.x.x.110 instead
of 10.101.8.71, printing out "WARNING:rr:after_strict:no socket found
for match second RR" error.

5004 was the CALLED user, 5009 the calling one, on WiFi network
(10.10.1.22):

/usr/sbin/opensips[29845]: 8EhpJFUAhqwKXTay3zK9S.B3nGLBWUub - Route
RELAY INVITE To: 5004, From: 5009, RURI: sip:5004@172.20.1.33:45802
/usr/sbin/opensips[29845]: 8EhpJFUAhqwKXTay3zK9S.B3nGLBWUub - Route NEW
BRANCH To: 5004, From: 5009, RURI: sip:5004@172.20.1.33:45802
/usr/sbin/opensips[29844]: 8EhpJFUAhqwKXTay3zK9S.B3nGLBWUub - Route
RELAY PRACK To: 5004, From: 5009, RURI: sip:193.x.x.110;lr;
/usr/sbin/opensips[29849]: 8EhpJFUAhqwKXTay3zK9S.B3nGLBWUub - Route
MISSED CALL INVITE To: 5004, From: 5009, RURI: sip:5004@172.20.1.33:45802
/usr/sbin/opensips[29845]: 8EhpJFUAhqwKXTay3zK9S.B3nGLBWUub - Route
RELAY ACK To: 5004, From: 5009, RURI: sip:voip..it;transport=udp;lr

Oh the 5009 phone i did a tcpdump where i saw:

*

SIP/2.0 489 Bad Event

v: SIP/2.0/UDP
10.0.8.1:34209;rport=53951;received=10.101.8.71;branch=z9hG4bKPjDD2mDOwI11dIEIX-FY-72lpXL2jS9Qvz

Record-Route: 

i: 6znDCyifz4jVTBUDMGe07e2UQrdr2qCl

f: ;tag=V41fxeL-v5HuRwE4rUnVN-XRVBTsVal3

t: ;tag=1eC1ckc8ts5OH4mJhMwZ-RgHxEFUgMJw

CSeq: 27800 SUBSCRIBE

l:  0


PRACK sip:5004@193.*x*.*x*.110:26892 SIP/2.0

v: SIP/2.0/UDP
10.0.8.1:34209;rport;branch=z9hG4bKPjghFr0FmAkMHZhWMcfUtl1mUxj-IdkyQg

Max-Forwards: 70

f: ;tag=KgJWD-2L-MlmTD0FyxgXhlnUeIIOhYbM

t: ;tag=aewrc0nu91

i: 8EhpJFUAhqwKXTay3zK9S.B3nGLBWUub

CSeq: 13112 PRACK

Route:


RAck: 1 13111 INVITE

l:  0


SIP/2.0 404 Not here

v: SIP/2.0/UDP
10.0.8.1:34209;received=10.101.8.71;rport=53951;branch=z9hG4bKPjghFr0FmAkMHZhWMcfUtl1mUxj-IdkyQg

f: ;tag=KgJWD-2L-MlmTD0FyxgXhlnUeIIOhYbM

t: ;tag=aewrc0nu91

i: 8EhpJFUAhqwKXTay3zK9S.B3nGLBWUub

CSeq: 13112 PRACK

Server: VoIP

Content-Length: 0


*Any hints how to solve this issue ?

Thanks, Michele

-- 

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


[OpenSIPS-Users] Block anonymous incoming calls

2016-10-05 Thread Michele Pinassi
Hi all,

i'm trying to block anonymous incoming calls using userblacklist module:

if (!check_user_blacklist("$rU", "$rd", "$fU")) {
xlog("L_ERR","403 - Forbidden - Call blocked from $fU to $rU\n");
sl_send_reply("403", "Forbidden");
exit;
}

and in userblacklist MySQL table i add:

username: 5002 [my number]

domain: voip [my domain]

prefix: anonymous

but don't work as expected. Log say:

Oct  5 11:12:00 proxy-voip01 /usr/sbin/opensips[2980]: b153ab3e2c30d38e
- User net group is 1
[172.20.1.5/sip:anonymous@172.20.1.5:5060/voip/sip:5002@voip:5060/172.20.1.5]
Oct  5 11:12:00 proxy-voip01 /usr/sbin/opensips[2980]: b153ab3e2c30d38e
- Destination for 5002 is voip
Oct  5 11:12:01 proxy-voip01 /usr/sbin/opensips[2980]: b153ab3e2c30d38e
- Route RELAY INVITE To: 5002, From: anonymous, RURI:
sip:5002@172.20.1.47:37496
Oct  5 11:12:01 proxy-voip01 /usr/sbin/opensips[2980]: b153ab3e2c30d38e
- Route NEW BRANCH To: 5002, From: anonymous, RURI:
sip:5002@172.20.1.47:37496

If i try to change "anonymous" with another number prefix, i.e. '333',
it works as expected:

Oct  5 11:11:08 proxy-voip01 /usr/sbin/opensips[2978]: d5d1d108325d3c69
- User net group is 1
[172.20.1.4/sip:333xxx@172.20.1.4:5060/voip/sip:5002@voip:5060/172.20.1.4]
Oct  5 11:11:08 proxy-voip01 /usr/sbin/opensips[2978]: d5d1d108325d3c69
- Destination for 5002 is voip
Oct  5 11:11:08 proxy-voip01 /usr/sbin/opensips[2978]: 403 - Forbidden -
Call blocked from 333xx to 5002

Any suggestions ?

Thanks, Michele

-- 
Michele Pinassi
Responsabile Telefonia di Ateneo
Servizio Reti, Sistemi e Sicurezza Informatica - Università degli Studi di Siena
tel: 0577.(23)5000 - central...@unisi.it

Per trovare una soluzione rapida ai tuoi problemi tecnici consulta le FAQ di 
Ateneo, http://www.faq.unisi.it 




signature.asc
Description: OpenPGP digital signature
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Dynamic Routing module issue with srip

2016-05-03 Thread Michele Pinassi
Hi Bogdan,

yes i'm sure (checked via tcpdump). How i can strip the '0' in the To
(alto che in R-URI) before sending SIP INVITE outside through the gateway ?

Thanks, Michele

Il 03/05/2016 14:29, Bogdan-Andrei Iancu ha scritto:
> Hi Michele,
>
> Sorry for my question, but are you sure that $var(carrier) points to
> "toip" carrier ?
>
> Note that the module changes only the username in RURI, it does not
> change TO hdr .
>
> Best regards,
>
> Bogdan-Andrei Iancu
> OpenSIPS Founder and Developer
> http://www.opensips-solutions.com
>
> On 02.05.2016 12:33, Michele Pinassi wrote:
>> Thanks Bogdan for your prompt reply but seems that don't work as
>> expected: i need to strip leading '0' from called R-URI and To !
>>
>> Just to help, i try to describe better my context:
>>
>> for any external calls, i use route[pstn]:
>>
>> route[pstn] {
>>  # Default outbound carrier
>>  $var(carrier) = "pstn";
>>
>>  # Need to route to specific carrier ?
>>  if(avp_db_load("$fu","$avp(out_carrier)")) {
>>  $var(carrier) = $avp(out_carrier);
>> # Remove leading zero
>>  subst_uri('/sip:0(.*)@(.*)/sip:\1@\2/g');
>>  subst('/^To:(.*)sip:0(.*)@(.*)/sip:\1@\2/g'); < Seems that
>> don't work !!!
>>  }
>>  # Need to map outbound caller number ?
>>  if(avp_db_load("$fu","$avp(out_number_map)")) {
>>
>> uac_replace_from("$avp(out_number_map)","sip:$avp(out_number_map)@$Ri");
>>  append_hf("P-Asserted-Identity:
>> <sip:$avp(out_number_map)@$Ri>\r\n");
>>  }
>>
>>  xlog("L_INFO","$ci - Route via $var(carrier) from $fU to $tU (RURI:
>> $ru)\n");
>>
>>  if(route_to_carrier("$var(carrier)")) {
>>  t_on_failure("next_gw");
>>  t_relay();
>>  exit;
>>  }
>> }
>>
>> Here are dynamic routing tables:
>>
>> dr gateways
>> ++---+--+-+---++---++---+++
>>
>> | id | gwid  | type | address | strip | pri_prefix | attrs |
>> probe_mode | state | socket | description|
>> ++---+--+-+---++---++---+++
>>
>> |  2 | mediabox1 |1 | 172.y.x.x  | 0 | NULL   | NULL
>> |  2 | 0 || Mediabox gateway   |
>> |  1 | pstn1 |1 | 172.y.x.z  | 0 | NULL   | NULL
>> |  2 | 0 || Patton GW to MD110 |
>> |  5 | toip1 |1 | 172.w.x.r | 1 | NULL   | NULL
>> |  2 | 0 || Trunk VoIP Fastweb |
>> |  6 | toip2 |1 | 172.w.x.f | 1 | NULL   | NULL
>> |  2 | 0 || Trunk VoIP Fastweb |
>> ++---+--+-+---++---++---+++
>>
>> dr groups
>> ++--++-+---+
>> | id | username | domain | groupid | description   |
>> ++--++-+---+
>> |  1 | .*   | .* |   1 | PSTN  |
>> |  2 | .*   | .* |   2 | Asterisk mediabox |
>> |  5 | .*   | .* |   3 | Trunk TOIP|
>> ++--++-+---+
>> dr carriers
>> ++---+-+---+---+---+-+
>>
>> | id | carrierid | gwlist  | flags | state | attrs |
>> description |
>> ++---+-+---+---+---+-+
>>
>> |  6 | legacy| pstn1   | 1 | 0 |   | Carrier to
>> legacy MD110 |
>> |  2 | mediabox  | mediabox1   | 1 | 0 |   | Carrier to
>> MEDIA BOX|
>> |  1 | pstn  | pstn1   | 1 | 0 |   | Carrier to
>> PSTN |
>> |  5 | toip  | toip1,toip2 | 1 | 0 |   | Carrier to
>> Trunk TOIP   |
>> ++---+-+---+---+---+-+
>>
>> dr rules
>> ++-++-+--+-+-+---+---+
>>
>> | ruleid | groupid | prefix | timerec | priority | routeid | gwlist
>> | attrs | description   |
>> ++-++-+--+-+---

Re: [OpenSIPS-Users] Dynamic Routing module issue with srip

2016-05-02 Thread Michele Pinassi
Thanks Bogdan for your prompt reply but seems that don't work as
expected: i need to strip leading '0' from called R-URI and To !

Just to help, i try to describe better my context:

for any external calls, i use route[pstn]:

route[pstn] {
# Default outbound carrier
$var(carrier) = "pstn";

# Need to route to specific carrier ?
if(avp_db_load("$fu","$avp(out_carrier)")) {
$var(carrier) = $avp(out_carrier);
   # Remove leading zero
subst_uri('/sip:0(.*)@(.*)/sip:\1@\2/g');
subst('/^To:(.*)sip:0(.*)@(.*)/sip:\1@\2/g'); < Seems that
don't work !!!
}
   
# Need to map outbound caller number ?
if(avp_db_load("$fu","$avp(out_number_map)")) {
   
uac_replace_from("$avp(out_number_map)","sip:$avp(out_number_map)@$Ri");
append_hf("P-Asserted-Identity:
<sip:$avp(out_number_map)@$Ri>\r\n");
}

xlog("L_INFO","$ci - Route via $var(carrier) from $fU to $tU (RURI:
$ru)\n");

if(route_to_carrier("$var(carrier)")) {
t_on_failure("next_gw");
t_relay();
exit;
}
}

Here are dynamic routing tables:

dr gateways
++---+--+-+---++---++---+++
| id | gwid  | type | address | strip | pri_prefix | attrs |
probe_mode | state | socket | description|
++---+--+-+---++---++---+++
|  2 | mediabox1 |1 | 172.y.x.x  | 0 | NULL   | NULL 
|  2 | 0 || Mediabox gateway   |
|  1 | pstn1 |1 | 172.y.x.z  | 0 | NULL   | NULL 
|  2 | 0 || Patton GW to MD110 |
|  5 | toip1 |1 | 172.w.x.r | 1 | NULL   | NULL 
|  2 | 0 || Trunk VoIP Fastweb |
|  6 | toip2 |1 | 172.w.x.f | 1 | NULL   | NULL 
|  2 | 0 || Trunk VoIP Fastweb |
++---+--+-+---++---++---+++
dr groups
++--++-+---+
| id | username | domain | groupid | description   |
++--++-+---+
|  1 | .*   | .* |   1 | PSTN  |
|  2 | .*   | .* |   2 | Asterisk mediabox |
|  5 | .*   | .* |   3 | Trunk TOIP|
++--++-+---+
dr carriers
++---+-+---+---+---+-+
| id | carrierid | gwlist  | flags | state | attrs |
description |
++---+-+---+---+---+-+
|  6 | legacy| pstn1   | 1 | 0 |   | Carrier to
legacy MD110 |
|  2 | mediabox  | mediabox1   | 1 | 0 |   | Carrier to
MEDIA BOX|
|  1 | pstn  | pstn1   | 1 | 0 |   | Carrier to
PSTN |
|  5 | toip  | toip1,toip2 | 1 | 0 |   | Carrier to
Trunk TOIP   |
++---+-+---+---+---+-+
dr rules
++-++-+--+-+-+---+---+
| ruleid | groupid | prefix | timerec | priority | routeid | gwlist 
| attrs | description   |
++-++-+--+-+-+---+---+
|  1 | 1   || |  100 | NULL| pstn1  
| NULL  | Default route to PSTN |
|  2 | 2   || |  100 | NULL| mediabox1  
| NULL  | Route to MEDIA BOX|
|  6 | 3   || |  100 | NULL| toip1,toip2
| NULL  | VoIP Trunk|

When someone call 00 and need to get out via "toip" carrier,
just for example, i need to strip out first 0...

Thanks, Michele

Il 29/04/2016 15:59, Bogdan-Andrei Iancu ha scritto:
> Hi Michele,
>
> the per-gw ops are done in all the routing scenarios (per prefix, per
> carrier, etc). Are you sure your call is routed via that GW ? try to
> print in cfg the GW ID to see it the right GW is used.
>
> Regards,
>
> Bogdan-Andrei Iancu
> OpenSIPS Founder and Developer
> http://www.opensips-solutions.com
>
> On 29.04.2016 12:02, Michele Pinassi wrote:
>> Hi all,
>>
>> on my OpenSIPS 1.11.6 i use dymanic module routing to magare multiple
>> routes. I need to strip a number for particular gateways and, following
>> manual, i set to '1' the 'strip' field in dr_gateways table.
>>
>> But, using function "route_to_carrier" to manage carrier routing, i get
>> no number strip...
>>
>> Maybe i'm missing something ?
>>
>

[OpenSIPS-Users] Knowing when a call was diverted

2015-11-25 Thread Michele Pinassi
Hi all,

i have a problem setting up a boss/secretary function with my OpenSIPS
router.

Scenario:

5000 was the boss phone
5002 was the secretary phone

Only 5002 can call directly 5000 (the boss phone) and all call directed
to 5000 were diverted to 5002, that answer and decide if the call should
be transferred to the boss phone (5000) or not.

Just imagine i'm 3000. And i call the 5000 (boss phone)

3000 ---> 5000 ---[DIVERT]---> 5002

The secretary answer [5002] and call the boss > [5000] to ask
permission to forward the call. If the boss say YES, secretary TRASNFER
the call originated to 3000 (answered 5002) to 5000. And on OpenSIPS i
see the call originated from 3000 and directed to 5000, so DENIED.

I try with brach flag, with AVP...no way, i cannot determine if a call
was firstly answered (and allowed) by 5002. Just for information, i'm
using SNOM 710/760 phones.

Any hint/suggestions ?

Thanks, Michele

-- 
Michele Pinassi
Responsabile Telefonia di Ateneo
Servizio Reti, Sistemi e Sicurezza Informatica - Università degli Studi di Siena
tel: 0577.(23)5000 - central...@unisi.it

Per trovare una soluzione rapida ai tuoi problemi tecnici consulta le FAQ di 
Ateneo, http://www.faq.unisi.it 



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


[OpenSIPS-Users] Try to setup ENUM NRENUM support...

2015-11-03 Thread Michele Pinassi
Hi all,

i'm trying to setup enum (NRENUM) infrastructure for our university. We
have a public IP voip server, VOIP01, with a private network for voip
phones (172.20.x.x). To let RTP flow through the private and public
network, i set up a RTP Proxy:

/onreply_route[enum_answer] {//
//if(has_body("application/sdp")) {//
//rtpproxy_answer();//
//}//
//}//
//
//onreply_route[enum_offer] {//
//if(has_body("application/sdp")) {//
//rtpproxy_offer();//
//}//
//}//
//
//route[enum] {//
//xlog("L_INFO","Route to ENUM [$fd/$fu/$rd/$ru/$si/]\n");//
//   //
//if (is_method("INVITE")) {//
//if(has_body("application/sdp")) {//
//if (rtpproxy_offer()) {//
//t_on_reply("enum_answer");//
//}//
//} else {//
//t_on_reply("enum_offer");//
//}//
//}//
//if (is_method("ACK") && has_body("application/sdp")) {//
//rtpproxy_answer();//
//}//
////
//t_on_failure("pstn");//
//
//if(!t_relay()) {//
//sl_reply_error();//
//}//
//exit;//
//}/


but on establishing call, this is the tcpdump trace between VOIP01 and
VOIP02 i get this:

/IP VOIP01.5060 > VOIP02.5060: UDP, length 1170//
//
//INVITE sip:86472@VOIP02 SIP/2.0//
//Record-Route: <sip:VOIP01;lr;ftag=gujliebxxu;did=a26.6c5c0e13>//
//Via: SIP/2.0/UDP VOIP01:5060;branch=z9hG4bKe567.edebdee3.0//
//Via: SIP/2.0/UDP
172.20.1.47:57907;received=172.20.1.47;branch=z9hG4bK-7l3vckv00z2m;rport=57907//
//From: "Michele Pinassi" <sip:5002@VOIP01:5060>;tag=gujliebxxu//
//To: <sip:009123886472@VOIP01:5060;user=phone>//
//Call-ID: 313434363534333236353330393830-j09a5i32z5kd//
//CSeq: 2 INVITE//
//Max-Forwards: 69//
//User-Agent: snom760/8.7.5.17//
//Contact: <sip:5002@172.20.1.47:57907>;reg-id=1//
//X-Serialnumber: 00041371928A//
//P-Key-Flags: resolution="31x13", keys="4"//
//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, 100rel, replaces, from-change//
//Session-Expires: 3600//
//Min-SE: 90//
//Content-Type: application/sdp//
//Content-Length: 228//
//
//v=0//
//o=root 846474428 846474428 IN IP4 172.20.1.47//
//s=call//
//c=IN IP4 VOIP01//
//t=0 0//
//m=audio 63194 RTP/AVP 9 0 8//
//a=rtpmap:9 G722/8000//
//a=rtpmap:0 PCMU/8000//
//a=rtpmap:8 PCMA/8000//
//a=ptime:20//
//a=sendrecv//
//a=nortpproxy:yes//
//
//IP VOIP02.5060 > VOIP01.5060: UDP, length 722//
//
//SIP/2.0 100 Trying//
//Via: SIP/2.0/UDP
VOIP01:5060;branch=z9hG4bKe567.edebdee3.0;received=VOIP01;rport=5060//
//Via: SIP/2.0/UDP
172.20.1.47:57907;received=172.20.1.47;branch=z9hG4bK-7l3vckv00z2m;rport=57907//
//Record-Route: <sip:VOIP01;lr;ftag=gujliebxxu;did=a26.6c5c0e13>//
//From: "Michele Pinassi" <sip:5002@VOIP01:5060>;tag=gujliebxxu//
//To: <sip:009123886472@VOIP01:5060;user=phone>//
//Call-ID: 313434363534333236353330393830-j09a5i32z5kd//
//CSeq: 2 INVITE//
//Server: FPBX-2.11.0(11.7.0)//
//Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY,
INFO, PUBLISH//
//Supported: replaces, timer//
//Session-Expires: 1800;refresher=uas//
//Contact: <sip:86472@VOIP02:5060>//
//Content-Length: 0//
//
//
//IP VOIP02.5060 > VOIP01.5060: UDP, length 590//
//
//SIP/2.0 603 Declined//
//Via: SIP/2.0/UDP
VOIP01:5060;branch=z9hG4bKe567.edebdee3.0;received=VOIP01;rport=5060//
//Via: SIP/2.0/UDP
172.20.1.47:57907;received=172.20.1.47;branch=z9hG4bK-7l3vckv00z2m;rport=57907//
//From: "Michele Pinassi" <sip:5002@VOIP01:5060>;tag=gujliebxxu//
//To: <sip:009123886472@VOIP01:5060;user=phone>;tag=as15312d47//
//Call-ID: 313434363534333236353330393830-j09a5i32z5kd//
//CSeq: 2 INVITE//
//Server: FPBX-2.11.0(11.7.0)//
//Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY,
INFO, PUBLISH//
//Supported: replaces, timer//
//Content-Length: 0//
//
//
//IP VOIP01.5060 > VOIP02.5060: UDP, length 375//
//
//ACK sip:86472@VOIP02 SIP/2.0//
//Via: SIP/2.0/UDP VOIP01:5060;branch=z9hG4bKe567.edebdee3.0//
//From: "Michele Pinassi" <sip:5002@VOIP01:5060>;tag=gujliebxxu//
//Call-ID: 313434363534333236353330393830-j09a5i32z5kd//
//To: <sip:009123886472@VOIP01:5060;user=phone>;tag=as15312d47//
//CSeq: 2 ACK//
//Max-Forwards: 70//
//User-Agent: VoIP Unisi.it//
//Content-Length: 0/

The main doubt is: /a=nortpproxy:yes/ ...why ?

Thanks, Michele



-- 
Michele Pinassi
Responsabile Telefonia di Ateneo
Servizio Reti, Sistemi e Sicurezza Informatica - Università degli Studi di Siena
tel: 0577.(23)5000 - central...@unisi.it

Per trovare una soluzione rapida ai tuoi problemi tecnici consulta le FAQ di 
Ateneo, http://www.faq.unisi.it 

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


[OpenSIPS-Users] Secretary/Boss

2015-11-02 Thread Michele Pinassi
Hi all,

in my context, i have OpenSIPS as a SIP router and Asterisk as a media
box for IVR, Voicemail etc etc etc...

I need to implement Secretary/Boss function, like this:

(USER) call--///--> (Boss phone) --- call diverted to secretary--->
(Secretary) - divert > (Boss)

User cannot call directly to Boss phone: firstly, the call will be
diverted to secretary and only in a second time, call should be
forwarded to boss phone (from secretary).

Any hint how to do this ?

Michele

-- 
Michele Pinassi
Responsabile Telefonia di Ateneo
Servizio Reti, Sistemi e Sicurezza Informatica - Università degli Studi di Siena
tel: 0577.(23)5000 - central...@unisi.it

Per trovare una soluzione rapida ai tuoi problemi tecnici consulta le FAQ di 
Ateneo, http://www.faq.unisi.it 




signature.asc
Description: OpenPGP digital signature
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] SUBSCRIBE not routed to destination

2015-04-03 Thread Michele Pinassi
Hi all,

i've just upgraded to opensips 1.11.4 (just to be clear: my problem
still exists on 1.11.3). My big issue is that SUBSCRIBE messages weren't
not routed to dest after received (andh managed) by OpenSIPS.

Setting debug=4, this is the log fot a SUBSCRIBE from 5002 to 5030:
http://pastebin.com/h7qBTKbv

This is the full opensips.cfg - http://pastebin.com/r7fNTxpy

Thanks for any help.

Michele

-- 
Michele Pinassi
Responsabile Telefonia di Ateneo
Servizio Reti, Sistemi e Sicurezza Informatica - Università degli Studi di Siena
tel: 0577.(23)5000 - fax: 0577.(23)2053

Per trovare una soluzione rapida ai tuoi problemi tecnici
consulta le FAQ di Ateneo, http://www.faq.unisi.it 



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


[OpenSIPS-Users] Some questions about Presence server

2015-03-31 Thread Michele Pinassi
Hi all,

i've read the tutorial on OpenSIPS site
(http://www.opensips.org/Documentation/Tutorials-Presence-SimplePresConfig)
but i suspect that my simple presence server don't work as expected,
causing me some annoying troubles.

Mainly, is not clear if the Basic Presence Server need OpenXCAP or
similar server installed and working: seems not, but for some reasons my
OpenSIPS's presence route (http://pastebin.com/FV2L6JaS) handle
SUBSCRIBE and PRESENCE but don't send NOTIFY.

I've tried suggested configuration but no way, NOTIFY weren't sent out.

If i disable all routing and handling for SUBSCRIBE, NOTIFY and
PRESENCE, all works as expected. But because i want to mantain control
over my system, i want to let OpenSIPS manage all requests.

You can see my config on http://pastebin.com/FV2L6JaS

This issue caused me a lot of frustration because i can't figure out why
doesn't work...

Michele

-- 
Michele Pinassi
Responsabile Telefonia di Ateneo
Servizio Reti, Sistemi e Sicurezza Informatica - Università degli Studi di Siena
tel: 0577.(23)5000 - fax: 0577.(23)2053

Per trovare una soluzione rapida ai tuoi problemi tecnici
consulta le FAQ di Ateneo, http://www.faq.unisi.it 



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


[OpenSIPS-Users] NOTIFY not routed

2015-03-27 Thread Michele Pinassi


binGAdVESTnG0.bin
Description: PGP/MIME version identification


encrypted.asc
Description: OpenPGP encrypted message
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] Routing NOTIFY to the phone - MAYBE SOLVED

2015-03-27 Thread Michele Pinassi
Oh dear,

maybe i've found the bug: in my routing logic, NOTIFY messages return
true for has_totag() but false for loose_route() so they felt into
sl_send_reply(404,Not here).

Maybe i've solved adding a else if(is_method(NOTIFY) and just relaying
them, as follow:

if (has_totag()) {
if (loose_route()) {
[...]
} else {
if ( is_method(ACK) ) {
if ( t_check_trans() ) {
t_relay();
exit;
} else {
exit;
}
} else if(is_method(NOTIFY)) {
t_relay();
exit;
}

sl_send_reply(404,Not here);
}
exit;

}

Hope this works.

Michele

-- 
Michele Pinassi
Responsabile Telefonia di Ateneo
Servizio Reti, Sistemi e Sicurezza Informatica - Università degli Studi
di Siena
tel: 0577.(23)5000 - fax: 0577.(23)2053

Per trovare una soluzione rapida ai tuoi problemi tecnici
consulta le FAQ di Ateneo, http://www.faq.unisi.it




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


[OpenSIPS-Users] Routing NOTIFY to the phone

2015-03-26 Thread Michele Pinassi
Hi all,

again on BLF...i noticed that after correct SUBSCRIPTION on the server
and on the phones of the monitored extension, when one of that change
its status, the NOTIFY was send to the server that reply with 404 and
*not* to the monitoring phone.

Here's a siptrace of what's happens:

U 2015/03/26 14:52:15.359182 172.20.1.47:47362 - 172.20.1.2:5060

NOTIFY sip:5023@172.20.1.27:32768 SIP/2.0.
Via: SIP/2.0/UDP 172.20.1.47:47362;branch=z9hG4bK-xvlhtivkog2x;rport.
From: sip:5...@voip.unisi.it:5060;user=phone;tag=o5sz371uyn.
To: sip:5...@voip.unisi.it:5060;tag=aqhxe3d198.
Call-ID: 5512ce5dc6fa-5z8xbqdcqj6f.
CSeq: 4 NOTIFY.
Max-Forwards: 70.
User-Agent: snom760/8.7.5.13.
Contact: sip:5002@172.20.1.47:47362;reg-id=1.
Event: dialog.
Subscription-State: active.
Content-Type: application/dialog-info+xml.
Content-Length: 619.
.
?xml version=1.0?
dialog-info xmlns=urn:ietf:params:xml:ns:dialog-info version=3
state=full entity=sip:5...@voip.unisi.it:5060;user=phonedialog
id=f2e27cd312a10cc126736ec8173b4f42 direction='recipient'
call-id='cb725de1020312e8' local-tag=tediqnmq6i
remote-tag=fe6112ffc8stateterminated/statelocalidentity
display=Michele Pinassisip:5...@voip.unisi.it:5060/identitytarget
uri=sip:5002@172.20.1.47:47362param pname=x-line-id pval=0
//target/localremoteidentitysip:2169@172.20.1.4:5060/identitytarget
uri=sip:2169@172.20.1.4:5060//remote/dialog/dialog-info


U 2015/03/26 14:52:15.359534 172.20.1.2:5060 - 172.20.1.47:47362

SIP/2.0 404 Not here.
Via: SIP/2.0/UDP
172.20.1.47:47362;received=172.20.1.47;branch=z9hG4bK-xvlhtivkog2x;rport=47362.
From: sip:5...@voip.unisi.it:5060;user=phone;tag=o5sz371uyn.
To: sip:5...@voip.unisi.it:5060;tag=aqhxe3d198.
Call-ID: 5512ce5dc6fa-5z8xbqdcqj6f.
CSeq: 4 NOTIFY.
Server: OpenSIPS (1.11.3-tls (i386/linux)).
Content-Length: 0.
.

Here's the part of opensips.cfg involved:

 XCAP modules
loadmodule xcap.so
loadmodule xcap_client.so

modparam(xcap, integrated_xcap_server, 1)

 PRESENCE modules
loadmodule presence.so
loadmodule presence_mwi.so
loadmodule presence_callinfo.so
loadmodule presence_xml.so
loadmodule presence_dialoginfo.so

modparam(presence, db_url, mysql://)
modparam(presence, server_address, sip:voip.unisi.it:5060)

modparam(presence, notify_offline_body, 1)
modparam(presence, fallback2db, 1)
modparam(presence, clean_period,  30)
modparam(presence, mix_dialog_presence, 1)

modparam(presence_xml,force_active,1)

[...]
route {
[...]
### PRESENCE
if(is_method(PUBLISH|SUBSCRIBE)) {
route(handle_presence);
}
[...]
}

# Presence route
route[handle_presence] {
xlog(L_INFO,Route PRESENCE on $rm [$fd/$fu/$rd/$ru/$si/]\n);
if(!t_newtran()){
sl_reply_error();
exit;
}

if (is_method(PUBLISH)) {
if($hdr(Sender)!= NULL)
handle_publish($hdr(Sender));
else
handle_publish();
} else if (is_method(SUBSCRIBE)) {
handle_subscribe();
   }

exit;
}

How i can route NOTIFY to the right extensions ?

Thanks, Michele

-- 
Michele Pinassi
Responsabile Telefonia di Ateneo
Servizio Reti, Sistemi e Sicurezza Informatica - Università degli Studi di Siena
tel: 0577.(23)5000 - fax: 0577.(23)2053

Per trovare una soluzione rapida ai tuoi problemi tecnici
consulta le FAQ di Ateneo, http://www.faq.unisi.it 




signature.asc
Description: OpenPGP digital signature
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] Sad and frustrated: PRESENCE not working

2015-03-11 Thread Michele Pinassi
Hi all,

my fight to have Presence and BLF working continue. Here's a step by
step trace when, on my phone with account 5002, i enabled a BLF for
account 5008. I use OpenSIPS 1.11.3-tls.

First, the phone send SUBSCRIBE packet:

*SUBSCRIBE sip:prese...@voip.unisi.it:5060 SIP/2.0 *
Via: SIP/2.0/UDP 172.20.1.10:37508;branch=z9hG4bK-h30k6rwp6oy5;rport
From: sip:5...@voip.unisi.it:5060;tag=pkntk9npjh
To:
sip:5...@voip.unisi.it:5060;user=phone;tag=f315b2d58ae8829149b784764c5a40e3-2387

Call-ID: 54b1fe548d09-v32qemyjagpv
CSeq: 3 SUBSCRIBE
Max-Forwards: 70
Contact: sip:5002@172.20.1.10:37508;reg-id=1
Event: dialog
Accept: application/dialog-info+xml
User-Agent: snom760/8.7.3.25.9
Expires: 3600
Content-Length: 0
 
*SIP/2.0 200 OK *
Via: SIP/2.0/UDP
172.20.1.10:37508;received=172.20.1.10;branch=z9hG4bK-h30k6rwp6oy5;rport=37508

From: sip:5...@voip.unisi.it:5060;tag=pkntk9npjh
To:
sip:5...@voip.unisi.it:5060;user=phone;tag=f315b2d58ae8829149b784764c5a40e3-2387

Call-ID: 54b1fe548d09-v32qemyjagpv
CSeq: 3 SUBSCRIBE
Expires: 3600
Contact: sip:prese...@voip.unisi.it:5060
Server: OpenSIPS (1.11.3-tls (i386/linux))
Content-Length: 0

Afterward, i get a NOTIFY with the state of the phone:

*NOTIFY sip:5002@172.20.1.10:37508 SIP/2.0 *
Via: SIP/2.0/UDP 172.20.1.2:5060;branch=z9hG4bK4e24.38cd2ef4.0
To: sip:5...@voip.unisi.it;tag=pkntk9npjh
From: sip:5...@voip.unisi.it;tag=f315b2d58ae8829149b784764c5a40e3-2387
CSeq: 2 NOTIFY
Call-ID: 54b1fe548d09-v32qemyjagpv
Max-Forwards: 70
Content-Length: 147
User-Agent: OpenSIPS (1.11.3-tls (i386/linux))
Event: dialog
Contact: sip:prese...@voip.unisi.it:5060
Subscription-State: active;expires=3600
Content-Type: application/dialog-info+xml
 
?xml version=1.0?
dialog-info xmlns=urn:ietf:params:xml:ns:dialog-info
version=1   state=full entity=sip:5...@voip.unisi.it/

*SIP/2.0 200 Ok *
Via: SIP/2.0/UDP 172.20.1.2:5060;branch=z9hG4bK4e24.38cd2ef4.0
From: sip:5...@voip.unisi.it;tag=f315b2d58ae8829149b784764c5a40e3-2387
To: sip:5...@voip.unisi.it;tag=pkntk9npjh
Call-ID: 54b1fe548d09-v32qemyjagpv
CSeq: 2 NOTIFY
Content-Length: 0


At this point i expect a NOTIFY packet when 5008 was busy but none. Of
course i have a row on active_watchers table.

My config for PRESENCE and PUA is:

 PRESENCE modules
loadmodule presence.so
loadmodule presence_mwi.so
loadmodule presence_callinfo.so
loadmodule presence_xml.so
loadmodule presence_dialoginfo.so

modparam(presence, server_address, sip:prese...@voip.unisi.it:5060)
modparam(presence, notify_offline_body, 1)
modparam(presence, fallback2db, 1)
modparam(presence, clean_period,  30)
modparam(presence, mix_dialog_presence, 1)

modparam(presence_xml,force_active,1)

  PUA module
loadmodule pua.so
loadmodule pua_dialoginfo.so
loadmodule pua_usrloc.so

modparam(pua_dialoginfo, presence_server,
sip:prese...@voip.unisi.it:5060)
modparam(pua_dialoginfo, include_callid, 1)
modparam(pua_dialoginfo, include_tags, 1)
modparam(pua_dialoginfo, include_localremote, 1)
modparam(pua_dialoginfo, publish_on_trying, 1)

modparam(pua_usrloc, default_domain, voip.unisi.it)

and on main() route logic i have:

### PRESENCE
if(is_method(PUBLISH|SUBSCRIBE)) {
route(handle_presence);
}
[]

# Presence route

route[handle_presence] {
xlog(L_INFO,Route PRESENCE on $rm [$fd/$fu/$rd/$ru/$si/]\n);
if(!t_newtran()){
sl_reply_error();
exit;
}

if (is_method(PUBLISH)) {
if($hdr(Sender)!= NULL)
handle_publish($hdr(Sender));
else
handle_publish();
}

if (is_method(SUBSCRIBE)) {
if(search(^Event: message-summary)) {
# if there is no R-URI username, grab From URI
if(!uri=~sip:.+@) { # add From username as R-URI username
avp_pushto($ruri/username,$fU);
}
# fix some broken subscriptions
if(!search(^Accept: application/simple-message-summary)) {
append_hf(Accept: application/simple-message-summary\r\n);
}
setdsturi(sip:172.20.1.5:5060);
t_relay();
} else {
handle_subscribe();
}
}
exit;
}

Just for info, the MWI (using Asterisk) works perfectly...

Any suggestions ? Hints ?

Thanks, Michele

-- 
Michele Pinassi
Responsabile Telefonia di Ateneo
Servizio Reti, Sistemi e Sicurezza Informatica - Università degli Studi di Siena
tel: 0577.(23)5000 - fax: 0577.(23)2053

Per trovare una soluzione rapida ai tuoi problemi tecnici
consulta le FAQ di Ateneo, http://www.faq.unisi.it 



signature.asc
Description: OpenPGP digital signature
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] Again BLF and Presence with Snom 7xx phones and OpenSips

2015-02-24 Thread Michele Pinassi
Hi all,

I'm still stuck on this issue: BLF not working. For example, on my SNOM
760 (ext 5002) i activated BLF for some ext, like 5020. Using SIPGREP i saw:
*
**SUBSCRIBE sip:5...@voip.unisi.it;user=phone SIP/2.0.*
Via: SIP/2.0/UDP 172.20.1.10:57286;branch=z9hG4bK-nprg3gvnk4q1;rport.
From: sip:5...@voip.unisi.it:5060;tag=nyux2omhly.
To: sip:5...@voip.unisi.it;user=phone.
Call-ID: 3944ec54dc20-pfzjpjhrpm6p.
CSeq: 2 SUBSCRIBE.
Max-Forwards: 70.
Contact: sip:5002@172.20.1.10:57286;reg-id=1.
Event: dialog.
Accept: application/dialog-info+xml.
User-Agent: snom760/8.7.3.25.9.
Proxy-Authorization: Digest
Expires: 3600.
Content-Length: 0.

*SIP/2.0 200 OK.*
Via: SIP/2.0/UDP
172.20.1.10:57286;received=172.20.1.10;branch=z9hG4bK-nprg3gvnk4q1;rport=57286.
From: sip:5...@voip.unisi.it:5060;tag=nyux2omhly.
To:
sip:5...@voip.unisi.it;user=phone;tag=f315b2d58ae8829149b784764c5a40e3-163d.
Call-ID: 3944ec54dc20-pfzjpjhrpm6p.
CSeq: 2 SUBSCRIBE.
Expires: 3600.
Contact: sip:prese...@voip.unisi.it:5060.
Server: OpenSIPS (1.11.3-tls (i386/linux)).
Content-Length: 0.

*NOTIFY sip:5002@172.20.1.10:57286 SIP/2.0.*
Via: SIP/2.0/UDP 172.20.1.2:5060;branch=z9hG4bKdb02.83d58916.0.
To: sip:5...@voip.unisi.it;tag=nyux2omhly.
From: sip:5...@voip.unisi.it;tag=f315b2d58ae8829149b784764c5a40e3-163d.
CSeq: 1 NOTIFY.
Call-ID: 3944ec54dc20-pfzjpjhrpm6p.
Max-Forwards: 70.
Content-Length: 147.
User-Agent: OpenSIPS (1.11.3-tls (i386/linux)).
Event: dialog.
Contact: sip:prese...@voip.unisi.it:5060.
Subscription-State: active;expires=3600.
Content-Type: application/dialog-info+xml.
.
?xml version=1.0?
dialog-info xmlns=urn:ietf:params:xml:ns:dialog-info version=0
state=full entity=sip:5...@voip.unisi.it/
*
**SIP/2.0 200 Ok.*
Via: SIP/2.0/UDP 172.20.1.2:5060;branch=z9hG4bKdb02.83d58916.0.
From: sip:5...@voip.unisi.it;tag=f315b2d58ae8829149b784764c5a40e3-163d.
To: sip:5...@voip.unisi.it;tag=nyux2omhly.
Call-ID: 3944ec54dc20-pfzjpjhrpm6p.
CSeq: 1 NOTIFY.
Content-Length: 0.

*SUBSCRIBE sip:prese...@voip.unisi.it:5060 SIP/2.0.*
Via: SIP/2.0/UDP 172.20.1.25:32768;branch=z9hG4bK-lbgnea3kuorq;rport.
From: sip:5...@voip.unisi.it:5060;tag=w8vp9q5iyn.
To:
sip:5...@voip.unisi.it;user=phone;tag=f315b2d58ae8829149b784764c5a40e3-29cc.
Call-ID: 54ec3a578c9e-klgn0s3i32zo.
CSeq: 75 SUBSCRIBE.
Max-Forwards: 70.
Contact: sip:5007@172.20.1.25:32768;reg-id=1.
Event: dialog.
Accept: application/dialog-info+xml.
User-Agent: snom710/8.7.3.25.9.
Expires: 3600.
Content-Length: 0.
*
**SIP/2.0 404 Not here.*
Via: SIP/2.0/UDP
172.20.1.25:32768;received=172.20.1.25;branch=z9hG4bK-lbgnea3kuorq;rport=32768.
From: sip:5...@voip.unisi.it:5060;tag=w8vp9q5iyn.
To:
sip:5...@voip.unisi.it;user=phone;tag=f315b2d58ae8829149b784764c5a40e3-29cc.
Call-ID: 54ec3a578c9e-klgn0s3i32zo.
CSeq: 75 SUBSCRIBE.
Server: OpenSIPS (1.11.3-tls (i386/linux)).
Content-Length: 0.

*NOTIFY sip:5002@172.20.1.10:57286 SIP/2.0.*
Via: SIP/2.0/UDP 172.20.1.2:5060;branch=z9hG4bKdbe9.7966c706.0.
To: sip:5...@voip.unisi.it;tag=iklb1qjh1v.
From: sip:5...@voip.unisi.it;tag=f315b2d58ae8829149b784764c5a40e3-b571.
CSeq: 2 NOTIFY.
Call-ID: ee35ec54a72b-draf1nwo4qn7.
Max-Forwards: 70.
Content-Length: 0.
User-Agent: OpenSIPS (1.11.3-tls (i386/linux)).
Event: dialog.
Contact: sip:prese...@voip.unisi.it:5060.
*Subscription-State: terminated;reason=timeout.*
*
**SIP/2.0 200 Ok.*
Via: SIP/2.0/UDP 172.20.1.2:5060;branch=z9hG4bKdbe9.7966c706.0.
From: sip:5...@voip.unisi.it;tag=f315b2d58ae8829149b784764c5a40e3-b571.
To: sip:5...@voip.unisi.it;tag=iklb1qjh1v.
Call-ID: ee35ec54a72b-draf1nwo4qn7.
CSeq: 2 NOTIFY.
Content-Length: 0.

The line 5020 was active but no lamp was powered. Also no NOTIFY or
other event was sent by Opensips server when i try to call (from another
phone) 5020.

The full opensips.cfg is available here: http://pastebin.com/e6SfbFfq

Thanks for any help.

Michele

-- 
Michele Pinassi
Responsabile Telefonia di Ateneo
Servizio Reti, Sistemi e Sicurezza Informatica - Università degli Studi di Siena
tel: 0577.(23)5000 - fax: 0577.(23)2053

Per trovare una soluzione rapida ai tuoi problemi tecnici
consulta le FAQ di Ateneo, http://www.faq.unisi.it 



signature.asc
Description: OpenPGP digital signature
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] Some phones can call, others not...

2014-11-28 Thread Michele Pinassi
Hi all,

i'm experiencing a strange issue. Some VoIP phones, like mine (5002),
cannot call other phones (like 5023) but i receive calls from 5023. Same
config, same context.

I did some sipgrep:

Call from 5002 to 5023 (FAILED): http://pastebin.com/BF6YyWHr
Call from 5023 to 5002 (SUCCESS): http://pastebin.com/rW3AKr22

My config: http://pastebin.com/9gP9xncd

Thanks for all your help.

Michele

-- 
Michele Pinassi
Responsabile Telefonia di Ateneo
Servizio Reti, Sistemi e Sicurezza Informatica - Università degli Studi di Siena
tel: 0577.(23)2169 - fax: 0577.(23)2053

Per trovare una soluzione rapida ai tuoi problemi tecnici
consulta le FAQ di Ateneo, http://www.faq.unisi.it 




signature.asc
Description: OpenPGP digital signature
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Not forwarding 200 ok sporatically

2014-11-26 Thread Michele Pinassi
A similar issue happens to me, when from some voip phones i try to call
other voip phones.

For example, when from 5002 i try to call 5023.

Here's my config: http://pastebin.com/9gP9xncd

This is what happens on server 172.20.1.2: http://pastebin.com/gZNSwyHB

This is the log on 5002: http://pastebin.com/RXtqwMtz

But on 5023 no INVITE arrive... :-( this happens only from some phones
while on others calling 5023 works as expected.

Michele


Il 25/11/2014 17:24, Vlad Paiu ha scritto:
 Hello,

 Please provide the SIP trace and the OpenSIPS full debug log.

 Best Regards,
 Vlad Paiu
 OpenSIPS Developer
 http://www.opensips-solutions.com 
 On 25.11.2014 11:50, Tito Cumpen wrote:
 group


 I am having an issue in which opensips will ignore the the 200 ok
 response to an invite . I am using Opensips 1.11. This will cause the
 the b leg to assume a call and the A leg to be treated by the failure
 route. I cant find the initial invite in the debug logs but see the
 200 ok response. I have captures of a working call vs a non working
 and cannot find a difference that would be the reason behind the
 failure. Is there anything I can provide to help identify the cause
 of this issue?


 Thanks,
 Tito


 ___
 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

-- 
Michele Pinassi
Responsabile Telefonia di Ateneo
Servizio Reti, Sistemi e Sicurezza Informatica - Università degli Studi di Siena
tel: 0577.(23)2169 - fax: 0577.(23)2053

Per trovare una soluzione rapida ai tuoi problemi tecnici
consulta le FAQ di Ateneo, http://www.faq.unisi.it 



signature.asc
Description: OpenPGP digital signature
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] BLF and Presence/PUA

2014-11-19 Thread Michele Pinassi
 
sip:voip.unisi.it:5060


but on a phone call to 5007 i get no NOTIFY and, moreover, i don't get
any NOTIFY at all !!!

Any hint ?

Thanks, Michele

-- 
Michele Pinassi
Responsabile Telefonia di Ateneo
Servizio Reti, Sistemi e Sicurezza Informatica - Università degli Studi di Siena
tel: 0577.(23)2169 - fax: 0577.(23)2053

Per trovare una soluzione rapida ai tuoi problemi tecnici
consulta le FAQ di Ateneo, http://www.faq.unisi.it 



signature.asc
Description: OpenPGP digital signature
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] Presence error

2014-11-18 Thread Michele Pinassi
))
append_hf(Accept: application/simple-message-summary\r\n);
   
setdsturi(sip:172.20.1.5:5060);
t_relay();
} else {
# ...for anything else...
handle_subscribe();
}
}
exit;
}

branch_route[per_branch_ops] {
xlog(L_INFO,Route NEW BRANCH [$fd/$fu/$rd/$ru/$si/]\n);
}

failure_route[missed_call] {
xlog(L_INFO,Route MISSED CALL [$fd/$fu/$rd/$ru/$si/]\n);
if (t_was_cancelled()) {
exit;
}

# User set CALL FORWARD ON BUSY ?
if (t_check_status(486)) {
revert_uri();
if(avp_db_load($ru,$avp(fwdbusy))) {
$ru = $avp(fwdbusy);
xlog(L_INFO,User forward on BUSY to $ru\n);
} else {
# Forward call with BUSY to Asterisk
prefix(BUSY_);
rewritehostport(172.20.1.5:5060);
}
t_relay();
}
   
# if the failure code is 408 - timeout or 480 - unanswered
if (t_check_status(408|480)) {
revert_uri();
if(avp_db_load($ru,$avp(fwdnoans))) {
$ru = $avp(fwdnoans);
xlog(L_INFO,User forward on TIMEOUT/NOANSWER to $ru\n);
} else {
prefix(VMR_);
   
rewritehostport(172.20.1.5:5060);
}
t_relay();
}
   
# For other...
if (t_check_status(5[0-9][0-9])) {
revert_uri();
prefix(FAILURE_);
rewritehostport(172.20.1.5:5060);
t_relay();
}
}

failure_route[next_gw] {
if (use_next_gw()) {
t_relay();
exit;
}
}



-- 
Michele Pinassi
Responsabile Telefonia di Ateneo
Servizio Reti, Sistemi e Sicurezza Informatica - Università degli Studi di Siena
tel: 0577.(23)2169 - fax: 0577.(23)2053

Per trovare una soluzione rapida ai tuoi problemi tecnici
consulta le FAQ di Ateneo, http://www.faq.unisi.it 




signature.asc
Description: OpenPGP digital signature
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] ul_publish: failed to send publish

2014-11-14 Thread Michele Pinassi
);
xlog(L_INFO,User forward on BUSY to $ru\n);
} else {
# Forward call with BUSY to Asterisk
prefix(BUSY_);
rewritehostport(172.20.1.5:5060);
}
t_relay();
}
   
# if the failure code is 408 - timeout or 480 - unanswered
if (t_check_status(408|480)) {
revert_uri();
if(avp_db_load($ru,$avp(fwdnoans))) {
$ru = $avp(fwdnoans);
xlog(L_INFO,User forward on TIMEOUT/NOANSWER to $ru\n);
} else {
prefix(VMR_);
   
rewritehostport(172.20.1.5:5060);
}
t_relay();
}
   
# For other...
if (t_check_status(5[0-9][0-9])) {
revert_uri();
prefix(FAILURE_);
rewritehostport(172.20.1.5:5060);
t_relay();
}
}

failure_route[next_gw] {
if (use_next_gw()) {
t_relay();
exit;
}
}

route[mediabox] {
xlog(L_INFO,Route MEDIABOX [$fd/$fu/$rd/$ru/$si/]\n);

if(route_to_carrier(mediabox)) {
t_on_failure(next_gw);
t_relay();
exit;
}

}


route[pstn] {
xlog(L_INFO,Route to PSTN [$fd/$fu/$rd/$ru/$si/]\n);
   
if(route_to_carrier(pstn)) {
t_on_failure(next_gw);
t_relay();
exit;
}

}

-- 
Michele Pinassi
Responsabile Telefonia di Ateneo
Servizio Reti, Sistemi e Sicurezza Informatica - Università degli Studi di Siena
tel: 0577.(23)2169 - fax: 0577.(23)2053

Per trovare una soluzione rapida ai tuoi problemi tecnici
consulta le FAQ di Ateneo, http://www.faq.unisi.it 




signature.asc
Description: OpenPGP digital signature
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] BLF and PRESENCE

2014-10-29 Thread Michele Pinassi
Hi all,

on our opensips system i'm trying to implement PRESENCE-BLF
funcionality, where the boss phone (Snom 760) subscribe the workers
line and see when they are busy/free.

As i see, here's my opensips.cfg relevant parts:

[...]
 PRESENCE modules
loadmodule presence.so
loadmodule presence_xml.so
loadmodule presence_mwi.so
loadmodule presence_callinfo.so
loadmodule xcap.so

modparam(presence, server_address, sip:sa@172.20.1.2:5060)
modparam(presence_xml, force_active, 1)

modparam(xcap,db_url,mysql://voip:4lagjzck8c6pp...@mysql.unisi.it/opensips)
modparam(xcap, integrated_xcap_server, 1)

[...]

and simply add a route for presence:

[...]
if( is_method(PUBLISH|SUBSCRIBE))
route(handle_presence);

[...]
# Presence route

route[handle_presence] {
xlog(L_INFO,Route PRESENCE [$fd/$fu/$rd/$ru/$si/]\n);
if(!t_newtran()){
sl_reply_error();
exit;
}

if (is_method(PUBLISH)) {
handle_publish();
}
   
if (is_method(SUBSCRIBE)) {
handle_subscribe();
}
exit;
}
[...]

on the boss phone (5002) i set up BLF for 5009 but BLF simply don't work.

On Opensips logs i have:

Oct 29 11:47:05 proxy-voip01 /usr/sbin/opensips[5494]: Route PRESENCE
[voip.unisi.it/sip:5...@voip.unisi.it:5060/voip.unisi.it/sip:5...@voip.unisi.it:5060;user=phone/172.20.1.10/]
Oct 29 11:47:05 proxy-voip01 /usr/sbin/opensips[5494]:
INFO:presence:handle_subscribe: Missing or unsupported event header
field value
Oct 29 11:47:05 proxy-voip01 /usr/sbin/opensips[5494]:
INFO:presence:handle_subscribe: #011event= dialog
[...]
Oct 29 11:47:32 proxy-voip01 /usr/sbin/opensips[5496]: Route PRESENCE
[voip.unisi.it/sip:5...@voip.unisi.it:5060/voip.unisi.it/sip:*9...@voip.unisi.it:5060;user=phone/172.20.2.12/]
Oct 29 11:47:32 proxy-voip01 /usr/sbin/opensips[5496]:
INFO:presence:update_subscription: notify
Oct 29 11:47:32 proxy-voip01 /usr/sbin/opensips[5496]:
INFO:presence:send_notify_request: NOTIFY sip:5...@voip.unisi.it via
sip:5022@172.20.2.12:32768 on behalf of sip:*9...@voip.unisi.it for event
message-summary, to_tag=f315b2d58ae8829149b784764c5a40e3-c2fb, cseq=1


Moreover, i've tried to see how watchers/presentity works but i'm not
able to find any tutorialhints ? Suggestions ?

Thanks, Michele

-- 
Michele Pinassi
Responsabile Telefonia di Ateneo
Servizio Reti, Sistemi e Sicurezza Informatica - Università degli Studi di Siena
tel: 0577.(23)2169 - fax: 0577.(23)2053

Per trovare una soluzione rapida ai tuoi problemi tecnici
consulta le FAQ di Ateneo, http://www.faq.unisi.it 




signature.asc
Description: OpenPGP digital signature
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] Help with dr_routing outside VoIP network

2014-05-30 Thread Michele Pinassi
Hi all,

this is my context:

VoIP NET 172.20.x.x
VoIP ROUTER 172.20.1.2
External NET 200.200.200.x

I use dr_route module to do dynamic routing:

main() {

[...]
if($avp(dest)==trunkmed) {
route(trunkmed);
}
   
if($avp(dest)==external) {
route(pstn);
}
   
if($avp(dest)==media) {
route(mediabox);

[...]
}


route[trunkmed] {
xlog(L_INFO,Route TRUNK MEDICINA [$fd/$fu/$rd/$ru/$si/]\n);

if(route_to_carrier(trunkmed)) {
t_on_failure(next_gw);
t_relay();
exit;
}
   
}

trunkmed gw is outside VoIP network (200.200.200.2) and i'm not able
to forward correctly packets from VoIP devices to trunkmed GW: maybe i
have to nat/fix it ?

Any hint ?

Thanks, Michele

-- 
Michele Pinassi
Responsabile Telefonia di Ateneo
Servizio Reti, Sistemi e Sicurezza Informatica - Università degli Studi di Siena
tel: 0577.(23)2169 - fax: 0577.(23)2053

Per trovare una soluzione rapida ai tuoi problemi tecnici
consulta le FAQ di Ateneo, http://www.faq.unisi.it 




signature.asc
Description: OpenPGP digital signature
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Opensips plays an audio

2014-04-22 Thread Michele Pinassi
Hi Frana,

Just install an Asterisk and live happy.

If you need help i've already di what you want

Michele
Il 20/apr/2014 09:57 H Yavari hyav...@rocketmail.com ha scritto:

 Hi Frank,
 I tried to do with rtpproxy_stream2uac() the RBT but this not work for me.

 --
 Regards,
 H.Yavari
   --
 Greetings,

 Is there any way for an opensips and a rtpproxy to play an audio to a
 caller?

 Intentions:
 - I want to play an announcement to callers when all our UAS are down.
 - I am using opensips and rtpproxy and trying Not to introduce a new
 component like a media server.

 Thoughts?

 It seems that b2bua module is a way to go but there might be some learning
 curve. Is it the only way?

 Is it possible to use the rtpproxy_stream2uac of the rtpproxy midule? How
 to make the SDP that uac needs (183 or something else)?

 Thanks

 Frank






 ___
 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] Opensips 1.11.0 CRASH

2013-10-29 Thread Michele Pinassi
/opensips[10210]:
INFO:core:sig_usr: signal 15 received
Oct 29 13:59:04 proxy-voip01 /usr/sbin/opensips[10193]:
INFO:core:cleanup: cleanup
Oct 29 13:59:04 proxy-voip01 /usr/sbin/opensips[10193]:
NOTICE:presence:destroy: destroy module ...

Any hint ?

Michele

-- 
Michele Pinassi
Responsabile Telefonia di Ateneo
Servizio Reti, Sistemi e Sicurezza Informatica - Università degli Studi di Siena
tel: 0577.(23)2169 - fax: 0577.(23)2053

Per trovare una soluzione rapida ai tuoi problemi tecnici
consulta le FAQ di Ateneo, http://www.faq.unisi.it 




signature.asc
Description: OpenPGP digital signature
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] RTPProxy to link two networks

2013-10-18 Thread Michele Pinassi
sl_send_reply(484,Address Incomplete);
exit;
}

   
# apply DB based aliases
alias_db_lookup(dbaliases);

# do lookup with method filtering
if (!lookup(location,m)) {
switch ($retcode) {
case -1: # Note here: check for blacklist numbers
if (!check_blacklist(globalblacklist)) {
sl_send_reply(403, Forbidden);
exit;
}

# Check for user ACLs
if($rU=~^\0) {
if(!db_is_user_in(Credentials,extern)) {
xlog(L_INFO,403 - Forbidden
[$fd/$fu/$rd/$ru/$si]\n);
sl_send_reply(403, Forbidden - No permission for
external calls);
exit;
}
}

# Then route it !
cr_user_carrier($fU, $fd, $avp(carrier));
if($avp(carrier)==0) {
xlog(L_INFO,Not here: default route
[$fd/$fu/$rd/$ru/$si]\n);

if($(rU{s.len})  4) {
xlog(L_ERR, Number incomplete/failure for $rU\n);
prefix(FAIL_);
route(vmbox);
}
   
if(!cr_route(default, $fd, $rU, $rU,
call_id, $avp(host))) {
xlog(L_ERR, Number not found for $rU\n);
prefix(FAIL_);
route(vmbox);
}
} else {
xlog(L_INFO,Not here: user route
[$fd/$fu/$rd/$ru/$si/$avp(carrier)]\n);

$avp(domain)=voip.unisi.it;
if (!cr_route($avp(carrier), $avp(domain),
$rU, $rU,call_id, $avp(host))) {
sl_send_reply(404, Not found);
xlog(L_ERR, cr_route failed\n);
exit;
}
}
   
t_on_failure(missed_call);
   
if (!t_relay()) {
sl_reply_error();
};
exit;
case -3: # internal error
t_newtran();
t_reply(404, Not Found);
exit;
case -2: # method not supported
sl_send_reply(405, Method Not Allowed);
exit;
}
}
   
if (isbflagset(NAT)) setflag(NAT);

# when routing via usrloc, log the missed calls also
setflag(ACC_MISSED);
route(relay);
}


route[relay] {
# for INVITEs enable some additional helper routes
if (is_method(INVITE)) {
   
if (isflagset(NAT)) {
rtpproxy_offer(ro);
}

t_on_branch(per_branch_ops);
t_on_reply(handle_nat);
t_on_failure(missed_call);
}

if (isflagset(NAT)) {
add_rr_param(;nat=yes);
}

if (!t_relay()) {
send_reply(500,Internal Error);
};
exit;
}


# Presence route
route[handle_presence]
{
if (!t_newtran())
{
sl_reply_error();
exit;
}

if(is_method(PUBLISH))
{
handle_publish();
}
else
if( is_method(SUBSCRIBE))
{
handle_subscribe();
}

exit;
}


branch_route[per_branch_ops] {
xlog(new branch at $ru\n);
}


onreply_route[handle_nat] {
if (nat_uac_test(1))
fix_nated_contact();
if ( isflagset(NAT) )
rtpproxy_answer(ro);
#xlog(incoming reply\n);
}


failure_route[missed_call] {
if (t_was_cancelled()) {
exit;
}
   
if (t_check_status(408|5[0-9][0-9])) {
if(!cr_route(default, $fd, $rU, $rU, call_id,
$avp(host))){
t_reply(403, Not allowed);
} else {
revert_uri();
prefix(FAILURE_);
rewritehostport(172.20.1.5:5060);
t_relay();
}
}
}

route[vmbox] {
xlog(L_INFO,Route VMBOX  [$fd/$fu/$rd/$ru/$si/]\n);

rewritehostport(172.20.1.5:5060);

route(relay);
}


local_route {
if (is_method(BYE)  $DLG_dir==UPSTREAM) {
   
acc_db_request(200 Dialog Timeout, acc);
   
}
}

SIP Signaling works but RTP (Voice) not. If i register a device like
sip:5001@10.1.65.117 call signalling works but voice not.

Any hint ?

Thanks, Michele

-- 
Michele Pinassi
Responsabile Telefonia di Ateneo
Servizio Reti, Sistemi e Sicurezza Informatica - Università degli Studi di Siena
tel: 0577.(23)2169 - fax: 0577.(23)2053

Per trovare una soluzione rapida ai tuoi problemi tecnici
consulta le FAQ di Ateneo, http://www.faq.unisi.it 




signature.asc
Description: OpenPGP digital signature
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Where to place acc_aaa_request ?

2013-05-17 Thread Michele Pinassi
Via Radius using acc module, as you suggest before !

Michele

On 16/05/2013 16:13, Bogdan-Andrei Iancu wrote:
 Well, do you want to do accouting via RADIUS (aaa) or via DB (in acc
 table) ???
 
 Regards,
 
 Bogdan-Andrei Iancu
 OpenSIPS Founder and Developer
 http://www.opensips-solutions.com
 
 
 On 05/16/2013 01:18 PM, Michele Pinassi wrote:
 Thanks Bodgan for your kindly reply but now accounting don't work:
 nothing will be added to acc table !

 Here's the full routing logic. Maybe there's something wrong:

 modparam(aaa_radius, radius_config,
 /etc/radiusclient-ng/radiusclient.conf)


 modparam(acc, early_media, 0)
 modparam(acc, report_cancels, 0)
 modparam(acc, detect_direction, 0)
 modparam(acc, log_level, 1)
 modparam(acc, aaa_url, radius:/etc/radiusclient-ng/radiusclient.conf)
 modparam(acc, aaa_flag, 1)
 modparam(acc, aaa_extra,  via=$hdr(Via[*]); \
Digest-User-Name=$Au; \
Calling-Station-Id=$from; \
Called-Station-Id=$to; \
Sip-Translated-Request-URI=$ru; \
Sip-RPid=$avp(s:rpid); \
Source-IP=$avp(s:source_ip); \
Source-Port=$avp(s:source_port); \
SIP-Proxy-IP=$avp(s:sip_proxy_ip); \
Canonical-URI=$avp(s:can_uri); \

 Divert-Reason=$avp(s:divert_reason); \
User-Agent=$hdr(user-agent); \
Contact=$hdr(contact); \
Event=$hdr(event) ;\
ENUM-TLD=$avp(s:enum_tld))


 ### Routing Logic 

 route{
  if (!mf_process_maxfwd_header(10)) {
  sl_send_reply(483,Too Many Hops);
  exit;
  }
  
  if (msg:len = 2048 ) {
  sl_send_reply(513, Message too big);
  exit;
  };
  
  if (check_address(4,$si,$sp,$proto)) {
 #xlog(L_INFO,IP $si Allowed);
  } else {
  xlog(L_INFO,IP $si Forbidden);
  sl_send_reply(403, Forbidden);
  }
  
  
  if (has_totag()) {
  if (loose_route()) {
  if (is_method(BYE)) {
  setflag(1);
  } else if (is_method(INVITE)) {
  record_route();
  }
  route(1);
  } else {
  /* uncomment the following lines if you want to enable 
 presence */
  if (is_method(SUBSCRIBE)  $rd == voip.unisi.it) {
  route(2);
  exit;
  }
  if ( is_method(ACK) ) {
  if ( t_check_trans() ) {
  t_relay();
  exit;
  } else {
  exit;
  }
  }
  sl_send_reply(404,Not here);
  }
  exit;
  }

  if (is_method(CANCEL))
  {
  if (t_check_trans())
  t_relay();
  exit;
  }

  if (is_method(INVITE)) {
  setflag(1);
  }

  t_check_trans();

  if (!(method==REGISTER)  is_from_local())
  {
  if(!check_source_address(0)){
  if (!proxy_authorize(, subscriber)) {
  proxy_challenge(, 0);
  exit;
  }
  if (!db_check_from()) {
  sl_send_reply(403,Forbidden auth ID);
  exit;
  }
  
  consume_credentials();
  # caller authenticated
  }
  }

  # preloaded route checking
  if (loose_route()) {
  xlog(L_ERR, Attempt to route with preloaded Route's
 [$fu/$tu/$ru/$ci]);
  if (!is_method(ACK))
  sl_send_reply(403,Preload Route denied);
  exit;
  }

  # record routing
  if (!is_method(REGISTER|MESSAGE))
  record_route();

  if (!uri==myself) {
  append_hf(P-hint: outbound\r\n);
  route(1);
  }

  if( is_method(PUBLISH|SUBSCRIBE)) {
  route(2);
  }
  
  
  if (is_method(REGISTER)) {
  # authenticate the REGISTER requests (uncomment to enable auth)
  if (!www_authorize(, subscriber))
  {
  www_challenge(, 0);
  exit;
  }
  
  if (!db_check_to())
  {
  sl_send_reply(403,Forbidden auth ID

Re: [OpenSIPS-Users] Where to place acc_aaa_request ?

2013-05-17 Thread Michele Pinassi
Yes, the radius server receive the packets.

I saw them in the text log of freeradius server. Here's an entry example:

Fri May 17 13:54:11 2013
Acct-Status-Type = Stop
Service-Type = Sip-Session
Sip-Response-Code = 200
Sip-Method = Bye
Event-Timestamp = May 17 2013 13:54:11 CEST
Sip-From-Tag = da61bce06d
Sip-To-Tag = 6a3c0aa1e36e0c87i0
Acct-Session-Id = 9f4987d21afa6fc9
Digest-Attributes = 0x0a143530303540766f69702e756e6973692e6974
Calling-Station-Id = sip:5...@voip.unisi.it
Called-Station-Id = sip:2233@172.20.1.4
Sip-Translated-Request-URI = sip:2233@172.20.1.4:5060
User-Agent = Cisco/SPA502G-7.4.8a
NAS-Port = 5060
Acct-Delay-Time = 0
NAS-IP-Address = 127.0.0.1
Acct-Unique-Session-Id = de5f87e909fa9a63
Timestamp = 1368791651


But in the 'radacc' mysql table i have all calls (missed too).

Michele


On 17/05/2013 13:00, Bogdan-Andrei Iancu wrote:
 That means you do it (from OpenSIPS perspective) via RADIUS, and the
 configuration seems ok for that ; Could you confirm that OpenSIPS is
 sending RADIUS packages to the RADIUS server ? The RARDIUS server is the
 one responsible for writing in whatever file or DB the received data.
 
 Regards,
 
 Bogdan-Andrei Iancu
 OpenSIPS Founder and Developer
 http://www.opensips-solutions.com
 
 
 On 05/17/2013 10:34 AM, Michele Pinassi wrote:
 Via Radius using acc module, as you suggest before !

 Michele

 On 16/05/2013 16:13, Bogdan-Andrei Iancu wrote:
 Well, do you want to do accouting via RADIUS (aaa) or via DB (in acc
 table) ???

 Regards,

 Bogdan-Andrei Iancu
 OpenSIPS Founder and Developer
 http://www.opensips-solutions.com


 On 05/16/2013 01:18 PM, Michele Pinassi wrote:
 Thanks Bodgan for your kindly reply but now accounting don't work:
 nothing will be added to acc table !

 Here's the full routing logic. Maybe there's something wrong:

 modparam(aaa_radius, radius_config,
 /etc/radiusclient-ng/radiusclient.conf)


 modparam(acc, early_media, 0)
 modparam(acc, report_cancels, 0)
 modparam(acc, detect_direction, 0)
 modparam(acc, log_level, 1)
 modparam(acc, aaa_url, radius:/etc/radiusclient-ng/radiusclient.conf)
 modparam(acc, aaa_flag, 1)
 modparam(acc, aaa_extra,  via=$hdr(Via[*]); \
Digest-User-Name=$Au; \
Calling-Station-Id=$from; \
Called-Station-Id=$to; \
Sip-Translated-Request-URI=$ru; \
Sip-RPid=$avp(s:rpid); \
Source-IP=$avp(s:source_ip); \
Source-Port=$avp(s:source_port); \
SIP-Proxy-IP=$avp(s:sip_proxy_ip); \
Canonical-URI=$avp(s:can_uri); \

 Divert-Reason=$avp(s:divert_reason); \
User-Agent=$hdr(user-agent); \
Contact=$hdr(contact); \
Event=$hdr(event) ;\
ENUM-TLD=$avp(s:enum_tld))


 ### Routing Logic 

 route{
if (!mf_process_maxfwd_header(10)) {
sl_send_reply(483,Too Many Hops);
exit;
}

if (msg:len = 2048 ) {
sl_send_reply(513, Message too big);
exit;
};

if (check_address(4,$si,$sp,$proto)) {
 #  xlog(L_INFO,IP $si Allowed);
} else {
xlog(L_INFO,IP $si Forbidden);
sl_send_reply(403, Forbidden);
}


if (has_totag()) {
if (loose_route()) {
if (is_method(BYE)) {
setflag(1);
} else if (is_method(INVITE)) {
record_route();
}
route(1);
} else {
/* uncomment the following lines if you want to enable 
 presence */
if (is_method(SUBSCRIBE)  $rd == voip.unisi.it) {
route(2);
exit;
}
if ( is_method(ACK) ) {
if ( t_check_trans() ) {
t_relay();
exit;
} else {
exit;
}
}
sl_send_reply(404,Not here);
}
exit;
}

if (is_method(CANCEL))
{
if (t_check_trans())
t_relay();
exit;
}

if (is_method(INVITE)) {
setflag(1);
}

t_check_trans();

if (!(method==REGISTER)  is_from_local())
{
if(!check_source_address(0

[OpenSIPS-Users] Where to place acc_aaa_request ?

2013-05-16 Thread Michele Pinassi
] {
xlog(L_INFO,Failure Route1  [$fd/$fu/$rd/$ru/$si/]\n);

if (t_was_cancelled()) {
exit;
}

if (t_check_status(408|5[0-9][0-9])) {
if(!cr_route(default, $fd, $rU, $rU, call_id,
$avp(host))){
t_reply(403, Not allowed);
} else {
t_on_failure(2);
t_relay();
}
}
}

failure_route[2] {
xlog(L_INFO,Failure Route2  [$fd/$fu/$rd/$ru/$si/]\n);

if (t_was_cancelled()) {
exit;
}

revert_uri();
prefix(FAILURE_);
rewritehostport(172.20.1.5:5060);
t_relay();
}

i insert acc_aaa_request inside INVITE but also missed calls were
recorded. I want to count only effective calls: maybe i need to move
acc_aaa_request in another place ?

Thanks for your suggestions, Michele

-- 
Michele Pinassi
Responsabile Telefonia di Ateneo
Servizio Reti, Sistemi e Sicurezza Informatica - Università degli Studi
di Siena
tel: 0577.(23)2169 - fax: 0577.(23)2053

Per trovare una soluzione rapida ai tuoi problemi tecnici
consulta le FAQ di Ateneo, http://www.faq.unisi.it



signature.asc
Description: OpenPGP digital signature
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Where to place acc_aaa_request ?

2013-05-16 Thread Michele Pinassi
 the accounting via flags only.
 Use the aaa_flag only (do not set aa_missed_flag) and it should do the
 trick.
 
 Regards,
 
 Bogdan-Andrei Iancu
 OpenSIPS Founder and Developer
 http://www.opensips-solutions.com

-- 
Michele Pinassi
Responsabile Telefonia di Ateneo
Servizio Reti, Sistemi e Sicurezza Informatica - Università degli Studi
di Siena
tel: 0577.(23)2169 - fax: 0577.(23)2053

Per trovare una soluzione rapida ai tuoi problemi tecnici
consulta le FAQ di Ateneo, http://www.faq.unisi.it



signature.asc
Description: OpenPGP digital signature
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] OpenSIPS with public/private interface and RTPProxy

2013-05-09 Thread Michele Pinassi
;
}

if (!db_check_to())
{
sl_send_reply(403,Forbidden auth ID);
exit;
}

if (!save(location))
sl_reply_error();

exit;
}

if ($rU==NULL) {
# request with no Username in RURI
sl_send_reply(484,Address Incomplete);
exit;
}

# media service number? (digits starting with *)
if($rU=~^\*) {
route(4);
}

# apply DB based aliases (uncomment to enable)
alias_db_lookup(dbaliases);

# do lookup with method filtering
if (!lookup(location,m)) {
switch ($retcode) {
case -1: # no contact: route it !
cr_user_carrier($fU, $fd, $avp(carrier));
if($avp(carrier)==0) {
xlog(L_INFO,Not here: default route 
[$fd/$fu/$rd/$ru/$si]\n);
# Not here: default route
[172.20.1.4/sip:2425@172.20.1.4:5060/voip.unisi.it/sip:5...@voip.unisi.it:5060/172.20.1.4]
if($(rU{s.len})  4) {
xlog(L_ERR, Number 
incomplete/failure for $rU\n);
prefix(FAIL_);
route(4);
}

if(!cr_route(default, $fd, $rU, 
$rU, call_id,
$avp(host))) {
xlog(L_ERR, Number not found for 
$rU\n);
prefix(FAIL_);
route(4);
}
} else {
xlog(L_INFO,Not here: user route
[$fd/$fu/$rd/$ru/$si/$avp(carrier)]\n);
$avp(domain)=voip.unisi.it;
if (!cr_route($avp(carrier), 
$avp(domain), $rU,
$rU,call_id, $avp(host))) {
sl_send_reply(404, Not found);
xlog(L_ERR, cr_route failed\n);
exit;
}
}
t_on_failure(1);
if (!t_relay()) {
sl_reply_error();
};
exit;
case -3: # internal error
t_newtran();
t_reply(404, Not Found);
exit;
case -2: # method not supported
sl_send_reply(405, Method Not Allowed);
exit;
}
}

# when routing via usrloc, log the missed calls also
setflag(2);

route(1);
}

route[1] {
xlog(L_INFO,Route1  [$fd/$fu/$rd/$ru/$si/]\n);

# for INVITEs enable some additional helper routes
if (is_method(INVITE)) {
t_on_branch(2);
t_on_reply(2);
t_on_failure(1);
}

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


# Presence route
route[2] {
xlog(L_INFO,Route2  [$fd/$fu/$rd/$ru/$si/]\n);

if (!t_newtran())   {
sl_reply_error();
exit;
};

if(is_method(PUBLISH)) {
handle_publish();
} else if( is_method(SUBSCRIBE)) {
handle_subscribe();
}

exit;
}

route[4] {
xlog(L_INFO,Route4  [$fd/$fu/$rd/$ru/$si/]\n);

rewritehostport(172.20.1.5:5060);
route(1);
}

branch_route[2] {
xlog(L_INFO,Branch Route2  [$fd/$fu/$rd/$ru/$si/]\n);
}

onreply_route[2] {
xlog(L_INFO,OnReply Route2  [$fd/$fu/$rd/$ru/$si/]\n);
}

failure_route[1] {
xlog(L_INFO,Failure Route1  [$fd/$fu/$rd/$ru/$si/]\n);

if (t_was_cancelled()) {
exit;
}

if (t_check_status(408|5[0-9][0-9])) {
if(!cr_route(default, $fd, $rU, $rU, call_id,
$avp(host))){
t_reply(403, Not allowed);
} else {
t_on_failure(2);
t_relay();
}
}
}

failure_route[2] {
xlog(L_INFO,Failure Route2  [$fd/$fu/$rd/$ru/$si/]\n);

if (t_was_cancelled()) {
exit;
}

revert_uri();
prefix(FAILURE_);
rewritehostport(172.20.1.5:5060);
t_relay();
}
===

and this is the RTPProxy config:

===
CONTROL_SOCK=udp:127.0.0.1:12221

# Additional options that are passed to the daemon.
EXTRA_OPTS=-l [external IP]/172.20.1.2
===

Anybody can help me ?

Michele

-- 
Michele

[OpenSIPS-Users] Calls from Asterisk gateway not allowed...

2012-06-01 Thread Michele Pinassi
]:
DBG:core:parse_msg: SIP Request:
Jun  1 10:05:35 proxy-voip01 /usr/sbin/opensips[29951]:
DBG:core:parse_msg:  method:  ACK
Jun  1 10:05:35 proxy-voip01 /usr/sbin/opensips[29951]:
DBG:core:parse_msg:  uri: sip:2617@172.20.0.1
Jun  1 10:05:35 proxy-voip01 /usr/sbin/opensips[29951]:
DBG:core:parse_msg:  version: SIP/2.0
Jun  1 10:05:35 proxy-voip01 /usr/sbin/opensips[29951]:
DBG:core:parse_headers: flags=2
Jun  1 10:05:35 proxy-voip01 /usr/sbin/opensips[29951]:
DBG:core:parse_via_param: found param type 232, branch =
z9hG4bK0b0e13b5; state=6
Jun  1 10:05:35 proxy-voip01 /usr/sbin/opensips[29951]:
DBG:core:parse_via_param: found param type 235, rport = n/a; state=17
Jun  1 10:05:35 proxy-voip01 /usr/sbin/opensips[29951]:
DBG:core:parse_via: end of header reached, state=5
Jun  1 10:05:35 proxy-voip01 /usr/sbin/opensips[29951]:
DBG:core:parse_headers: via found, flags=2
Jun  1 10:05:35 proxy-voip01 /usr/sbin/opensips[29951]:
DBG:core:parse_headers: this is the first via
Jun  1 10:05:35 proxy-voip01 /usr/sbin/opensips[29951]:
DBG:core:receive_msg: After parse_msg...
Jun  1 10:05:35 proxy-voip01 /usr/sbin/opensips[29951]:
DBG:core:receive_msg: preparing to run routing scripts...
Jun  1 10:05:35 proxy-voip01 /usr/sbin/opensips[29951]:
DBG:core:parse_headers: flags=8
Jun  1 10:05:35 proxy-voip01 /usr/sbin/opensips[29951]:
DBG:core:parse_to_param: tag=c97b4d1cb1f3d0da549e06a8d482ef63.5412
Jun  1 10:05:35 proxy-voip01 /usr/sbin/opensips[29951]:
DBG:core:parse_to: end of header reached, state=29
Jun  1 10:05:35 proxy-voip01 /usr/sbin/opensips[29951]:
DBG:core:parse_to: display={}, ruri={sip:2617@172.20.0.1}
Jun  1 10:05:35 proxy-voip01 /usr/sbin/opensips[29951]:
DBG:core:get_hdr_field: To [65]; uri=[sip:2617@172.20.0.1]
Jun  1 10:05:35 proxy-voip01 /usr/sbin/opensips[29951]:
DBG:core:get_hdr_field: to body [sip:2617@172.20.0.1]
Jun  1 10:05:35 proxy-voip01 /usr/sbin/opensips[29951]:
DBG:sl:sl_filter_ACK: local ACK found - dropping it!
Jun  1 10:05:35 proxy-voip01 /usr/sbin/opensips[29951]:
DBG:core:destroy_avp_list: destroying list (nil)
Jun  1 10:05:35 proxy-voip01 /usr/sbin/opensips[29951]:
DBG:core:receive_msg: cleaning up


this is opensips.cfg related to INVITE:

# account only INVITEs
if (is_method(INVITE)) {
if (check_source_address(1)) {
route(1);
setflag(1);
}
}

and this is the dump from address table:

root@proxy-voip01:/etc/opensips# opensipsctl address show
database engine 'MYSQL' loaded
Control engine 'FIFO' loaded
++-++--+--+---+--+--+
| id | grp | ip | mask | port | proto | pattern  | context_info |
++-++--+--+---+--+--+
|  1 |   0 | 172.20.0.5 |   32 | 5060 | any   | ^sip:.*$ | NULL |
++-++--+--+---+--+--+
root@proxy-voip01:/etc/opensips#


Any hint ? Thanks, Michele



-- 
Michele Pinassi
Responsabile Telefonia di Ateneo
Servizio Reti, Sistemi e Sicurezza Informatica - Università degli Studi
di Siena
tel: 0577.(23)2169 - fax: 0577.(23)2053



signature.asc
Description: OpenPGP digital signature
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users