[SR-Users] lcr module: strip and tag

2011-04-27 Thread Alida - Danilo SMALDONE
Hello,

I've some understanding problem on lcr module.

I've this route

 

route[LCR] {

xlog(L_INFO, ENTRO IN ROUTE LCR
** \n);

if (!load_gws(1)) {

sl_send_reply(503, Unable to load gateways);

exit;

} else {

$var(i) = 0;

while(is_avp_set($(avp(i:709)[$var(i)]))) {

xlog(L_INFO,loading
gw_uri_avp[$var(i)]='$(avp(i:709)[$var(i)])'\n);

$var(i) = $var(i) + 1;

avp_print();

};

if(is_avp_set($avp(i:709))) {

xlog(L_INFO, Trying gateway '$avp(i:709)'\n);

} else {

xlog(L_INFO, No More Gateways \n);

};

# try the first matched gateway

if (next_gw()) {

xlog(L_INFO,ruri_user_avp='$avp(i:500)'\n);

xlog(L_INFO,test ruri_avp_mod='$tu'\n);

 
#xlog(L_INFO,
\n);

avp_print();

   # Route to failure for failover

   #t_on_failure(2);

 route(RELAY);

} else {

sl_send_reply(503,No available gateways);

exit;

};

};

exit;

}

 

 

And this is what I get:

 

Apr 27 15:44:44 localhost kamailio[7827]: INFO: script: ENTRO IN ROUTE LCR
**

Apr 27 15:44:44 localhost kamailio[7827]: INFO: script: loading
gw_uri_avp[0]='1|1|3|774|1171521237|172.16.10.200|5060||1|0'

Apr 27 15:44:44 localhost kamailio[7827]: INFO: avpops [avpops_impl.c:1328]:
p=0xb60dc5b0, flags=0x0112

Apr 27 15:44:44 localhost kamailio[7827]: INFO: avpops [avpops_impl.c:1334]:
id=709

Apr 27 15:44:44 localhost kamailio[7827]: INFO: avpops [avpops_impl.c:1340]:
val_str=1|1|3|774|1171521237|172.16.10.200|5060||1|0 / 45

Apr 27 15:44:44 localhost kamailio[7827]: INFO: script: Trying gateway
'1|1|3|774|1171521237|172.16.10.200|5060||1|0'

Apr 27 15:44:44 localhost kamailio[7827]: INFO: script:
ruri_user_avp='09711234567'

Apr 27 15:44:44 localhost kamailio[7827]: INFO: script: test
ruri_avp_mod='sip: 09711234...@voip.myproxy.it'

Apr 27 15:44:44 localhost kamailio[7827]: INFO: avpops [avpops_impl.c:1328]:
p=0xb60dc624, flags=0x0110

Apr 27 15:44:44 localhost kamailio[7827]: INFO: avpops [avpops_impl.c:1334]:
id=712

Apr 27 15:44:44 localhost kamailio[7827]: INFO: avpops [avpops_impl.c:1342]:
val_int=0

Apr 27 15:44:44 localhost kamailio[7827]: INFO: avpops [avpops_impl.c:1328]:
p=0xb60dc5b0, flags=0x0112

Apr 27 15:44:44 localhost kamailio[7827]: INFO: avpops [avpops_impl.c:1334]:
id=500

Apr 27 15:44:44 localhost kamailio[7827]: INFO: avpops [avpops_impl.c:1340]:
val_str=09711234567 / 11

 

I expected that the lcr module strips 3 numbers from avp(i:500) and adds the
prefix 774.

Anyone can explane why it didn't works? The called number never changes in
77409711891234567.

 

Any help will be appreciated.

 

Thank you

 

Danilo

 

___
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] perlvdb error

2011-04-27 Thread Daniel-Constantin Mierla

Can you try with tcp disabled? i.e.,

disable_tcp=yes

in your config file.

Might be the way the module is initialized for tcp handling.

Cheers,
Daniel

On 4/26/11 4:05 PM, Roman Yeryomin wrote:

On 26 April 2011 11:58, Daniel-Constantin Mierlamico...@gmail.com  wrote:

On 4/21/11 2:21 PM, Roman Yeryomin wrote:

On 21 April 2011 12:16, Daniel-Constantin Mierlamico...@gmail.com
  wrote:

(gdb) bt full
#0  0xb7228e3a in parseurl (url=0xb7213230 T�0\b#) at perlvdbfunc.c:60
No locals.
#1  0xb7228e7d in perlvdb_db_init (url=0x1Address 0x1 out of

Seems that the db url is not passed properly.

While you are in gdb, do:

frame 2
p db_url

(gdb) frame 2
#2  0xb720df85 in child_init (rank=0) at authdb_mod.c:166
166 auth_db_handle = auth_dbf.init(db_url);
(gdb) p db_url
$1 = {s = 0x830f554 perlvdb:OpenSER::VDB::Adapter::Auth, len = 35}

the url value looks ok here, but what t gets to perlvdb_db_init() is
corrupted ...

Can you send also the log messages, i.e., output of:

kamailio -E -ddd


sure, see kam.log in attachment
and this is from syslog:

...

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


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


[SR-Users] lcr module: strip and tag

2011-04-27 Thread Juha Heinanen

 I've some understanding problem on lcr module.

based on info you gave, i cannot say anything.  check how your request
uri looks like when you call load_gws() and after you have called
next_gw() and check how your tables look like.  there is no need to
inspect the internal avps unless you suspect a bug somewhere.

-- juha

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


[SR-Users] R: lcr module: strip and tag

2011-04-27 Thread Alida - Danilo SMALDONE
Here you are…

 

gw_uri_avp[0]='1|1|3|774|1171521237|172.16.10.200|5060||1|0' - what does
1171521237 means? I never entered this value

 

Kamailio 3.1 installed from rpm on Centos

 

The modified route

 

route[LCR] {

xlog(L_WARN, ENTRO IN ROUTE LCR
** \n);

if (!load_gws(1)) {

sl_send_reply(503, Unable to load gateways);

exit;

} else {

$var(i) = 0;

while(is_avp_set($(avp(i:709)[$var(i)]))) {

xlog(L_WARN,loading
gw_uri_avp[$var(i)]='$(avp(i:709)[$var(i)])'\n);

$var(i) = $var(i) + 1;

avp_print();

};

if(is_avp_set($avp(i:709))) {

xlog(L_WARN, Trying gateway '$avp(i:709)'\n);

} else {

xlog(L_WARN, No More Gateways \n);

};

# try the first matched gateway

if (next_gw()) {

xlog(L_WARN,ruri_user_avp='$avp(i:500)'\n);

xlog(L_WARN,test ruri_avp='$ru'\n);

xlog(L_WARN, $tu in next_gw() call
route(LCR)='$tu' \n);

# Route to failure for failover

#t_on_failure(2);

 route(RELAY);

} else {

sl_send_reply(503,No available gateways);

exit;

};

};

exit;

}

 

The result

 

Apr 27 16:34:14 localhost kamailio[8725]: WARNING: script: ENTRO IN PSTN
**

Apr 27 16:34:14 localhost kamailio[8725]: WARNING: script: $tu before call
route(LCR)='sip:09711234...@voip.myproxy.it'

Apr 27 16:34:14 localhost kamailio[8725]: WARNING: script: ENTRO IN ROUTE
LCR **

Apr 27 16:34:14 localhost kamailio[8725]: WARNING: script: loading
gw_uri_avp[0]='1|1|3|774|1171521237|172.16.10.200|5060||1|0'

Apr 27 16:34:14 localhost kamailio[8725]: WARNING: script: Trying gateway
'1|1|3|774|1171521237|172.16.10.200|5060||1|0'

Apr 27 16:34:14 localhost kamailio[8725]: WARNING: script:
ruri_user_avp='09711234567'

Apr 27 16:34:14 localhost kamailio[8725]: WARNING: script: test
ruri_avp='sip: 09711234567@172.16.10.200'

