aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormatteo <matteo@f38db490-d61c-443f-a65b-d21fe96a405b>2003-03-13 15:44:31 +0000
committermatteo <matteo@f38db490-d61c-443f-a65b-d21fe96a405b>2003-03-13 15:44:31 +0000
commit077328e2663d127ae27156081002729fc15f632a (patch)
treed8ab849df7554bceeabcc26942e151d4c33ef7a5
parent30de186e01fb6266f677b8bb5eba04834229e619 (diff)
gio mar 13 16:44:17 CET 2003
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@643 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-xchannels/chan_iax2.c6
-rwxr-xr-xchannels/chan_mgcp.c1
-rwxr-xr-xchannels/chan_sip.c6
-rwxr-xr-xchannels/iax2.h22
4 files changed, 31 insertions, 4 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index 23f936efb..96793258d 100755
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -3500,6 +3500,7 @@ static int socket_read(int *id, int fd, short events, void *cbdata)
int dcallno = 0;
struct ast_iax2_full_hdr *fh = (struct ast_iax2_full_hdr *)buf;
struct ast_iax2_mini_hdr *mh = (struct ast_iax2_mini_hdr *)buf;
+ struct ast_iax2_meta_hdr *meta = (struct ast_iax2_meta_hdr *)buf;
struct ast_iax2_frame fr, *cur;
struct ast_frame f;
struct ast_channel *c;
@@ -3522,6 +3523,11 @@ static int socket_read(int *id, int fd, short events, void *cbdata)
ast_log(LOG_WARNING, "midget packet received (%d of %d min)\n", res, sizeof(struct ast_iax2_mini_hdr));
return 1;
}
+ if (meta->zeros == 0) {
+ /* This is a a meta header */
+ ast_log(LOG_DEBUG, "Meta header Command = %d!\n", meta->metacmd);
+ return 1;
+ }
#ifdef DEBUG_SUPPORT
if (iaxdebug)
showframe(NULL, fh, 1, &sin);
diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c
index 0b7627d90..49d823b00 100755
--- a/channels/chan_mgcp.c
+++ b/channels/chan_mgcp.c
@@ -1345,6 +1345,7 @@ static int handle_request(struct mgcp_endpoint *p, struct mgcp_request *req, str
p->alreadygone = 1;
ast_queue_hangup(p->owner, 1);
}
+ transmit_notify_request(p, "", 0);
} else if ((strlen(ev) == 1) &&
(((ev[0] >= '0') && (ev[0] <= '9')) ||
((ev[0] >= 'A') && (ev[0] <= 'D')) ||
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 729bb816e..385c48389 100755
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -2249,6 +2249,7 @@ static int parse_contact(struct sip_pvt *pvt, struct sip_peer *p, struct sip_req
port = atoi(pt);
} else
port = DEFAULT_SIP_PORT;
+ memcpy(&oldsin, &p->addr, sizeof(oldsin));
if (!p->nat) {
/* XXX This could block for a long time XXX */
hp = gethostbyname(n);
@@ -2256,7 +2257,6 @@ static int parse_contact(struct sip_pvt *pvt, struct sip_peer *p, struct sip_req
ast_log(LOG_WARNING, "Invalid host '%s'\n", n);
return -1;
}
- memcpy(&oldsin, &p->addr, sizeof(oldsin));
p->addr.sin_family = AF_INET;
memcpy(&p->addr.sin_addr, hp->h_addr, sizeof(p->addr.sin_addr));
p->addr.sin_port = htons(port);
@@ -2273,7 +2273,7 @@ static int parse_contact(struct sip_pvt *pvt, struct sip_peer *p, struct sip_req
ast_sched_del(sched, p->expire);
if ((expirey < 1) || (expirey > max_expirey))
expirey = max_expirey;
- p->expire = ast_sched_add(sched, expirey * 1000, expire_register, p);
+ p->expire = ast_sched_add(sched, (expirey + 10) * 1000, expire_register, p);
pvt->expirey = expirey;
if (memcmp(&p->addr, &oldsin, sizeof(oldsin))) {
sip_poke_peer(p);
@@ -3629,7 +3629,7 @@ static int handle_request(struct sip_pvt *p, struct sip_request *req, struct soc
static int sipsock_read(int *id, int fd, short events, void *ignore)
{
struct sip_request req;
- struct sockaddr_in sin;
+ struct sockaddr_in sin = { 0, };
struct sip_pvt *p;
int res;
int len;
diff --git a/channels/iax2.h b/channels/iax2.h
index da8acadff..b38609c41 100755
--- a/channels/iax2.h
+++ b/channels/iax2.h
@@ -96,6 +96,9 @@
#define IAX_AUTH_MD5 (1 << 1)
#define IAX_AUTH_RSA (1 << 2)
+#define IAX_META_TRUNK 1 /* Trunk meta-message */
+#define IAX_META_VIDEO 2 /* Video frame */
+
#define IAX_DPSTATUS_EXISTS (1 << 0)
#define IAX_DPSTATUS_CANEXIST (1 << 1)
#define IAX_DPSTATUS_NONEXISTANT (1 << 2)
@@ -116,11 +119,28 @@ struct ast_iax2_full_hdr {
/* Mini header is used only for voice frames -- delivered unreliably */
struct ast_iax2_mini_hdr {
- short callno; /* Source call number -- high bit must be 0 */
+ unsigned short callno; /* Source call number -- high bit must be 0, rest must be non-zero */
unsigned short ts; /* 16-bit Timestamp (high 16 bits from last ast_iax2_full_hdr) */
/* Frametype implicitly VOICE_FRAME */
/* subclass implicit from last ast_iax2_full_hdr */
unsigned char iedata[0];
} __attribute__ ((__packed__));
+struct ast_iax2_meta_hdr {
+ unsigned short zeros; /* Zeros field -- must be zero */
+ unsigned char metacmd; /* Meta command */
+ unsigned char cmddata; /* Command Data */
+ unsigned char data[0];
+} __attribute__ ((__packed__));
+
+struct ast_iax2_meta_trunk_hdr {
+ unsigned int ts; /* 32-bit timestamp for all messages */
+ unsigned char data[0];
+};
+
+struct ast_iax2_meta_trunk_entry {
+ unsigned short callno; /* Call number */
+ unsigned short len; /* Length of data for this callno */
+};
+
#endif