Re: [SR-Users] decimal fraction problem

2011-03-13 Thread
sorry to bother again


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

this script line doesn't work and the pv $branch() aren't
writable,just readable . index -1 is not accessable either.

if append_branch() function doesn't take the q value parameter,the
$branch(q) just return NULL (which I think is the default value
Q_UNSPECFIED=-1)

I find a function set_ruri_q() in dset.c but I don't know how to call
it in the configure file.


2011/2/23 Daniel-Constantin Mierla mico...@gmail.com:
 Hello,

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

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

 do:

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

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

 Cheers,
 Daniel

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

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


Re: [SR-Users] set_dlg_profile() in failure_route

2011-03-04 Thread
I did trace the dialog in the initial REQUEST

my script:
...
modparam(dialog,dlg_flag,4)
...
route{

 if (is_method(INVITE)){
   dlg_setflag(2);
   dlg_manage();
   ...
   if(avp_db_load($ruri/username,$avp(s:busyforward)))
   {
   setflag(26);
   t_on_failure(FAIL_ONE);
   }
   ...
}
failure_route[FAIL_ONE]{
   ...
   if(isflagset(26)t_check_status(486))
   {
   $ru=$avp(s:busyforward);
   append_branch();
   dlg_setflag(2);
   avp_delete($avp(s:busyforward));
   resetflag(26);
   lookup(location);
   route(RELAY);
   }
   ...
}
route[RELAY]{
   if(!t_relay()){
sl_reply_error();
   }
}
#--#

Is anything wrong?

2011/3/3 Timo Reimann timo.reim...@1und1.de:
 Hi,


 On 03.03.2011 14:47, 侯旭光 wrote:
 set_dlg_profile() function carshed in failure_route when I need do the
 call-forwarding.

 When in busy-call-forward or no-answer-forward mode ,it'll run into
 the failure_route.But at the time , the route_type of the dialog is
 FAILURE_ROUTE and the get_current_dialog() return NULL,

 then the set_dlg_profile() function won't work.

 How can I set dialog profile in the busy or no-answer call-forwarding ?

 CRITIAL dialog [dlg_profile.c]:  BUG - dialog not found in non REQUEST route
 ERROR dialog [dialog.c]  :  failed to set  profile

 I think you did not track the dialog in the first place, i.e., when the
 initial request associated to the dialog you seek to profile was processed.

 Are you using dlg_flag, and if so, have you enabled it in REQUEST_ROUTE?
 If you want to track dialogs on demand instead, try calling dlg_manage()
 prior to calling set_dlg_profile(). I'm not sure if this is the most
 elegant approach for your use case but it might at least work.


 Cheers,

 --Timo


___
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] set_dlg_profile() in failure_route

2011-03-03 Thread
Hello

set_dlg_profile() function carshed in failure_route when I need do the
call-forwarding.

When in busy-call-forward or no-answer-forward mode ,it'll run into
the failure_route.But at the time , the route_type of the dialog is
FAILURE_ROUTE and the get_current_dialog() return NULL,

then the set_dlg_profile() function won't work.

How can I set dialog profile in the busy or no-answer call-forwarding ?

LOG file

CRITIAL dialog [dlg_profile.c]:  BUG - dialog not found in non REQUEST route
ERROR dialog [dialog.c]  :  failed to set  profile

thanks

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


[SR-Users] kamctl db exec

2011-02-24 Thread
Hello

How to use kamctl db exec query  function?

My SQL_ENGINE is MySQL

How to write the command line when I want to do the query select *
from acc with kamctl db tool?

thanks

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


Re: [SR-Users] get_profile_size() function help (Alex Balashov)

2011-02-23 Thread
upgraded,problem solved
thank you

2011/2/23 Daniel-Constantin Mierla mico...@gmail.com:
 What is the version of kamailio used here? I did a fix for this function
 when it takes three parameters sometime by end of last year, so if you
 are not using the latest version, just upgrade to it and see if the
 issue still persists.

 Cheers,
 Daniel

 On 2/22/11 6:38 PM, Henning Westerholt wrote:
 On Tuesday 22 February 2011, 侯旭光 wrote:
 On 02/21/2011 04:50 AM, ??? wrote:
 ALTER:core  [main.c 722] : child process 29651 exited by sinal 11
 ALTER:core  [main.c 725] : core was generated
 INFO :core  [main.c 737] : terminating due to SIGCHILD
 This is a crash.  It's a bug.


 Then how to get the number  of dialogs belonging to a profile?
 Hi 侯旭光,

 well, the server should return the number of dialogs here - that it crashs 
 its
 not normal, of course. :-) Can you take a look to the core dump that was
 generated and post the result here on the list? More informations can be find
 here: http://www.kamailio.org/dokuwiki/doku.php/troubleshooting:corefiles

 Cheers,

 Henning

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

 --
 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] decimal fraction problem

2011-02-21 Thread
Hello

I need to add q value while using  function append_branch(),but the function
only takes decimal fraction as the parameter.
What if I want to use pv to add q value?
The $var and $avp just have string and integer type.
Thanks a lot!
___
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] get_profile_size() function help

2011-02-21 Thread
Hello

bother again

what's the problem with the function get_profile_size()

My script

modparam(dialog, enable_stats, 1)
modparam(dialog, dlg_flag, 4)
modparam(dialog, dlg_mode, 1)
modparam(dialog, db_url, mysql://openser:openserrw@localhost/openser)
modparam(dialog, profiles_no_value, inbound ; outbound)

...

if(is_method(INVITE))
{
   ...
dlg_manage();
set_dlg_profile(inbound);
   ...
get_profile_size(inbound,$avp(size));
   ...
}


when program runs to the function get_profile_size(), the proxy will
be terminate.

log file:

ALTER: core [main.c 722] : child process 29651 exited by sinal 11
ALTER: core [main.c 725] : core was generated
INFO : core [main.c 737] : terminating due to SIGCHILD



what' s the problem? Did I use the func wrong?

thanks

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


Re: [SR-Users] get_profile_size() function help (Alex Balashov)

2011-02-21 Thread
On 02/21/2011 04:50 AM, ??? wrote:

 ALTER:core  [main.c 722] : child process 29651 exited by sinal 11
 ALTER:core  [main.c 725] : core was generated
 INFO :core  [main.c 737] : terminating due to SIGCHILD

This is a crash.  It's a bug.


Then how to get the number  of dialogs belonging to a profile?

___
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] avp_db_query() question

2011-01-19 Thread
Hello
avp_db_query(query[,dest]) can get a database query and store the results in 
the avps.
But what if the results returns many rows,and how can I get all the results? 
How to set the [dest] parameter ?
I've tried the method describered 
inhttp://www.kamailio.org/docs/avp_db_query.html,but it doesn't work.
like below
mysqlselect mem_user from tgroup where grp_name='1234';
+--+
| mem_user |
+--+
| 1013 |
| 2013 |
+--+
2 rows in set (0.00 sec)
kamailio.cfg
if(avp_db_query(select mem_user from tgroup where 
grp_name='1234',$avp(name)))
{
   xlog(L_INFO,query results[1] :$avp(name[1])\n);
   xlog(L_INFO,query results[2] :$avp(name[2])\n);
}
syslog
INFO query results[1] :null
INFO query results[2] :null
version: kamailio 3.0.2 MySQL 5.0
 
thank you very much!___
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