[SR-Users] mediaproxy-ng Tutorial

2013-04-01 Thread Aft nix
Hi,

I stumbled upon this git://github.com/sipwise/mediaproxy-ng.git which
looked very neat to me. Its said that it can be used with kamailio. It
seems like its backed sipwise inc.

But no documentation is given there. Anyone know of a
tutorial/documentation for how to use it?
--
-aft

___
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] Dialog is not cleaned up after failed calls and BYEs.

2013-02-15 Thread Aft nix
Hi,

I'm trying to limit concurrent calls through kamailio using following script:
#!ifdef WITH_CALL_LIMIT
if (is_method("INVITE")) {
dlg_manage();
$var(100) = 0;
get_profile_size("callquota", "$fd", "$var(100)");
if ($var(100) >= 100 ) {
xdbg("DEBUG: Simultaneous calls limit reached");
sl_send_reply("503","Simultaneous calls limit reached");
exit;
}

set_dlg_profile("callquota","$fd");

}
#!endif

But the dialogs are not cleaned up after the call ends or a failed call happens.

For example after two failed calls :

[root@new tls]# kamctl fifo profile_get_size callquota
profile::  name=callquota value= count=4

and the dialog list :

[root@new tls]# kamctl fifo dlg_list
dialog::  hash=896:11654
state:: 1
ref_count:: 1
timestart:: 0
timeout:: 0
callid:: iSGRqQR0C4suBpQD0rHAEgV42vw0Sbpe
from_uri:: sip:123@205.164.40.150
from_tag:: d8x2LDBptN9FRJWtqFTj4DIpuQlKq.KN
caller_contact:: sip:123@180.149.7.45:33852;ob
caller_cseq:: 11755
caller_route_set::
caller_bind_addr:: udp:185.8.105.70:9547
callee_bind_addr::
to_uri:: sip:8801684077496@205.164.40.150
to_tag::
callee_contact::
callee_cseq::
callee_route_set::
dialog::  hash=896:11655
state:: 1
ref_count:: 1
timestart:: 0
timeout:: 0
callid:: iSGRqQR0C4suBpQD0rHAEgV42vw0Sbpe
from_uri:: sip:123@205.164.40.150
from_tag:: d8x2LDBptN9FRJWtqFTj4DIpuQlKq.KN
caller_contact:: sip:123@180.149.7.45:33852;ob
caller_cseq:: 11755
caller_route_set::
caller_bind_addr:: udp:185.8.105.70:9547
callee_bind_addr::
to_uri:: sip:8801684077496@205.164.40.150
to_tag::
callee_contact::
callee_cseq::
callee_route_set::
dialog::  hash=896:11657
state:: 1
ref_count:: 1
timestart:: 0
timeout:: 0
callid:: iSGRqQR0C4suBpQD0rHAEgV42vw0Sbpe
from_uri:: sip:123@205.164.40.150
from_tag:: d8x2LDBptN9FRJWtqFTj4DIpuQlKq.KN
caller_contact:: sip:123@180.149.7.45:33852;ob
caller_cseq:: 11756
caller_route_set::
caller_bind_addr:: udp:185.8.105.70:9547
callee_bind_addr::
to_uri:: sip:8801684077496@205.164.40.150
to_tag::
callee_contact::
callee_cseq::
callee_route_set::
dialog::  hash=1532:8089
state:: 1
ref_count:: 1
timestart:: 0
timeout:: 0
callid:: povqQaC.sRhKvmUaLzzR83bRXxouoNy8
from_uri:: sip:123@205.164.40.150
from_tag:: qXQll3QXrff.t27FHY2hucPfJ7K8Pfrs
caller_contact:: sip:123@180.149.7.45:33852;ob
caller_cseq:: 9232
caller_route_set::
caller_bind_addr:: udp:185.8.105.70:9547
callee_bind_addr::
to_uri:: sip:8801684077496@205.164.40.150
to_tag::
callee_contact::
callee_cseq::
callee_route_set::


You can see there are multiple entries. And these dialog does not get
cleaned up. The data is collected when there was no call(pending or
connected).


My kamailio version is :

 [root@new tls]# kamailio -V
version: kamailio 4.0.0-pre0 (x86_64/linux) 83eafc
flags: STATS: Off, USE_IPV6, USE_TCP, USE_TLS, TLS_HOOKS,
USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM,
SHM_MMAP, PKG_MALLOC, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT,
USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST,
HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16,
MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 4MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: 83eafc
compiled on 18:34:58 Jan 17 2013 with gcc 4.4.6

Any suggestion?(It seems dialog module is not working as it should be.
I've also tried calling unset_profile() forcefully in failure route
with no luck)
--
-aft

___
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] Use different flags in rtpproxy_manage() based on from which route its called

2012-11-11 Thread Aft nix
On Fri, Nov 9, 2012 at 2:08 PM, Daniel-Constantin Mierla
 wrote:
> Hello,
>
>
> On 11/8/12 11:40 AM, Aft nix wrote:
>>

> in route[NATMANAGE] you can see that there are some functions that help to
> detect if a request or a reply is processed, respectively
> is_request()/is_reply().
>

Thanks for the solution.

I'm thinking of setting up a kamailio lab in my lapto using VMs. Any
pointer on that how should i proceed?

If i have that i can check first hand these little things without
bothering others.

The lab should only be a place for testing kamailio features. nothing else.

How can i set it up without any sort of sip client?(Like can i use one
kamailio instance as sip client for
generating sip msgs?)

> You can have if conditions and execute any of rtpproxy_*() functions with
> different parameters.
>
> Cheers,
> Daniel
>>
>>
>> Thanks in advance.
>>
>> --
>> -aft
>>
>> ___
>> 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
> http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
> Kamailio Advanced Training, Berlin, Nov 5-8, 2012 - http://asipto.com/u/kat
> Kamailio Advanced Training, Miami, USA, Nov 12-14, 2012 -
> http://asipto.com/u/katu
>



--
-aft

___
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] Use different flags in rtpproxy_manage() based on from which route its called

2012-11-08 Thread Aft nix
Hi,

rtpproxy_manage() combines both rtpproxy_offer() and
rtpproxy_answer(). Now if i want different flags set for
rtpproxy_offer() and rtpproxy_answer() then how should i use
rtpproxy_manage()?

To specific, what i want :

route[REQUEST]{
.
rtpproxy_offer("z20");
...
}

onreply_route[]{

rtpproxy_answer("z120");

}

Now in kamailio.cfg there is one call rtpproxy_manage() in
route[NATMANAGE]. route[NATMANAGE] is called from both route[REQUEST]
and onreply_route[]. So i can't emulate the functionality described
above. My question is using only rtpproxy_manage() is it possible to
emulate the above functionality?

Thanks in advance.

--
-aft

___
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] implementing call-quota with dialog module

2012-10-08 Thread Aft nix
On Mon, Oct 8, 2012 at 8:09 PM, Daniel-Constantin Mierla
 wrote:
> Hello,
>
> what version are you using? at some point it was an issue adding a call in a
> profile after creating its associated dialog.
>

i'm using 3.2 branch of the git repository.

> Also, it might be better to check the quota before creating the dialog,
> because if the limit is reached, then you will just reject the call, so you
> avoid quite some internal operations -- but it is not really something
> crucial.

I'm under the impression that my idea behind this implementation is
somewhat flawed.

The idea was to  count calls per "domain".  If the the idea is
reflected in my approach then
i will head for minor tweaking. But if my implementation is just plain
wrong, then i will have to
do it manually, like using sqlops and do the dialog accounting myself.

cheers.

