Skip to content

Commit 1ab6df3

Browse files
committed
New method JsSIP.NameAddrHeader.parse() which returns a JsSIP.NameAddrHeader instance.
1 parent 7211bde commit 1ab6df3

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

src/NameAddrHeader.js

+17
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,21 @@ JsSIP.NameAddrHeader.prototype = {
8686

8787
return body;
8888
}
89+
};
90+
91+
92+
/**
93+
* Parse the given string and returns a JsSIP.NameAddrHeader instance or undefined if
94+
* it is an invalid NameAddrHeader.
95+
* @public
96+
* @param {String} name_addr_header
97+
*/
98+
JsSIP.NameAddrHeader.parse = function(name_addr_header) {
99+
name_addr_header = JsSIP.Grammar.parse(name_addr_header,'Name_Addr_Header');
100+
101+
if (name_addr_header !== -1) {
102+
return name_addr_header;
103+
} else {
104+
return undefined;
105+
}
89106
};

src/URI.js

+2
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ JsSIP.URI = function(scheme, user, host, port, parameters, headers) {
5252
host = value.toLowerCase();
5353
}
5454
},
55+
5556
port: {
5657
get: function(){ return port; },
5758
set: function(value){
@@ -163,6 +164,7 @@ JsSIP.URI.prototype = {
163164

164165
return uri;
165166
},
167+
166168
toAor: function(show_port){
167169
var aor;
168170

0 commit comments

Comments
 (0)