summaryrefslogtreecommitdiff
path: root/net/asterisk12/files/patch-channels::chan_sip.c
diff options
context:
space:
mode:
authorMaxim Sobolev <sobomax@FreeBSD.org>2004-10-17 18:00:02 +0000
committerMaxim Sobolev <sobomax@FreeBSD.org>2004-10-17 18:00:02 +0000
commitcd8cc8071ff2ad81003a23f16fac61debf60153b (patch)
treea6810dff0623ee603db9fa365f2ee4ce444f0c7b /net/asterisk12/files/patch-channels::chan_sip.c
parentEnable building on 4.x. (diff)
Update to 1.0.1.
Notes
Notes: svn path=/head/; revision=119685
Diffstat (limited to 'net/asterisk12/files/patch-channels::chan_sip.c')
-rw-r--r--net/asterisk12/files/patch-channels::chan_sip.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/net/asterisk12/files/patch-channels::chan_sip.c b/net/asterisk12/files/patch-channels::chan_sip.c
index b98f9d185009..521d6a46d256 100644
--- a/net/asterisk12/files/patch-channels::chan_sip.c
+++ b/net/asterisk12/files/patch-channels::chan_sip.c
@@ -1,26 +1,26 @@
$FreeBSD$
---- channels/chan_sip.c.orig Wed Jan 14 08:10:53 2004
-+++ channels/chan_sip.c Fri Jan 30 01:47:34 2004
-@@ -124,7 +124,7 @@
- static int restart_monitor(void);
+--- channels/chan_sip.c.orig
++++ channels/chan_sip.c
+@@ -139,7 +139,7 @@
- /* Codecs that we support by default: */
--static int capability = AST_FORMAT_ULAW | AST_FORMAT_ALAW | AST_FORMAT_GSM | AST_FORMAT_H263;
-+static int capability = AST_FORMAT_ULAW | AST_FORMAT_ALAW | AST_FORMAT_GSM | AST_FORMAT_H263 | AST_FORMAT_G723_1 | AST_FORMAT_G729A;
- static int noncodeccapability = AST_RTP_DTMF;
+ static char default_language[MAX_LANGUAGE] = "";
- static char ourhost[256];
-@@ -176,6 +176,7 @@
+-static char default_callerid[AST_MAX_EXTENSION] = "asterisk";
++static char default_callerid[AST_MAX_EXTENSION] = "Unknown";
+
+ static char default_fromdomain[AST_MAX_EXTENSION] = "";
+
+@@ -244,6 +244,7 @@
struct sip_route {
struct sip_route *next;
char hop[0];
+ int lr;
};
- static struct sip_pvt {
-@@ -3417,6 +3418,10 @@
+ struct sip_history {
+@@ -4573,6 +4574,10 @@
/* Make a struct route */
thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+len+1);
if (thishop) {
@@ -28,17 +28,17 @@ $FreeBSD$
+ thishop->lr = 1;
+ else
+ thishop->lr = 0;
- strncpy(thishop->hop, rr, len);
+ strncpy(thishop->hop, rr, len); /* safe */
thishop->hop[len] = '\0';
ast_log(LOG_DEBUG, "build_route: Record-Route hop: <%s>\n", thishop->hop);
-@@ -3440,31 +3445,41 @@
+@@ -4596,31 +4601,41 @@
rr += len+1;
}
}
- /* 2nd append the Contact: if there is one */
- /* Can be multiple Contact headers, comma separated values - we just take the first */
- contact = get_header(req, "Contact");
-- if (strlen(contact)) {
+- if (!ast_strlen_zero(contact)) {
- ast_log(LOG_DEBUG, "build_route: Contact hop: %s\n", contact);
- /* Look for <: delimited address */
- c = strchr(contact, '<');
@@ -55,7 +55,7 @@ $FreeBSD$
+ if (head && head->lr) {
+ thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+strlen(head->hop)+1);
if (thishop) {
-- strncpy(thishop->hop, c, len);
+- strncpy(thishop->hop, c, len); /* safe */
- thishop->hop[len] = '\0';
- thishop->next = NULL;
- /* Goes at the end */
@@ -71,7 +71,7 @@ $FreeBSD$
+ /* Append the Contact: if there is one and first route is w/o `lr' param */
+ /* Can be multiple Contact headers, comma separated values - we just take the first */
+ contact = get_header(req, "Contact");
-+ if (strlen(contact)) {
++ if (!ast_strlen_zero(contact)) {
+ ast_log(LOG_DEBUG, "build_route: Contact hop: %s\n", contact);
+ /* Look for <: delimited address */
+ c = strchr(contact, '<');
@@ -85,7 +85,7 @@ $FreeBSD$
+ }
+ thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+len+1);
+ if (thishop) {
-+ strncpy(thishop->hop, c, len);
++ strncpy(thishop->hop, c, len); /* safe */
+ thishop->hop[len] = '\0';
+ thishop->next = NULL;
+ /* Goes at the end */
@@ -97,7 +97,7 @@ $FreeBSD$
}
}
/* Store as new route */
-@@ -5143,7 +5158,11 @@
+@@ -7197,7 +7212,11 @@
/* Get destination right away */
gotdest = get_destination(p, NULL);
get_rdnis(p, NULL);
@@ -110,8 +110,8 @@ $FreeBSD$
build_contact(p);
if (gotdest) {
-@@ -5165,7 +5184,6 @@
- c = sip_new(p, AST_STATE_DOWN, strlen(p->username) ? p->username : NULL);
+@@ -7225,7 +7244,6 @@
+ c = sip_new(p, AST_STATE_DOWN, ast_strlen_zero(p->username) ? NULL : p->username );
*recount = 1;
/* Save Record-Route for any later requests we make on this dialogue */
- build_route(p, req, 0);