[OpenSIPS-Devel] [ opensips-Feature Requests-3046191 ] URI construction function / transformation

SourceForge.net noreply at sourceforge.net
Mon Aug 16 13:24:37 CEST 2010


Feature Requests item #3046191, was opened at 2010-08-16 13:24
Message generated for change (Tracker Item Submitted) made by viraptor
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: Nobody/Anonymous (nobody)
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.

----------------------------------------------------------------------

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