Changeset 440:f38bff0bf3e9 in freeDiameter
- Timestamp:
- Jul 28, 2010, 4:17:29 PM (14 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/app_sip.conf.sample
r432 r440 3 3 #You must have at least in your network a Diameter SIP server and a Subscriber Locator (on different nodes) 4 4 mode = DSSERVER; 5 6 7 # Administrator commands port (port should be provided with "-p" in remote line) 8 ppr_port=90; 9 rtr_port=91; 5 10 6 11 -
extensions/app_sip/app_sip.h
r434 r440 66 66 char mysql_prefix[10]; //default: as_ 67 67 uint16_t mysql_port; //if 0, default port will be used 68 68 uint16_t rtr_port; 69 uint16_t ppr_port; 69 70 }; 70 71 extern struct as_conf * as_conf; … … 135 136 int app_sip_RTR_cb(struct rtrsipaor structure); 136 137 int app_sip_PPR_cb(struct pprsipaor structure); 137 #define PORT 666 //TODO:put in conf file 138 138 139 139 140 int ds_entry(); -
extensions/app_sip/app_sip.l
r433 r440 121 121 return ASMYSQL_PORT; 122 122 } 123 123 (?i:"rtr_port") { 124 return RTR_PORT; 125 } 126 (?i:"ppr_port") { 127 return PPR_PORT; 128 } 124 129 (?i:"mode") { 125 130 return MODE; -
extensions/app_sip/app_sip.y
r433 r440 124 124 %token ASMYSQL_SERVER 125 125 %token ASMYSQL_PORT 126 %token RTR_PORT 127 %token PPR_PORT 126 128 127 129 /* Tokens and types for routing table definition */ … … 146 148 | conffile mysql_server 147 149 | conffile mysql_port 150 | conffile rtr_port 151 | conffile ppr_port 148 152 ; 149 153 … … 193 197 } 194 198 ; 199 rtr_port: RTR_PORT '=' INTEGER ';' 200 { 201 as_conf->rtr_port = (uint16_t)$3; 202 } 203 ; 204 ppr_port: PPR_PORT '=' INTEGER ';' 205 { 206 as_conf->ppr_port = (uint16_t)$3; 207 } 208 ; -
extensions/app_sip/pushprofile.c
r433 r440 47 47 void *ppr_socket(void *arg) 48 48 { 49 /*49 50 50 SOCKET sock; 51 51 SOCKADDR_IN sin, csin; 52 struct rtrsipaor rtrsip;52 struct pprsipaor pprsip; 53 53 int rcvbytes=0; 54 54 sock = socket(AF_INET, SOCK_STREAM, 0); 55 55 sin.sin_addr.s_addr = inet_addr("127.0.0.1"); 56 56 sin.sin_family = AF_INET; 57 sin.sin_port = htons(PORT);57 sin.sin_port = htons(as_conf->ppr_port); 58 58 socklen_t sinsize = sizeof(csin); 59 59 int accepted=0; … … 72 72 if(accepted>-1) 73 73 { 74 rcvbytes=recv(accepted, & rtrsip, sizeof(struct rtrsipaor),0);74 rcvbytes=recv(accepted, &pprsip, sizeof(struct pprsipaor),0); 75 75 76 76 if(rcvbytes>-1) … … 86 86 else 87 87 TRACE_DEBUG(INFO,"Can't create socket!"); 88 */ 88 89 89 90 90 pthread_exit(NULL); -
extensions/app_sip/registrationtermination.c
r433 r440 54 54 sin.sin_addr.s_addr = inet_addr("127.0.0.1"); 55 55 sin.sin_family = AF_INET; 56 sin.sin_port = htons( PORT);56 sin.sin_port = htons(as_conf->rtr_port); 57 57 socklen_t sinsize = sizeof(csin); 58 58 int accepted=0; … … 251 251 252 252 //TODO:remove for debug 253 fd_msg_dump_walk(INFO,message);253 //fd_msg_dump_walk(INFO,message); 254 254 CHECK_FCT( fd_msg_send( &message, NULL, NULL )); 255 255 -
extensions/app_sip/tools/app_sip_ppr.c
r435 r440 48 48 #include <stdlib.h> 49 49 #include <string.h> 50 #define PORT 667 50 51 51 #include <errno.h> 52 52 … … 66 66 struct pprsipaor pprsip; 67 67 int numdatatype=0,i=0; 68 68 int port=667; 69 69 70 sock = socket(AF_INET, SOCK_STREAM, 0); 70 71 sin.sin_addr.s_addr = inet_addr("127.0.0.1"); 71 72 sin.sin_family = AF_INET; 72 sin.sin_port = htons(PORT);73 73 74 74 75 //We initialize the structure … … 158 159 pprsip.accounting=1; 159 160 161 162 } 163 else if(strcmp(argv[i],"-p")==0) 164 { 165 166 if(sscanf(argv[i+1],"%d", &port)!=1) 167 { 168 fprintf(stderr,"Incorrect port number!\n"); 169 return 1; 170 } 171 172 160 173 i++; 161 174 } … … 170 183 } 171 184 185 //We set the port number 186 sin.sin_port = htons(port); 172 187 173 188 … … 180 195 181 196 182 197 fprintf(stderr,"%d!\n",port); 183 198 184 199 /* -
extensions/app_sip/tools/app_sip_rtr.c
r433 r440 48 48 #include <stdlib.h> 49 49 #include <string.h> 50 #define PORT 66651 50 #include <errno.h> 52 51 … … 68 67 struct rtrsipaor rtrsip; 69 68 int numaor=0,i=0; 70 69 int port=666; 70 71 71 sock = socket(AF_INET, SOCK_STREAM, 0); 72 72 sin.sin_addr.s_addr = inet_addr("127.0.0.1"); 73 73 sin.sin_family = AF_INET; 74 sin.sin_port = htons(PORT);74 75 75 76 76 //We initialize the structure … … 215 215 rtrsip.reason=3; 216 216 } 217 else if(strcmp(argv[i],"-p")==0) 218 { 219 220 if(sscanf(argv[i+1],"%d", &port)!=1) 221 { 222 fprintf(stderr,"Incorrect port number!\n"); 223 return 1; 224 } 225 226 227 i++; 228 } 217 229 else 218 230 { … … 247 259 } 248 260 249 261 //We set the port number 262 sin.sin_port = htons(port); 250 263 251 264
Note: See TracChangeset
for help on using the changeset viewer.