Changeset 282:f092dbf9c3c2 in verona
- Timestamp:
- Sep 8, 2011 10:45:31 AM (22 months ago)
- Branch:
- default
- Files:
-
- 3 edited
-
misc/vtims.py (modified) (5 diffs)
-
phapi/phapi.c (modified) (5 diffs)
-
phapi/phapi.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
misc/vtims.py
r278 r282 46 46 USERNAME="Vadim Lebedev" 47 47 PUBLIC_IP_ADDR = "217.128.124.171" 48 #PUBLIC_IP_ADDR = MYIPADDR 48 49 if True: 49 50 #testsip3 server … … 52 53 TARGET=imspasswd.TARGET1 53 54 ZNDI = "0" + NDI 55 54 56 USERNAME=ZNDI 55 # PREFIX="974682000" 56 # SUFFIX=".DGP.9TALK@sfr.fr" 57 # USER="+33999" + NDI 58 PREFIX="" 59 SUFFIX=".TST.DGP@sfr.fr" 57 if imspasswd.MODE9BOX: 58 PREFIX="" 59 SUFFIX=".TST.DGP@sfr.fr" 60 elif imspasswd.NEWSPECS: 61 PREFIX="974682000" 62 SUFFIX=".DGP.9TALK@sfr.fr" 63 else: 64 PREFIX="999" 65 PREFPREFIX = "999" 66 SUFFIX=".TST.9TALK@sfr.fr" 67 68 if imspasswd.RFC5626: 69 USERFC5626 = 1 << 11 70 else: 71 USERFC5626 = 0 72 60 73 USER="+33" + PREFIX + NDI 61 # IMSUSERID="NDI" + ZNDI + ".TST.9TALK@sfr.fr" 74 PREFUSER = "+33" + PREFPREFIX + NDI 62 75 IMSUSERID="NDI" + ZNDI + SUFFIX 63 76 SERVER="ims.mnc010.mcc208.3gppnetwork.org" 64 77 PROXY="<sip:91.68.5.52;lr>" 78 #PROXY="<sip:172.22.43.69:5062;lr>" # In PROLOG office behind 9BOX 65 79 REALM="sfr.fr" 80 TRANSPORT = 17 # IPPROTO_UDP 81 if imspasswd.PROTOCOL == "tcp": 82 TRANSPORT = 6 # IPPROTO_TCP 66 83 else: 67 84 # external server … … 87 104 cfg.audio_codecs="PCMA,PCMU" 88 105 cfg.local_audio_rtp_port = "16384" 106 cfg.sip_id = '"<urn:uuid:00000000-0000-1000-8000-AABBCCDDEEFF>"' 89 107 cfg.ptime=20 108 cfg.transport = TRANSPORT 90 109 if 0 < API.init(): 91 110 print "Init failed\n" … … 93 112 def reg1(): 94 113 global VLID 114 95 115 API.addAuthInfo(USER, IMSUSERID, PASSWD, REALM) 96 VLID = API.addVline(USERNAME, USER, SERVER, PROXY, 3600, verona.PH_LINE_MOBILITY_PHONE+verona.PH_NORTCP_ATTR )116 VLID = API.addVline(USERNAME, USER, SERVER, PROXY, 3600, verona.PH_LINE_MOBILITY_PHONE+verona.PH_NORTCP_ATTR + USERFC5626) 97 117 print "vlid = ", VLID 98 118 … … 132 152 133 153 def addcustomizations(): 134 prefid = "<sip:%s@%s;user=phone>" % (USER, SERVER) 135 API.addCustomHeader("INVITE", "P-Preferred-Identity", prefid) 154 prefid = "<sip:%s@%s;user=phone>" % (PREFUSER, SERVER) 155 prefid = "<sip:%s@%s>" % (PREFUSER, SERVER) 156 prefid = "<tel:%s>" % PREFUSER 157 API.addCustomHeader("INVITE", "P-Preferred-Identity", prefid) 158 if imspasswd.RFC5626: 159 API.addCustomHeader("REGISTER,INVITE", "Suppported", "path, outbound") 136 160 137 161 def setup(): -
phapi/phapi.c
r281 r282 1548 1548 ph_replace_contact(invite, vl->contact); 1549 1549 } 1550 if (vl->mobility & PH_USE_RFC5626) 1551 ph_replace_contact(invite, vl->contact); 1552 1550 1553 1551 1554 … … 2312 2315 osip_contact_parse(ctct, vl->contact); 2313 2316 if (inside) 2314 osip_uri_param_add(&ctct->url->url_params, osip_strdup(param), osip_strdup(value));2317 osip_uri_param_add(&ctct->url->url_params, osip_strdup(param), value ? osip_strdup(value) : 0); 2315 2318 else 2316 osip_contact_param_add(ctct, osip_strdup(param), osip_strdup(value));2319 osip_contact_param_add(ctct, osip_strdup(param), value ? osip_strdup(value) : 0); 2317 2320 2318 2321 osip_free(vl->contact); … … 2947 2950 } 2948 2951 2952 static void ph_fix_reg_contact(struct vline* vl, char **rcontact) 2953 { 2954 osip_contact_t* ctct = 0; 2955 char regid[16]; 2956 int fixit = (PH_USE_RFC5626 == (vl->mobility & PH_USE_RFC5626)); 2957 2958 *rcontact = vl->contact; 2959 2960 if (!fixit) 2961 return; 2962 2963 2964 2965 if (osip_contact_init(&ctct)) 2966 return; 2967 2968 if (osip_contact_parse(ctct, vl->contact)) 2969 goto err; 2970 2971 snprintf(regid, 16, "%d", ph_vline2vlid(vl) ); 2972 if (osip_contact_param_add(ctct, osip_strdup("reg-id"), osip_strdup(regid))) 2973 goto err; 2974 2975 if (osip_contact_param_add(ctct, osip_strdup("+sip.instance"), osip_strdup(phcfg.sip_id))) 2976 goto err; 2977 2978 osip_contact_to_str(ctct, rcontact); 2979 2980 err: 2981 osip_contact_free(ctct); 2982 } 2983 2949 2984 PHAPI_EXPORT int 2950 2985 phvlRegister(int vlid) … … 2991 3026 } else { 2992 3027 #if 1 2993 vl->rid = eXosip_register_build_initial_register(utmp, server, vl->contact, vl->regTimeout, &msg); 3028 char *rcontact; 3029 3030 ph_fix_reg_contact(vl, &rcontact); 3031 3032 vl->rid = eXosip_register_build_initial_register(utmp, server, rcontact, vl->regTimeout, &msg); 2994 3033 if (vl->proxy) 2995 3034 osip_message_set_route(msg, vl->proxy); 3035 if (rcontact != vl->contact) 3036 osip_free(rcontact); 2996 3037 } 2997 3038 #else … … 3343 3384 add_contact_param(vl, "user", "phone", TRUE); 3344 3385 3386 if ((mobility & PH_USE_RFC5626) == PH_USE_RFC5626) { 3387 // add_contact_param(vl, "ob", 0, TRUE); 3388 } 3345 3389 3346 3390 vl->mobility = mobility; -
phapi/phapi.h
r279 r282 174 174 #define PH_ANONYMOUS_CALL (1 << 9) 175 175 #define PH_NORTCP_ATTR (1 << 10) 176 #define PH_USE_RFC5626 (1 << 11) 176 177 177 178 typedef struct _phStream … … 197 198 PH_LINE_MOBILITY_MOBILE, 198 199 PH_LINE_MOBILITY_PHONE, 199 PH_LINE_MOBILITY_MASK = 255200 PH_LINE_MOBILITY_MASK = 3 200 201 }; 201 202 #define checkmobility(m, v) ((((m) & PH_LINE_MOBILITY_MASK) == (v))) … … 1263 1264 char http_proxy_user[128]; 1264 1265 char http_proxy_passwd[128]; 1266 1267 char sip_id[128]; // Used for RFC5626 functionality 1268 1265 1269 #ifdef WIN32 1266 1270 void* videoHandle;
Note: See TracChangeset
for help on using the changeset viewer.
