Re: [SR-Users] Text Operations on a Message

2014-08-15 Thread AliReza Khoshgoftar Monfared
Awesome, Thanks very much On Fri, Aug 15, 2014 at 2:56 PM, Alex Balashov wrote: > On 08/15/2014 02:54 PM, AliReza Khoshgoftar Monfared wrote: > > Awesome, and I assume to recover the integer value, I need sth like, as >> well: >> >> $var(param1) = $(var(

Re: [SR-Users] Text Operations on a Message

2014-08-15 Thread AliReza Khoshgoftar Monfared
Awesome, and I assume to recover the integer value, I need sth like, as well: $var(param1) = $(var(param1){s.int}); Thanks very much, Alireza On Fri, Aug 15, 2014 at 2:48 PM, Alex Balashov wrote: > On 08/15/2014 02:43 PM, AliReza Khoshgoftar Monfared wrote: > > Thanks very much

Re: [SR-Users] Rate Limiting with Kamailio

2014-08-15 Thread AliReza Khoshgoftar Monfared
and limit them properly. Cheers, Alireza On Fri, Aug 15, 2014 at 10:23 AM, Daniel-Constantin Mierla < mico...@gmail.com> wrote: > Hello, > > > On 14/08/14 18:49, AliReza Khoshgoftar Monfared wrote: > >> Hi list, >> >> A quick question, >> >

Re: [SR-Users] Text Operations on a Message

2014-08-15 Thread AliReza Khoshgoftar Monfared
Thanks very much Alex and Hugh, I think what Hugh mentioned is the best way to process text in Kamailio without relying on an external tool and it's good to know it, and Alex's suggestion is great for transferring a single number. Cheers, Alireza On Fri, Aug 15, 2014 at 7:36 AM, Alex Balashov

Re: [SR-Users] Text Operations on a Message

2014-08-14 Thread AliReza Khoshgoftar Monfared
, Alex Balashov wrote: > On 08/14/2014 02:59 PM, AliReza Khoshgoftar Monfared wrote: > >> Hi list, >> >> How can I extract a specific part of my message body? >> I know that "textops" has the function "search_body(re)" but it returns >> True/F

[SR-Users] Text Operations on a Message

2014-08-14 Thread AliReza Khoshgoftar Monfared
Hi list, How can I extract a specific part of my message body? I know that "textops" has the function "search_body(re)" but it returns True/False upon finding "re" in the body of the text, how can I return the actual text that regular expression matches? As an example, my message body is rate is

[SR-Users] Rate Limiting with Kamailio

2014-08-14 Thread AliReza Khoshgoftar Monfared
Hi list, A quick question, What is the best way to limit the rate of the kamailio, Say I want it to process only 200 INVITEs per second I know this can be done using ratelimit module, but what if I want to change this rate dynamically? say, in an overload control scenario, I am getting a recomme

Re: [SR-Users] Keep Number of Messages per Source

2014-08-13 Thread AliReza Khoshgoftar Monfared
p people who will get into the same issue later) All the best, Alireza On Wed, Aug 13, 2014 at 10:58 AM, Daniel-Constantin Mierla < mico...@gmail.com> wrote: > > On 13/08/14 16:24, Alex Balashov wrote: > >> On 08/13/2014 10:21 AM, AliReza Khoshgoftar Monfared wrote: >> &g

Re: [SR-Users] Keep Number of Messages per Source

2014-08-13 Thread AliReza Khoshgoftar Monfared
h item in hash table. > > Cheers, > Daniel > > > On 13/08/14 05:26, AliReza Khoshgoftar Monfared wrote: > > Thanks Alex, > > This is exactly the module I needed. > Now just another small usage question. > How can I reset the value of all entries in my hash table to 0 e

Re: [SR-Users] Keep Number of Messages per Source

2014-08-12 Thread AliReza Khoshgoftar Monfared
hanks Alireza On Tue, Aug 12, 2014 at 3:58 PM, Alex Balashov wrote: > On 08/12/2014 03:56 PM, AliReza Khoshgoftar Monfared wrote: > >> Hi List, >> >> I am trying to keep a counter for number of messages received per source >> ip in my kamailio script. >&g

[SR-Users] Keep Number of Messages per Source

2014-08-12 Thread AliReza Khoshgoftar Monfared
Hi List, I am trying to keep a counter for number of messages received per source ip in my kamailio script. The basic challenge is to keep this data in a neat structure. Ideally, I want some array with keys named after source IP addresses, sth like number_of_messages["10.10.10.10"] = 23 Of cour

Re: [SR-Users] Accessing Message Buffer in Kamailio

2014-08-08 Thread AliReza Khoshgoftar Monfared
;t have access to pending packets from the > network. Ratelimit module works on the number of packets processed by > kamailio (those already read from kernel buffer). > > Cheers, > Daniel > > > On 07/08/14 19:06, AliReza Khoshgoftar Monfared wrote: > > Hi list, &

[SR-Users] Accessing Message Buffer in Kamailio

2014-08-07 Thread AliReza Khoshgoftar Monfared
Hi list, Is there a way to survey the message buffer (iei the queue where arriving sip messages wait to be processed by worker threads) in Kamailio? Is there a way to check the number of messages in this buffer? Additionally, is it possible to survey the number of messages by method (INVITE, BYE,

[SR-Users] BUG: ip_addr2sbuf: unknown address family 0

2014-07-14 Thread AliReza Khoshgoftar Monfared
Hi, I am running a simple command on timer in a kamailio proxy. Here is the related parts of the config scripts: loadmodule "timer" > modparam("timer", "declare_timer", "tmr1=LOG_STATS,1,fast,enable"); > > route{ > ... > } > > route[LOG_STATS] { > exec_avp("netstat -ul | grep ':sip' | awk

Re: [SR-Users] Comparing strings

2014-07-11 Thread AliReza Khoshgoftar Monfared
Here is the definition for cmp_str(), for example: static int cmp_str_f(struct sip_msg *msg, char *str1, char *str2 ) > { > str s1; > str s2; > int ret; > > if(fixup_get_svalue(msg, (gparam_p)str1, &s1)!=0) > { > LM_ERR("cannot get first parameter\n"); > return

Re: [SR-Users] Update Interval for Rtimer

2014-07-11 Thread AliReza Khoshgoftar Monfared
Hi Alex, It prints only one time. The log file looks like this: Jul 11 20:43:58 ip-10-238-242-214 kamailio[20354]: ALERT:

[SR-Users] Update Interval for Rtimer

2014-07-11 Thread AliReza Khoshgoftar Monfared
Hi, I have a basic yet weird problem with Rtimer module. I cannot make it execute a route block for me at an interval of my choice (which is what it is supposed to do, right?) Here is a simplified example with relevant parts of my config script: Assume I want to print "hello" every 100 ms: I ha

[SR-Users] Measuring Response Time for a SIP Message

2014-07-07 Thread AliReza Khoshgoftar Monfared
Hi, I am trying to do two types of measurements on a packet (say an INVITE or BYE) that arrives at a kamailio proxy. 1) The time that packet is spending in Kamailio to be processed 2) The total time from when the packet arrives at the machine that runs the proxy till it leaves that machine. I b

Re: [SR-Users] How to check message queue (buffer) in Kamailio

2014-07-02 Thread AliReza Khoshgoftar Monfared
ach being processed once read. It is hard to know >> how many are waiting in the kernel. >> >> My question would be, when such information would really help? If >> kamailio is too busy handling traffic, won't get much time to care of other >> tasks (e.g., predict what

Re: [SR-Users] How to check message queue (buffer) in Kamailio

2014-07-01 Thread AliReza Khoshgoftar Monfared
waiting in the kernel. > > My question would be, when such information would really help? If kamailio > is too busy handling traffic, won't get much time to care of other tasks > (e.g., predict what is in network read kernel queue). > > Cheers, > Daniel > > > On

[SR-Users] How to check message queue (buffer) in Kamailio

2014-06-30 Thread AliReza Khoshgoftar Monfared
Hi, I had another simple question: In a kamailio server (proxy), how do I check the number of messages currently waiting for processing? Is there a variable that I can monitor, say, if I want to make a routing decision in my config based on the number of messages in the queue? Also, is it poss

[SR-Users] Transaction Stateful Message Handling

2014-06-26 Thread AliReza Khoshgoftar Monfared
Hi, I am trying to configure a SIP proxy architecture that is stateful with regard to transaction but not the dialogues, i.e. If an INVITE takes a specific route, the corresponding 180 Ringing, 200 OK and ACK shall traverse the same set of proxies, but the corresponding BYE can take another route

Re: [SR-Users] Passing Command-Line Arguments to Kamailio Config Script

2014-06-25 Thread AliReza Khoshgoftar Monfared
Thanks very much Daniel. Did you mean: kamailio -A xyz='"abc"' ... in equivalent to $var(xyz) = "abc" in config? Also is there a scope restriction on the use of $var() or -A option? I seem to be able to use it inside the route {} block but not in the global scope... On Wed, Jun 25, 2014 at 3

[SR-Users] Passing Command-Line Arguments to Kamailio Config Script

2014-06-24 Thread AliReza Khoshgoftar Monfared
Hi, I had a simple question to which I could not find a clear answer in the documentation. How can I pass a command line argument to Kamailio config script? For example, assume that I run my kamailio daemon using script myconf.cfg: >>kamailio -f myconf.cfg Now I want to pass a value, say an I

[SR-Users] Setting up two Kamailio Proxies in Tandem

2014-06-23 Thread AliReza Khoshgoftar Monfared
Hi, I am trying to build a simple architecture like this: UAC <--> Proxy1 <--> Proxy2 <--> UAS (each on a different VM) Is it possible to have this architecture built without any "registrar" module? I have simulated my UAC and UAS using SIPp and the routing in Proxy1 and Proxy2 is to forward to

Re: [SR-Users] Specifying Upstream and Downstream Servers for a simple SIP proxy

2014-06-23 Thread AliReza Khoshgoftar Monfared
SIPp default client, but I thought it might be helpful to document the issue here in case that somebody else was searching the same issue. On Thu, Jun 19, 2014 at 8:42 PM, AliReza Khoshgoftar Monfared < khoshgof...@gmail.com> wrote: > Shedding some more light on the situation, here are

Re: [SR-Users] Specifying Upstream and Downstream Servers for a simple SIP proxy

2014-06-19 Thread AliReza Khoshgoftar Monfared
n call termination. The client is not receiving any "200 OK" for the "BYE"s it is sending. Is there anything wrong in my routing logic that is preventing these ACKs? On Thu, Jun 19, 2014 at 4:09 PM, AliReza Khoshgoftar Monfared < khoshgof...@gmail.com> wrote: > T

Re: [SR-Users] Specifying Upstream and Downstream Servers for a simple SIP proxy

2014-06-19 Thread AliReza Khoshgoftar Monfared
t; t_relay(); > exit; > > Or, if you don't want to change the r-uri, then use: > > $du = "sip:__NEXT_PROXY_IP__"; > t_relay(); > exit; > > Of course, you have to replace the __NEXT_PROXY_IP__ with the appropriate > value. > > More dynamic option wou

[SR-Users] Specifying Upstream and Downstream Servers for a simple SIP proxy

2014-06-15 Thread AliReza Khoshgoftar Monfared
Dear Kamailio users, I am trying to set up a simple scenario as follows: UAC --> Proxy_1 --> Proxy_2 --> Proxy_3 --> UAC I am new to Kamailio and had the following basic questions that came to my mind after reading the documentation an the default kamilio.cfg config script: 1) Is there any good