allow password, uri-parameters and headers in SIP URIs

according to RFC 3261 the sip uri format is:

  sip:user:password@host:port;uri-parameters?headers

we do now allow all elements in SIP URIs for permanent contacts

TODO for trunk implementation:
* the check should use Sipwise::Provisioning::check_sip_uri()
* also fix check_sip_uri to support password, uri-parameters and headers
* syntax check on contact param. of create_subscriber_registered_device
3.4
Daniel Tiefnig 14 years ago
parent 21c60fadc7
commit 0c0e86ea20

@ -574,7 +574,7 @@ sub add_permanent_contact : Local {
my $subscriber_id = $c->request->params->{subscriber_id};
my $contact = $c->request->params->{contact};
unless($contact =~ /^sip\:[a-zA-Z0-9\-\_\.\!\~\*\'\(\)\%\+]+\@[a-zA-Z0-9\-\.\[\]\:]+(\:\d{1,5})?$/) {
unless($contact =~ /^sip\:[a-zA-Z0-9\-\_\.\!\~\*\'\(\)\%\+]+(:.+?)?\@[a-zA-Z0-9\-\.\[\]\:]+(\:\d{1,5})?(;[^;=?]+?=[^;=?]+?)*(\?[^;=?]+?=[^;=?]+?(&[^;=?]+?=[^;=?]+?)?)?$/) {
$c->session->{messages}{conterr} = 'Client.Syntax.MalformedUri';
$c->response->redirect("/subscriber/detail?subscriber_id=$subscriber_id#activeregs");
return;

Loading…
Cancel
Save