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@X.X.X.X;npdi;q=0.001;rate=0.002000 Contact: sip:9546496708@X.X.X.X;npdi;q=0.002;rate=0.009850 Contact: sip:9546496708@X.X.X.X;npdi;q=0.003;rate=0.009850 Contact: sip:9546496708@X.X.X.X;npdi;q=0.004;rate=0.009850 Contact: sip:9546496708@X.X.X.X;npdi;q=0.005;rate=0.009850 Contact: sip:9546496708@X.X.X.X;npdi;q=0.006;rate=0.009850 To: sip:19546496708@X.X.X.X From: "7203355925" sip:7203355925@X.X.X.X;tag=as5927da08 Call-ID: 3eb09e772e32e18c1fe926230802818c@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
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@lists.sip-router.org [mailto:sr-users-bounces@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@X.X.X.X;npdi sip:9546496708@X.X.X.X;npdi>;q=0.001;rate=0.002000 Contact: < sip:9546496708@X.X.X.X;npdi sip:9546496708@X.X.X.X;npdi>;q=0.002;rate=0.009850 Contact: < sip:9546496708@X.X.X.X;npdi sip:9546496708@X.X.X.X;npdi>;q=0.003;rate=0.009850 Contact: < sip:9546496708@X.X.X.X;npdi sip:9546496708@X.X.X.X;npdi>;q=0.004;rate=0.009850 Contact: < sip:9546496708@X.X.X.X;npdi sip:9546496708@X.X.X.X;npdi>;q=0.005;rate=0.009850 Contact: < sip:9546496708@X.X.X.X;npdi sip:9546496708@X.X.X.X;npdi>;q=0.006;rate=0.009850 To: < sip:19546496708@X.X.X.X sip:19546496708@X.X.X.X> From: "7203355925" < sip:7203355925@X.X.X.X sip:7203355925@X.X.X.X>;tag=as5927da08 Call-ID: mailto:3eb09e772e32e18c1fe926230802818c@X.X.X.X 3eb09e772e32e18c1fe926230802818c@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
I should have been more clear. I am using Kamailio 1.5. I would consider upgrading, but that isn't the ideal path here.
Any other idea for 1.5?
On Fri, Jun 28, 2013 at 12:46 AM, I.Pavlov ip@izhnet.ru wrote:
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@lists.sip-router.org [mailto: sr-users-bounces@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@X.X.X.X;npdi;q=0.001;rate=0.002000 Contact: sip:9546496708@X.X.X.X;npdi;q=0.002;rate=0.009850 Contact: sip:9546496708@X.X.X.X;npdi;q=0.003;rate=0.009850 Contact: sip:9546496708@X.X.X.X;npdi;q=0.004;rate=0.009850 Contact: sip:9546496708@X.X.X.X;npdi;q=0.005;rate=0.009850 Contact: sip:9546496708@X.X.X.X;npdi;q=0.006;rate=0.009850 To: sip:19546496708@X.X.X.X From: "7203355925" sip:7203355925@X.X.X.X;tag=as5927da08 Call-ID: 3eb09e772e32e18c1fe926230802818c@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****
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
This should work in 1.5:
$ct - reference to body of contact header
xlog("CONTCAT: rate=$(ct{param.value,rate})");
acc_log_request("RATE: $(ct{param.value,rate})");
From: sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Geoffrey Mina Sent: Friday, June 28, 2013 4:38 PM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Consuming 300 Multiple Choices
I should have been more clear. I am using Kamailio 1.5. I would consider upgrading, but that isn't the ideal path here.
Any other idea for 1.5?
On Fri, Jun 28, 2013 at 12:46 AM, I.Pavlov ip@izhnet.ru wrote:
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@lists.sip-router.org [mailto:sr-users-bounces@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@X.X.X.X;npdi;q=0.001;rate=0.002000 Contact: sip:9546496708@X.X.X.X;npdi;q=0.002;rate=0.009850 Contact: sip:9546496708@X.X.X.X;npdi;q=0.003;rate=0.009850 Contact: sip:9546496708@X.X.X.X;npdi;q=0.004;rate=0.009850 Contact: sip:9546496708@X.X.X.X;npdi;q=0.005;rate=0.009850 Contact: sip:9546496708@X.X.X.X;npdi;q=0.006;rate=0.009850 To: sip:19546496708@X.X.X.X From: "7203355925" sip:7203355925@X.X.X.X;tag=as5927da08 Call-ID: mailto:3eb09e772e32e18c1fe926230802818c@X.X.X.X 3eb09e772e32e18c1fe926230802818c@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
_______________________________________________ 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
Thanks! I am actually taking this opportunity to upgrade to 4.0. Looks like there is a lot of good stuff here!
On Fri, Jun 28, 2013 at 7:14 AM, I.Pavlov ip@izhnet.ru wrote:
This should work in 1.5:****
*$ct* - reference to body of contact header ****
xlog("CONTCAT: rate=$(ct{param.value,rate})");****
acc_log_request(“RATE: $(ct{param.value,rate})”);****
*From:* sr-users-bounces@lists.sip-router.org [mailto: sr-users-bounces@lists.sip-router.org] *On Behalf Of *Geoffrey Mina *Sent:* Friday, June 28, 2013 4:38 PM *To:* Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Consuming 300 Multiple Choices****
I should have been more clear. I am using Kamailio 1.5. I would consider upgrading, but that isn't the ideal path here.****
Any other idea for 1.5?****
On Fri, Jun 28, 2013 at 12:46 AM, I.Pavlov ip@izhnet.ru wrote:****
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@lists.sip-router.org [mailto: sr-users-bounces@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@X.X.X.X;npdi;q=0.001;rate=0.002000 Contact: sip:9546496708@X.X.X.X;npdi;q=0.002;rate=0.009850 Contact: sip:9546496708@X.X.X.X;npdi;q=0.003;rate=0.009850 Contact: sip:9546496708@X.X.X.X;npdi;q=0.004;rate=0.009850 Contact: sip:9546496708@X.X.X.X;npdi;q=0.005;rate=0.009850 Contact: sip:9546496708@X.X.X.X;npdi;q=0.006;rate=0.009850 To: sip:19546496708@X.X.X.X From: "7203355925" sip:7203355925@X.X.X.X;tag=as5927da08 Call-ID: 3eb09e772e32e18c1fe926230802818c@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****
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
Igor, I have successfully migrated to Kamailio 4.0 so I can use the function as you defined. I am getting back a "0" instead of the actual rate though. The only difference I can see is that my "q" and "rate" are outside of the angle brackets in the Contact header:
Yours: *Contact: sip:sipp@[local_ip]:[local_port];q=0.1;rate=0.002
* *Mine: *Contact: sip:9546496708@X.X.X.X;npdi;q=0.001;rate=0.002000
Would there be a different way to address the rate attribute if it is outside the URI?
On Fri, Jun 28, 2013 at 12:46 AM, I.Pavlov ip@izhnet.ru wrote:
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@lists.sip-router.org [mailto: sr-users-bounces@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@X.X.X.X;npdi;q=0.001;rate=0.002000 Contact: sip:9546496708@X.X.X.X;npdi;q=0.002;rate=0.009850 Contact: sip:9546496708@X.X.X.X;npdi;q=0.003;rate=0.009850 Contact: sip:9546496708@X.X.X.X;npdi;q=0.004;rate=0.009850 Contact: sip:9546496708@X.X.X.X;npdi;q=0.005;rate=0.009850 Contact: sip:9546496708@X.X.X.X;npdi;q=0.006;rate=0.009850 To: sip:19546496708@X.X.X.X From: "7203355925" sip:7203355925@X.X.X.X;tag=as5927da08 Call-ID: 3eb09e772e32e18c1fe926230802818c@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****
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
I think I have narrowed down the problem. The Contact header available here is the original Contact header that was in the INVITE. We are using an LCR service that sends back a 300 Multiple Choices with various contacts sorted by "q". We are consuming the 300 using the uac_redirect module, but perhaps that isn't the only way to skin this cat. Here is the flow:
Asterisk --> INVITE --> Kamailio --> INVITE --> LCR Service LCR Service --> 300 Multiple Choices --> Kamailio --> INVITE --> Least Cost Carrier
The 300 Multiple Choices has the Contact headers that have the rates. I want to use the acc module to log the rate with the CDR based on the carrier we are sending the call to.
I have attached my current config file so you can see what we are doing here.
Thanks, Geoff
On Sat, Jun 29, 2013 at 8:48 AM, Geoffrey Mina geoffreymina@gmail.comwrote:
Igor, I have successfully migrated to Kamailio 4.0 so I can use the function as you defined. I am getting back a "0" instead of the actual rate though. The only difference I can see is that my "q" and "rate" are outside of the angle brackets in the Contact header:
Yours: *Contact: sip:sipp@[local_ip]:[local_port];q=0.1;rate=0.002
*Mine: *Contact: sip:9546496708@X.X.X.X;npdi;q=0.001;rate=0.002000
Would there be a different way to address the rate attribute if it is outside the URI?
On Fri, Jun 28, 2013 at 12:46 AM, I.Pavlov ip@izhnet.ru wrote:
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@lists.sip-router.org [mailto: sr-users-bounces@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@X.X.X.X;npdi;q=0.001;rate=0.002000 Contact: sip:9546496708@X.X.X.X;npdi;q=0.002;rate=0.009850 Contact: sip:9546496708@X.X.X.X;npdi;q=0.003;rate=0.009850 Contact: sip:9546496708@X.X.X.X;npdi;q=0.004;rate=0.009850 Contact: sip:9546496708@X.X.X.X;npdi;q=0.005;rate=0.009850 Contact: sip:9546496708@X.X.X.X;npdi;q=0.006;rate=0.009850 To: sip:19546496708@X.X.X.X From: "7203355925" sip:7203355925@X.X.X.X;tag=as5927da08 Call-ID: 3eb09e772e32e18c1fe926230802818c@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****
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