Re: [SR-Users] If we print out $fu, $fU & $fd on onsend_route, it prints out incorrect values.

2015-12-04 Thread Daniel-Constantin Mierla
Hello,

in onsend_route, the 'standard' message variables still point to
incoming message structure. But you can see what is going to be sent out
with $snd(buf).

Cheers,
Daniel

On 04/12/15 14:28, Jurijs Ivolga wrote:
> Hi all,
>
> I opened a bug here:
>
> https://github.com/kamailio/kamailio/issues/430
>
> But then I was advised to write to mailing list.
>
> In nutshell:
>
> I'm running Kamailio 4.3.3.
>
> When I'm trying to update $ru, $fu & $fd in Kamailio conf:
> $rU = "1000";
> $fu = "sip:someth...@mydomain.com ";
> $fd = "newdomain.com ";
>
> And later I'm trying to print out $rU, $fu, $fU & $fd in onsend_route:
>
> |xlog("ALERT: From URI $fu \n"); xlog("ALERT: From domain $fd \n");
> xlog("ALERT: From user $fU \n"); xlog("ALERT: Request user $rU \n"); |
>
> Kamailio 4.3.3 prints out following:
> ALERT: From URI sip:2000@some_ip
> ALERT: From domain some_ip
> ALERT: From user 2000
> ALERT: Request user 1000
>
> But I believe it should:
>
> ALERT: From URI sip:someth...@mydomain.com 
> ALERT: From domain mydomain.com 
> ALERT: From user something
> ALERT: Request user 1000
>
> I'm using default Kamailio config with minor changes, you can check it
> in attachment.
>
> Is it proper behavior?
>
> Thank you!
>
> With kind regards,
>
> Jurijs
>
>
>
> ___
> 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://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Book: SIP Routing With Kamailio - http://www.asipto.com
http://miconda.eu

___
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] If we print out $fu, $fU & $fd on onsend_route, it prints out incorrect values.

2015-12-04 Thread Jurijs Ivolga
Hi all,

I opened a bug here:

https://github.com/kamailio/kamailio/issues/430

But then I was advised to write to mailing list.

In nutshell:

I'm running Kamailio 4.3.3.

When I'm trying to update $ru, $fu & $fd in Kamailio conf:
$rU = "1000";
$fu = "sip:someth...@mydomain.com";
$fd = "newdomain.com";

And later I'm trying to print out $rU, $fu, $fU & $fd in onsend_route:

xlog("ALERT: From URI $fu \n");
xlog("ALERT: From domain $fd \n");
xlog("ALERT: From user $fU \n");
xlog("ALERT: Request user $rU \n");

Kamailio 4.3.3 prints out following:
ALERT: From URI sip:2000@some_ip
ALERT: From domain some_ip
ALERT: From user 2000
ALERT: Request user 1000

But I believe it should:

ALERT: From URI sip:someth...@mydomain.com
ALERT: From domain mydomain.com
ALERT: From user something
ALERT: Request user 1000

I'm using default Kamailio config with minor changes, you can check it in
attachment.

Is it proper behavior?

Thank you!

With kind regards,