Apr 27 16:34:14 localhost kamailio[8725]: WARNING: script: $tu in
next_gw() call route(LCR)='sip:09711234...@voip.alida.it'

 

Danilo

 

-Messaggio originale-
Da: sr-users-boun...@lists.sip-router.org
[mailto:sr-users-boun...@lists.sip-router.org] Per conto di Juha Heinanen
Inviato: mercoledì 27 aprile 2011 14:31
A: SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) -Users
Mailing List
Oggetto: [SR-Users] lcr module: strip and tag

 

 

 

 I've some understanding problem on lcr module.

 

based on info you gave, i cannot say anything.  check how your request

uri looks like when you call load_gws() and after you have called

next_gw() and check how your tables look like.  there is no need to

inspect the internal avps unless you suspect a bug somewhere.

 

-- juha

 

___

SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list

sr-users@lists.sip-router.org

http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

___
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] R: lcr module: strip and tag

2011-04-27 Thread Juha Heinanen
Alida - Danilo SMALDONE writes:

 Here you are…

no, i asked you to check request uri before calling load_gws() and check
how your tables look like.

-- juha

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


[SR-Users] R: R: lcr module: strip and tag

2011-04-27 Thread Alida - Danilo SMALDONE
Thanks for your replies

Here you are Juha

 

xlog(L_WARN, ENTRO IN ROUTE LCR
** \n);

xlog(L_WARN,test before call load_gws() ruri='$ru'\n);

if (!load_gws(1)) {

. . . 

. . . 

   if (next_gw()) {

xlog(L_WARN,ruri_user_avp='$avp(i:500)'\n);

xlog(L_WARN,test ruri_avp='$ru'\n);

xlog(L_WARN, $tu in next_gw() call
route(LCR)='$tu' \n);

 

 

 and this is what I get

 

Apr 27 17:02:19 localhost kamailio[9135]: WARNING: script: ENTRO IN ROUTE
LCR **

Apr 27 17:02:19 localhost kamailio[9135]: WARNING: script: test before
call load_gws() ruri='sip:09711234...@voip.myproxy.it'

Apr 27 17:02:19 localhost kamailio[9135]: WARNING: script: loading
gw_uri_avp[0]='1|1|3|774|1171521237|172.16.10.200|5060||1|0'

Apr 27 17:02:19 localhost kamailio[9135]: WARNING: script: Trying gateway
'1|1|3|774|1171521237|172.16.10.200|5060||1|0'

Apr 27 17:02:19 localhost kamailio[9135]: WARNING: script:
ruri_user_avp='09711234567'

Apr 27 17:02:19 localhost kamailio[9135]: WARNING: script: test
ruri_avp='sip:09711234567@172.16.10.200'

Apr 27 17:02:19 localhost kamailio[9135]: WARNING: script: $tu in
next_gw() call route(LCR)='sip:09711234...@voip.myproxy.it'

 

Danilo

 

-Messaggio originale-
Da: sr-users-boun...@lists.sip-router.org
[mailto:sr-users-boun...@lists.sip-router.org] Per conto di Juha Heinanen
Inviato: mercoledì 27 aprile 2011 15:03
A: SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) -Users
Mailing List
Oggetto: [SR-Users] R: lcr module: strip and tag

 

 

Alida - Danilo SMALDONE writes:

 

 Here you are…

 

no, i asked you to check request uri before calling load_gws() and check

how your tables look like.

 

-- juha

 

___

SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list

sr-users@lists.sip-router.org

http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

___
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] R: R: lcr module: strip and tag

2011-04-27 Thread Juha Heinanen
Alida - Danilo SMALDONE writes:

 Thanks for your replies
 
 Here you are Juha

no, you have not yet shown your tables and i'll offline for the next 24
hours or so.

-- juha

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


[SR-Users] R: R: R: lcr module: strip and tag

2011-04-27 Thread Alida - Danilo SMALDONE

I'm sorry... which tables?


