Re: [SR-Users] How to use regular expression for $var ?

2012-07-16 Thread Daniel-Constantin Mierla

Hello,

On 7/16/12 4:32 PM, Gary Chen wrote:


Kamailio 3.3.0

I have a variable  $var(s:dst). It can store either a number or IP.

How do I check to determine whether it is a number of IP?

I tried the following and it did not work:

If ($var(s:dst) =~ "^\d+\.\d+\.\d+\.\d+$"){
It is a IP.
}else{
It is a Number
}

for this particular case, you better use functions from ipops module:

http://kamailio.org/docs/modules/stable/modules/ipops.html#id2536192

Using regular expressions with variables is correct as you tried, not 
sure the \d is taken on consideration, you may try \\d or what I usually 
use is [0-9] instead of \d.


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

___
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] Does kamailio has some headers optimizing mechanism ?

2012-07-16 Thread Daniel-Constantin Mierla

Hello,

On 7/16/12 8:19 PM, Konstantin M. wrote:

Hello,

I have a following part of code:


if (route(Test_TO_Dialer))
{
append_hf("P-hint: Loose Routing. Re-INVITE Detected: Uplink 
--> Originator.\r\n");
xlog("** loose_route(): Detected Re-INVITE from 
Uplink! **\n");


setflag(1); # do accounting

append_hf("P-hint: SDP was mangled\r\n");
python_exec("ParseSDP", $mb);

fix_nated_contact();
setbflag(6);# Mark as NATed

rtpproxy_manage();
dlg_manage();
}

But in a logs I see:

P-hint: Loose Routing. Re-INVITE Detected: Uplink --> Originator., SDP 
was mangled


but it should be like this:
P-hint: Loose Routing. Re-INVITE Detected: Uplink --> Originator.
P-hint: SDP was mangled

Does kamailio has some headers optimizing mechanism ?

# ./kamailio -V
version: kamailio 3.2.3 (x86_64/linux)
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, DBG_QM_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: unknown
compiled on 15:37:11 Jun  9 2012 with gcc 4.4.3


there is no such mechanism to join headers with same name added by 
append_hf(). Can you provide a ngrep trace of such situation?


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


___
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] How to use Kamailio

2012-07-16 Thread piyush singhai
Hello

I am very new in opensip.
i am trying to install kamailio and freeswitch...kamailio is running
fine...but i donot know how kamailio will communicate to my local sip
server.

kamctl start and stop ...starting and stopping the kamailio.

i have installed kamalio from

http://www.kamailio.org/dokuwiki/doku.php/install:kamailio-3.1.x-from-git

--Piyush
___
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] Does kamailio has some headers optimizing mechanism ?

2012-07-16 Thread Konstantin M.
Hello,

I have a following part of code:


if (route(Test_TO_Dialer))
{
append_hf("P-hint: Loose Routing. Re-INVITE Detected: Uplink -->
Originator.\r\n");
xlog("** loose_route(): Detected Re-INVITE from Uplink!
**\n");

setflag(1); # do accounting

append_hf("P-hint: SDP was mangled\r\n");
python_exec("ParseSDP", $mb);

fix_nated_contact();
setbflag(6);# Mark as NATed

rtpproxy_manage();
dlg_manage();
}

But in a logs I see:

P-hint: Loose Routing. Re-INVITE Detected: Uplink --> Originator., SDP was
mangled

but it should be like this:
P-hint: Loose Routing. Re-INVITE Detected: Uplink --> Originator.
P-hint: SDP was mangled

Does kamailio has some headers optimizing mechanism ?

# ./kamailio -V
version: kamailio 3.2.3 (x86_64/linux)
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,
DBG_QM_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: unknown
compiled on 15:37:11 Jun  9 2012 with gcc 4.4.3
___
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] How to use regular expression for $var ?

2012-07-16 Thread Brandon Armstead
Gary,

  Please elaborate on "did not work".  Also have you logged the actual value of 
this var before the if/else statement?

Sent from my iPhone

On Jul 16, 2012, at 7:32 AM, Gary Chen  wrote:

> Kamailio 3.3.0
>  
> I have a variable  $var(s:dst). It can store either a number or IP.
> How do I check to determine whether it is a number of IP?
> I tried the following and it did not work:
> If ($var(s:dst) =~ “^\d+\.\d+\.\d+\.\d+$”){
> It is a IP.
> }else{
> It is a Number
> }
>  
>  
> Thanks
>  
> Gary
>  
>  
> ___
> 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


Re: [SR-Users] [sr-dev] kamailio core at qm_status

2012-07-16 Thread Jijo
Thanks.. It is not easy to upgrade as it is happening at customer system.
Is there any change occurred for this issue.I looked at it, but didn't see
anything in q_malloc.c/qm_status()


On Mon, Jul 16, 2012 at 11:12 AM, Jon Bonilla  wrote:

> El Mon, 16 Jul 2012 10:27:42 -0400
> Jijo  escribió:
>
> > Hi All,
> >
> > I'm observing a core intermittently at "qm_status (qm=0x786cd000) at
> > mem/q_malloc.c:763" for kamailio version 3.1.0
> >
>
> I'd say that you're using a very old version. You should update your
> branch to
> 3.1.6 or upgrade to a newer branch.
>
>
> ___
> sr-dev mailing list
> sr-...@lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
>
___
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] [sr-dev] kamailio core at qm_status