Jurijs
#!KAMAILIO
#
# Kamailio (OpenSER) SIP Server v4.3 - default configuration script
# - web: http://www.kamailio.org
# - git: http://sip-router.org
#
# Direct your questions about this file to: 
#
# Refer to the Core CookBook at http://www.kamailio.org/wiki/
# for an explanation of possible statements, functions and parameters.
#
# Several features can be enabled using '#!define WITH_FEATURE' directives:
#
# *** To run in debug mode: 
# - define WITH_DEBUG
#
# *** To enable mysql: 
# - define WITH_MYSQL
#
# *** To enable authentication execute:
# - enable mysql
# - define WITH_AUTH
# - add users using 'kamctl'
#
# *** To enable IP authentication execute:
# - enable mysql
# - enable authentication
# - define WITH_IPAUTH
# - add IP addresses with group id '1' to 'address' table
#
# *** To enable persistent user location execute:
# - enable mysql
# - define WITH_USRLOCDB
#
# *** To enable presence server execute:
# - enable mysql
# - define WITH_PRESENCE
#
# *** To enable nat traversal execute:
# - define WITH_NAT
# - install RTPProxy: http://www.rtpproxy.org
# - start RTPProxy:
#rtpproxy -l _your_public_ip_ -s udp:localhost:7722
# - option for NAT SIP OPTIONS keepalives: WITH_NATSIPPING
#
# *** To enable PSTN gateway routing execute:
# - define WITH_PSTN
# - set the value of pstn.gw_ip
# - check route[PSTN] for regexp routing condition
#
# *** To enable database aliases lookup execute:
# - enable mysql
# - define WITH_ALIASDB
#
# *** To enable speed dial lookup execute:
# - enable mysql
# - define WITH_SPEEDDIAL
#
# *** To enable multi-domain support execute:
# - enable mysql
# - define WITH_MULTIDOMAIN
#
# *** To enable TLS support execute:
# - adjust CFGDIR/tls.cfg as needed
# - define WITH_TLS
#
# *** To enable XMLRPC support execute:
# - define WITH_XMLRPC
# - adjust route[XMLRPC] for access policy
#
# *** To enable anti-flood detection execute:
# - adjust pike and htable=>ipban settings as needed (default is
#   block if more than 16 requests in 2 seconds and ban for 300 seconds)
# - define WITH_ANTIFLOOD
#
# *** To block 3XX redirect replies execute:
# - define WITH_BLOCK3XX
#
# *** To enable VoiceMail routing execute:
# - define WITH_VOICEMAIL
# - set the value of voicemail.srv_ip
# - adjust the value of voicemail.srv_port
#
# *** To enhance accounting execute:
# - enable mysql
# - define WITH_ACCDB
# - add following columns to database
#!ifdef ACCDB_COMMENT
  ALTER TABLE acc ADD COLUMN src_user VARCHAR(64) NOT NULL DEFAULT '';
  ALTER TABLE acc ADD COLUMN src_domain VARCHAR(128) NOT NULL DEFAULT '';
  ALTER TABLE acc ADD COLUMN src_ip varchar(64) NOT NULL default '';
  ALTER TABLE acc ADD COLUMN dst_ouser VARCHAR(64) NOT NULL DEFAULT '';
  ALTER TABLE acc ADD COLUMN dst_user VARCHAR(64) NOT NULL DEFAULT '';
  ALTER TABLE acc ADD COLUMN dst_domain VARCHAR(128) NOT NULL DEFAULT '';
  ALTER TABLE missed_calls ADD COLUMN src_user VARCHAR(64) NOT NULL DEFAULT '';
  ALTER TABLE missed_calls ADD COLUMN src_domain VARCHAR(128) NOT NULL DEFAULT 
'';
  ALTER TABLE missed_calls ADD COLUMN src_ip varchar(64) NOT NULL default '';
  ALTER TABLE missed_calls ADD COLUMN dst_ouser VARCHAR(64) NOT NULL DEFAULT '';
  ALTER TABLE missed_calls ADD COLUMN dst_user VARCHAR(64) NOT NULL DEFAULT '';
  ALTER TABLE missed_calls ADD COLUMN dst_domain VARCHAR(128) NOT NULL DEFAULT 
'';
#!endif

### Include Local Config If Exists #
import_file "kamailio-local.cfg"

### Defined Values #

# *** Value defines - IDs used later in config
#!ifdef WITH_MYSQL
# - database URL - used to connect to database server by modules such
#   as: auth_db, acc, usrloc, a.s.o.
#!ifndef DBURL
#!define DBURL "mysql://kamailio:kamailiorw@localhost/kamailio"
#!endif
#!endif
#!ifdef WITH_MULTIDOMAIN
# - the value for 'use_domain' parameters
#!define MULTIDOMAIN 1