Changeset 301:6c407bf16b7b in verona
- Timestamp:
- Sep 13, 2011 2:30:57 PM (22 months ago)
- Branch:
- default
- File:
-
- 1 edited
-
phapi/phapi.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
phapi/phapi.c
r300 r301 1341 1341 #define FROM_PORT 2 1342 1342 #define FROM_FORCEPORT 4 1343 #define FROM_NRUSERNAME 8 1343 1344 1344 1345 static void … … 1352 1353 assert(vl != NULL); 1353 1354 1354 if ( vl->mobility == PH_LINE_MOBILITY_PHONE)1355 if (checkmobility(vl->mobility,PH_LINE_MOBILITY_PHONE)) 1355 1356 uphone=";user=phone"; 1356 1357 1357 1358 1358 1359 un = nonempty(vl->username) ? vl->username : "unknown"; 1359 if (flags & FROM_NRUSERNAME) 1360 un = nonempty(vl->nrusername) ? vl->nrusername : "unknown"; 1361 else 1362 un = nonempty(vl->rusername) ? vl->rusername : "unknown"; 1363 1360 1364 s = nonempty(vl->server) ? vl->server : "localhost"; 1361 1365 if ((vl->port >= 0 && vl->port != 5060 && (flags & FROM_PORT)) || (vl->port == 5060 && (flags & FROM_FORCEPORT))) … … 1385 1389 ph_build_from(char *buf, int n, struct vline *vl) 1386 1390 { 1387 ph_build_from2(buf, n, vl, FROM_DISPLAYNAME );1391 ph_build_from2(buf, n, vl, FROM_DISPLAYNAME|FROM_NRUSERNAME); 1388 1392 } 1389 1393 … … 1398 1402 if (!eXosip_build_contact_str(fbuf, 0, &ctct)) 1399 1403 { 1400 osip_strncpy(buf, ctct, n-1);1404 strncpy(buf, ctct, n); 1401 1405 osip_free(ctct); 1402 1406 return; 1403 1407 } 1404 osip_strncpy(buf, fbuf, n-1);1408 strncpy(buf, fbuf, n); 1405 1409 1406 1410 … … 1530 1534 strcpy(from, "<sip:anonymous@anonymous.invalid>"); 1531 1535 else 1532 ph_build_from2(from, sizeof(from), vl, FROM_DISPLAYNAME & FROM_PORT);1536 ph_build_from2(from, sizeof(from), vl, FROM_DISPLAYNAME | FROM_PORT | FROM_NRUSERNAME); 1533 1537 1534 1538 proxy = vl->proxy; … … 1577 1581 { 1578 1582 if (!ca0->sdpctx) { 1579 ca0->sdpctx = sdp_handler_create_context(&ph_sdp_handler, local_ip, vl-> username, 0);1583 ca0->sdpctx = sdp_handler_create_context(&ph_sdp_handler, local_ip, vl->nrusername, 0); 1580 1584 ca0->cfg = &phcfg; 1581 1585 sdp_context_set_user_pointer(ca0->sdpctx, ca0); … … 2123 2127 2124 2128 if (!ca->sdpctx) { 2125 ca->sdpctx = sdp_handler_create_context(&ph_sdp_handler, local_ip, vl-> username, 0);2129 ca->sdpctx = sdp_handler_create_context(&ph_sdp_handler, local_ip, vl->nrusername, 0); 2126 2130 ca->cfg = &phcfg; 2127 2131 sdp_context_set_user_pointer(ca->sdpctx, ca); … … 3001 3005 3002 3006 assert(vl!=NULL); 3003 assert(vl-> username!=NULL);3007 assert(vl->rusername!=NULL); 3004 3008 assert(vl->server!=NULL); 3005 3009 3006 3010 if (vl->displayname) 3007 snprintf(utmp, sizeof(utmp), "\"%s\" <sip:%s@%s>", vl->displayname, vl-> username, vl->server);3011 snprintf(utmp, sizeof(utmp), "\"%s\" <sip:%s@%s>", vl->displayname, vl->rusername, vl->server); 3008 3012 else 3009 snprintf(utmp, sizeof(utmp), "sip:%s@%s", vl-> username, vl->server);3013 snprintf(utmp, sizeof(utmp), "sip:%s@%s", vl->rusername, vl->server); 3010 3014 3011 3015 server = stmp; 3012 3016 if (vl->port && vl->port != 5060) 3013 3017 { 3014 /* snprintf(stmp, sizeof(stmp), "sip:%s@%s:%d", vl-> username, vl->server, vl->port); */3018 /* snprintf(stmp, sizeof(stmp), "sip:%s@%s:%d", vl->rusername, vl->server, vl->port); */ 3015 3019 snprintf(stmp, sizeof(stmp), "sip:%s:%d", vl->server, vl->port); 3016 3020 } 3017 3021 else 3018 3022 { 3019 /* snprintf(stmp, sizeof(stmp), "sip:%s@%s:%d", vl-> username, vl->server, vl->port); */3023 /* snprintf(stmp, sizeof(stmp), "sip:%s@%s:%d", vl->rusername, vl->server, vl->port); */ 3020 3024 snprintf(stmp, sizeof(stmp), "sip:%s", vl->server); 3021 3025 }
Note: See TracChangeset
for help on using the changeset viewer.
