* 2007-09-10 introduced phone2uri option which allows NOT to consider
* user=phone URIs as TEL URIs
... | ... |
@@ -69,7 +69,9 @@ |
69 | 69 |
* RT_TIMER2_POLICY (andrei) |
70 | 70 |
* 2007-06-16 added DNS_SRV_LB, DNS_TRY_NAPTR (andrei) |
71 | 71 |
* 2007-06-18 added DNS_{UDP,TCP,TLS}_PREF (andrei) |
72 |
- */ |
|
72 |
+ * 2007-09-10 introduced phone2tel option which allows NOT to consider |
|
73 |
+ * user=phone URIs as TEL URIs (jiri) |
|
74 |
+*/ |
|
73 | 75 |
|
74 | 76 |
|
75 | 77 |
%{ |
... | ... |
@@ -264,6 +266,7 @@ STAT statistics |
264 | 266 |
MAXBUFFER maxbuffer |
265 | 267 |
CHILDREN children |
266 | 268 |
CHECK_VIA check_via |
269 |
+PHONE2TEL phone2tel |
|
267 | 270 |
SYN_BRANCH syn_branch |
268 | 271 |
MEMLOG "memlog"|"mem_log" |
269 | 272 |
MEMDBG "memdbg"|"mem_dbg" |
... | ... |
@@ -513,6 +516,7 @@ EAT_ABLE [\ \t\b\r] |
513 | 516 |
<INITIAL>{MAXBUFFER} { count(); yylval.strval=yytext; return MAXBUFFER; } |
514 | 517 |
<INITIAL>{CHILDREN} { count(); yylval.strval=yytext; return CHILDREN; } |
515 | 518 |
<INITIAL>{CHECK_VIA} { count(); yylval.strval=yytext; return CHECK_VIA; } |
519 |
+<INITIAL>{PHONE2TEL} { count(); yylval.strval=yytext; return PHONE2TEL; } |
|
516 | 520 |
<INITIAL>{SYN_BRANCH} { count(); yylval.strval=yytext; return SYN_BRANCH; } |
517 | 521 |
<INITIAL>{MEMLOG} { count(); yylval.strval=yytext; return MEMLOG; } |
518 | 522 |
<INITIAL>{MEMDBG} { count(); yylval.strval=yytext; return MEMDBG; } |
... | ... |
@@ -82,7 +82,9 @@ |
82 | 82 |
* RT_POLICY, RT_TIMER1_PRIO, RT_TIMER1_POLICY, RT_TIMER2_PRIO, |
83 | 83 |
* RT_TIMER2_POLICY (andrei) |
84 | 84 |
* 2007-06-16 added DDNS_SRV_LB, DNS_TRY_NAPTR (andrei) |
85 |
- */ |
|
85 |
+ * 2007-09-10 introduced phone2tel option which allows NOT to consider |
|
86 |
+ * user=phone URIs as TEL URIs (jiri) |
|
87 |
+*/ |
|
86 | 88 |
|
87 | 89 |
%{ |
88 | 90 |
|
... | ... |
@@ -301,6 +303,7 @@ static struct socket_id* mk_listen_id(char*, int, int); |
301 | 303 |
%token STAT |
302 | 304 |
%token CHILDREN |
303 | 305 |
%token CHECK_VIA |
306 |
+%token PHONE2TEL |
|
304 | 307 |
%token SYN_BRANCH |
305 | 308 |
%token MEMLOG |
306 | 309 |
%token MEMDBG |
... | ... |
@@ -380,6 +383,7 @@ static struct socket_id* mk_listen_id(char*, int, int); |
380 | 383 |
%token STUN_ALLOW_STUN |
381 | 384 |
%token STUN_ALLOW_FP |
382 | 385 |
|
386 |
+ |
|
383 | 387 |
/* operators */ |
384 | 388 |
%nonassoc EQUAL |
385 | 389 |
%nonassoc EQUAL_T |
... | ... |
@@ -642,6 +646,8 @@ assign_stm: |
642 | 646 |
| CHILDREN EQUAL error { yyerror("number expected"); } |
643 | 647 |
| CHECK_VIA EQUAL NUMBER { check_via=$3; } |
644 | 648 |
| CHECK_VIA EQUAL error { yyerror("boolean value expected"); } |
649 |
+ | PHONE2TEL EQUAL NUMBER { phone2tel=$3; } |
|
650 |
+ | PHONE2TEL EQUAL error { yyerror("boolean value expected"); } |
|
645 | 651 |
| SYN_BRANCH EQUAL NUMBER { syn_branch=$3; } |
646 | 652 |
| SYN_BRANCH EQUAL error { yyerror("boolean value expected"); } |
647 | 653 |
| MEMLOG EQUAL NUMBER { memlog=$3; } |
... | ... |
@@ -296,6 +296,8 @@ int log_facility = LOG_DAEMON; |
296 | 296 |
int config_check = 0; |
297 | 297 |
/* check if reply first via host==us */ |
298 | 298 |
int check_via = 0; |
299 |
+/* translate user=phone URIs to TEL URIs */ |
|
300 |
+int phone2tel = 1; |
|
299 | 301 |
/* shall use stateful synonym branches? faster but not reboot-safe */ |
300 | 302 |
int syn_branch = 1; |
301 | 303 |
/* debugging level for memory stats */ |
... | ... |
@@ -36,9 +36,13 @@ |
36 | 36 |
* 2005-02-25 preliminary tel uri support (andrei) |
37 | 37 |
* 2005-03-03 more tel uri fixes (andrei) |
38 | 38 |
* 2006-04-20 comp uri param. support (rfc3486) if defined USE_COMP (andrei) |
39 |
+ * 2007-09-10 introduced phone2tel option which allows NOT to consider |
|
40 |
+ * user=phone URIs as TEL URIs |
|
41 |
+ * |
|
39 | 42 |
*/ |
40 | 43 |
|
41 | 44 |
|
45 |
+#include "../globals.h" |
|
42 | 46 |
#include "parse_uri.h" |
43 | 47 |
#include <string.h> |
44 | 48 |
#include "../dprint.h" |
... | ... |
@@ -1098,8 +1102,10 @@ int parse_uri(char* buf, int len, struct sip_uri* uri) |
1098 | 1102 |
switch(uri->type){ |
1099 | 1103 |
case SIPS_URI_T: |
1100 | 1104 |
case SIP_URI_T: |
1101 |
- if ((uri->user_param_val.len == 5) && |
|
1102 |
- (strncmp(uri->user_param_val.s, "phone", 5) == 0)) { |
|
1105 |
+ if ((phone2tel) && |
|
1106 |
+ (uri->user_param_val.len == 5) && |
|
1107 |
+ (strncmp(uri->user_param_val.s, "phone", 5) == 0) |
|
1108 |
+ ) { |
|
1103 | 1109 |
uri->type = TEL_URI_T; |
1104 | 1110 |
uri->flags |= URI_SIP_USER_PHONE; |
1105 | 1111 |
/* move params from user into uri->params */ |