[svn-commits] branch mogorman/asterisk-xmpp r18126 -
/team/mogorman/asterisk-xmpp/res/stun/
svn-commits at lists.digium.com
svn-commits at lists.digium.com
Thu Apr 6 22:33:55 MST 2006
Author: mogorman
Date: Fri Apr 7 00:33:54 2006
New Revision: 18126
URL: http://svn.digium.com/view/asterisk?rev=18126&view=rev
Log:
tested wrapper and it works, need to add some features
and then ill do res_stun.c for real ^_^
Modified:
team/mogorman/asterisk-xmpp/res/stun/main.c
team/mogorman/asterisk-xmpp/res/stun/stunwrapper.cpp
Modified: team/mogorman/asterisk-xmpp/res/stun/main.c
URL: http://svn.digium.com/view/asterisk/team/mogorman/asterisk-xmpp/res/stun/main.c?rev=18126&r1=18125&r2=18126&view=diff
==============================================================================
--- team/mogorman/asterisk-xmpp/res/stun/main.c (original)
+++ team/mogorman/asterisk-xmpp/res/stun/main.c Fri Apr 7 00:33:54 2006
@@ -6,5 +6,8 @@
cold = insertstun();
printf("HELLO \n");
printf("HELLO %d\n",getRetVal(hott,0));
+ setupstun(hott, "64.233.167.126", "eth0", 10379);
+ executestun(hott);
+ printf("HELLO %d\n",getRetVal(hott,0));
return 0;
}
Modified: team/mogorman/asterisk-xmpp/res/stun/stunwrapper.cpp
URL: http://svn.digium.com/view/asterisk/team/mogorman/asterisk-xmpp/res/stun/stunwrapper.cpp?rev=18126&r1=18125&r2=18126&view=diff
==============================================================================
--- team/mogorman/asterisk-xmpp/res/stun/stunwrapper.cpp (original)
+++ team/mogorman/asterisk-xmpp/res/stun/stunwrapper.cpp Fri Apr 7 00:33:54 2006
@@ -70,43 +70,55 @@
mynode->type = stunNatType( mynode->stunServerAddr, 0, &presPort, &hairpin, mynode->srcPort, &mynode->sAddr[i]);
switch(mynode->type) {
case StunTypeFailure:
+ printf("StunTypeFailure\n");
mynode->retval[i] = -1;
return(NULL);
break;
case StunTypeUnknown:
+ printf("StunTypeUnknown\n");
mynode->retval[i] = 0xEE;
break;
case StunTypeOpen:
+ printf("StunTypeOpen\n");
mynode->retval[i] = 0x00;
break;
case StunTypeIndependentFilter:
+ printf("StunTypeIdependentFilter\n");
mynode->retval[i] = 0x02;
break;
case StunTypeDependentFilter:
+ printf("StunTypeDependentFilter\n");
mynode->retval[i] = 0x04;
break;
case StunTypePortDependedFilter:
+ printf("StunTypePortDependedFilter\n");
mynode->retval[i] = 0x06;
break;
case StunTypeDependentMapping:
+ printf("StunTypeDependentMapping\n");
mynode->retval[i] = 0x08;
break;
case StunTypeFirewall:
+ printf("StunTypeFirewall\n");
mynode->retval[i] = 0x0A;
break;
case StunTypeBlocked:
+ printf("StunTypeBlocked\n");
mynode->retval[i] = 0x0C;
break;
default:
+ printf("default\n");
mynode->retval[i] = 0x0E; // Unknown NAT type
break;
}
if (!hairpin) {
+ printf("not hairpin\n");
mynode->retval[i] |= 0x10;
}
if (presPort) {
+ printf("pres port!\n");
mynode->retval[i] |= 0x01;
}
}
@@ -170,7 +182,7 @@
void *executestun(void *pointer)
{
Node *mynode = (struct Node *)pointer;
- return executestun(mynode);
+ return wrapper.executestun(mynode);
}
void *gethead()
More information about the svn-commits
mailing list