[OpenSIPS-Devel] [ opensips-Feature Requests-3046191 ] URI construction function / transformation
SourceForge.net
noreply at sourceforge.net
Mon Oct 11 10:48:21 CEST 2010
Feature Requests item #3046191, was opened at 2010-08-16 14:24
Message generated for change (Settings changed) made by bogdan_iancu
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=1086413&aid=3046191&group_id=232389
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: core
Group: None
Status: Open
Priority: 5
Private: No
Submitted By: Stanislaw Pitucha (viraptor)
>Assigned to: Bogdan-Andrei Iancu (bogdan_iancu)
Summary: URI construction function / transformation
Initial Comment:
I run a couple of times into situations where I need to change the URI a little bit. It ends up as a mess of if/else-s because the urls can have different protocols, may or may not contain a user and port, may have params, etc.
I propose a function `construct_uri(protocol, user, domain, port, params)` which returns a URI based on those arguments. The user, port, params parts should be optional, so it should be legal to call:
construct_uri("sip", null, "1.2.3.4", null, null) -> "sip:1.2.3.4"
construct_uri("sip", $rU, $rd, null, "key=val") -> "sip:$rU@$rd;key=val" (with expanded vars of course)
etc.
----------------------------------------------------------------------
>Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2010-10-11 11:48
Message:
Hi Stan,
But what will be the benefit of
construct_uri("sip", null, "1.2.3.4", null, null) -> "sip:1.2.3.4"
over
$ru = "sip:1.2.3.4";
or of
construct_uri("sip", $rU, $rd, null, "key=val") ->
"sip:$rU@$rd;key=val"
over
$ru = :sip:"+$rU+"@" +$rd+";key=val"
?
Regards,
Bogdan
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=1086413&aid=3046191&group_id=232389
More information about the Devel
mailing list