[OpenSIPS-Users] Creating RURI ($ru) from Contact ($ct)

Aft nix aftnix at gmail.com
Sat May 26 21:36:13 CEST 2012


On Sun, May 27, 2012 at 1:26 AM, Ovidiu Sas <osas at voipembedded.com> wrote:
> http://www.opensips.org/Resources/DocsCoreTran18#toc52

Hi Ovidiu

Thanks a lot. For the first time in my SER usage, i have gone past
string and uri
transformation documentation and found there are other transformation
available :)

I've not tested yet, but i'm sure it will solve my issue.

>
> On Sat, May 26, 2012 at 1:48 PM, Aft nix <aftnix at gmail.com> wrote:
>> On Sat, May 26, 2012 at 9:43 PM, Ovidiu Sas <osas at voipembedded.com> wrote:
>>> You are building a nameaddr, not a uri.  A uri doens't have '<' and
>>> '>' characters.
>>> Take a look at http://tools.ietf.org/html/rfc3261#section-25.1 to see
>>> what a proper URI is.
>>>
>>> Regards,
>>> Ovidiu Sas
>>>
>> Hi Ovidiu Sas
>>
>> Thank you for your reply. So i guess i have to trim leading and
>> trailing '<','>'s.
>>
>> My first guess is to use string transformation like following :
>>
>> $var{s.rm,'<'}
>> $var{s.rm,'>'}
>>
>> Cheers
>>
>>
>>> --
>>> VoIP Embedded, Inc.
>>> http://www.voipembedded.com
>>>
>>> On Sat, May 26, 2012 at 10:39 AM, Aft nix <aftnix at gmail.com> wrote:
>>>> Hi,
>>>>
>>>> I'm trying to create a ruri from contact header like following :
>>>>
>>>> In request route I've saved contact header in a hashtable using htable module.
>>>> request_route{
>>>>
>>>> ---------------------
>>>> ---------------------
>>>> #!ifdef WITH_HASH
>>>>         if (is_method("INVITE") && !has_totag()){
>>>>                 xdbg ("Contact [$ct] with Callid [$ci]");
>>>>                 $sht(a=>$ci) = $ct;
>>>>         }
>>>>  #!endif
>>>>
>>>> ----------------
>>>> }
>>>>
>>>> And in route[WITHINDLG]
>>>>
>>>> route[WITHINDLG] {
>>>>
>>>> ---------------------------
>>>> ---------------------------
>>>>  #!ifdef WITH_HASH
>>>>                                 xdbg ("ruri [$ru]");
>>>>                                 if ($sht(a=>$ci) != $ru){
>>>>                                         $ru = ($sht(a=>$ci));
>>>>                                         xdbg ("rewriting ruri to [$ru]");
>>>>                                 }
>>>>  #!endif
>>>>
>>>> But it log shows that its unable to parse the uri :
>>>>
>>>> [4039]: DEBUG: <core> [parser/parse_uri.c:1277]: parse_uri: bad uri,
>>>> state 0 parsed: <<sip> (4) / <<sip:2020 at 103.23.169.2:64358>> (29)
>>>> : DEBUG: <core> [parser/parse_uri.c:1327]: ERROR: parse_sip_msg_uri:
>>>> bad uri <<sip:2020 at 103.23.169.2:64358>>
>>>> [4039]: ERROR: pv [pv_core.c:232]: failed to parse the R-URI
>>>> [4039]: DEBUG: <script>: rewriting ruri to [<null>]
>>>>
>>>>
>>>> I'm not understanding what's wrong with that. May be the port part
>>>> should be discarded, but how i'm gonna do that?
>>>>
>>>>
>>>> --
>>>> -aft
>>>>
>>>> _______________________________________________
>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users at lists.opensips.org
>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>>
>> --
>> -aft
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users



-- 
-aft



More information about the Users mailing list