>
> Cheers,
> Daniel
>
>
> On 10/8/12 11:40 AM, Aft nix wrote:
>>
>> Hi,
>>
>> I'm trying to implement a "callquota" based on destination domains.
>>
>> The idea is following:
>>
>> every destation domain has a limit of, say 50 calls.
>>
>> As the sip clients are registered with the "destination domains", i've
>> extracted
>> the domain using "$fd" because it results as same value as destination
>> domain.
>>
>> Problem is, i wanted to have separate quota for each domains. But it
>> seems,
>> that the quota is  reached "as total" not as per domain basis.
>>
>> Another thing is, the number of calls reported by it is also unusually
>> large than
>> actual calls.
>>
>> This is implemenated as bellow:
>>
>>
>> #!ifdef WITH_CALL_LIMIT
>>   modparam("dialog","enable_stats",1)
>>   modparam("dialog","dlg_flag", DLG_FLAG)
>>   modparam("dialog","hash_size", 4096)
>>   modparam("dialog", "profiles_with_value","callquota")
>>   modparam("dialog", "default_timeout", 300)
>>   modparam("dialog", "dlg_match_mode", 2)
>>   modparam("dialog", "detect_spirals", 1)
>>   modparam("dialog", "db_mode", 0)
>>   #!endif
>>
>>   #!ifdef WITH_CALL_LIMIT
>>if (is_method("INVITE")) {
>>dlg_manage();
>>$var(100) = 0;
>>get_profile_size("callquota", "$fd", "$var(100)");
>>if ($var(100) >= 50 ) {
>>xdbg("DEBUG: Simultaneous calls limit
>> reached");
>>sl_send_reply("503","Simultaneous calls
>> limit reached");
>>exit;
>>}
>>
>>set_dlg_profile("callquota","$fd");
>>if (get_profile_size("callquota","$fd", "$var(100)")) {
>>xdbg("DEBUG: there are $var(100) total calls
>> for $fd");
>>}
>>}
>>#!endif
>>
>> Thanks in advance.
>
>
> --
> Daniel-Constantin Mierla - http://www.asipto.com
> http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
> Kamailio Advanced Training, Berlin, Nov 5-8, 2012 - http://asipto.com/u/kat
> Kamailio Advanced Training, Miami, USA, Nov 12-14, 2012 -
> http://asipto.com/u/katu
>



-- 
-aft

___
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] implementing call-quota with dialog module

2012-10-08 Thread Aft nix
Hi,

I'm trying to implement a "callquota" based on destination domains.

The idea is following:

every destation domain has a limit of, say 50 calls.

As the sip clients are registered with the "destination domains", i've extracted
the domain using "$fd" because it results as same value as destination domain.

Problem is, i wanted to have separate quota for each domains. But it seems,
that the quota is  reached "as total" not as per domain basis.

Another thing is, the number of calls reported by it is also unusually
large than
actual calls.

This is implemenated as bellow:


#!ifdef WITH_CALL_LIMIT
 modparam("dialog","enable_stats",1)
 modparam("dialog","dlg_flag", DLG_FLAG)
 modparam("dialog","hash_size", 4096)
 modparam("dialog", "profiles_with_value","callquota")
 modparam("dialog", "default_timeout", 300)
 modparam("dialog", "dlg_match_mode", 2)
 modparam("dialog", "detect_spirals", 1)
 modparam("dialog", "db_mode", 0)
 #!endif

 #!ifdef WITH_CALL_LIMIT
  if (is_method("INVITE")) {
  dlg_manage();
  $var(100) = 0;
  get_profile_size("callquota", "$fd", "$var(100)");
  if ($var(100) >= 50 ) {
  xdbg("DEBUG: Simultaneous calls limit reached");
  sl_send_reply("503","Simultaneous calls
limit reached");
  exit;
  }

  set_dlg_profile("callquota","$fd");
  if (get_profile_size("callquota","$fd", "$var(100)")) {
  xdbg("DEBUG: there are $var(100) total calls
for $fd");
  }
  }
  #!endif

Thanks in advance.
-- 
-aft

___
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] Error starting kamailio with dialog module usage

2012-10-01 Thread Aft nix
On Sun, Sep 30, 2012 at 10:15 PM, SamyGo  wrote:
> Is it typo or by chance you are missing a $ in line 507  before var(100)
>

You are spot on :) Thanks.



> On Sep 30, 2012 2:50 PM, "Aft nix"  wrote:
>>
>> Hi,
>>
>> After implementing a "Call limit" application with the following config:
>>
>> #!ifdef WITH_CALL_LIMIT
>> modparam("dialog","enable_stats",1)
>> modparam("dialog","dlg_flag", 4)
>> modparam("dialog","hash_size", 4096)
>> modparam("dialog", "profiles_with_value","callquota")
>> modparam("dialog", "default_timeout", 300)
>> modparam("dialog", "dlg_match_mode", 2)
>> modparam("dialog", "detect_spirals", 1)
>> modparam("dialog", "db_mode", 0)
>> #!endif
>>
>> request_route {
>> 
>> #!ifdef WITH_CALL_LIMIT
>> if (is_method("INVITE")) {
>> dlg_manage();
>> $var(100) = 0;
>> get_profile_size("callquota", "$rU", "var(100)");
>> if ($var(100) >= 5 ) {
>> xlog("DEBUG: Simultaneous calls limit reached");
>> sl_send_reply("503","Simultaneous calls limit
>> reached");
>> exit;
>> }
>>
>> set_dlg_profile("callquota","$ru");
>> if (get_profile_size("callquota", "$var(100)")) {
>> xlog("DEBUG: there are $var(100) total calls
>> for $rU\n");
>> }
>> }
>> #!endif
>> ...
>> }
>>
>> Now it passes cleanly when i issue :
>> $kamailio -c
>>
>> but it fails to start with following info:
>>
>> Sep 29 19:37:49 108 /usr/local/sbin/kamailio[1865]: ERROR: 
>> [route.c:1216]: fixing failed (code=-1) at
>> cfg:/usr/local/etc/kamailio/kamailio.cfg:507
>> Sep 29 19:37:49 108 /usr/local/sbin/kamailio[1865]: ERROR: 
>> [route.c:1216]: fixing failed (code=-1) at
>> cfg:/usr/local/etc/kamailio/kamailio.cfg:523
>>
>> line 507 : get_profile_size("callquota", "$rU", "var(100)");
>>
>> Thanks in advance
>>
>> --
>> -aft
>>
>> ___
>> 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
>



-- 
-aft

___
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] Error starting kamailio with dialog module usage

2012-09-30 Thread Aft nix
Hi,

After implementing a "Call limit" application with the following config:

#!ifdef WITH_CALL_LIMIT
modparam("dialog","enable_stats",1)
modparam("dialog","dlg_flag", 4)
modparam("dialog","hash_size", 4096)
modparam("dialog", "profiles_with_value","callquota")
modparam("dialog", "default_timeout", 300)
modparam("dialog", "dlg_match_mode", 2)
modparam("dialog", "detect_spirals", 1)
modparam("dialog", "db_mode", 0)
#!endif

request_route {

#!ifdef WITH_CALL_LIMIT
if (is_method("INVITE")) {
dlg_manage();
$var(100) = 0;
get_profile_size("callquota", "$rU", "var(100)");
if ($var(100) >= 5 ) {
xlog("DEBUG: Simultaneous calls limit reached");
sl_send_reply("503","Simultaneous calls limit reached");
exit;
}

set_dlg_profile("callquota","$ru");
if (get_profile_size("callquota", "$var(100)")) {
xlog("DEBUG: there are $var(100) total calls
for $rU\n");
}
}
#!endif
...
}

Now it passes cleanly when i issue :
$kamailio -c

but it fails to start with following info:

Sep 29 19:37:49 108 /usr/local/sbin/kamailio[1865]: ERROR: 
[route.c:1216]: fixing failed (code=-1) at
cfg:/usr/local/etc/kamailio/kamailio.cfg:507
Sep 29 19:37:49 108 /usr/local/sbin/kamailio[1865]: ERROR: 
[route.c:1216]: fixing failed (code=-1) at
cfg:/usr/local/etc/kamailio/kamailio.cfg:523

line 507 : get_profile_size("callquota", "$rU", "var(100)");

Thanks in advance

-- 
-aft

___
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] Limiting concurrent calls

2012-09-15 Thread Aft nix
Hi,
I need to limit the number of concurrent calls go through kamailio.
Its a simple set up(Not per user basis, a global limit will suffice).

I know i need to employ dialog module. But i'm a little confused about
profiles. I thought for simple application like this, i may be able to
use profile altogether.

Any code snippet to limit number of concurrent calls will be very helpful.

Thanks in advance.
-- 
-aft

___
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] sip over tls is not working

2012-07-12 Thread Aft nix
->type==PROTO_TLS)
tls_close(c, fd);
 #endif
_tcpconn_rm(c);
@@ -4522,7 +4522,7 @@ static inline void tcpconn_destroy_all(void)
tcp_safe_close(fd);
}
(*tcp_connections_no)--;
-   if (unlikely(c->type==PROTO_TLS || 
c->type==PROTO_WSS))
+   if (unlikely(c->type==PROTO_TLS))
(*tls_connections_no)--;
c=next;
}

I don't know if that changed anything.

Most likely i have done something silly which i am not finding at this moment.

Whatever, as things work so the thread should be marked SOLVED. Though
it irks me that i still dont know, what went wrong.

Cheers.

>
>> On Wed, Jul 11, 2012 at 9:37 PM, Peter Dunkley
>>  wrote:
>>>
>>> Hi,
>>>
>>> WebSockets over TLS works which requires establishing a TLS connection
>>> and
>>> exchanging an HTTP request and response.  It doesn't sound like this
>>> connection is even getting passed the TLS handshake part?
>>>
>>> Peter
>>>
>>
>> Hi,
>> That was my first guess. I will run some tests with plain tcp socket
>> and post update.
>>
>> cheers.
>>
>>>
>>> On Wed, 2012-07-11 at 17:14 +0200, Klaus Darilion wrote:
>>>
>>> Maybe there were some changes fore websocket support which cause
>>> problems. Do plain TCP connections work?
>>>
>>> klaus
>>>
>>> On 11.07.2012 16:20, Aft nix wrote:
>>> > On Wed, Jul 11, 2012 at 6:56 PM, Klaus Darilion
>>> >  wrote:
>>> >> I just tested TLS with Kamailio 3.3.0 and Eyebeam and it works. Make
>>> >> sure to
>>> >> specify "ca_list" if intermediate certificates are used.
>>> >>
>>> >
>>> > I was working with master branch, not 3.3 branch.
>>> >
>>> >>
>>> >> regards
>>> >> Klaus
>>> >>
>>> >> On 09.07.2012 13:27, Aft nix wrote:
>>> >>>
>>> >>> Hi,
>>> >>>
>>> >>> I have enabled tls parameters as follows:
>>> >>>
>>> >>> in kamailio.cfg
>>> >>>
>>> >>> listen = tls::
>>> >>>
>>> >>> in tls.cfg
>>> >>>
>>> >>> [server::]
>>> >>> method = TLSv1
>>> >>> verify_certificate = no
>>> >>> require_certificate = no
>>> >>> private_key = /usr/local/etc/kamailio/kamailio-selfsigned.key
>>> >>> certificate = /usr/local/etc/kamailio/
>>> kamailio-selfsigned.pem
>>> >>>
>>> >>> Now if i try to connect to this interface using openssl s_client, it
>>> >>> does connects,
>>> >>> but now server certificate is sent from kamailio.
>>> >>>
>>> >>> kamailio log shows this :
>>> >>>
>>> >>>  [ip_addr.c:247]: tcpconn_new: new tcp connection: >> >>> IP>
>>> >>>  [tcp_main.c:10
>



-- 
-aft

___
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] sip over tls is not working

2012-07-11 Thread Aft nix
On Wed, Jul 11, 2012 at 9:37 PM, Peter Dunkley
 wrote:
>
> Hi,
>
> WebSockets over TLS works which requires establishing a TLS connection and
> exchanging an HTTP request and response.  It doesn't sound like this
> connection is even getting passed the TLS handshake part?
>
> Peter
>

Hi,
That was my first guess. I will run some tests with plain tcp socket
and post update.

cheers.

>
> On Wed, 2012-07-11 at 17:14 +0200, Klaus Darilion wrote:
>
> Maybe there were some changes fore websocket support which cause
> problems. Do plain TCP connections work?
>
> klaus
>
> On 11.07.2012 16:20, Aft nix wrote:
> > On Wed, Jul 11, 2012 at 6:56 PM, Klaus Darilion
> >  wrote:
> >> I just tested TLS with Kamailio 3.3.0 and Eyebeam and it works. Make
> >> sure to
> >> specify "ca_list" if intermediate certificates are used.
> >>
> >
> > I was working with master branch, not 3.3 branch.
> >
> >>
> >> regards
> >> Klaus
> >>
> >> On 09.07.2012 13:27, Aft nix wrote:
> >>>
> >>> Hi,
> >>>
> >>> I have enabled tls parameters as follows:
> >>>
> >>> in kamailio.cfg
> >>>
> >>> listen = tls::
> >>>
> >>> in tls.cfg
> >>>
> >>> [server::]
> >>> method = TLSv1
> >>> verify_certificate = no
> >>> require_certificate = no
> >>> private_key = /usr/local/etc/kamailio/kamailio-selfsigned.key
> >>> certificate = /usr/local/etc/kamailio/
> kamailio-selfsigned.pem
> >>>
> >>> Now if i try to connect to this interface using openssl s_client, it
> >>> does connects,
> >>> but now server certificate is sent from kamailio.
> >>>
> >>> kamailio log shows this :
> >>>
> >>>  [ip_addr.c:247]: tcpconn_new: new tcp connection:  >>> IP>
> >>>  [tcp_main.c:1089]: tcpconn_new: on port 40727, type 3
> >>>  [tcp_main.c:1400]: tcpconn_add: hashes: 2614:2652:2494, 2
> >>>  [io_wait.h:390]: DBG: io_watch_add(0x82535e0, 23, 2,
> >>> 0xb5701580), fd_no=11
> >>>  [io_wait.h:617]: DBG: io_watch_del (0x82535e0, 23, -1, 0x0)
> >>> fd_no=12 called
> >>>  [tcp_main.c:4296]: tcp: DBG: sending to child, events 1
> >>>  [tcp_main.c:3963]: WARNING: send2child: no free tcp
> >>> receiver,
> >>>connection passed to the least busy one (3289651)
> >>>  [tcp_main.c:3967]: selected tcp worker 0 0(8) for activity
> >>> on
> >>> [tls::], 0xb5701580
> >>>  [tcp_main.c:3576]: BUG: handle_ser_child: fd -1 for 0 (pid
> >>> 2491)
> >>>
> >>> I'm using kamailio from git. its updated to the latest.
> >>> Thanks in advance.
> >>>
> >>
> >
> >
> >
>
>
> ___
> 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
>
>
> --
> Peter Dunkley
> Technical Director
> Crocodile RCS Ltd