2012-07-16 Thread Manwe
El Mon, 16 Jul 2012 10:27:42 -0400
Jijo  escribió:

> Hi All,
> 
> I'm observing a core intermittently at "qm_status (qm=0x786cd000) at
> mem/q_malloc.c:763" for kamailio version 3.1.0
>

I'd say that you're using a very old version. You should update your branch to
3.1.6 or upgrade to a newer branch.


___
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] How to use regular expression for $var ?

2012-07-16 Thread Gary Chen
Kamailio 3.3.0

I have a variable  $var(s:dst). It can store either a number or IP.
How do I check to determine whether it is a number of IP?
I tried the following and it did not work:

If ($var(s:dst) =~ "^\d+\.\d+\.\d+\.\d+$"){

It is a IP.

}else{

It is a Number

}





Thanks



Gary




___
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 core at qm_status

2012-07-16 Thread Jijo
Hi All,

I'm observing a core intermittently at "qm_status (qm=0x786cd000) at
mem/q_malloc.c:763" for kamailio version 3.1.0

looking at the backtrace this is occurring while doing a tcp buffer
overrun. Please have a look and let me know if anyone observed this issue
or how can we debug it.


Please find the backtrace and kamailio version


osbprod-V2R0:~ # /usr/sbin/kamailio -V
version: kamailio 3.1.0 (i386/linux) 21a375
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,
DBG_QM_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, PKG_SIZE 15MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: 21a375
compiled on 12:38:44 Apr 26 2012 with gcc 4.5.0



#0  qm_status (qm=0x786cd000) at mem/q_malloc.c:763

#1  0x0819c0f3 in qm_debug_frag (qm=0x786cd000, f=) at
mem/q_malloc.c:167

#2  0x0819c352 in qm_free (qm=0x786cd000, p=0x7a6cb6ac, file=0x821cce2
": tcp_main.c", func=0x822285f "wbufq_run", line=880) at
mem/q_malloc.c:457

#3  0x0815f686 in wbufq_run (tcpconn=0x7a1a7548, ev=4, fd_i=-1) at
tcp_main.c:880

#4  handle_tcpconn_ev (tcpconn=0x7a1a7548, ev=4, fd_i=-1) at tcp_main.c:4141

#5  0x08169bf2 in io_wait_loop_epoll () at io_wait.h:1092

#6  tcp_main_loop () at tcp_main.c:4606

#7  0x080b0404 in main_loop () at main.c:1655

#8  0x080b1f84 in main (argc=9, argv=0xbfb4c9f4) at main.c:2446

(gdb) l

758 LOG_(DEFAULT_FACILITY, memlog, "qm_status: ",

759 "dumping free list stats :\n");

760 for(h=0,i=0;hfree_hash[h].head.u.nxt_free,j=0;

763 f!=&(qm->free_hash[h].head);
f=f->u.nxt_free, i++, j++){

764 if (!FRAG_WAS_USED(f)){

765 unused++;

766 #ifdef DBG_QM_MALLOC

767 LOG_(DEFAULT_FACILITY,
memlog, "qm_status: ",
___
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] How to use Kamailio

2012-07-16 Thread Stoyan Mihaylov
It depends what you want. You can forward calls to your local sip server,
you can accept calls from your local sip server.
But you need to know what kind of "discussion" you expect between your
local sip server and Kamailio.

On Mon, Jul 16, 2012 at 2:07 PM, piyush singhai <
piyush.sing...@eng.knowlarity.com> wrote:

>
> Hello
>
> I am very new in opensip.
> i am trying to install kamailio and freeswitch...kamailio is running
> fine...but i donot know how kamailio will communicate to my local sip
> server.
>
> kamctl start and stop ...starting and stopping the kamailio.
>
> i have installed kamalio from
>
> http://www.kamailio.org/dokuwiki/doku.php/install:kamailio-3.1.x-from-git
>
> --Piyush
>
>
> ___
> 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] How to use Kamailio

2012-07-16 Thread piyush singhai
Hello

I am very new in opensip.
i am trying to install kamailio and freeswitch...kamailio is running
fine...but i donot know how kamailio will communicate to my local sip
server.

kamctl start and stop ...starting and stopping the kamailio.

i have installed kamalio from

http://www.kamailio.org/dokuwiki/doku.php/install:kamailio-3.1.x-from-git

--Piyush
___
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] planning release of v3.2.4

2012-07-16 Thread Daniel-Constantin Mierla

Hello,

later this week (like Thursday) I am considering packaging v3.2.4 from 
the latest git branch 3.2. If anyone has patches to push it there, 
please do it asap in case you want them in this release.


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


___
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