[SR-Users] Consuming 300 Multiple Choices

Geoffrey Mina geoffreymina at gmail.com
Sat Jun 29 17:35:15 CEST 2013


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 at gmail.com>wrote:

> 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 at 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 at 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 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>;q=0.001;rate=0.002000
>> Contact: <sip:9546496708 at X.X.X.X;npdi>;q=0.002;rate=0.009850
>> Contact: <sip:9546496708 at X.X.X.X;npdi>;q=0.003;rate=0.009850
>> Contact: <sip:9546496708 at X.X.X.X;npdi>;q=0.004;rate=0.009850
>> Contact: <sip:9546496708 at X.X.X.X;npdi>;q=0.005;rate=0.009850
>> Contact: <sip:9546496708 at X.X.X.X;npdi>;q=0.006;rate=0.009850
>> To: <sip:19546496708 at X.X.X.X>
>> From: "7203355925" <sip:7203355925 at X.X.X.X>;tag=as5927da08
>> Call-ID: 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****
>>
>> _______________________________________________
>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>> sr-users at lists.sip-router.org
>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20130629/f59b8f8b/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kamailio.cfg
Type: application/octet-stream
Size: 8549 bytes
Desc: not available
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20130629/f59b8f8b/attachment-0001.obj>


More information about the sr-users mailing list