--
-aft

___
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] sip over tls is not working

2012-07-11 Thread Aft nix
On Wed, Jul 11, 2012 at 6:25 PM, Klaus Darilion
 wrote:
> Does it work with your web browser?
>
> https://ip.address.ofyour.proxy:5061/
>
> At least the TLS handshake should work.
>

Yes i've tested that way. It shows server not found. I think the
problem is not related to
tls. The TCP connection is not established in the first place. You
will get the a hint of this
by reading the debug log i gave in my initial mail.

> If you add the following snippet to your config you should also see the
> response in your browser:
>
> event_route[xhttp:request] {
> xhttp_reply("200", "OK", "text/html","OK - $hu -
> [$si:$sp]");
> }
>
>
> regards
> Klaus
>
>
>
> On 10.07.2012 12:44, Aft nix wrote:
>>
>> On Mon, Jul 9, 2012 at 10:24 PM, Daniel-Constantin Mierla
>>  wrote:
>>>
>>> Hello,
>>>
>>> also, can you provide more details about the case? Is it with the very
>>> first
>>> connection or you do some load testing and at some point you get this
>>> issue?
>>>
>>
>> No, its not a part of load testing. it happens on the first connection.
>>
>>> Can you reproduce it always?
>>
>>
>> Yes i can reproduce it.
>>
>>> Do you set different number of workers per
>>> socket? What is the output of 'kamctl ps'?
>>
>>
>> No. both are 4. (udp and tls )
>>
>> I have downgraded the lab machine to do some testing. so i can't give
>> kamctl ps of the faulty
>> installation at this moment. kamailio-3.2.x is deployed in our
>> production servers, and it worked flawlessly.
>>
>> this is the output of kamctl ps from a 3.2.x. it uses the same config
>> file as i was using with git master branch.
>>
>> [root@server kamailio-3.2.3]# kamctl ps
>> Process::  ID=0 PID=31109 Type=attendant
>> Process::  ID=1 PID=31110 Type=udp receiver child=0 sock=:
>> Process::  ID=2 PID=3 Type=udp receiver child=1 sock=:
>> Process::  ID=3 PID=31112 Type=udp receiver child=2 sock=:
>> Process::  ID=4 PID=31113 Type=udp receiver child=3 sock=:
>> Process::  ID=5 PID=31114 Type=slow timer
>> Process::  ID=6 PID=31115 Type=timer
>> Process::  ID=7 PID=31116 Type=MI FIFO
>> Process::  ID=8 PID=31117 Type=ctl handler
>> Process::  ID=9 PID=31118 Type=TIMER NH
>> Process::  ID=10 PID=31119 Type=tcp receiver child=0
>> Process::  ID=11 PID=31120 Type=tcp receiver child=1
>> Process::  ID=12 PID=31121 Type=tcp receiver child=2
>> Process::  ID=13 PID=31122 Type=tcp receiver child=3
>> Process::  ID=14 PID=31123 Type=tcp main process
>>
>>>
>>> Have you tried with 3.3 branch as well or just master branch?
>>>
>>
>> I've got this in master branch. haven't tried it with 3.3 branch.
>>
>> On the side note similar issue was reported by a guy earlier this year
>> in this list which went
>> unnoticed. here is the link to that mail :
>>
>> http://lists.sip-router.org/pipermail/sr-users/2012-April/072683.html
>>
>> His issue seems similar to me.
>>
>> Cheers
>>>
>>> Cheers,
>>> Daniel
>>>
>>>
>>> On 7/9/12 3:04 PM, Klaus Darilion wrote:
>>>>
>>>>
>>>> Use wireshark to analyze the TLS handshake
>>>>
>>>> regards
>>>> klaus
>>>>
>>>> On 09.07.2012 13:27, Aft nix wrote:
>>>>>
>>>>>
>>>>> Hi,
>>>>>
>>>>> I have enabled tls parameters as follows:
>>>>>
>>>>> in kamailio.cfg
>>>>>
>>>>> listen = tls::
>>>>>
>>>>> in tls.cfg
>>>>>
>>>>> [server::]
>>>>> method = TLSv1
>>>>> verify_certificate = no
>>>>> require_certificate = no
>>>>> private_key = /usr/local/etc/kamailio/kamailio-selfsigned.key
>>>>> certificate = /usr/local/etc/kamailio/kamailio-selfsigned.pem
>>>>>
>>>>> Now if i try to connect to this interface using openssl s_client, it
>>>>> does connects,
>>>>> but now server certificate is sent from kamailio.
>>>>>
>>>>> kamailio log shows this :
>>>>>
>>>>>  [ip_addr.c:247]: tcpconn_new: new tcp connection: >>>> IP>
>>>>>  [tcp_main.c:1089]: tcpconn_new: on port 40727, type 3
>>>>>  [tcp_main.c:1400]: tcpconn_add: hashes: 2

Re: [SR-Users] sip over tls is not working

2012-07-11 Thread Aft nix
On Wed, Jul 11, 2012 at 6:56 PM, Klaus Darilion
 wrote:
> I just tested TLS with Kamailio 3.3.0 and Eyebeam and it works. Make sure to
> specify "ca_list" if intermediate certificates are used.
>

I was working with master branch, not 3.3 branch.

>
> regards
> Klaus
>
> On 09.07.2012 13:27, Aft nix wrote:
>>
>> Hi,
>>
>> I have enabled tls parameters as follows:
>>
>> in kamailio.cfg
>>
>> listen = tls::
>>
>> in tls.cfg
>>
>> [server::]
>> method = TLSv1
>> verify_certificate = no
>> require_certificate = no
>> private_key = /usr/local/etc/kamailio/kamailio-selfsigned.key
>> certificate = /usr/local/etc/kamailio/kamailio-selfsigned.pem
>>
>> Now if i try to connect to this interface using openssl s_client, it
>> does connects,
>> but now server certificate is sent from kamailio.
>>
>> kamailio log shows this :
>>
>> [ip_addr.c:247]: tcpconn_new: new tcp connection: 
>> [tcp_main.c:1089]: tcpconn_new: on port 40727, type 3
>> [tcp_main.c:1400]: tcpconn_add: hashes: 2614:2652:2494, 2
>> [io_wait.h:390]: DBG: io_watch_add(0x82535e0, 23, 2,
>> 0xb5701580), fd_no=11
>> [io_wait.h:617]: DBG: io_watch_del (0x82535e0, 23, -1, 0x0)
>> fd_no=12 called
>> [tcp_main.c:4296]: tcp: DBG: sending to child, events 1
>> [tcp_main.c:3963]: WARNING: send2child: no free tcp receiver,
>>   connection passed to the least busy one (3289651)
>> [tcp_main.c:3967]: selected tcp worker 0 0(8) for activity on
>> [tls::], 0xb5701580
>> [tcp_main.c:3576]: BUG: handle_ser_child: fd -1 for 0 (pid 2491)
>>
>> I'm using kamailio from git. its updated to the latest.
>> Thanks in advance.
>>
>



-- 
-aft

___
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] DB create statements

2012-07-11 Thread Aft nix
On Wed, Jul 11, 2012 at 3:24 PM, Klaus Darilion
 wrote:
> Hi!
>
> For some reason I need to the enter the SQL statements manually on the DB
> server (I do not want to copy the scripts to the DB server and there is no
> superuser access over the network)
>
> Is there a simple method to get all the SQL commands to create the kamailio
> database?
>

Hi,

You can look at this module. you can query a sql database from your kamailio.cfg

http://kamailio.org/docs/modules/stable/modules_k/sqlops.html

Cheers.
> I see there are all the files in "/usr/share/kamailio/postgres/" and lots of
> other SQL statements in /usr/lib/kamailio/kamctl/kamdbctl.pgsql. Does anyone
> know of a simple method to get all the raw SQL queries?
>
> Thanks
> Klaus
>
>
>
> ___
> 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



-- 
-aft

___
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] sip over tls is not working

2012-07-10 Thread Aft nix
On Mon, Jul 9, 2012 at 10:24 PM, Daniel-Constantin Mierla
 wrote:
> Hello,
>
> also, can you provide more details about the case? Is it with the very first
> connection or you do some load testing and at some point you get this issue?
>

No, its not a part of load testing. it happens on the first connection.

> Can you reproduce it always?

Yes i can reproduce it.

>Do you set different number of workers per
> socket? What is the output of 'kamctl ps'?

No. both are 4. (udp and tls )

I have downgraded the lab machine to do some testing. so i can't give
kamctl ps of the faulty
installation at this moment. kamailio-3.2.x is deployed in our
production servers, and it worked flawlessly.

this is the output of kamctl ps from a 3.2.x. it uses the same config
file as i was using with git master branch.

[root@server kamailio-3.2.3]# kamctl ps
Process::  ID=0 PID=31109 Type=attendant
Process::  ID=1 PID=31110 Type=udp receiver child=0 sock=:
Process::  ID=2 PID=3 Type=udp receiver child=1 sock=:
Process::  ID=3 PID=31112 Type=udp receiver child=2 sock=:
Process::  ID=4 PID=31113 Type=udp receiver child=3 sock=:
Process::  ID=5 PID=31114 Type=slow timer
Process::  ID=6 PID=31115 Type=timer
Process::  ID=7 PID=31116 Type=MI FIFO
Process::  ID=8 PID=31117 Type=ctl handler
Process::  ID=9 PID=31118 Type=TIMER NH
Process::  ID=10 PID=31119 Type=tcp receiver child=0
Process::  ID=11 PID=31120 Type=tcp receiver child=1
Process::  ID=12 PID=31121 Type=tcp receiver child=2
Process::  ID=13 PID=31122 Type=tcp receiver child=3
Process::  ID=14 PID=31123 Type=tcp main process

