[SR-Users] Consuming 300 Multiple Choices

I.Pavlov ip at izhnet.ru
Fri Jun 28 08:46:44 CEST 2013


Hi Geoff, to grab "rate"-attribute try to use
"$sel(contact.params["rate"]);"-expression. For example, in my test with
sipp, I used Contact: sip:sipp@[local_ip]:[local_port];q=0.1;rate=0.002 and 

 

$var(rate)=$sel(contact.params["rate"]);

xlog("CONTACT URI PARAMS: $var(rate)");

 

/usr/sbin/kamailio[25909]: ERROR: <script>: CONTACT URI PARAMS: 0.002

 

Next, you can try to log $var(rate) with acc like this:
acc_log_request("RATE: $var(rate)");

 

-----

Igor Pavlov

 

From: sr-users-bounces at lists.sip-router.org
[mailto:sr-users-bounces at lists.sip-router.org] On Behalf Of Geoffrey Mina
Sent: Thursday, June 27, 2013 9:55 PM
To: kamailio
Subject: [SR-Users] Consuming 300 Multiple Choices

 

Greetings,

I am looking for a way to get some extra information out of the Contact
header when consuming a multiple choices response.  I am using uac_redirect
to populate the branches.  

get_redirects("*");
t_load_contacts();
t_next_contacts();
        
t_on_failure("2");
t_relay();



In my failure_route[2] I am just doing:

t_next_contacts();

t_on_failure("2");
t_relay();

In my Multiple Choices packet, I am getting some additional information that
I would like to log using the acc module.  There is a "rate" attribute that
defines how much the outbound leg is going to cost to terminate.  Here is
how the packet looks:

SIP/2.0 300 Multiple Choices
Via: SIP/2.0/UDP X.X.X.X;branch=z9hG4bK6213.a6567804.0
Via: SIP/2.0/UDP X.X.X.X;branch=z9hG4bK6213.a6c73fe6.0
Via: SIP/2.0/UDP
X.X.X.X:5060;received=X.X.X.X;branch=z9hG4bK61f266c4;rport=5060
Contact: < <sip:9546496708 at X.X.X.X;npdi>
sip:9546496708 at X.X.X.X;npdi>;q=0.001;rate=0.002000
Contact: < <sip:9546496708 at X.X.X.X;npdi>
sip:9546496708 at X.X.X.X;npdi>;q=0.002;rate=0.009850
Contact: < <sip:9546496708 at X.X.X.X;npdi>
sip:9546496708 at X.X.X.X;npdi>;q=0.003;rate=0.009850
Contact: < <sip:9546496708 at X.X.X.X;npdi>
sip:9546496708 at X.X.X.X;npdi>;q=0.004;rate=0.009850
Contact: < <sip:9546496708 at X.X.X.X;npdi>
sip:9546496708 at X.X.X.X;npdi>;q=0.005;rate=0.009850
Contact: < <sip:9546496708 at X.X.X.X;npdi>
sip:9546496708 at X.X.X.X;npdi>;q=0.006;rate=0.009850
To: < <sip:19546496708 at X.X.X.X> sip:19546496708 at X.X.X.X>
From: "7203355925" < <sip:7203355925 at X.X.X.X>
sip:7203355925 at X.X.X.X>;tag=as5927da08
Call-ID:  <mailto:3eb09e772e32e18c1fe926230802818c at X.X.X.X>
3eb09e772e32e18c1fe926230802818c at X.X.X.X
CSeq: 102 INVITE
Server: Routing Server
Content-Length: 0

How would I grab that attribute and log it using acc?

Thanks,
Geoff

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20130628/e2bb06df/attachment-0001.html>


More information about the sr-users mailing list