+ int x;
+ char urioptions[256]="";
+
+ if (p->usereqphone) {
+ char onlydigits = 1;
+ x=0;
+
+ /* Test p->username against allowed characters in AST_DIGIT_ANY
+ If it matches the allowed characters list, then sipuser = ";user=phone"
+
+ If not, then sipuser = ""
+ */
+ /* + is allowed in first position in a tel: uri */
+ if (p->username && p->username[0] == '+')
+ x=1;
+
+ for (;x<strlen(p->username);x++) {
+ if (!strchr(AST_DIGIT_ANY, p->username[x])) {
+ onlydigits = 0;
+ break;
+ }
+ }
+
+ /* If we have only digits, add ;user=phone to the uri */
+ if (onlydigits)
+ strcpy(urioptions, ";user=phone");
+ }
+