>
> Have you tried with 3.3 branch as well or just master branch?
>

I've got this in master branch. haven't tried it with 3.3 branch.

On the side note similar issue was reported by a guy earlier this year
in this list which went
unnoticed. here is the link to that mail :

http://lists.sip-router.org/pipermail/sr-users/2012-April/072683.html

His issue seems similar to me.

Cheers
> Cheers,
> Daniel
>
>
> On 7/9/12 3:04 PM, Klaus Darilion wrote:
>>
>> Use wireshark to analyze the TLS handshake
>>
>> regards
>> klaus
>>
>> On 09.07.2012 13:27, Aft nix wrote:
>>>
>>> Hi,
>>>
>>> I have enabled tls parameters as follows:
>>>
>>> in kamailio.cfg
>>>
>>> listen = tls::
>>>
>>> in tls.cfg
>>>
>>> [server::]
>>> method = TLSv1
>>> verify_certificate = no
>>> require_certificate = no
>>> private_key = /usr/local/etc/kamailio/kamailio-selfsigned.key
>>> certificate = /usr/local/etc/kamailio/kamailio-selfsigned.pem
>>>
>>> Now if i try to connect to this interface using openssl s_client, it
>>> does connects,
>>> but now server certificate is sent from kamailio.
>>>
>>> kamailio log shows this :
>>>
>>> [ip_addr.c:247]: tcpconn_new: new tcp connection: 
>>> [tcp_main.c:1089]: tcpconn_new: on port 40727, type 3
>>> [tcp_main.c:1400]: tcpconn_add: hashes: 2614:2652:2494, 2
>>> [io_wait.h:390]: DBG: io_watch_add(0x82535e0, 23, 2,
>>> 0xb5701580), fd_no=11
>>> [io_wait.h:617]: DBG: io_watch_del (0x82535e0, 23, -1, 0x0)
>>> fd_no=12 called
>>> [tcp_main.c:4296]: tcp: DBG: sending to child, events 1
>>> [tcp_main.c:3963]: WARNING: send2child: no free tcp receiver,
>>>   connection passed to the least busy one (3289651)
>>> [tcp_main.c:3967]: selected tcp worker 0 0(8) for activity on
>>> [tls::], 0xb5701580
>>> [tcp_main.c:3576]: BUG: handle_ser_child: fd -1 for 0 (pid
>>> 2491)
>>>
>>> I'm using kamailio from git. its updated to the latest.
>>> Thanks in advance.
>>>
>>
>>
>> ___
>> 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
> http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
> Kamailio Advanced Training, Seattle, USA, Sep 23-26, 2012 -
> http://asipto.com/u/katu
> Kamailio Practical Workshop, Netherlands, Sep 10-12, 2012 -
> http://asipto.com/u/kpw
>



-- 
-aft

___
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] sip over tls is not working

2012-07-09 Thread Aft nix
On Mon, Jul 9, 2012 at 7:04 PM, Klaus Darilion
 wrote:
> Use wireshark to analyze the TLS handshake
>

Thanks for the suggestion. I'll analyze it and post my findings.

> regards
> klaus
>
>
> On 09.07.2012 13:27, Aft nix wrote:
>>
>> Hi,
>>
>> I have enabled tls parameters as follows:
>>
>> in kamailio.cfg
>>
>> listen = tls::
>>
>> in tls.cfg
>>
>> [server::]
>> method = TLSv1
>> verify_certificate = no
>> require_certificate = no
>> private_key = /usr/local/etc/kamailio/kamailio-selfsigned.key
>> certificate = /usr/local/etc/kamailio/kamailio-selfsigned.pem
>>
>> Now if i try to connect to this interface using openssl s_client, it
>> does connects,
>> but now server certificate is sent from kamailio.
>>
>> kamailio log shows this :
>>
>> [ip_addr.c:247]: tcpconn_new: new tcp connection: 
>> [tcp_main.c:1089]: tcpconn_new: on port 40727, type 3
>> [tcp_main.c:1400]: tcpconn_add: hashes: 2614:2652:2494, 2
>> [io_wait.h:390]: DBG: io_watch_add(0x82535e0, 23, 2,
>> 0xb5701580), fd_no=11
>> [io_wait.h:617]: DBG: io_watch_del (0x82535e0, 23, -1, 0x0)
>> fd_no=12 called
>> [tcp_main.c:4296]: tcp: DBG: sending to child, events 1
>> [tcp_main.c:3963]: WARNING: send2child: no free tcp receiver,
>>   connection passed to the least busy one (3289651)
>> [tcp_main.c:3967]: selected tcp worker 0 0(8) for activity on
>> [tls::], 0xb5701580
>> [tcp_main.c:3576]: BUG: handle_ser_child: fd -1 for 0 (pid 2491)
>>
>> I'm using kamailio from git. its updated to the latest.
>> Thanks in advance.
>>
>



-- 
-aft

___
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] sip over tls is not working

2012-07-09 Thread Aft nix
Hi,

I have enabled tls parameters as follows:

in kamailio.cfg

listen = tls::

in tls.cfg

[server::]
method = TLSv1
verify_certificate = no
require_certificate = no
private_key = /usr/local/etc/kamailio/kamailio-selfsigned.key
certificate = /usr/local/etc/kamailio/kamailio-selfsigned.pem

Now if i try to connect to this interface using openssl s_client, it
does connects,
but now server certificate is sent from kamailio.

kamailio log shows this :

   [ip_addr.c:247]: tcpconn_new: new tcp connection: 
   [tcp_main.c:1089]: tcpconn_new: on port 40727, type 3
   [tcp_main.c:1400]: tcpconn_add: hashes: 2614:2652:2494, 2
   [io_wait.h:390]: DBG: io_watch_add(0x82535e0, 23, 2,
0xb5701580), fd_no=11
   [io_wait.h:617]: DBG: io_watch_del (0x82535e0, 23, -1, 0x0)
fd_no=12 called
   [tcp_main.c:4296]: tcp: DBG: sending to child, events 1
   [tcp_main.c:3963]: WARNING: send2child: no free tcp receiver,
 connection passed to the least busy one (3289651)
   [tcp_main.c:3967]: selected tcp worker 0 0(8) for activity on
[tls::], 0xb5701580
   [tcp_main.c:3576]: BUG: handle_ser_child: fd -1 for 0 (pid 2491)

I'm using kamailio from git. its updated to the latest.
Thanks in advance.
-- 
-aft

___
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] $200 bounty

2012-06-20 Thread Aft nix
On Thu, Jun 21, 2012 at 1:23 AM, Fred Posner  wrote:
> On Jun 20, 2012, at 3:19 PM, David wrote:
>
>> Do the death stars you are selling have a patch for the small exhaust port 
>> vulnerability (BBY0) ?
>>
>> David
>>
>> On 2012-06-20 15:12, Fred Posner wrote:
>>> On Jun 20, 2012, at 2:40 PM, Alex Balashov wrote:
>>>
 On 06/20/2012 02:38 PM, Fred Posner wrote:

> I know a great bakery that can offer dessert kamailio pricing.
> Generally, $6/portion starting.
 What's the going rate for the Millenium Falcon cake these days?  :-)

>>> They start at $250 and increase by size. =)
>>>
>>> Death Stars are much cheaper. =)
>>>
>
> We've patched the vulnerability but can back port on request. =)
>

To bad back port breaks the build. :)

cheers.
> With best regards,
>
> Fred
> http://qxork.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



-- 
-aft

___
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] $200 bounty

2012-06-20 Thread Aft nix
On Thu, Jun 21, 2012 at 1:19 AM, David  wrote:
> Do the death stars you are selling have a patch for the small exhaust port
> vulnerability (BBY0) ?
>

According to family guy, it was there because of aesthetic reasons. So
don't mock it. It will come handy if you wanna
win a classy artsy girl.

> David
>



-- 
-aft

___
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] $200 bounty

2012-06-20 Thread Aft nix
On Thu, Jun 21, 2012 at 1:12 AM, Fred Posner  wrote:
> On Jun 20, 2012, at 2:40 PM, Alex Balashov wrote:
>
>> On 06/20/2012 02:38 PM, Fred Posner wrote:
>>
>>> I know a great bakery that can offer dessert kamailio pricing.
>>> Generally, $6/portion starting.
>>
>> What's the going rate for the Millenium Falcon cake these days?  :-)
>>
>
> They start at $250 and increase by size. =)
>
> Death Stars are much cheaper. =)
>
> With best regards,
>
> Fred
> http://qxork.com
>

:D :D

couple of weeks ago a core developer of centos project posted a plea
to the community to lessen their hostility
towards ignorant newcomers. Yeah things can go overboard. but
sometimes i do see the point of it.

cheers.
>
> ___
> 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



-- 
-aft

___
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] $200 bounty

2012-06-20 Thread Aft nix
On Thu, Jun 21, 2012 at 1:07 AM, copycall  wrote:
> alex,
>
> i don't fell mocked, but if you feel the need to mock me for cathartic
> relief then i have made one man's day a little easier.
>
> and, if this is entertaining to the others, then the drinks are on me.
>
> i have a business problem to solve and i will try to solve it the best way i
> can.
>
> if it means kamailio developers and users are not sensitive to the needs of
> telephony service providers, then so be it.
>
> however, i know that the vast majority of them are like me - trying their
> best to do their jobs.
>
> if you want to offer your services to me, you are welcome.
>
> dave
>
>
> On Wed, Jun 20, 2012 at 11:55 AM, Alex Balashov 
> wrote:
>>
>> On 06/20/2012 02:51 PM, copycall wrote:
>>
>>> is the list designed for alex balashov to get rich?
>>
>>
>> You're right, all this talk of $200 and riches!  It's beyond the wildest
>> dreams of avarice!
>>
>> Actually, this list is not designed for anyone to get rich.  It has an
>> explicit non-commercial policy.  There is a separate Kamailio-Business list,
>> and, as Ovidiu mentioned, the business directory.
>>
>> That is the principal reason you're being mocked.
>>
>>
>> --
>> Alex Balashov - Principal
>> Evariste Systems LLC
>> 235 E Ponce de Leon Ave
>> Suite 106
>> Decatur, GA 30030
>> Tel: +1-678-954-0670
>> Fax: +1-404-961-1892
>> Web: http://www.evaristesys.com/, http://www.alexbalashov.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
>
>
>
> ___
> 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
>

Hi dave,

