[SR-Users] OPENSER MIB

2011-03-14 Thread Stefan Tiedje
Hi,

In the Kamailio OPENSER-MIB there is the counter 
"openserTotalNumFailedDialogSetups". This is a Counter32.
The description is:
"The total number of calls that failed with an error. The following 
codes define a failed call:"

Question:
*   I'm looking for the corresponding counter to 
"openserTotalNumFailedDialogSetups" who counts successful Dialog setups of 
Counter32 type. Does it exist?
*   If not, does it exist a work around?
*   Where in the code can the new suggested counter be added?
*   Something else

Suggestion for the new counter is a name like: 
"openserTotalNumSucceededDialogSetups". It has a counter32. Description: "The 
total number of calls that succeeded"

I know that there are the counters openserCurNumDialogs, 
openserCurNumDialogsInProgress and openserCurNumDialogsInSetup but these are of 
Gauge type who only reflects the current situation. These Gauge counters can't 
be used together with a Counter32 counter. That don't mix. The calculation done 
for the counter "openserCurNumDialogsInProgress" should be used where every new 
dialog setup is added to the new suggested counter. A counter of 32 should 
cover a great deal of connections. These counters are usually read, if used, 
every 15 minutes or 1 hour.


Rationale:
The reason for the new counter is that a calculation between succeeded and 
failed dialog setups can be done and be used for SLA agreements. Without this, 
its hard to make any customer versus provider agreements.


/Stefan
PS. Ask if anything is unclear and I need an answer rapidly.

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] OPENSER MIB

2011-03-14 Thread Daniel-Constantin Mierla

Hello,

On 3/14/11 9:42 AM, Stefan Tiedje wrote:

Hi,
In the Kamailio OPENSER-MIB there is the counter 
"openserTotalNumFailedDialogSetups". This is a Counter32.

The description is:
"The total number of calls that failed with an error. The 
following codes define a failed call:"

*Question:*

* I'm looking for the corresponding counter to
  "openserTotalNumFailedDialogSetups" who counts successful Dialog
  setups of Counter32 type. Does it exist?
* If not, does it exist a work around?
* Where in the code can the new suggested counter be added?
* Something else



the dialog module counts the number of processed dialogs, see:
http://kamailio.org/docs/modules/stable/modules_k/dialog.html#id2966360

There is no counter currently inside dialog module exporting exactly the 
number of successfully setup dialogs, it should not be hard to do it, 
though. Using the above and the number of failed and expired dialogs, 
you can actually get the number of successful dialogs.


Dialog module being the one that tracks SIP dialogs, therefore being 
able to count them, now I don't know if snmpstats module exports all the 
counters from dialog module. I setup snmpstats just few weeks ago and 
works perfect on Ubuntu/Debian servers, but I had no need to check 
dialog module counters.


Note that you can get the list of all internal statistics via kamctl:
- kamctl fifo get_statistics all

Or via XMLRPC if you need them remotely in another application.

Another option is to define your statistics with statistics module. 
Knowing that in SIP a successful call dialog means 200ok reply to an 
INVITE transaction, you can count it in the onreply_route[abc] that you 
arm for relayed transactions with t_on_reply("abc").


Hope these help you,
Daniel

Suggestion for the new counter is a name like: 
"openserTotalNumSucceededDialogSetups". It has a counter32. 
Description: "The total number of calls that succeeded"
I know that there are the counters openserCurNumDialogs, 
openserCurNumDialogsInProgress and openserCurNumDialogsInSetup but 
these are of Gauge type who only reflects the current situation. These 
Gauge counters can't be used together with a Counter32 counter. That 
don't mix. The calculation done for the counter 
"openserCurNumDialogsInProgress" should be used where every new dialog 
setup is added to the new suggested counter. A counter of 32 should 
cover a great deal of connections. These counters are usually read, if 
used, every 15 minutes or 1 hour.

*Rationale:*
The reason for the new counter is that a calculation between succeeded 
and failed dialog setups can be done and be used for SLA agreements. 
Without this, its hard to make any customer versus provider agreements.

/Stefan
PS. Ask if anything is unclear and I need an answer rapidly.


___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


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

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] decimal fraction problem

2011-03-14 Thread Daniel-Constantin Mierla
Hello,

are you using kamailio 3.1.x? If not, you have to upgrade, the
$branch(...) variable was updated to be writable starting with this version.

I played last week with it in a need of combining serial forking with
parallel forking and all is ok with assigning values to $branch(...).

Cheers,
Daniel

On 3/14/11 5:25 AM, 侯旭光 wrote:
> sorry to bother again
>
>
> $(branch(q)[-1]) = $var(q);
>
> this script line doesn't work and the pv $branch() aren't
> writable,just readable . index -1 is not accessable either.
>
> if append_branch() function doesn't take the q value parameter,the
> $branch(q) just return NULL (which I think is the default value
> Q_UNSPECFIED=-1)
>
> I find a function set_ruri_q() in dset.c but I don't know how to call
> it in the configure file.
>
>
> 2011/2/23 Daniel-Constantin Mierla :
>> Hello,
>>
>> On 2/21/11 10:28 AM, 侯旭光 wrote:
>>
>> Hello
>> I need to add q value while using  function append_branch(),but the function
>> only takes decimal fraction as the parameter.
>> What if I want to use pv to add q value?
>> The $var and $avp just have string and integer type.
>> Thanks a lot!
>>
>> do:
>>
>> km_append_branch("$var(branchuri)");
>> $(branch(q)[-1]) = $var(q);
>>
>> $var(q) has to hold an integer value that represents the decimal fraction
>> value multiplied with 100 (so if q should be 0.5, then $var(q) = 50).
>>
>> Cheers,
>> Daniel
>>
>> --
>> Daniel-Constantin Mierla
>> http://www.asipto.com
> ___
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users@lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

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


