Changeset 252:690efbd91dd4 in verona for phapi/phapi.c
- Timestamp:
- Jul 12, 2011 2:47:42 PM (23 months ago)
- Branch:
- default
- Children:
- 253:cbe0776765ad, 264:f55d03c29bb5
- File:
-
- 1 edited
-
phapi/phapi.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
phapi/phapi.c
r251 r252 422 422 423 423 ph_config_t phcfg = { 424 /* public ip addr */ "", 424 425 /* local ip addr */ "", 425 426 /* local audio rtp port */"10600", … … 430 431 /* local video rtcp port */ "11100", 431 432 /* sipport */ "5060", 433 /* public sip port */ "", 432 434 /* sip transport */ IPPROTO_UDP, 433 435 /* nattype */ "" , … … 2288 2290 2289 2291 static void 2290 add_contact_param(struct vline *vl, const char *param, const char *value )2292 add_contact_param(struct vline *vl, const char *param, const char *value, int inside) 2291 2293 { 2292 2294 osip_contact_t *ctct; … … 2299 2301 2300 2302 osip_contact_parse(ctct, vl->contact); 2301 osip_contact_param_add(ctct, osip_strdup(param), osip_strdup(value)); 2303 if (inside) 2304 osip_uri_param_add(&ctct->url->url_params, osip_strdup(param), osip_strdup(value)); 2305 else 2306 osip_contact_param_add(ctct, osip_strdup(param), osip_strdup(value)); 2302 2307 2303 2308 osip_free(vl->contact); … … 2951 2956 assert(vl->server!=NULL); 2952 2957 2953 snprintf(utmp, sizeof(utmp), "sip:%s@%s", vl->username, vl->server); 2958 if (vl->displayname) 2959 snprintf(utmp, sizeof(utmp), "\"%s\" <sip:%s@%s>", vl->displayname, vl->username, vl->server); 2960 else 2961 snprintf(utmp, sizeof(utmp), "sip:%s@%s", vl->username, vl->server); 2954 2962 2955 2963 server = stmp; … … 2972 2980 vl->rid = -2; 2973 2981 } else { 2982 #if 1 2983 vl->rid = eXosip_register_build_initial_register(utmp, server, vl->contact, vl->regTimeout, &msg); 2984 if (vl->proxy) 2985 osip_message_set_route(msg, vl->proxy); 2986 } 2987 #else 2974 2988 if (vl->proxy && vl->proxy[0] == '<') { 2975 2989 int size = strlen(vl->proxy); … … 2985 2999 else 2986 3000 vl->rid = eXosip_register_build_initial_register(utmp, server, vl->contact, vl->regTimeout, &msg); 2987 } 2988 } 3001 3002 } 3003 } 3004 #endif 2989 3005 2990 3006 if (vl->rid >= 0) … … 3310 3326 3311 3327 if (mobility == PH_LINE_MOBILITY_FIXED) 3312 add_contact_param(vl, "mobility", "fixed" );3328 add_contact_param(vl, "mobility", "fixed", FALSE); 3313 3329 else if (mobility == PH_LINE_MOBILITY_MOBILE) 3314 add_contact_param(vl, "mobility", "mobile"); 3330 add_contact_param(vl, "mobility", "mobile", FALSE); 3331 else if (mobility == PH_LINE_MOBILITY_PHONE) 3332 add_contact_param(vl, "user", "phone", TRUE); 3333 3315 3334 3316 3335 vl->mobility = mobility; … … 3971 3990 ph_nat_type_str[0] = 0; 3972 3991 3992 if (phcfg.public_ip_addr[0]) 3993 return; 3994 3973 3995 if (!phcfg.use_tunnel && phcfg.nattype[0]) 3974 3996 { … … 4309 4331 return -1; 4310 4332 4333 if (phcfg.public_ip_addr[0]) 4334 { 4335 int port = atoi(phcfg.public_sipport); 4336 eXosip_masquerade_contact(phcfg.public_ip_addr, port ? port : atoi(phcfg.sipport)); 4337 } 4338 4311 4339 if (phcfg.local_ip_addr[0] == 0) 4312 4340 eXosip_listen_addr(proto, NULL, atoi(phcfg.sipport), AF_INET, secure); 4313 4341 else 4314 4342 { 4315 eXosip_masquerade_contact(phcfg.local_ip_addr, atoi(phcfg.sipport)); 4343 if (!phcfg.public_ip_addr[0]) 4344 eXosip_masquerade_contact(phcfg.local_ip_addr, atoi(phcfg.sipport)); 4316 4345 eXosip_listen_addr(proto, phcfg.local_ip_addr, atoi(phcfg.sipport), AF_INET, secure); 4317 4346 }
Note: See TracChangeset
for help on using the changeset viewer.