You are not getting the point. nobody's against doing business. Infact
doing business in "the open source way" is
supposed be "service, support, consultancy" based rather than
"product" based. Its quiet ok for you to hire someone
who is active in kamailio list. But "kamailio-users" is not the place
to talk business. We all have to support us and our
families. But do it in business list please. I dont think people will
show different response if your starting price was 2000$.

please mail in business list. And talk business there.

You cant open a bank account in their reception desk although bank
wants to do business with you.

cheers.


-- 
-aft

___
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] Looking for RTP Proxy in TCP

2012-06-08 Thread Aft nix
On Fri, Jun 8, 2012 at 6:41 PM, Daniel-Constantin Mierla
 wrote:
>
> On 6/8/12 1:26 PM, Aft nix wrote:
>>
>> On Fri, Jun 8, 2012 at 2:18 PM, Andrew Pogrebennyk
>>  wrote:
>>>
>>> The papers talk about transport protocol for signaling, not media/RTP.
>>> I didn't hear of anyone who does RTP over TCP neither. I doubt even that
>>> the performance is a primary reason behind that, for media over TCP the
>>> client link must be virtually packet-loss free (due to TCP
>>> retransmissions), while over UDP sometimes up to 5% packet loss can be
>>> tolerated. TCP was not designed as transport for real-time media :-)
>>>
>>> On 06/08/2012 12:35 AM, Yang Hong wrote:
>>>>
>>>> Hello.
>>>>
>>>> SIP over TCP would reduce server performance significantly when compared
>>>> with SIP Over UDP.
>>>>
>>>> Please read the following two papers. Combining RTP proxy with SIP over
>>>> TCP would degrade SIP server performance even worse.
>>>>
>>>> ---
>>>> http://www.cs.columbia.edu/~hgs/papers/Shen1008_TLS.pdf
>>>>
>>>> The Impact of TLS on SIP Server Performance
>>>>
>>>> "Securing SIP is accomplished by using TLS instead of UDP as the
>>>> transport protocol. We show that using TLS can reduce performance by up
>>>> to a factor of 17 compared to the typical case of SIP-over-UDP."
>>>>
>>>> "Network operators considering deploying SIP over TLS will need to
>>>> consider the extra resources required to provide the same service
>>>> quality as would be the case with UDP."
>>>>
>>>> ---
>>>>
>>>> http://www.cs.columbia.edu/~hgs/nossdav/2007/files/file-27-session5-paper1-nahum.pdf
>>>>
>>>> Evaluating SIP Proxy Server Performance
>>>>
>>>> "The next most signi cant performance feature is which transport
>>>> protocol is used, TCP or UDP. Using TCP can reduce performance anywhere
>>>> from 43 percent (the stateful proxying scenario with authentication) to
>>>> 65 percent (state-less proxying without authentication).
>>>>
>>>> ---
>>>>
>>>> Best regards,
>>>>
>>>> Yang
>>>>>
>>>>> Date: Thu, 7 Jun 2012 13:36:39 +0200
>>>>> From: mico...@gmail.com
>>>>> To: sr-users@lists.sip-router.org
>>>>> Subject: Re: [SR-Users] Looking for RTP Proxy in TCP
>>>>>
>>>>> Hello,
>>>>>
>>>>> On 6/4/12 7:14 PM, Austin Einter wrote:
>>>>>>
>>>>>> Hi All
>>>>>> Now I am using Kamailio 3.1.5 and RTP proxy 1.1.
>>>>>> Looks both are compatible and working fine.
>>>>>>
>>>>>> The RTP Proxy basically sends/receives RTP packets over UDP.
>>>>>> Is there any RTP Proxy available that does send/receive of RTP packets
>>>>>> over TCP and also should be compatible with Kamailio 3.1.5.
>>>>>>
>>>>>> If you have any information in this regard, kindly share.
>>>>>
>>>>> RTP itself is specified over UDP, also I am not aware of any SIP phone
>>>>> doing RTP over TCP.
>>>>>
>>>>> MSRP is a mechanism specified for sending message streams over TCP, we
>>>>> have a module for that, but I guess is not exactly what you are
>>>>
>>>> looking for:
>>>>>
>>>>> http://kamailio.org/docs/modules/devel/modules/msrp.html
>>>>>
>>>>> Maybe based on it you can implement one that fits your needs.
>>>>>
>>>>> Cheers,
>>>>> Daniel
>>>>>
>>> ___
>>> 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] Looking for RTP Proxy in TCP

2012-06-08 Thread Aft nix
On Fri, Jun 8, 2012 at 2:18 PM, Andrew Pogrebennyk
 wrote:
> The papers talk about transport protocol for signaling, not media/RTP.
> I didn't hear of anyone who does RTP over TCP neither. I doubt even that
> the performance is a primary reason behind that, for media over TCP the
> client link must be virtually packet-loss free (due to TCP
> retransmissions), while over UDP sometimes up to 5% packet loss can be
> tolerated. TCP was not designed as transport for real-time media :-)
>
> On 06/08/2012 12:35 AM, Yang Hong wrote:
>> Hello.
>>
>> SIP over TCP would reduce server performance significantly when compared
>> with SIP Over UDP.
>>
>> Please read the following two papers. Combining RTP proxy with SIP over
>> TCP would degrade SIP server performance even worse.
>> ---
>> http://www.cs.columbia.edu/~hgs/papers/Shen1008_TLS.pdf
>>
>> The Impact of TLS on SIP Server Performance
>>
>> "Securing SIP is accomplished by using TLS instead of UDP as the
>> transport protocol. We show that using TLS can reduce performance by up
>> to a factor of 17 compared to the typical case of SIP-over-UDP."
>>
>> "Network operators considering deploying SIP over TLS will need to
>> consider the extra resources required to provide the same service
>> quality as would be the case with UDP."
>> ---
>> http://www.cs.columbia.edu/~hgs/nossdav/2007/files/file-27-session5-paper1-nahum.pdf
>>
>> Evaluating SIP Proxy Server Performance
>>
>> "The next most signi cant performance feature is which transport
>> protocol is used, TCP or UDP. Using TCP can reduce performance anywhere
>> from 43 percent (the stateful proxying scenario with authentication) to
>> 65 percent (state-less proxying without authentication).
>> ---
>>
>> Best regards,
>>
>> Yang
>>> Date: Thu, 7 Jun 2012 13:36:39 +0200
>>> From: mico...@gmail.com
>>> To: sr-users@lists.sip-router.org
>>> Subject: Re: [SR-Users] Looking for RTP Proxy in TCP
>>>
>>> Hello,
>>>
>>> On 6/4/12 7:14 PM, Austin Einter wrote:
>>> > Hi All
>>> > Now I am using Kamailio 3.1.5 and RTP proxy 1.1.
>>> > Looks both are compatible and working fine.
>>> >
>>> > The RTP Proxy basically sends/receives RTP packets over UDP.
>>> > Is there any RTP Proxy available that does send/receive of RTP packets
>>> > over TCP and also should be compatible with Kamailio 3.1.5.
>>> >
>>> > If you have any information in this regard, kindly share.
>>> RTP itself is specified over UDP, also I am not aware of any SIP phone
>>> doing RTP over TCP.
>>>
>>> MSRP is a mechanism specified for sending message streams over TCP, we
>>> have a module for that, but I guess is not exactly what you are
>> looking for:
>>>
>>> http://kamailio.org/docs/modules/devel/modules/msrp.html
>>>
>>> Maybe based on it you can implement one that fits your needs.
>>>
>>> Cheers,
>>> Daniel
>>>
>
> ___
> 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


These things are wild attempt to escape some telcos blocking UDP
packets suspecting VOIP for pushing their own IP telephony product.
Sometimes even encrypted media is blocked because their DPI use some
heuristic methods for detecting media packet. Like payload size in
different codecs can give a clue about the packet. Although This bites
in the a** of whole "net neutrality" campaign, They don't bother.

These practices force VOIP providers for "obsfucation" techniques for
escaping the DPI. Interesting thing is i know of some situation when
they blocked VPN because people were using it to make VOIP calls. Now
you can use VPN for other purposes!

Some telco even went to lengths to block UDP "streams" by calculating
some "threshold" bandwidth consumption.

The DPI vendors are making a business case, but it all comes at price
of making Provider inventing non standard schemes to do ordinary
stuffs.

Media over TCP is the worst idea in the history of worst ideas. But
sometimes you have no choice.

I guess big web companies should push these telcos who are afraid of
losing their traditional TDM market share and going at lengths to stop
media over IP.

Cheers.

-- 
-aft

___
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] Limiting calls from users in prepaid scenerio

2012-06-07 Thread Aft nix
On Thu, Jun 7, 2012 at 5:24 PM, Daniel-Constantin Mierla
 wrote:
> Hello,
>
>
> On 6/5/12 11:17 AM, Aft nix wrote:
>>
>> -BEGIN PGP SIGNED MESSAGE-
>> Hash: SHA1
>>
>> Hi all,
>>
>> We are thinking about launching a different "usage policy". The usage
>> policy will be prepaid in some sense.
>> but instead of limiting "number of minutes" we are thinking about
>> limiting "number of calls".
>>
>> That means if you pay this X amount of doller, you can make Y amount
>> of calls. calls can last whatever the
>> user wants given that its under 1 hr.
>>
>> I've seen how to limit concurrent calls using SER, but the usage i
>> have described, is not seen by me.
>>
>> So please help me out with this thing.
>>
>> My initial understanding about how it can be done :
>>
>> 1) when a dialog is confirmed with ACK(we have both callid, from tag,
>> to tag), we can make an entry to the database
>> by increasing "number of calls" field by one.
>>
>> 2) A field in database will be used as flag for usage limit. when
>> "number of calls" exceeds the usage limit, it will flag it
>> as "finished usage limit".
>>
>> 3) when a INVITE arrives, a check will be made with $fU against DB.
>>
>> With this framework in mind,  I have read "db_mysql" module. And to my
>> surprise, no direct the database
>> functions are not exported to the cfg.
>>
>> I don't know if any module in kamailio exports mysql_queury() to cfg,
>> which i need for my purpose.
>>
>> And may be there is some built in module which provides a higher level
>> layer which will enable myself achieving
>> my goal.
>>
>> If in the end i need "exported" mysql functions, then i can develop it
>> myself.
>>
>> So which way i should go?
>
> see the sqlops module that provides sql query interfaces to various database
> systems, including mysql.
> http://kamailio.org/docs/modules/stable/modules_k/sqlops.html
>

Thank you for the link. I will post updates on how its going about the
implementation.

Cheers,

> Cheers,
> Daniel
>
> --
> Daniel-Constantin Mierla - http://www.asipto.com
> http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
> Kamailio Advanced Training, Seattle, USA, Sep 23-26, 2012 -
> http://asipto.com/u/katu
> Kamailio Practical Workshop, Netherlands, Sep 10-12, 2012 -
> http://asipto.com/u/kpw
>
>
>