___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] LCR Routes and memory allocations

2011-03-14 Thread Daniel-Constantin Mierla

Hello,

popping in to add some clarifications/hints regarding some statements in 
this thread...


Loading of LCR rules from database is done through private memory, but 
the records are loaded in chunks. So you should be fine with 4MB of 
memory. If it is not enough for startup/reload time, just lower the 
valuu of fetch_rows parameter (usually present in other modules that 
load from database, as well).


http://kamailio.org/docs/modules/stable/modules/lcr.html#id2502056

Also note that private memory is sued temporary to load the rules, just 
to transit from database to shared memory, then no private memory is 
used for lcr records as Juha said.


Regarding the shared memory, looking at the source code will help to see 
the overhead per lcr record and then just add the size of the data 
loaded from memory (some such as domain names are variable size). 
However, there is a simple way to estimate the need of shared memory by 
loading for example 1000 records and then 2000 records. Using 'kamctl 
fifo get_statistics all' you can see the used shared memory size in the 
both cases, make the difference and then estimate the size per record. 
As I said, that is practically to approximate average size per record.


If you reload the rules at runtime, you may need 2x shared memory size 
for lcr rules - Juha can confirm that the module is (re-)loading rules 
in a separate memory structure and then swaps with the active one, and 
frees the old one afterwards, since I am not really using much this module.


Besides the lcr records, you need to have extra shared memory for 
transaction processing.


Cheers,
Daniel

On 3/13/11 9:13 PM, Juha Heinanen wrote:

Graham Wooden writes:


I already had the -m 512 in my init file, so it appears I am ok there.
I went ahead and recompiled with PKG_MEM_POOL_SIZE to 16MB and I'll see how
it goes.

graham,

lcr module (at least the later versions) does not use any pkg memory.
it keeps all gws and rules in shm memory.  you can check with kamctl
command how much shm memory you have left/used/etc.

-- juha

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


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


___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Call subscriber online

2011-03-14 Thread Daniel-Constantin Mierla

Hello,

shouldn't the call go to location service before relaying to subscriber 
B? Is B at a fix address an port and that is local host port 5060? Are 
you doing all in your computer for testing purposes, because otherwise 
an application bound to localhost (like could be the softphone B) cannot 
really communicate with the inter/intra-network?


Cheers,
Daniel


On 3/11/11 4:50 PM, Stefano Larosa wrote:


Hi,

I'm new on Kamailio 3.0

This is the scenario I would like to build:

 1 Subscriber A -> 2 kamailio -> 3 asterisk -> 4 Kamailio -> 5 
Subscriber B


Everything is working fine until the last step

This is the code that manage the call from asterisk to kamailio

/if(is_method("INVITE") && (src_ip==80.169.xx.xx) )/

/{/

/  route(TOPROXYUSER);/

/}/

And this is the code that should end the call the the subscriber

route[TOPROXYUSER] {

   xlog("L_NOTICE", "$mi route[$rm][0] $fu 
-> $ru START PROCESSING MESSAGE\n");


   rewritehostport("127.0.0.1:5060");

   if (is_method("BYE|CANCEL")) {

route(FAIL_ONE);

   } else if (is_method("INVITE")){

   route(RELAY);

   };

   exit;

}

Thank you,

Stivu.


___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


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

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Register a CISCO IP phone

2011-03-14 Thread Daniel-Constantin Mierla

Hello,

Hello,

assuming is no NAT ALG as Dani Popa asked previously and there was no 
answer so far, here are some questions/hints that may help...


On 3/11/11 12:15 PM, Dani Popa wrote:

CISCO SPA 303 IP phone is under NAT? if yes, what router do you use ?


Dani

On 03/10/11 21:32, Pang, Gary (Liguang) wrote:


Dear Sir,

I have a difficulty to register a CISCO SPA 303 IP phone.

I can register a Soft phone to the SER server by setting the Hold IP 
address



Did you mean here "Host IP address" instead of "Hold IP address"?


, Proxy, account number..

But it is not working with the CISCO phone.

Can you advice?


Many cisco phones are dual protocol, is yours set for SIP?

I have no spa 303 but you should get some web interface where to enter 
the sip server (registrar or proxy), username and password of you sip 
account that it should be enough.


Cheers,
Daniel

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

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] pseudo variables available in on_reply route

2011-03-14 Thread Daniel-Constantin Mierla

Hello,

On 3/11/11 3:03 AM, Asgaroth wrote:

Hi All,

I have a requirement to perform some processing based on the source and
destination addresses on a message in on_reply route. I can get source
ip address using $si pseudo variable, but I cant seem to access the
destination ($dd).

