aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.c31
-rw-r--r--readme.md25
-rw-r--r--sip.c18
3 files changed, 63 insertions, 11 deletions
diff --git a/main.c b/main.c
index 939f12d..61b6b16 100644
--- a/main.c
+++ b/main.c
@@ -7,6 +7,27 @@
int debug;
+//Channel *ingress;
+//Channel *egress;
+//
+//
+//void
+//threadnetrecv(void *arg)
+//{
+//
+//}
+//
+//void
+//threadnetppu(void *)
+//{
+//
+//}
+//
+//void
+//threadnetsend(void *arg)
+//{
+//
+//}
void
usage(void)
@@ -40,10 +61,16 @@ threadmain(int argc, char *argv[])
fd = dial(addr, nil, nil, nil);
if(fd < 0)
sysfatal("couldn't establish the connection");
-
- if(debug)
+ else if(debug)
fprint(2, "connection established\n");
+// ingress = chancreate(sizeof(Sipmsg*), 8);
+// egress = chancreate(sizeof(Sipmsg*), 8);
+// threadcreate(threadnetrecv, &fd, mainstacksize);
+// threadcreate(threadnetppu, nil, mainstacksize);
+// threadcreate(threadnetsend, &fd, mainstacksize);
+// yield();
+
sip = mksip(fd);
if(sip == nil)
sysfatal("mksip: %r");
diff --git a/readme.md b/readme.md
index e69de29..a70a116 100644
--- a/readme.md
+++ b/readme.md
@@ -0,0 +1,25 @@
+# Catphone
+
+A VoIP softphone operated by a cat.
+
+## Roadmap
+
+- [ ] SIP
+ - [x] REGISTER
+ - [x] MD5
+ - [ ] SHA-2
+ - [ ] INVITE
+- [ ] SDP
+- [ ] RTP/RTCP
+- [ ] Codecs
+ - [ ] G.711
+ - [ ] PCMU (ยต-law)
+ - [ ] PCMA (a-law)
+
+## References
+
+- rfc3261 - SIP: Session Initiation Protocol
+- rfc8760 - The Session Initiation Protocol (SIP) Digest Access Authentication Scheme
+- rfc5626 - Managing Client-Initiated Connections in the Session Initiation Protocol (SIP)
+- rfc8866 - SDP: Session Description Protocol
+- rfc3264 - An Offer/Answer Model with the Session Description Protocol (SDP)
diff --git a/sip.c b/sip.c
index 2c25da8..d237dd8 100644
--- a/sip.c
+++ b/sip.c
@@ -318,19 +318,19 @@ getheader(Hdrtab *ht, char *name)
void
delheader(Hdrtab *ht, char *name)
{
- Hdr **h, *nh;
+ Hdr *h, *nh;
uint key;
key = hash(name);
- h = &ht->headers[key];
- while(*h != nil){
- nh = (*h)->next;
- if(cistrcmp((*h)->name, name) == 0){
- free((*h)->name);
- free((*h)->value);
- free(*h);
+ h = ht->headers[key];
+ while(h != nil){
+ nh = h->next;
+ if(cistrcmp(h->name, name) == 0){
+ free(h->name);
+ free(h->value);
+ free(h);
}
- *h = nh;
+ h = nh;
}
}