-- 
-aft

___
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] Limiting calls from users in prepaid scenerio

2012-06-05 Thread Aft nix
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi all,

We are thinking about launching a different "usage policy". The usage
policy will be prepaid in some sense.
but instead of limiting "number of minutes" we are thinking about
limiting "number of calls".

That means if you pay this X amount of doller, you can make Y amount
of calls. calls can last whatever the
user wants given that its under 1 hr.

I've seen how to limit concurrent calls using SER, but the usage i
have described, is not seen by me.

So please help me out with this thing.

My initial understanding about how it can be done :

1) when a dialog is confirmed with ACK(we have both callid, from tag,
to tag), we can make an entry to the database
by increasing "number of calls" field by one.

2) A field in database will be used as flag for usage limit. when
"number of calls" exceeds the usage limit, it will flag it
as "finished usage limit".

3) when a INVITE arrives, a check will be made with $fU against DB.

With this framework in mind,  I have read "db_mysql" module. And to my
surprise, no direct the database
functions are not exported to the cfg.

I don't know if any module in kamailio exports mysql_queury() to cfg,
which i need for my purpose.

And may be there is some built in module which provides a higher level
layer which will enable myself achieving
my goal.

If in the end i need "exported" mysql functions, then i can develop it myself.

So which way i should go?

Thanks in advance

- --
- -aft

-BEGIN PGP SIGNATURE-
Version: OpenPGP.js v0.1
Comment: http://openpgpjs.org

wsBcBAEBAgAQBQJPzc6dCRCJVJ6A/SK8awAARAkH/R5rqfiTPqBP+zZr8rgM
0JE42l9jxYq5OteD13U4CvcrUklXZlgDf2jwr1F7ndd1rlV3yKXAT2u61Bz5
LwNneRZydl3xnPmt2+TV6Qkcgy8RXgyRMntP9iLeQOXWJNW7D637h7tLL11d
O50s86ofgJT+dfTICbomNZjLZRr1DvYOdcByG3LHcYx033G6bIFlMqJ0ZO+G
cBdgtJcLrwo6iPn8Gv+5aJDy2kRUphrF7cVCzFzLPnNVZpvXNNcv7LB9bkUH
cClcLDVAbsdw0TPd9Z6DNJSxFlHy2uzwNWB9mhpVJD1toT8Geb4iCOi+ZG8P
WT5fgNwSoZlEm0BBBHwMUdk=
=fcdD
-END PGP SIGNATURE-

___
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] [NOT Solved]Creating RURI ($ru) from Contact ($ct)

2012-05-31 Thread Aft nix
Hi,

My problem is now fixed. The last trick was adding a
is_direction("upstream") in route[WITHINDLG] for choosing which BYE
message i need to modify.

Thanks everyone for your help.

Cheers.


-- 
-aft

___
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] [NOT Solved]Creating RURI ($ru) from Contact ($ct)

2012-05-30 Thread Aft nix
On Wed, May 30, 2012 at 4:37 PM, Andrew Pogrebennyk
 wrote:
> Hi,
>
> On 05/30/2012 12:22 PM, Aft nix wrote:
>> So i'm interested if RFC 3261 provides any mechanism by which we can
>> differentiate a BYE whether its from "caller" or "callee".
>
> Check out is_direction() function:
> http://www.kamailio.org/docs/modules/3.2.x/modules_k/rr.html#id2527009

Hi Andrew,

Thank you for the reply. I will test and post updates.
Cheers.

>
> ___
> 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



-- 
-aft

___
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] [NOT Solved]Creating RURI ($ru) from Contact ($ct)

2012-05-30 Thread Aft nix
On Tue, May 29, 2012 at 3:03 PM, Aft nix  wrote:
> On Tue, May 29, 2012 at 2:57 PM, Daniel-Constantin Mierla
>  wrote:
>> Hello,
>>
>> in kamailio, if you want to apply immediately the changes done to the sip
>> request, then use msg_apply_changes() from textopsx module. Then you can
>> access it with the contact PV.
>>
>> Also, the pvs for source ip and port are $si and $sp -- see the PV cookbook
>> in the wiki site at kamailio.org
>>
>> Cheers,
>> Daniel
>>
>
> Hi Daniel,
>
> Thank you for quick reply. I will test both and post updates.
> Cheers.
>

Hi Daniel

The problem which i was facing is solved by adding a call
"msg_apply_changes()" after route[NATDETECT].

But i'm facing a new problem. As its the "callee" who always generates
the malformed "BYE", so i need to differentiate if the BYE is from
caller or callee.

It can be done with hardcoded IP address of my gateway , but it does
not seems OK to me.

So i'm interested if RFC 3261 provides any mechanism by which we can
differentiate a BYE whether its from "caller" or "callee".

Cheers.


>>
>> On 5/29/12 10:39 AM, Aft nix wrote:
>>>
>>> Hi,
>>>
>>> Sorry guyz, the problem is not solved as i thought. The script worked
>>> perfectly in my lab where i did'nt know that the wifi router is a so
>>> called "sip friendly router". It fixes broken contacts so it worked
>>> perfectly in my lab.
>>>
>>> But in my production server it did'nt work.
>>>
>>> Problem is when i put "contact" in hash table entry like following :
>>>
>>> sht(a=>$ci) = $ct;
>>>
>>> it puts the broken contact adress( I mean contact address with private
>>> IP) into the hashtable.
>>>
>>> At first i put my code after the execution of "fix_nated_contact()".
>>> But it did'nt work. Then i put a xlog() to print $ct. And to my
>>> surprise i saw that its printing the private IP instead of the public
>>> one. After searching through mailing list archives i came across this
>>> :
>>>
>>> http://lists.iptel.org/pipermail/serusers/2006-September/030511.html
>>>
>>> According to this although the contact is fixed with received IP and
>>> port, its not applied to the message buffer and kept in temporary
>>> storage. when the message is about to be sent over sockets this
>>> temporary storage is applied over the the original message buffer.
>>> pseudo variables like $ct will always reference to the original
>>> message, not the modified one after fix_nated_contact().
>>>
>>> So to populate my hashtable, i have to choices:
>>>
>>> 1. I can reference src_ip and src_port , put a ":" between them  like
>>> following :
>>>
>>> sht(a=>$ci) = $fU + src_ip + ":" + src_port (Please help with the
>>> correct syntax for string concatenation).
>>>
>>> 2. Or if possible i reference the changed contact from the temporary
>>> storage, and put this into my hashtable.
>>>
>>> Please direct me which way should i go.
>>>
>>> Cheers.
>>>
>>> On Mon, May 28, 2012 at 8:25 PM, Aft nix  wrote:
>>>>
>>>> Hi all,
>>>> I'm posting the script which worked. In future if anybody faces the
>>>> same problem can get a solution out of this.
>>>>
>>>> In request_route:
>>>>
>>>>  #!ifdef WITH_HASH
>>>>         if (is_method("INVITE") && !has_totag()){
>>>>                 xdbg ("Contact [$ct] with Callid [$ci]");
>>>>                 $sht(a=>$ci) = $ct;
>>>>         }
>>>>  #!endif
>>>>
>>>> in route[WITHINDLG]
>>>>
>>>> #!ifdef WITH_HASH
>>>>                                 xdbg ("ruri [$ru]");
>>>>                                 if ($(sht(a=>$ci){nameaddr.uri}) != $ru){
>>>>                                         xdbg ("hash table entry
>>>> [$sht(a=>$ci)]");
>>>>                                         $ru =
>>>> $(sht(a=>$ci){nameaddr.uri});
>>>>                                         sht_rm_name_re("ha=>$ci");
>>>>                                         xdbg ("rewriting ruri to [$ru]");
>>>>                                 }
>>>>  #!endif
>>>>
>>>>
>>>> Thanks everyone for the help. I'm marking this thread as solved.
>>>> --
>>>> -aft
>>>>
>>>>
>>>> --
>>>> -aft
>>>
>>>
>>>
>>
>> --
>> Daniel-Constantin Mierla - http://www.asipto.com
>> http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
>> Kamailio Advanced Training, Seattle, USA, Sep 23-26, 2012 -
>> http://asipto.com/u/katu
>>
>>
>>
>
>
>
> --
> -aft



-- 
-aft

___
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] [NOT Solved]Creating RURI ($ru) from Contact ($ct)

2012-05-29 Thread Aft nix
On Tue, May 29, 2012 at 2:57 PM, Daniel-Constantin Mierla
 wrote:
> Hello,
>
> in kamailio, if you want to apply immediately the changes done to the sip
> request, then use msg_apply_changes() from textopsx module. Then you can
> access it with the contact PV.
>
> Also, the pvs for source ip and port are $si and $sp -- see the PV cookbook
> in the wiki site at kamailio.org
>
> Cheers,
> Daniel
>

Hi Daniel,

Thank you for quick reply. I will test both and post updates.
Cheers.

>
> On 5/29/12 10:39 AM, Aft nix wrote:
>>
>> Hi,
>>
>> Sorry guyz, the problem is not solved as i thought. The script worked
>> perfectly in my lab where i did'nt know that the wifi router is a so
>> called "sip friendly router". It fixes broken contacts so it worked
>> perfectly in my lab.
>>
>> But in my production server it did'nt work.
>>
>> Problem is when i put "contact" in hash table entry like following :
>>
>> sht(a=>$ci) = $ct;
>>
>> it puts the broken contact adress( I mean contact address with private
>> IP) into the hashtable.
>>
>> At first i put my code after the execution of "fix_nated_contact()".
>> But it did'nt work. Then i put a xlog() to print $ct. And to my
>> surprise i saw that its printing the private IP instead of the public
>> one. After searching through mailing list archives i came across this
>> :
>>
>> http://lists.iptel.org/pipermail/serusers/2006-September/030511.html
>>
>> According to this although the contact is fixed with received IP and
>> port, its not applied to the message buffer and kept in temporary
>> storage. when the message is about to be sent over sockets this
>> temporary storage is applied over the the original message buffer.
>> pseudo variables like $ct will always reference to the original
>> message, not the modified one after fix_nated_contact().
>>
>> So to populate my hashtable, i have to choices:
>>
>> 1. I can reference src_ip and src_port , put a ":" between them  like
>> following :
>>
>> sht(a=>$ci) = $fU + src_ip + ":" + src_port (Please help with the
>> correct syntax for string concatenation).
>>
>> 2. Or if possible i reference the changed contact from the temporary
>> storage, and put this into my hashtable.
>>
>> Please direct me which way should i go.
>>
>> Cheers.
>>
>> On Mon, May 28, 2012 at 8:25 PM, Aft nix  wrote:
>>>
>>> Hi all,
>>> I'm posting the script which worked. In future if anybody faces the
>>> same problem can get a solution out of this.
>>>
>>> In request_route:
>>>
>>>  #!ifdef WITH_HASH
>>>         if (is_method("INVITE") && !has_totag()){
>>>                 xdbg ("Contact [$ct] with Callid [$ci]");
>>>                 $sht(a=>$ci) = $ct;
>>>         }
>>>  #!endif
>>>
>>> in route[WITHINDLG]
>>>
>>> #!ifdef WITH_HASH
>>>                                 xdbg ("ruri [$ru]");
>>>                                 if ($(sht(a=>$ci){nameaddr.uri}) != $ru){
>>>                                         xdbg ("hash table entry
>>> [$sht(a=>$ci)]");
>>>                                         $ru =
>>> $(sht(a=>$ci){nameaddr.uri});
>>>                                         sht_rm_name_re("ha=>$ci");
>>>                                         xdbg ("rewriting ruri to [$ru]");
>>>                                 }
>>>  #!endif
>>>
>>>
>>> Thanks everyone for the help. I'm marking this thread as solved.
>>> --
>>> -aft
>>>
>>>
>>> --
>>> -aft
>>
>>
>>
>
> --
> Daniel-Constantin Mierla - http://www.asipto.com
> http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
> Kamailio Advanced Training, Seattle, USA, Sep 23-26, 2012 -
> http://asipto.com/u/katu
>
>
>



-- 
-aft

___
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] [NOT Solved]Creating RURI ($ru) from Contact ($ct)