Is there any way I can access destination ip/domain of message in
on_reply route?
an easy (classic way) to do it is to store the the source IP of request 
(the IP address of sender) before t_relay() in an avp:


$avp(reqsrcip) = $si;

The in onreply_route you have access to source IP of reply which is the 
IP address of the destination for request.


Assuming you are using kamailio 3.x, then all avps you set for request 
are available in the onreply_route and you can do what ever operations 
you need now with $avp(reqsrcip) and $si.


Cheers,
Daniel

--

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


___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] ACK not sent and rr-enforced

2011-03-14 Thread Daniel-Constantin Mierla

Hello,

I will look over it very soon. As a hint for the future, if you catch me 
traveling, rar files won't work for me, use tgz or zip as they are easy 
to expand very easy even on web mail clients. If the trace is not big, 
plain text is faster or eventually use some pastebin sites out there.


Cheers,
Daniel

On 3/10/11 1:49 PM, Dominguez Jover, Ricardo wrote:

Hello Daniel, here it is.

Thanks

Ricardo

De: Daniel-Constantin Mierla [mailto:mico...@gmail.com] Enviado el: jueves, 10 
de marzo de 2011 12:49
Para: Dominguez Jover, Ricardo
CC: sr-users@lists.sip-router.org
Asunto: Re: [SR-Users] ACK not sent and rr-enforced

Hello,

can you post the ngrep trace of such call (fron incoming invite, to the bye, 
taken on your server)? That will help to see what could be mismatching there.

Cheers,
Daniel
On Thu, Mar 10, 2011 at 11:06 AM, Dominguez Jover, Ricardo  
wrote:
Hi again,

I'm still working in this issue. I've noticed that iptel proxy is writing in 
the ACK message the following:

ACK sip:username@myproxyIP:5060;.   ->  ACK is not sent to the client. 
tcheck_trans fails. If a force the transfer ->  t_relay do nothing

while sip2sip and VoIP-Talk are writing:

ACK sip:username@userprivateIP:5060;  ->  ACK is sent to the client

In both cases, contact URI sent in the 200 OK message by my proxy is the 
private IP address of the client  sending the 200 OK, so I don't know why IPtel 
doesn't use it in the ACK. I find a lot of information about lost ACKs in 
posts, but not this particular issue.

Could anyone give me some related information that can help me to solve this 
issue?

Best regards,

Ricardo Dominguez




De: sr-users-boun...@lists.sip-router.org 
[mailto:sr-users-boun...@lists.sip-router.org] En nombre de Dominguez Jover, 
Ricardo Enviado el: lunes, 07 de marzo de 2011 20:03
Para: sr-users@lists.sip-router.org
Asunto: [SR-Users] ACK not sent and rr-enforced

Hi everybody.

I am using Kamailio 3.1 and RTP proxy for internet calls. I'm using external 
test accounts to check if the calls are established and the media flow is ok.

When I use a sip2sip.info or  VoIP Talk accounts, then all is working fine 
between my internal and these external accounts.

But when I use a iptel.org account and this account calls to an internal 
account (registered with kamailio), then callee sends the 200 OK to the SIP 
proxy and the SIP proxy to iptel. IPtel.org proxy sends the ACK to my proxy 
with this lines at the end of the packet:

P-hint:  rr-enforced\r\n
P-hint:  rr-enforced\r\n

And my SIP proxy never resends the ACK to the callee, so the callee resends OK 
200 periodically and after 32 seconds sends a BYE message and the call is 
finished.

I've been reading posts about missing ACKs but I can't find the answer to my problem, 
that it seems like "t_check_trans" doesn´t recognize the ACK as related to a 
transaction. But this is only with IPTEL accounts, my proxy SIP is working with other SIP 
providers, so I don't know if forcing relay of every ACK packet is a good idea.

Any help would be appreciated.

Thanks,

Ricardo
___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list 
sr-users@lists.sip-router.org 
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users



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


___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


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

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] stats in kamailio

2011-03-14 Thread Henning Westerholt
On Friday 04 March 2011, Daniel-Constantin Mierla wrote:
> [..]
> - insert in db the value of $var(diff) along with the timestamp so you have
> the number of transactions answered with 2xx during the last minute. Then
> configure siremis to make a graph out of the db records
> 
> You can have another rtimer route executed not that often that can delete
> records older than 1-2 days, so you don't fill up the database.

Hi Daniel,

really interesting solution, we use some external scripts which works somehow 
similar - but an internal solution is of course more elegant.

Cheers,

Henning

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Siremis - Auto update dialplan on save?

2011-03-14 Thread Elena-Ramona Modroiu

Hi Russell,

your email slipped unnoticed so far ... see more comments inline.

On 2/24/11 10:14 PM, Russell Feeser wrote:

To Siremis Admin,

I'm a bit of a php rookie, and even more of a noob with openbiz cubi, 
but I've burnt a day and a half trying to implement a new button on 
the SER Menu > Server Services > Dialplan List page, and curious if 
you could give some words of advice concerning my plight.


Ideally, I would like dialplan to auto update the Kamailio mySQL 
database with the dp_reload feature; I am simply sick of bouncing 
Kamailio with a "kamctl restart" from the command line each time 
I implement a change to the dialplan in Siremis.


