[Kamailio-Users] how to work with Remote-Party-ID ?

Daniel-Constantin Mierla miconda at gmail.com
Thu Feb 12 14:34:11 CET 2009


On 02/12/2009 01:23 PM, Henning Westerholt wrote:
> On Thursday 12 February 2009, BERGANZ François wrote:
>   
>> i need to get the Remote-Party-ID in the header.
>> I have that:
>> Remote-Party-ID: "francois bgz"
>> <sip:170725014 at 217.64.x.x:5067>;screen=yes;privacy=off;party=calling;-call-
>> i
>> nitiator=5016;-call-initiator-location=int;-redirected-by;-int-ext=5016;-en
>> t -name=Acro;-direction=ext;-call-id=55665.
>>
>> I need to have -ent-name=Acro
>> but, when I use $re, I have sip:170725014 at 217.64.x.x:5067
>>
>> how can I do ?
>>     
>
> Hi,
>
> the '$re' returns only to the remote-party URI. But you can use 
> $hdr(Remote-Party-ID), and then use a transformation to split the content 
> further.
>   
to complete this, the upcoming 1.5.0 does have some new stuff that helps 
a lot in such case:
- the tobody transformation to get the params part:
http://www.kamailio.org/dokuwiki/doku.php/transformations:devel#to-body_transformations
- and param transformation to get the value:
http://www.kamailio.org/dokuwiki/doku.php/transformations:devel#parameters_list_transformations

In case of something more complex to parse and extract, the re.subst 
transformation can be used:
http://www.kamailio.org/dokuwiki/doku.php/transformations:devel#regular_expression_transformations

Cheers,
Daniel

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





More information about the sr-users mailing list