2012-05-29 Thread Aft nix
Hi,

Sorry guyz, the problem is not solved as i thought. The script worked
perfectly in my lab where i did'nt know that the wifi router is a so
called "sip friendly router". It fixes broken contacts so it worked
perfectly in my lab.

But in my production server it did'nt work.

Problem is when i put "contact" in hash table entry like following :

sht(a=>$ci) = $ct;

it puts the broken contact adress( I mean contact address with private
IP) into the hashtable.

At first i put my code after the execution of "fix_nated_contact()".
But it did'nt work. Then i put a xlog() to print $ct. And to my
surprise i saw that its printing the private IP instead of the public
one. After searching through mailing list archives i came across this
:

http://lists.iptel.org/pipermail/serusers/2006-September/030511.html

According to this although the contact is fixed with received IP and
port, its not applied to the message buffer and kept in temporary
storage. when the message is about to be sent over sockets this
temporary storage is applied over the the original message buffer.
pseudo variables like $ct will always reference to the original
message, not the modified one after fix_nated_contact().

So to populate my hashtable, i have to choices:

1. I can reference src_ip and src_port , put a ":" between them  like
following :

sht(a=>$ci) = $fU + src_ip + ":" + src_port (Please help with the
correct syntax for string concatenation).

2. Or if possible i reference the changed contact from the temporary
storage, and put this into my hashtable.

Please direct me which way should i go.

Cheers.

On Mon, May 28, 2012 at 8:25 PM, Aft nix  wrote:
> Hi all,
> I'm posting the script which worked. In future if anybody faces the
> same problem can get a solution out of this.
>
> In request_route:
>
>  #!ifdef WITH_HASH
>         if (is_method("INVITE") && !has_totag()){
>                 xdbg ("Contact [$ct] with Callid [$ci]");
>                 $sht(a=>$ci) = $ct;
>         }
>  #!endif
>
> in route[WITHINDLG]
>
> #!ifdef WITH_HASH
>                                 xdbg ("ruri [$ru]");
>                                 if ($(sht(a=>$ci){nameaddr.uri}) != $ru){
>                                         xdbg ("hash table entry
> [$sht(a=>$ci)]");
>                                         $ru = $(sht(a=>$ci){nameaddr.uri});
>                                         sht_rm_name_re("ha=>$ci");
>                                         xdbg ("rewriting ruri to [$ru]");
>                                 }
>  #!endif
>
>
> Thanks everyone for the help. I'm marking this thread as solved.
> --
> -aft
>
>
> --
> -aft



-- 
-aft

___
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] Fwd: [Solved]Creating RURI ($ru) from Contact ($ct)

2012-05-28 Thread Aft nix
Hi all,
I'm posting the script which worked. In future if anybody faces the
same problem can get a solution out of this.

In request_route:

 #!ifdef WITH_HASH
        if (is_method("INVITE") && !has_totag()){
                xdbg ("Contact [$ct] with Callid [$ci]");
                $sht(a=>$ci) = $ct;
        }
 #!endif

in route[WITHINDLG]

#!ifdef WITH_HASH
                                xdbg ("ruri [$ru]");
                                if ($(sht(a=>$ci){nameaddr.uri}) != $ru){
                                        xdbg ("hash table entry
[$sht(a=>$ci)]");
                                        $ru = $(sht(a=>$ci){nameaddr.uri});
                                        sht_rm_name_re("ha=>$ci");
                                        xdbg ("rewriting ruri to [$ru]");
                                }
 #!endif


Thanks everyone for the help. I'm marking this thread as solved.
--
-aft


-- 
-aft

___
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] Creating RURI ($ru) from Contact ($ct)

2012-05-28 Thread Aft nix
On Mon, May 28, 2012 at 4:52 PM, Daniel-Constantin Mierla
 wrote:
> Hello,
>
> On 5/27/12 12:46 AM, Aft nix wrote:
>>
>> [...]
>>
>> Hi Aleksandrov
>> Thanks for the reply.
>>
>> Yes my checks should be more specific.
>>
>> On the side how , i'm facing difficulties to print script variables
>> and hashtable entries.
>>
>> xdbg("my var [$var(temp)]")
>> xdbg("my hash entries [$sht(a=>$ci)"])
>>
>> Both statements shows parse errors. What's the correct syntax to print
>> script
>> variables and hash table entries?
>
> if you copy&paste the lines from your config, then the errors are:
> - missing ; at the end of lines
> - second xdbg has the double quotes before ], making it invalid syntax

Hi Daniel,
Thanks, other than the typo, its ok to print stuffs like this, then.

>
> Cheers,
> Daniel
>
> --
> Daniel-Constantin Mierla - http://www.asipto.com
> http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
> Kamailio Advanced Training, Seattle, USA, Sep 23-26, 2012 -
> http://asipto.com/u/katu
>
>
>



--
-aft


-- 
-aft

___
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] Creating RURI ($ru) from Contact ($ct)

2012-05-26 Thread Aft nix
On Sun, May 27, 2012 at 3:57 AM, Vitaliy Aleksandrov
 wrote:
> On 05/26/2012 05:39 PM, Aft nix wrote:
>
> Hi,
>
> I'm trying to create a ruri from contact header like following :
>
> In request route I've saved contact header in a hashtable using htable
> module.
> request_route{
>
> -
> -
> #!ifdef WITH_HASH
>  if (is_method("INVITE") && !has_totag()){
>  xdbg ("Contact [$ct] with Callid [$ci]");
>  $sht(a=>$ci) = $ct;
>  }
>  #!endif
>
> 
> }
>
> And in route[WITHINDLG]
>
> route[WITHINDLG] {
>
> ---
> ---
>  #!ifdef WITH_HASH
>  xdbg ("ruri [$ru]");
>  if ($sht(a=>$ci) != $ru){
>  $ru = ($sht(a=>$ci));
>  xdbg ("rewriting ruri to [$ru]");
>  }
>  #!endif
>
> But it log shows that its unable to parse the uri :
>
> [4039]: DEBUG:  [parser/parse_uri.c:1277]: parse_uri: bad uri,
> state 0 parsed: < (4) / <> (29)
> : DEBUG:  [parser/parse_uri.c:1327]: ERROR: parse_sip_msg_uri:
> bad uri <>
> [4039]: ERROR: pv [pv_core.c:232]: failed to parse the R-URI
> [4039]: DEBUG: 

[SR-Users] Creating RURI ($ru) from Contact ($ct)

2012-05-26 Thread Aft nix
Hi,

I'm trying to create a ruri from contact header like following :

In request route I've saved contact header in a hashtable using htable module.
request_route{

-
-
#!ifdef WITH_HASH
 if (is_method("INVITE") && !has_totag()){
 xdbg ("Contact [$ct] with Callid [$ci]");
 $sht(a=>$ci) = $ct;
 }
 #!endif


}

And in route[WITHINDLG]

route[WITHINDLG] {

---
---
 #!ifdef WITH_HASH
 xdbg ("ruri [$ru]");
 if ($sht(a=>$ci) != $ru){
 $ru = ($sht(a=>$ci));
 xdbg ("rewriting ruri to [$ru]");
 }
 #!endif

But it log shows that its unable to parse the uri :

[4039]: DEBUG:  [parser/parse_uri.c:1277]: parse_uri: bad uri,
state 0 parsed: < (4) / <> (29)
: DEBUG:  [parser/parse_uri.c:1327]: ERROR: parse_sip_msg_uri:
bad uri <>
[4039]: ERROR: pv [pv_core.c:232]: failed to parse the R-URI
[4039]: DEBUG: 

Re: [SR-Users] kamailioi is not relaying BYE message to UAC

2012-05-25 Thread Aft nix
On Thu, May 24, 2012 at 6:41 PM, Vitaliy Aleksandrov
 wrote:
>
> Thanks for the reply.
>
> We have already came to the same conclusion by some testing in our
> lab. It seems its a bug in provider which not constructing BYE message
> properly.
>
> But i'm interested in if its possible to detect the fault in this BYE
> and construct a new one and then relay it to the UAC.
>
> I mean can i do this :
>
> contact-header = INVITE's contact-header
> if (contact-header != BYE's ruri)
> {
>   construct BYE message with contact header
>   t_relay()
>  }
>
> Cheers
> aft
>
>
> Hi aft,
>
> I think to do what you want you can save Contact field + callid pair taken
> from the INVITEs that comes from your side.
> Then when BYE comes from such provider you should find a correct Contact for
> that call-id and if it exists and not equal to R-URI you can rewrite it.
>
> For example to write to R-URI value from $var(correct_ruri) you can use $ru
> = $var(correct_ruri); statement.
>
> What about a place where contact can be saved, i think htable will be the
> nice one.
> Please pay attention to "autoexpire" parameter of htable module. You should
> take care about the staled records to avoid memory usage problems.
>
> Cheers,
> Vitaliy Aleksandrov
>

Hi Aleksandrov,

Thanks for the suggestion. I was playing with the dialog module to
achieve the same thing. But your suggestion seems more lightweight
ans sensible than invoking full blown dialog functionality most of
which i do not need for my purpose.

I will try your approach and post the update.

In the mean time, my dialog module approach is not working either as expected.

I used dialog module like following :

 #!ifdef WITH_DLG
 modparam("dialog", "enable_stats",0)
 modparam("dialog", "dlg_flag",DLG_FLAG )
 modparam("dialog", "default_timeout",100)
 #!endif


request_route {
 # per request initial checks
 route(REQINIT);
 #!ifdef WITH_DLG
 if (is_method("INVITE") && !has_totag()){
 $dlg_ctx(timeout_route) = 12;
 $dlg_ctx(timeout_bye) = 1;
 }
 dlg_manage();
 #!endif

...
...
 route[WITHINDLG] {

 if (has_totag()) {
 # sequential request withing a dialog should
 # take the path determined by record-routing
 #!ifdef WITH_DLG
 if (is_method("BYE")){
 dlg_get ("$ci","$ft","$tt");
 dlg_bye ("all");
 return;
 }
 #!endif
 if (loose_route()) {
 if (is_method("BYE")) {
 setflag(FLT_ACC); # do accounting ...
 setflag(FLT_ACCFAILED); # ... even if
tansaction fails



#!ifdef WITH_DLG
 route[12]{
 dlg_bye("all");
 xdbg("bye everyone");
 }
 #!endif


I'm not worried about timeout right now. This does not work. When bye
message arrives i can see the following in kamailio log :

[4016]: DEBUG:  [parser/msg_parser.c:624]: SIP Request:
[4016]: DEBUG:  [parser/msg_parser.c:626]:  method:  
[4016]: DEBUG:  [parser/msg_parser.c:628]:  uri:

[4016]: DEBUG:  [parser/msg_parser.c:630]:  version: 
[4016]: DEBUG:  [parser/parse_via.c:1289]: Found param type 232,
 = ; state=16
[4016]: DEBUG:  [parser/parse_via.c:2564]: end of header reached, state=5
[4016]: DEBUG:  [parser/msg_parser.c:511]: parse_headers: Via
found, flags=2
[4016]: DEBUG:  [parser/msg_parser.c:513]: parse_headers: this
is the first via
--
[4016]: DEBUG:  [parser/msg_parser.c:190]: DEBUG: to body
["1010"]
[4016]: DEBUG:  [parser/msg_parser.c:168]: get_hdr_field: cseq
: <3> 
[4016]: DEBUG:  [parser/msg_parser.c:202]: DEBUG: get_hdr_body :
content_length=0
[4016]: DEBUG:  [parser/msg_parser.c:104]: found end of header
[4016]: DEBUG:  [parser/parse_to.c:178]: DEBUG: add_param: tag=e06d7c6a
[4016]: DEBUG:  [parser/parse_to.c:802]: end of header reached, state=29
[4016]: DEBUG: sanity [mod_sanity.c:255]: sanity checks result: 1
[4016]: DEBUG: dialog [dlg_hash.c:652]: no dialog
callid='OTljOWU1NTU1NWE1ZmEzZGE4NDNhNGQyNDE2MmUzZDc.' found
[4016]: DEBUG: dialog [dlg_hash.c:683]: no dialog
callid='OTljOWU1NTU1NWE1ZmEzZGE4NDNhNGQyNDE2MmUzZDc.' found
[4016]: DEBUG: dialog [dlg_handlers.c:1166]: Callid
'OTljOWU1NTU1NWE1ZmEzZGE4NDNhNGQyNDE2MmUzZDc.' not found
.
.
[4016]: DEBUG: dialog [dlg_hash.c:652]: no dialog
callid='OTljOWU1NTU1NWE1ZmEzZGE4NDNhNGQyNDE2MmUzZDc.' found
[4016]: DEBUG: dialog [dlg_hash.c:683]: no dialog
callid='OTljOWU1NTU1NWE1ZmEzZGE4NDNhNGQyNDE2MmUzZDc.' found


After some inspection i found out this :

[4017]: DEBUG: dialog [dlg_hash.c:646]: dialog
callid='OTljOWU1NTU1NWE1ZmEzZGE4NDNhNGQyNDE2MmUzZDc.' found  on entry
321, dir=1
[401

[SR-Users] Detect and Correct wrong BYEs from proxy.

2012-05-22 Thread Aft nix
Hi all,

When record routing is enabled, that means, the proxy will act statefull mode,
There has to be a mechanism for storing dialogue states.
Like the location of the peers (Contact header filed of initial INVITE
and 200 OK).

And i suspect these states are stored in variables which has a lifespan same as
the dialogue itself. I guess important variables (Contact header,
local and remote tag etc)
are exported to configuration file also.

I'm aware of the dialogue module  but i'm kind of convinced there has
to be a simpler way
for achieving my goal.

Our Sip gateway provider sending a wrong BYE when PSTN side phone hangs up.
Instead of using Contact Header of the initial INVITE, its sending
BYEs with its IP as ruri.
So the BYE message is looping between proxy and gateway instead of
relayed to UAC.

What i'm trying to achieve is following  :

route[RELAY]
{
  if(is_method('BYE'))
  {
 
  t_relay()
  }
}



-- 
-aft

___
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] kamailioi is not relaying BYE message to UAC

2012-05-22 Thread Aft nix
On Tue, May 22, 2012 at 5:41 PM, Daniel-Constantin Mierla
 wrote:
> Hello,
>
> is 205.164.40.74 the IP address of VoipSwitch? If yes, then the BYE is
> constructed to be sent back to it, because the r-uri has this IP address.
>
> R-uri in the BYE must have the IP address and port of UAC1.
>
> If you give here all the sip trace for such call (from INVITE to the BYE,
> taken with ngrep for example, on kamailio host), we may be able to spot
> where the mistake is made. R-URI should be constructed from Contact header
> of INVITE or 200ok.
>
> Cheers,
> Daniel
>

Hi Daniel,

Thanks for the reply.

We have already came to the same conclusion by some testing in our
lab. It seems its a bug in provider which not constructing BYE message
properly.

But i'm interested in if its possible to detect the fault in this BYE
and construct a new one and then relay it to the UAC.

I mean can i do this :

contact-header = INVITE's contact-header
if (contact-header != BYE's ruri)
{
  construct BYE message with contact header
  t_relay()
 }

Cheers
aft

>
> On 5/21/12 9:21 PM, Arif Hossain wrote:
>>
>> Hi,
>>
>> We have the following network architecture :
>>
>>
>> UAC1->kamailio>VoipSwitch->PSTN-->Phone1
>> (Sip Client)
>>
>> Now UAC1 calls Phone1 and everything is ok. If UAC1 hangs up session
>> is terminated cleanly.
>> But if Phone1 hangs up the BYE message which  comes to kamailio and
>> goes back to VoipSwitch
>> instead of relayed to UAC1 .
>>
>> So The session becomes a zombie one, And UAC1 unfortunately gets
>> billed for a session
>> which should be terminated.
>>
>> Following is the Call flow as seen from VoipSwitch :
>>
>>  |                       |
>> |         |                                              | > IP>     |
>> |134.856  |         INVITE SDP
>> |         |(7890)   -->  (5060)   |
>> |134.858  |         407 Proxy Authentication Required
>> |         |(7890)   <--  (5060)   |
>> |134.902  |         ACK       |
>> |         |(7890)   -->  (5060)   |
>> |135.408  |         INVITE SDP
>> |         |(7890)   -->  (5060)   |
>> |135.414  |         100 Trying|
>> |         |(7890)   <--  (5060)   |
>> |140.121  |         183 Session Progress SDP
>> |         |(7890)   <--  (5060)   |
>> |140.184  |         RTP (g729)                    |
>> |         |(61868)  <--  (5136)   |
>> |141.295  |         RTP (g729)                    |
>> |         |(61868)  -->  (5136)   |
>> |153.701  |         200 OK SDP
>> |         |(7890)   <--  (5060)   |
>> |153.713  |         RTP (g729)                    |
>> |         |(61868)  -->  (5136)   |
>> |154.126  |         ACK       |
>> |         |(7890)   -->  (5060)   |
>> |159.988  |         BYE       |
>> |         |(7890)   <--  (5060)   |
>> |160.031  |         BYE       |
>> |         |(7890)   -->  (5060)   |
>> |160.478  |         BYE       |
>> |         |(7890)   -->  (5060)   |
>> |161.412  |         BYE       |
>>
>> |         |(7890)   -->  (5060)   |
>> |181.952  |         BYE       |
>> |         |(7890)   -->  (5060)   |
>> |185.687  |         BYE       |
>> |         |(7890)   -->  (5060)   |
>> |188.018  |         408 Request Timeout
>> |         |(7890)   -->  (5060)   |
>>
>>
>>
>> Sip Traces :
>>
>> kamailio-->VoipSwitch
>>
>> I'm posting only the offending BYE msg instead of full trace , because
>> of the mail will become difficult to read . If more traces needed, i
>> can post it.
>>
>> The following BYE message is sent by VoipSwitch:
>>
>> BYE sip:ipphone@205.164.40.74 SIP/2.0
>> Route: 
>> CSeq: 2 BYE
>> Via: SIP/2.0/UDP 205.164.40.74:5060
>> From: sip:008801673345531@205.164.40.74;tag=100528120745985872655137
>> Call-ID: IqBknV19AuxW0jk.8BjuE4hyx93Ws9qS
>> To: "123456"
>> ;tag=Zopl5lj5YiqyaSR5Le3QnfoR-G0NZAGG
>> Content-Length: 0
>>
>> Kamailio instead of relaying the message, sends a BYE message towards
>> VoipSwitch:
>>
>> BYE sip:ipphone@205.164.40.74 SIP/2.0
>> Max-Forwards: 10
>> CSeq: 2 BYE
>> Via: SIP/2.0/UDP 108.166.195.189:7890;branch=z9hG4bK4b2b.5d893e95.0
>> Via: SIP/2.0/UDP 205.164.40.74:5060;rport=5060
>> From: sip:008801673345531@205.164.40.74;tag=100528120745985872655137
>> Call-ID: IqBknV19AuxW0jk.8BjuE4hyx93Ws9qS
>> To: "123456"
>> ;tag=Zopl5lj5YiqyaSR5Le3QnfoR-G0NZAGG
>> Content-Length: 0
>>
>> When the first BYE message comes from VoipSwitch , kamailio does the
>> following :
>> May 20 02:25:53 VOS20-108 /usr/local/sbin/kamailio[16442]: DEBUG:
>>  [receive.c:289]: receive_msg: cleaning up
>> May 20 02:25:53 VOS20-108 /usr/local/sbin/kamailio[16442]: DEBUG:
>>  [parser/sdp/sdp.c:751]: _sdp = 0x831bf10
>> May 20 02:25:53 VOS20-108 /usr/local/sbin/kamailio[16442]: DEBUG:
>>  [parser/sdp/sdp.c:75