I have successfully enabled this feature on the drop-down menu in SER 
Menu > Command Services > MI Commands, however, I don't want to have 
to navigate to the MI Commands page each time I wish to refresh 
dialplan. In siremisMICommands.xml, I was able to activate dp_reload 
with the following code:


(taken from siremisMICommands.xml)


Class="siremisMICommands">







command="get_statistics all"/>


 
<-- Code I added, WORKS!






Here's where I'm stuck: I can't seem to get a new button 
to implement dp_reload in the DialplanListForm.xml. I'm not sure if I 
need to write a function to call dp_reload, or if I can simply 
activate dp_reload from the DialplanListForm.xml. The code I have 
written creates a button on the  SER Menu > Server Services > Dialplan 
List page, but thats as far as I've gotten. My code currently looks 
like this:


(taken from DialplanListForm.xml)

CssClass="button_gray_m" Description="Refresh dialplan in Kamailio 
without restarting Kamailio">
Function="" ContextMenu="Activate"/>



Anything you can say would be most helpful, as this is a feature I'm 
sure many using Siremis would appreciate having.
One option is to extend the base class for the dialplan form where you 
add a new function to perform the dp_reload function, then create the 
button that will perform an action calling the new function.


There are several cases when siremis uses same approach, see 
modules/ser/common/... for the base functions and then reused to have a 
particular functionality (such as search results). You can search for 
"extended" in ser module to see what classes are extending other.


Hopefully soon the version 2.0 of siremis will get on GIT and we can 
grant access to others that want to contribute.


Regards,
Ramona
___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] OPENSER MIB

2011-03-14 Thread Daniel-Constantin Mierla

Hello Stefan,


On 3/14/11 11:03 AM, Stefan Tiedje wrote:

Thanks for the answer.
Maybe I have some older versions of the OPENSER-MIB and the other 
related MIB's since I could not find the counter you pointed at. I'm 
using a MIB browser for reading the MIB's.
Is the suggested counter "expired dialogs" added in a specific release 
of Kamailio? Which? We use Kamailio 3.0.2.
I used Kamailio and recommend using it sine it has the latest commits 
for stability.


However, what I wrote before is pretty much not related to the version. 
There is a counter that tracks the processed dialogs, but seems it is 
not exported by default through snmpstats module. The statistics counter 
is named "processed_dialogs", implemented by dialog module.


You can dump all internal statistics through kamctl or via xmlrpc 
command, but probably to export it through snmpstats you may need to 
extend the mibs and the code of the module.


I just grepped the sources of snmpstats module to see what dialog 
statistics it is exporting:


$ grep -n _dialogs modules_k/snmpstats/* | grep get_statistic
modules_k/snmpstats/alarm_checks.c:83:num_dialogs = 
get_statistic("active_dialogs");
modules_k/snmpstats/snmpObjects.c:404:int result = 
get_statistic("active_dialogs");
modules_k/snmpstats/snmpObjects.c:424:
get_statistic("active_dialogs") -
modules_k/snmpstats/snmpObjects.c:425:
get_statistic("early_dialogs");
modules_k/snmpstats/snmpObjects.c:443:int result = 
get_statistic("early_dialogs");
modules_k/snmpstats/snmpObjects.c:459:int result = 
get_statistic("failed_dialogs");
modules_k/snmpstats/snmpObjects.c:508:int num_dialogs = 
get_statistic("active_dialogs");


Perhaps when the snmpstats was developed the dialog module didn't export 
the statistics counter of "processed_dialogs" and then it was not updated.


Now, what I tried to say is that if the "processed_dialogs" counter is 
not available through snmpstats (and it is not now after grepping the 
sources) you can get its value from another application through "kamctl 
get_statistics all" or XMLRPC command for all of the existing kamailio 
releases. Upcoming one we will look to implement the export through 
snmpstats as well. If you have time to do it and send us a patch, we 
will gladly commit it to source tree in our GIT repository.


Cheers,
Daniel
Do you have the MIB name for the "expired dialogs" counter. I will 
look for that in my version of OPENSER MIBS.
Important, do you have a link to where MIB files can be downloaded for 
Kamailio 3.0.2?

Below follows an excerp from one of the MIB's. Is it old, I don't know?

-- ***

-- OPENSER-MIB: OPENSER MIB

--

-- Date of Creation: Januay 2006

--

-- This MIB provides information related to the OpenSER SIP Router.

--

-- Copyright (c) The Internet Society (2006)

-- Ammendments (c) Soma Networks, Inc. (2006)

--

-- All rights reserved.

-- *

/Stefan


*From:* Daniel-Constantin Mierla [mailto:mico...@gmail.com]
*Sent:* den 14 mars 2011 10:16
*To:* Stefan Tiedje
*Cc:* sr-users@lists.sip-router.org
*Subject:* Re: [SR-Users] OPENSER MIB

Hello,

On 3/14/11 9:42 AM, Stefan Tiedje wrote:

Hi,
In the Kamailio OPENSER-MIB there is the counter 
"openserTotalNumFailedDialogSetups". This is a Counter32.

The description is:
"The total number of calls that failed with an error. The 
following codes define a failed call:"

*Question:*

* I'm looking for the corresponding counter to
  "openserTotalNumFailedDialogSetups" who counts successful
  Dialog setups of Counter32 type. Does it exist?
* If not, does it exist a work around?
* Where in the code can the new suggested counter be added?
* Something else



the dialog module counts the number of processed dialogs, see:
http://kamailio.org/docs/modules/stable/modules_k/dialog.html#id2966360

There is no counter currently inside dialog module exporting exactly 
the number of successfully setup dialogs, it should not be hard to do 
it, though. Using the above and the number of failed and expired 
dialogs, you can actually get the number of successful dialogs.


Dialog module being the one that tracks SIP dialogs, therefore being 
able to count them, now I don't know if snmpstats module exports all 
the counters from dialog module. I setup snmpstats just few weeks ago 
and works perfect on Ubuntu/Debian servers, but I had no need to check 
dialog module counters.


Note that you can get the list of all internal statistics via kamctl:
- kamctl fifo get_statistics all

Or via XMLRPC if you need them remotely in another application.

Another option is to define your statistics with statistics module. 
Knowing that in SIP a successful call dialog means 200ok reply to an 
INVITE transaction, you can count it in the onreply_rout

[SR-Users] Paging from asterisk to accounts with Multiple Registrations...

2011-03-14 Thread Derrick Bradbury

Hi all... interesting problem...

I am using kamailio as the registration server for a cluster of asterisk 
servers. I am allowing multiple registrations on the same account to allow for 
parallel forking on a normal call...

The problem is set paging... when I send the page to the account that has 
multiple registrations, the parallel fork works properly and the first phone to 
respond gets "control" of the call. Unfortunately there is an auto answer field 
in the invite. So simple case: one account, two phones.. invite gets sent to 
both phones, both phones answer... BUT one phone grabs "control" of the call, 
and the other phone no longer receives any more commands... so it never hangs 
up as it doesn't receive a "BYE".

Is there any way to turn off the parallel fork behavior, and keep sending all 
packets to both (or more) phones?

Any thoughts are appreciated!
Thanks,
Derrick

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] change in list setup - default is now reply to list

2011-03-14 Thread Henning Westerholt
Hello,

for your information - i just did a small change in the mailling list 
configuration for sr-dev and sr-users, now all replies goes per default to the 
list instead of the sender.

This should help to keep the discussion on the list, especially if new people 
join. :-) In the past a lot of "Please always include the list in your reply" 
reminders were necessary.. If you choose "reply to all" then the mail still 
goes to the list and the sender, so no change in this case.

Regards,

Henning

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] OPENSER MIB

2011-03-14 Thread Daniel-Constantin Mierla



On 3/14/11 12:33 PM, Daniel-Constantin Mierla wrote:

Hello Stefan,


On 3/14/11 11:03 AM, Stefan Tiedje wrote:

Thanks for the answer.
Maybe I have some older versions of the OPENSER-MIB and the other 
related MIB's since I could not find the counter you pointed at. I'm 
using a MIB browser for reading the MIB's.
Is the suggested counter "expired dialogs" added in a specific 
release of Kamailio? Which? We use Kamailio 3.0.2.
I used Kamailio and recommend using it sine it has the latest commits 
for stability.
 ... ^^^ ... obviously this was incomplete phrase, it meant to be: "I 
used Kamailio 3.1.2 and recommend using it since it has the latest 
commits for stability".


I can add also that I got more familiar in configuring it with snmpstats 
on debian/ubuntu, so it would be easier for me to give hints as well as 
add new features since it is the same as devel version.


Cheers,
Daniel



However, what I wrote before is pretty much not related to the 
version. There is a counter that tracks the processed dialogs, but 
seems it is not exported by default through snmpstats module. The 
statistics counter is named "processed_dialogs", implemented by dialog 
module.


You can dump all internal statistics through kamctl or via xmlrpc 
command, but probably to export it through snmpstats you may need to 
extend the mibs and the code of the module.


I just grepped the sources of snmpstats module to see what dialog 
statistics it is exporting:


$ grep -n _dialogs modules_k/snmpstats/* | grep get_statistic
modules_k/snmpstats/alarm_checks.c:83:num_dialogs = 
get_statistic("active_dialogs");
modules_k/snmpstats/snmpObjects.c:404:int result = 
get_statistic("active_dialogs");
modules_k/snmpstats/snmpObjects.c:424:
get_statistic("active_dialogs") -
modules_k/snmpstats/snmpObjects.c:425:
get_statistic("early_dialogs");
modules_k/snmpstats/snmpObjects.c:443:int result = 
get_statistic("early_dialogs");
modules_k/snmpstats/snmpObjects.c:459:int result = 
get_statistic("failed_dialogs");
modules_k/snmpstats/snmpObjects.c:508:int num_dialogs = 
get_statistic("active_dialogs");


Perhaps when the snmpstats was developed the dialog module didn't 
export the statistics counter of "processed_dialogs" and then it was 
not updated.


Now, what I tried to say is that if the "processed_dialogs" counter is 
not available through snmpstats (and it is not now after grepping the 
sources) you can get its value from another application through 
"kamctl get_statistics all" or XMLRPC command for all of the existing 
kamailio releases. Upcoming one we will look to implement the export 
through snmpstats as well. If you have time to do it and send us a 
patch, we will gladly commit it to source tree in our GIT repository.


Cheers,
Daniel
Do you have the MIB name for the "expired dialogs" counter. I will 
look for that in my version of OPENSER MIBS.
Important, do you have a link to where MIB files can be downloaded 
for Kamailio 3.0.2?

Below follows an excerp from one of the MIB's. Is it old, I don't know?

--
***

-- OPENSER-MIB: OPENSER MIB

--

-- Date of Creation: Januay 2006

--

-- This MIB provides information related to the OpenSER SIP Router.

--

-- Copyright (c) The Internet Society (2006)

-- Ammendments (c) Soma Networks, Inc. (2006)

--

-- All rights reserved.

-- *

/Stefan


*From:* Daniel-Constantin Mierla [mailto:mico...@gmail.com]
*Sent:* den 14 mars 2011 10:16
*To:* Stefan Tiedje
*Cc:* sr-users@lists.sip-router.org
*Subject:* Re: [SR-Users] OPENSER MIB

Hello,

On 3/14/11 9:42 AM, Stefan Tiedje wrote:

Hi,
In the Kamailio OPENSER-MIB there is the counter 
"openserTotalNumFailedDialogSetups". This is a Counter32.

The description is:
"The total number of calls that failed with an error. The 
following codes define a failed call:"

*Question:*

* I'm looking for the corresponding counter to
  "openserTotalNumFailedDialogSetups" who counts successful
  Dialog setups of Counter32 type. Does it exist?
* If not, does it exist a work around?
* Where in the code can the new suggested counter be added?
* Something else



the dialog module counts the number of processed dialogs, see:
http://kamailio.org/docs/modules/stable/modules_k/dialog.html#id2966360

There is no counter currently inside dialog module exporting exactly 
the number of successfully setup dialogs, it should not be hard to do 
it, though. Using the above and the number of failed and expired 
dialogs, you can actually get the number of successful dialogs.


Dialog module being the one that tracks SIP dialogs, therefore being 
able to count them, now I don't know if snmpstats module exports all 
the counters from dialog module. I setup snmpstats just few weeks ago 
and works perfect 

Re: [SR-Users] change in list setup - default is now reply to list

2011-03-14 Thread Daniel-Constantin Mierla

Hi Henning,

thanks, I was just to send another "please cc the mailing list".

Cheers,
Daniel

On 3/14/11 3:32 PM, Henning Westerholt wrote:

Hello,

for your information - i just did a small change in the mailling list
configuration for sr-dev and sr-users, now all replies goes per default to the
list instead of the sender.

This should help to keep the discussion on the list, especially if new people
join. :-) In the past a lot of "Please always include the list in your reply"
reminders were necessary.. If you choose "reply to all" then the mail still
goes to the list and the sender, so no change in this case.

Regards,

Henning

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


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


___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] decimal fraction problem

2011-03-14 Thread Daniel-Constantin Mierla
Hello,

cc-ing to the mailing list is very important because even it is an email
to show the previous answer was good, that will help other people with
similar problem that search on web and read the mailing list archive to
know the proposed solution worked and they can use it without asking
again on mailing list if it was ok or not.

Thanks,
Daniel

On 3/14/11 12:07 PM, 侯旭光 wrote:
> got it
>
> thanks
>
> cheers
>
> 在 2011年3月14日 下午5:22,Daniel-Constantin Mierla  写道:
>> Hello,
>>
>> are you using kamailio 3.1.x? If not, you have to upgrade, the
>> $branch(...) variable was updated to be writable starting with this version.
>>
>> I played last week with it in a need of combining serial forking with
>> parallel forking and all is ok with assigning values to $branch(...).
>>
>> Cheers,
>> Daniel
>>
>> On 3/14/11 5:25 AM, 侯旭光 wrote:
>>> sorry to bother again
>>>
>>>
>>> $(branch(q)[-1]) = $var(q);
>>>
>>> this script line doesn't work and the pv $branch() aren't
>>> writable,just readable . index -1 is not accessable either.
>>>
>>> if append_branch() function doesn't take the q value parameter,the
>>> $branch(q) just return NULL (which I think is the default value
>>> Q_UNSPECFIED=-1)
>>>
>>> I find a function set_ruri_q() in dset.c but I don't know how to call
>>> it in the configure file.
>>>
>>>
>>> 2011/2/23 Daniel-Constantin Mierla :
 Hello,

 On 2/21/11 10:28 AM, 侯旭光 wrote:

 Hello
 I need to add q value while using  function append_branch(),but the 
 function
 only takes decimal fraction as the parameter.
 What if I want to use pv to add q value?
 The $var and $avp just have string and integer type.
 Thanks a lot!

 do:

 km_append_branch("$var(branchuri)");
 $(branch(q)[-1]) = $var(q);

 $var(q) has to hold an integer value that represents the decimal fraction
 value multiplied with 100 (so if q should be 0.5, then $var(q) = 50).

 Cheers,
 Daniel

 --
 Daniel-Constantin Mierla
 http://www.asipto.com
>>> ___
>>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>>> sr-users@lists.sip-router.org
>>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>> --
>> Daniel-Constantin Mierla
>> http://www.asipto.com
>>
>>

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


___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Paging from asterisk to accounts with Multiple Registrations...

2011-03-14 Thread Ovidiu Sas
On Mon, Mar 14, 2011 at 10:18 AM, Derrick Bradbury  wrote:
>
> Hi all... interesting problem...
>
> I am using kamailio as the registration server for a cluster of asterisk
> servers. I am allowing multiple registrations on the same account to allow
> for parallel forking on a normal call...
>
> The problem is set paging... when I send the page to the account that has
> multiple registrations, the parallel fork works properly and the first phone
> to respond gets "control" of the call. Unfortunately there is an auto answer
> field in the invite. So simple case: one account, two phones.. invite gets
> sent to both phones, both phones answer... BUT one phone grabs "control" of
> the call, and the other phone no longer receives any more commands... so it
> never hangs up as it doesn't receive a "BYE".
>
> Is there any way to turn off the parallel fork behavior, and keep sending
> all packets to both (or more) phones?

See 
http://www.kamailio.org/docs/modules/3.1.x/modules_k/registrar.html#id2952881
.
With this parameter, the parallel forking could be turned off, but the
second phone will not be contacted.

One solution here would be to implement some sort of serial forking:
 - asterisk will make a 'paging' call to kamailio
 - kamailio will perform a lookup() and it will send the call the the
firs binding address
 - once the call is answered, asterisk should place a second call to
the same account
 - kamailio will perform a lookup() and it will send the call the the
firs binding address and it will get busy, then it will fail-over to
the next binding address.
 - and so on ...

This is kind of ugly ... but it may work

You need to have individual calls between asterisk and each paged
phone in order to have proper media to work.
I don't think asterisk can send multiple rtp streams for the same call.

Or some other hack wold be to set up aliases on the asterisk server
for each binding account and make a call for each one of them.
In the kamailio server, revert the alias to the true account and
perform a lookup.  Once you get the list or bindings, for each
individual call you drop all the branches that are not matched and
keep the one that matches the alias.

Let's say, on the kamailio server you have the user 'paging' and there
are 3 binding URIs:
 - paging-location1
 - paging-location2
 - paging-location3

On the asterisk server, three calls are setup to:
 - paging1
 - paging2
 - paging3
When the call is received, for each call a lookup will be performed
for paging.  For each call we kow the original RURI and we will
extract from it the location that we want to call.  The call for
"paging1" will pick "paging-location1", the call for "paging2" will
pick "paging-location2" and so on ...


Anyway, you can't solve this issue with a single call from asterisk
unless you have some rtp-replicator somewhere in the middle to fork
the rtp stream from asterisk and let one single rtp stream to go back
to asterisk.



Regards,
Ovidiu Sas

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] Registrar module creates an extra branch

2011-03-14 Thread Efelin Novak
Hi Folks,
I have a problem with registrar module (I suppose). When A calls to B, is
some specific situation, B receives two INVITEs. This mostly (not only)
happens when one account is registered on two or more UAs. In this situation
extra INVITE is sent only to the one that is second in the list (kamctl ul
show ACCOUNT).

kamctl ul show Alice:
Contact:: ;q=0;expires=1916;flags=0x0;cflags=0x40;socket=;methods=0x;received=;user_agent=
Contact:: ;q=;expires=3061;flags=0x0;cflags=0x40;socket=;methods=0x129F;received=;user_agent=


My situation.
1. Alice calls to BOB.
2. kamailio looks up in location table for BOBs registrations
3. in DB there are two rows (two devices(linksys PAP2T and Blink(blink is
second one)))
4. kamailio send 3 INVITES ( linksys, blink and blink). Every INVITE has
different via.branch
 (Via: SIP/2.0/UDP 8.8.8.8;branch=z9hG4bKe2d7.009b1df2.1)
 (Via: SIP/2.0/UDP 8.8.8.8;branch=z9hG4bKe2d7.009b1df2.2)
 (Via: SIP/2.0/UDP 8.8.8.8;branch=z9hG4bKe2d7.009b1df2.3)

All my registrar parameters are set to default.

I have no idea whether this is a bug or my missconfiguration.

Thanks for replies.

Kind regards,

Efelin Novak
___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] Kamailio setup

2011-03-14 Thread roman
Hello everyone!!!

 

 

What location I use for chrooted directory?

 

Thanks in advance

 

Roman

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Registrar module creates an extra branch

2011-03-14 Thread Klaus Darilion
Where is the 3rd INVITE sent to? to blink, to linksys or somewhere else?

Is something looping? (ngrep -d lo port 5060)

klaus

Am 14.03.2011 18:38, schrieb Efelin Novak:
> Hi Folks,
> I have a problem with registrar module (I suppose). When A calls to B,
> is some specific situation, B receives two INVITEs. This mostly (not
> only) happens when one account is registered on two or more UAs. In this
> situation extra INVITE is sent only to the one that is second in the
> list (kamctl ul show ACCOUNT).
> 
> kamctl ul show Alice:
> Contact::  >;q=0;expires=1916;flags=0x0;cflags=0x40;socket= >;methods=0x;received= >;user_agent=
> Contact::  >;q=;expires=3061;flags=0x0;cflags=0x40;socket= >;methods=0x129F;received= >;user_agent=
> 
> 
> My situation.
> 1. Alice calls to BOB.
> 2. kamailio looks up in location table for BOBs registrations
> 3. in DB there are two rows (two devices(linksys PAP2T and Blink(blink
> is second one)))
> 4. kamailio send 3 INVITES ( linksys, blink and blink). Every INVITE has
> different via.branch 
>  (Via: SIP/2.0/UDP 8.8.8.8;branch=z9hG4bKe2d7.009b1df2.1)
>  (Via: SIP/2.0/UDP 8.8.8.8;branch=z9hG4bKe2d7.009b1df2.2)
>  (Via: SIP/2.0/UDP 8.8.8.8;branch=z9hG4bKe2d7.009b1df2.3)
> 
> All my registrar parameters are set to default.
> 
> I have no idea whether this is a bug or my missconfiguration.
> 
> Thanks for replies.
> 
> Kind regards,
> 
> Efelin Novak
> 
> 
> 
> 
> 
> ___
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users@lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] getting fragmented packet when adding record-route header

2011-03-14 Thread Asgaroth
Hi All,

I have a scenario where I have 2 asterisk media servers that, when
calling a registered sip account, will forward off the invite to a
location server, who looks up the contact information, then forwards the
invite off to the proxy that the user registered against (done via the
path module). This all appears to work perfectly until the us hangs up
the call. The BYE message does not make it all the way back to the
originating asterisk media server, it makes it back to the location
server that looked up the registration information.

To overcome this issue, I add a "Record-Route" header specifying the
address of the asterisk media server that the request originated from.
However, when I add the custom header, the Invite shows up as fragmented
packet my wire-shark trace at the end-user's soft-phone. The call sets
up properly and when I hang up it looks like the BYE message makes it
all the way back to the media server, but when it is relayed on the the
caller, the sip proxy then fails the call with a message too big. If I
remove the line that adds the record-route header, then all looks fine,
except that I am unable to tear down calls from sip end-points.

The specific line I'm using to add the header is as follows:

insert_hf("Record-Route: \r\n","Record-Route");

I do remove this from the route header on in-dialog replies as
loose-route does not remove the header on the original location server
as it does not see the route header as local, so I manually remove it.

Has anyone come across this particular issue? I'm using Kamailio 3.1.2.
Am I going about this is the wrong way? I've been reading the module
docs for registrar/usrloc/rr/path/textops to see if there is something
I've missed but cannot see it.

Any tips/suggestions would be greatly appreciated.

Thanks


___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] getting fragmented packet when adding record-route header

2011-03-14 Thread Alex Balashov
It sounds like adding the RR header adds just enough payload to push 
the size of your packet over the edge of being too close to the MTU 
boundary.  There's no particular solution except to make the message 
smaller, and/or use a receiving endpoint that supports fragmented SIP 
messages.


On 03/14/2011 03:35 PM, Asgaroth wrote:


Hi All,

I have a scenario where I have 2 asterisk media servers that, when
calling a registered sip account, will forward off the invite to a
location server, who looks up the contact information, then forwards the
invite off to the proxy that the user registered against (done via the
path module). This all appears to work perfectly until the us hangs up
the call. The BYE message does not make it all the way back to the
originating asterisk media server, it makes it back to the location
server that looked up the registration information.

To overcome this issue, I add a "Record-Route" header specifying the
address of the asterisk media server that the request originated from.
However, when I add the custom header, the Invite shows up as fragmented
packet my wire-shark trace at the end-user's soft-phone. The call sets
up properly and when I hang up it looks like the BYE message makes it
all the way back to the media server, but when it is relayed on the the
caller, the sip proxy then fails the call with a message too big. If I
remove the line that adds the record-route header, then all looks fine,
except that I am unable to tear down calls from sip end-points.

The specific line I'm using to add the header is as follows:

insert_hf("Record-Route:\r\n","Record-Route");

I do remove this from the route header on in-dialog replies as
loose-route does not remove the header on the original location server
as it does not see the route header as local, so I manually remove it.

Has anyone come across this particular issue? I'm using Kamailio 3.1.2.
Am I going about this is the wrong way? I've been reading the module
docs for registrar/usrloc/rr/path/textops to see if there is something
I've missed but cannot see it.

Any tips/suggestions would be greatly appreciated.

Thanks


___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users



--
Alex Balashov - Principal
Evariste Systems LLC
260 Peachtree Street NW
Suite 2200
Atlanta, GA 30303
Tel: +1-678-954-0670
Fax: +1-404-961-1892
Web: http://www.evaristesys.com/

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] Q.850 Reason in CANCEL on Kamailio 3.0

2011-03-14 Thread Jeremy McNamara

I am attempting to add a Reason header with Q.850 result codes.

Unfortunately, this does not work:


if (is_method("CANCEL")) {
 append_hf("Reason: Q.850; cause=16\r\n");
  if (t_check_trans()) {
  t_relay();
  }
  exit;
}



If I have to use 3.1.x, does it support sending Q.850 codes?





Jeremy McNamara

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users