-Messaggio originale-
Da: sr-users-boun...@lists.sip-router.org
[mailto:sr-users-boun...@lists.sip-router.org] Per conto di Juha Heinanen
Inviato: mercoledì 27 aprile 2011 15:28
A: SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) -Users
Mailing List
Oggetto: [SR-Users] R: R: lcr module: strip and tag


Alida - Danilo SMALDONE writes:

 Thanks for your replies
 
 Here you are Juha

no, you have not yet shown your tables and i'll offline for the next 24
hours or so.

-- juha

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


___
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] R: R: R: lcr module: strip and tag

2011-04-27 Thread Ovidiu Sas
LCR tables, of course:
http://www.kamailio.org/docs/modules/3.1.x/modules/lcr.html#id2551334
http://www.kamailio.org/docs/modules/3.1.x/modules/lcr.html#id2499833
http://www.kamailio.org/docs/modules/3.1.x/modules/lcr.html#id2501638


Regards,
Ovidiu Sas

On Wed, Apr 27, 2011 at 11:28 AM, Alida - Danilo SMALDONE
dsmald...@alida.it wrote:

 I'm sorry... which tables?


 -Messaggio originale-
 Da: sr-users-boun...@lists.sip-router.org
 [mailto:sr-users-boun...@lists.sip-router.org] Per conto di Juha Heinanen
 Inviato: mercoledì 27 aprile 2011 15:28
 A: SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) -Users
 Mailing List
 Oggetto: [SR-Users] R: R: lcr module: strip and tag


 Alida - Danilo SMALDONE writes:

 Thanks for your replies

 Here you are Juha

 no, you have not yet shown your tables and i'll offline for the next 24
 hours or so.

 -- juha

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


 ___
 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] R: R: R: R: lcr module: strip and tag

2011-04-27 Thread Alida - Danilo SMALDONE
Thanks Ovidiu

 

lcr_rule_target

 

id lcr_idrule_id  gw_id  priority weight 

1  1 21  1 1

 

lcr_rule

id lcr_id   prefixfrom_uri stopper  enabled 

 2 10971  -11

 

lcr_gw

id lcr_idgw_name  ip_addr   hostnameport
paramsuri_scheme   transportstrip  tagflags  defunct 

1  1ALIDA 172.16.10.200 172.16.10.200  5060  -
1 13  7740-

 

 

These are the tables

 

Thank you

 

-Messaggio originale-
Da: sr-users-boun...@lists.sip-router.org
[mailto:sr-users-boun...@lists.sip-router.org] Per conto di Ovidiu Sas
Inviato: mercoledì 27 aprile 2011 17:34
A: SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) -
UsersMailing List
Oggetto: Re: [SR-Users] R: R: R: lcr module: strip and tag

 

 

LCR tables, of course:

http://www.kamailio.org/docs/modules/3.1.x/modules/lcr.html#id2551334

http://www.kamailio.org/docs/modules/3.1.x/modules/lcr.html#id2499833

http://www.kamailio.org/docs/modules/3.1.x/modules/lcr.html#id2501638

 

 

Regards,

Ovidiu Sas

 

On Wed, Apr 27, 2011 at 11:28 AM, Alida - Danilo SMALDONE

dsmald...@alida.it wrote:

 

 I'm sorry... which tables?

 

 

 -Messaggio originale-

 Da: sr-users-boun...@lists.sip-router.org

 [mailto:sr-users-boun...@lists.sip-router.org] Per conto di Juha Heinanen

 Inviato: mercoledì 27 aprile 2011 15:28

 A: SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) -Users

 Mailing List

 Oggetto: [SR-Users] R: R: lcr module: strip and tag

 

 

 Alida - Danilo SMALDONE writes:

 

 Thanks for your replies

 

 Here you are Juha

 

 no, you have not yet shown your tables and i'll offline for the next 24

 hours or so.

 

 -- juha

 

 ___

 SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list

 sr-users@lists.sip-router.org

 http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

 

 

 ___

 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

___
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