I was looking at packet traces of the OPTIONS packets generated by natping
and it appears that at least in my implementation of OpenSer 1.0.0 the "To:
sip" line has no username which causes many UA's require in order to respond
to the OPTIONS packet. I was wondering if this was intentional or if it
would be possible to change this behavior or at least make it an
configurable option. I think a lot could be done/determined based on the
results of the reply; including determining if the packet is really reaching
the UA. I realize that some UA's may not support this feature but I think
more do than not.
Just my observations/thoughts. Please give me reasons for this being a good
or bad idea..
Current Packet:
U 2006/01/20 16:27:10.410848 111.15.13.67:5060 -> 111.16.187.102:5060
OPTIONS sip:111.16.187.102:5060 SIP/2.0.
Via: SIP/2.0/UDP 111.15.13.67:5060;branch=0.
From: sip:ping@intervoz.com.br;tag=ec30e9b7.
To: sip:111.16.187.102:5060.
Call-ID: b3fdcfa3-71a82db5-445151(a)111.15.13.67.
CSeq: 1 OPTIONS.
Content-Length: 0.
Suggested Packet:
U 2006/01/20 16:27:10.410848 111.15.13.67:5060 -> 111.16.187.102:5060
OPTIONS sip:<username from location table>@111.16.187.102:5060 SIP/2.0.
Via: SIP/2.0/UDP 111.15.13.67:5060;branch=0.
From: sip:ping@intervoz.com.br;tag=ec30e9b7.
To: sip:111.16.187.102:5060.
Call-ID: b3fdcfa3-71a82db5-445151(a)111.15.13.67.
CSeq: 1 OPTIONS.
Content-Length: 0.
Hi everybody,
A new feature is present on the development version of openser - Global
Statistics Management support: the core includes a Statistics Manager
which roll is to collect statistics variables from all over openser and
to offer management support (to create and operate them); it also
provides a single, centralized point of access to allow external apps or
internal modules to get any statistics.
How it works? the core and the module exports different statistics
variables (via the module interface). The Statistics Manager (SM) offers
support for auto-initialization, for updating ans resetting variables.
The statistics variables are kept into shared mem to be accessible to
all processes. Synchronization support is offered by SM.
Statistic variable capabilities
-------------------------------
be defined with:
NO_RESET (it cannot be reset -ex. used mem, register
subscribers, etc)
NO_SYNC (it will not be synchronized during ops; by their
nature, some variables are already synchronized)
be updated (added with new val)
be reset (set to zero if allowed).
Accessing the statistics
-------------------------
The SM export two FIFO functions for offering access to the statistics:
"get_statistics all" - gets all statistics
"get_statistics stat_name" - gets the value of the stat_name variable
"get_statistics module_name:" - get all statistics exported by
module "module name"; to get statistics from core, use "core" as module_name
"reset_statistics stat_name" - sets to 0 the value of the stat_name
variable
The SM internally offers an API to be used by other modules interested
in accessing the statistics. Ex: a future snmp module
Current statistics
------------------
For the moment only a few core statistics are defined (we can easily add
them in time):
received requests : "rcv_reqs"
received replies : "rcv_rpls"
dropped requests (by scripts or post-script callbacks) : "drp_reqs"
dropped replies (by scripts or post-script callbacks) : "drp_rpls"
error requests (basic parsing failed) : "err_reqs"
error replies (bassic parsing failed) : "err_rpls"
How to use it
--------------
first to need to enable its compiling - enable the -DSTATISTICS flag in
Makefile.def (by default is disabled).
Recompile and run openser.
Use fifo to get the statistics. Ex:
openserctl fifo get_statistics all
openserctl fifo get_statistics core:
openserctl fifo get_statistics rcv_reqs
Next steps
-----------
optimization of the SM (better locking for sync, usage of atomic ops if
possible)
replace old statistics (see stats.c) - the code is not compiling since
it depends on some snmp stuff...
replace local module statistics (sl,tm,usrloc) with sttistics via SM
add more statistics...ideas are welcomed
new module to implement dynamic statistics variables to be used from
script.
regards,
bogdan
Hi,
I increased the length of the value column in the usr_preferences
table from 128 to 1024, but I got a core dump after these logs:
0(24138) val2str(): converting record_route, 12
0(24138) PG[224] str2valp got string
<sip:10.112.64.59;ftag=605ff764c617d3cd28dbbdd72be8f9a2;lr=on>,<sip:10.112.64.12;ftag=605ff764c617d3cd28dbbdd72be8f9a2;lr=on>,<sip:10.112.64.12;ftag=605ff764c617d3cd28dbbdd72be8f9a2;lr=on>,<sip:10.112.64.59;ftag=605ff764c617d3cd28dbbdd72be8f9a2;lr=on>
Segmentation fault (core dumped)
This was caused by an avp_db_load() call from the script. I'm using
OpenSER 1.0.0.
I found the following comment on modules/postgres/db_res.c that might
have something to do with it:
/* I'm not sure about this */
/* PQfsize() gives us the native length in the database, so */
/* an int would be 4, not the strlen of the value */
/* however, strlen of the value would be easy to strlen() */
Also, in modules/postgres/db_val.c, there is a FIXME in val2str()
function that seems to be related.
Can anyone help solve this problem? It seems like a bug.
Thanks,
JF
Hi,
I'm trying to use avpops module, but I'm facing the following error:
0(8178) PG[367] submit_query query 'insert into usr_preferences
(uuid,attribute,value,type,username,domain ) values
('test','avpname','test',0,'','')', result 'ERROR: duplicate key
violates unique constraint "usr_preferences_pkey"
It seems to be caused by the username and domain parameters being
empty strings, since the usr_preferences table has this PK constraint:
"usr_preferences_pkey" primary key, btree (attribute, username,
"domain")
The avpops module is configured like this:
modparam("avpops", "avp_url", "postgres://xpto:xpto@127.0.0.1/xpto")
modparam("avpops", "avp_table", "usr_preferences")
modparam("avpops","use_domain",1)
modparam("avpops", "avp_aliases", "avpalias=s:avpname")
And I'm simply doing:
avp_printf("s:avpname", "test");
avp_db_store("$avpalias/uuid", "s:avpname");
What may be missing? Maybe the usr_preferences table should not have
this PK when using UUID-based AVP identification...
JF
Hi,
i have a db_extra accounting rule like:
modparam("acc", "db_extra", "customer_code=$avp(i:102)")
The avp value is 12 and i checked it with avp_print() .
DEBUG:avpops:print_avp: p=0x2a97a866e8, flags=0
DEBUG: id=<102>
DEBUG: val_int=<12>
When it is accounted in the table the value become 11 !!!!!
the field in the table is type int(10) .
How is it possible??
Thanks,
Bye,
MArcello
Hello to all,
I'm using the latest CVS 1_0_0 and I got the following message in the
log after a "record_route_preset( "213.191.xxx.xxx:5060;nat=yes" )":
record_route_preset(): No memory left
Why this comes?
Regards
Bastian
____________
Virus checked by G DATA AntiVirusKit
Version: AVK 16.5138 from 28.01.2006
Virus news: www.antiviruslab.com
if you enable auto from_restore_mode, you do not need to perform any
restore from script. Just replace the from in the initial INVITE and
this is it - all replies and sequential request would be auto fixed
(restore/replace).
regards,
bogdan
Barry Flanagan wrote:
> Bogdan-Andrei Iancu wrote:
>
>> Hi Barry,
>>
>> have you set auto from restoring? See:
>> http://openser.org/docs/modules/1.1.x/uac.html#AEN75
>
>
> Yes, but I am not sure where it is supposed to go.
>
> I have the following in just before relaying to Asterisk:
>
> rewritehostport("XXX.XXX.XXX.XXX:5060");
> uac_replace_from("$fn","sip:$au_$ar@$fd");
> append_hf("P-hint: GATEWAY\r\n");
> t_relay("udp:XXX.XXX.XXX.XXX:5060");
>
>
> and I put in uac_restore_from(); just after the record_route()
>
>
> with all the other modparams I have:
>
> modparam("uac","from_restore_mode","auto")
>
>
> Thanks for the help.
>
> -Barry
>
>
>> regards,
>> bogdan
>>
>> Barry Flanagan wrote:
>>
>>>
>>> So, the only way around it that I can see is to somehow have OpenSER
>>> change the username to username_domain so that each will be unique.
>>>
>>> It looks like uac_from_replace should handle this. I have tried it,
>>> and I can see that Asterisk does in fact get user_domain@domain in
>>> the first invite, but thereafter for some reason OpenSER changes it
>>> to just _@domain for subsequent requests.
>>>
>>>
>>> Regards,
>>>
>>> -Barry
>>>
>
>
Hello members,
I have SER and SEMS on the same machine and it works fine. For
performance reasons, I would like to them to be on separate machines.
My query is the fact that SEMS uses the email address from the
subscriber table in SER db. Do I need to have SER db on the machine
where SEMS is running (means 2 identical dbs) or how can I achieve this?
Regards,
Amos.
Dear all,
I think it will be useful for everybody.
I have discussion with SIP device manufacturer about expiration time of
call attempt. When call is made from UA it sends INVITE with "Expires:
65". It is controlled by device's timer setting "ring_time_limit". This
timer can be set to anything between 10 and 600 seconds, we set it to 65
seconds. Fine.
However at the same time it starts a special timer, say
"max_response_time_invite". It can be set to anything between 8 and 20
seconds. We set it to 20 sec. Fine so far.
CASE 1: Imagine we call from UA to PSTN number, using one of VoIP->PSTN
providers. We have more than one provider, so we setup SER with
"fr_timer" value of, let's say 25 seconds and "fr_inv_timer" of 60. We
prepare failure routes in case when those timers hits in PSTN call. When
"fr_timer" hits, we simply reroute to another gateway. Great.
SER forwards INVITE from UA to remote PSTN gateway and at the same time
sends back "100 Trying" to UA. Fine.
Imagine now that it is busy-hour and it takes PSTN provider 21 seconds
to send back "180 Ringing" (or "183 Session Progress") and after 8
seconds more remote callee picks up ("200 OK").
Unfortunately device wil send CANCEL to SER, because it hasn't received
"180 Ringing" or "183 Session Progress" within the
"max_response_time_invite" setting of 20 seconds. It only received "100
Trying" at the beginning.
This ruined any failure route attempts from SER, as call failed.
CASE 2: Imagine now a second call. This time PSTN provider send "183
Session Progress" after 14 seconds and remote callee picked up after
further 15 seconds. This time everything went good. UA did not hit
"max_response_time_invite" timer - it waited patiently for whole 29
seconds for remote callee to pick up.
I think that when UA receives provisional response (like "100 Trying")
from SER it should stop timer "max_response_time_invite" and use
'ring_time_limit'. What device does now, it uses:
* "max_response_time_invite" when "100 Trying" received
* "ring_time_limit" when "180 Ringing" or "183 Session Progress" received
I haven't really found explanation of this in RFC3261. When you look at
SIP state machine on page 128, it is not explicitly said which timer
controls behaviour of UA when in "Proceeding" state ("Proceeding" is
entered oin receipt of ANY provisional response).
QUESTION 1: what timer controls behaviour of UA when in "Proceeding"
state? Especially regarding timeout. Is this still the 'timer B' started
at the beginning of INVITE transaction? If it is 'timer B', why UA is
CANCELing transaction after 20 seconds, if it informed by "Expires: 65"
field in INVITE that it set 'timer B' to 65 seconds.
QUESTION 2: What should I propose to manufacturer for maximum value for
"max_response_time_invite"?
--
Thanks,
Arek Bekiersz
Hi Ramin!
Please always cc to the list
Ramin Dousti wrote:
> Thanks, Klaus.
>
> Here is the full picture:
>
> I receive a SIP URI "sip:user@dest" on a UDP socket. The only thing I need to do
> is to proxy this session on a TCP socket to "dest".
>
> I fugured I can do:
> forward_tcp(dest);
>
> But when I extract dest into an AVP, forwasrd_tcp does not work with an AVP as
> its argument.
>
> avp_printf("s:dst", "$td");
> forward_tcp("s:dst");
>
> it tries to resolve "s:dst" literally.
forward_tcp does not support pseudo variables.
try forward_tcp() without parameters.
regards
klaus
>>If the destination is stored in an AVP, use avp_pushto
>>(http://openser.org/docs/modules/1.0.x/avpops.html#AEN291) to push the
>>new URI into the request URI.
>>
>>Then use t_relay (make sure the URI contains a transport=tcp parameter).
>>
>>If the destination is static, use t_relay_to_tcp(ip, port)
>>http://openser.org/docs/modules/1.0.x/tm.html#AEN320
>>
>>regards
>>klaus
>>
>>
>>
>>Ramin Dousti wrote:
>>
>>>Hello,
>>>
>>>I'm trying to forward a SIP message that's been received by UDP, to
>>>$td through TCP. but the following configuration doesn't work:
>>>
>>> send_tcp("$td", 5060 );
>>>or
>>> send_tcp($td, 5060 );
>>>or
>>> avp_printf("s:dst", "$td");
>>> send_tcp("s:dst", 5060 );
>>>
>>>Could you please help?
>>>
>>>--
>>>Ramin
>>>
>>>_______________________________________________
>>>Users mailing list
>>>Users(a)openser.org
>>>http://openser.org/cgi-bin/mailman/listinfo/users
>>>
>>>
>>
>>
>
>
> --
> Ramin
>
>