diff options
author | sobomax <sobomax@FreeBSD.org> | 2006-12-04 07:33:38 +0800 |
---|---|---|
committer | sobomax <sobomax@FreeBSD.org> | 2006-12-04 07:33:38 +0800 |
commit | 9abf7d80930c8ec20cfd9518760cd38fbb805a58 (patch) | |
tree | 41d882be83fcc18c5413dcbd73afe1c52835cd53 | |
parent | 82f87fd0907132ba12218ca637c0428657eb35dc (diff) | |
download | freebsd-ports-gnome-9abf7d80930c8ec20cfd9518760cd38fbb805a58.tar.gz freebsd-ports-gnome-9abf7d80930c8ec20cfd9518760cd38fbb805a58.tar.zst freebsd-ports-gnome-9abf7d80930c8ec20cfd9518760cd38fbb805a58.zip |
Allow secure digest auth to be requested for outgoing call legs by AGI.
-rw-r--r-- | net/asterisk/files/asterisk.sh.in | 1 | ||||
-rw-r--r-- | net/asterisk/files/patch-channels::chan_sip.c | 35 | ||||
-rw-r--r-- | net/asterisk10/files/asterisk.sh.in | 1 | ||||
-rw-r--r-- | net/asterisk10/files/patch-channels::chan_sip.c | 35 | ||||
-rw-r--r-- | net/asterisk12/files/asterisk.sh.in | 1 | ||||
-rw-r--r-- | net/asterisk12/files/patch-channels::chan_sip.c | 35 | ||||
-rw-r--r-- | net/asterisk14/files/asterisk.sh.in | 1 | ||||
-rw-r--r-- | net/asterisk14/files/patch-channels::chan_sip.c | 35 | ||||
-rw-r--r-- | net/asterisk16/files/asterisk.sh.in | 1 | ||||
-rw-r--r-- | net/asterisk16/files/patch-channels::chan_sip.c | 35 |
10 files changed, 115 insertions, 65 deletions
diff --git a/net/asterisk/files/asterisk.sh.in b/net/asterisk/files/asterisk.sh.in index 3774209eefe1..4489cb50be04 100644 --- a/net/asterisk/files/asterisk.sh.in +++ b/net/asterisk/files/asterisk.sh.in @@ -3,7 +3,6 @@ # PROVIDE: asterisk # REQUIRE: DAEMON # KEYWORD: shutdown - # # Add the following lines to /etc/rc.conf to enable asterisk: # diff --git a/net/asterisk/files/patch-channels::chan_sip.c b/net/asterisk/files/patch-channels::chan_sip.c index 2b2fae7a311f..30eca068f9b1 100644 --- a/net/asterisk/files/patch-channels::chan_sip.c +++ b/net/asterisk/files/patch-channels::chan_sip.c @@ -1,9 +1,6 @@ - -$FreeBSD$ - ---- channels/chan_sip.c.orig Tue Jan 24 16:25:53 2006 -+++ channels/chan_sip.c Tue Jan 24 16:30:44 2006 -@@ -337,7 +337,7 @@ static char global_vmexten[AST_MAX_EXTEN +--- channels/chan_sip.c.orig Fri Nov 17 15:51:56 2006 ++++ channels/chan_sip.c Fri Nov 17 15:53:30 2006 +@@ -340,7 +340,7 @@ static char global_vmexten[AST_MAX_EXTEN static char default_language[MAX_LANGUAGE] = ""; @@ -12,7 +9,7 @@ $FreeBSD$ static char default_callerid[AST_MAX_EXTENSION] = DEFAULT_CALLERID; static char default_fromdomain[AST_MAX_EXTENSION] = ""; -@@ -475,6 +475,7 @@ struct sip_invite_param { +@@ -483,6 +483,7 @@ struct sip_invite_param { struct sip_route { struct sip_route *next; @@ -20,7 +17,7 @@ $FreeBSD$ char hop[0]; }; -@@ -6015,6 +6016,7 @@ static void build_route(struct sip_pvt * +@@ -6222,6 +6223,7 @@ static void build_route(struct sip_pvt * /* Make a struct route */ thishop = malloc(sizeof(*thishop) + len); if (thishop) { @@ -28,7 +25,7 @@ $FreeBSD$ ast_copy_string(thishop->hop, rr, len); ast_log(LOG_DEBUG, "build_route: Record-Route hop: <%s>\n", thishop->hop); /* Link in */ -@@ -6040,31 +6042,41 @@ static void build_route(struct sip_pvt * +@@ -6247,31 +6249,41 @@ static void build_route(struct sip_pvt * /* Only append the contact if we are dealing with a strict router */ if (!head || (!ast_strlen_zero(head->hop) && strstr(head->hop,";lr") == NULL) ) { @@ -94,7 +91,21 @@ $FreeBSD$ } } } -@@ -10352,7 +10364,11 @@ static int handle_request_invite(struct +@@ -9248,6 +9260,13 @@ static int build_reply_digest(struct sip + secret = p->peersecret; + md5secret = p->peermd5secret; + } ++ /* No authentication. Try to get auth info from channel vars */ ++ if (ast_strlen_zero(username)) ++ { ++ username = pbx_builtin_getvar_helper(p->owner, "SIP_AUTH_NAME"); ++ secret = pbx_builtin_getvar_helper(p->owner, "SIP_AUTH_SECRET"); ++ md5secret = pbx_builtin_getvar_helper(p->owner, "SIP_AUTH_MD5SECRET"); ++ } + if (ast_strlen_zero(username)) /* We have no authentication */ + return -1; + +@@ -10621,7 +10640,11 @@ static int handle_request_invite(struct gotdest = get_destination(p, NULL); get_rdnis(p, NULL); @@ -107,7 +118,7 @@ $FreeBSD$ build_contact(p); if (gotdest) { -@@ -10380,7 +10396,6 @@ static int handle_request_invite(struct +@@ -10649,7 +10672,6 @@ static int handle_request_invite(struct 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 */ @@ -115,7 +126,7 @@ $FreeBSD$ if (c) { /* Pre-lock the call */ ast_mutex_lock(&c->lock); -@@ -10466,7 +10481,12 @@ static int handle_request_invite(struct +@@ -10735,7 +10757,12 @@ static int handle_request_invite(struct transmit_response(p, "180 Ringing", req); break; case AST_STATE_UP: diff --git a/net/asterisk10/files/asterisk.sh.in b/net/asterisk10/files/asterisk.sh.in index 3774209eefe1..4489cb50be04 100644 --- a/net/asterisk10/files/asterisk.sh.in +++ b/net/asterisk10/files/asterisk.sh.in @@ -3,7 +3,6 @@ # PROVIDE: asterisk # REQUIRE: DAEMON # KEYWORD: shutdown - # # Add the following lines to /etc/rc.conf to enable asterisk: # diff --git a/net/asterisk10/files/patch-channels::chan_sip.c b/net/asterisk10/files/patch-channels::chan_sip.c index 2b2fae7a311f..30eca068f9b1 100644 --- a/net/asterisk10/files/patch-channels::chan_sip.c +++ b/net/asterisk10/files/patch-channels::chan_sip.c @@ -1,9 +1,6 @@ - -$FreeBSD$ - ---- channels/chan_sip.c.orig Tue Jan 24 16:25:53 2006 -+++ channels/chan_sip.c Tue Jan 24 16:30:44 2006 -@@ -337,7 +337,7 @@ static char global_vmexten[AST_MAX_EXTEN +--- channels/chan_sip.c.orig Fri Nov 17 15:51:56 2006 ++++ channels/chan_sip.c Fri Nov 17 15:53:30 2006 +@@ -340,7 +340,7 @@ static char global_vmexten[AST_MAX_EXTEN static char default_language[MAX_LANGUAGE] = ""; @@ -12,7 +9,7 @@ $FreeBSD$ static char default_callerid[AST_MAX_EXTENSION] = DEFAULT_CALLERID; static char default_fromdomain[AST_MAX_EXTENSION] = ""; -@@ -475,6 +475,7 @@ struct sip_invite_param { +@@ -483,6 +483,7 @@ struct sip_invite_param { struct sip_route { struct sip_route *next; @@ -20,7 +17,7 @@ $FreeBSD$ char hop[0]; }; -@@ -6015,6 +6016,7 @@ static void build_route(struct sip_pvt * +@@ -6222,6 +6223,7 @@ static void build_route(struct sip_pvt * /* Make a struct route */ thishop = malloc(sizeof(*thishop) + len); if (thishop) { @@ -28,7 +25,7 @@ $FreeBSD$ ast_copy_string(thishop->hop, rr, len); ast_log(LOG_DEBUG, "build_route: Record-Route hop: <%s>\n", thishop->hop); /* Link in */ -@@ -6040,31 +6042,41 @@ static void build_route(struct sip_pvt * +@@ -6247,31 +6249,41 @@ static void build_route(struct sip_pvt * /* Only append the contact if we are dealing with a strict router */ if (!head || (!ast_strlen_zero(head->hop) && strstr(head->hop,";lr") == NULL) ) { @@ -94,7 +91,21 @@ $FreeBSD$ } } } -@@ -10352,7 +10364,11 @@ static int handle_request_invite(struct +@@ -9248,6 +9260,13 @@ static int build_reply_digest(struct sip + secret = p->peersecret; + md5secret = p->peermd5secret; + } ++ /* No authentication. Try to get auth info from channel vars */ ++ if (ast_strlen_zero(username)) ++ { ++ username = pbx_builtin_getvar_helper(p->owner, "SIP_AUTH_NAME"); ++ secret = pbx_builtin_getvar_helper(p->owner, "SIP_AUTH_SECRET"); ++ md5secret = pbx_builtin_getvar_helper(p->owner, "SIP_AUTH_MD5SECRET"); ++ } + if (ast_strlen_zero(username)) /* We have no authentication */ + return -1; + +@@ -10621,7 +10640,11 @@ static int handle_request_invite(struct gotdest = get_destination(p, NULL); get_rdnis(p, NULL); @@ -107,7 +118,7 @@ $FreeBSD$ build_contact(p); if (gotdest) { -@@ -10380,7 +10396,6 @@ static int handle_request_invite(struct +@@ -10649,7 +10672,6 @@ static int handle_request_invite(struct 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 */ @@ -115,7 +126,7 @@ $FreeBSD$ if (c) { /* Pre-lock the call */ ast_mutex_lock(&c->lock); -@@ -10466,7 +10481,12 @@ static int handle_request_invite(struct +@@ -10735,7 +10757,12 @@ static int handle_request_invite(struct transmit_response(p, "180 Ringing", req); break; case AST_STATE_UP: diff --git a/net/asterisk12/files/asterisk.sh.in b/net/asterisk12/files/asterisk.sh.in index 3774209eefe1..4489cb50be04 100644 --- a/net/asterisk12/files/asterisk.sh.in +++ b/net/asterisk12/files/asterisk.sh.in @@ -3,7 +3,6 @@ # PROVIDE: asterisk # REQUIRE: DAEMON # KEYWORD: shutdown - # # Add the following lines to /etc/rc.conf to enable asterisk: # diff --git a/net/asterisk12/files/patch-channels::chan_sip.c b/net/asterisk12/files/patch-channels::chan_sip.c index 2b2fae7a311f..30eca068f9b1 100644 --- a/net/asterisk12/files/patch-channels::chan_sip.c +++ b/net/asterisk12/files/patch-channels::chan_sip.c @@ -1,9 +1,6 @@ - -$FreeBSD$ - ---- channels/chan_sip.c.orig Tue Jan 24 16:25:53 2006 -+++ channels/chan_sip.c Tue Jan 24 16:30:44 2006 -@@ -337,7 +337,7 @@ static char global_vmexten[AST_MAX_EXTEN +--- channels/chan_sip.c.orig Fri Nov 17 15:51:56 2006 ++++ channels/chan_sip.c Fri Nov 17 15:53:30 2006 +@@ -340,7 +340,7 @@ static char global_vmexten[AST_MAX_EXTEN static char default_language[MAX_LANGUAGE] = ""; @@ -12,7 +9,7 @@ $FreeBSD$ static char default_callerid[AST_MAX_EXTENSION] = DEFAULT_CALLERID; static char default_fromdomain[AST_MAX_EXTENSION] = ""; -@@ -475,6 +475,7 @@ struct sip_invite_param { +@@ -483,6 +483,7 @@ struct sip_invite_param { struct sip_route { struct sip_route *next; @@ -20,7 +17,7 @@ $FreeBSD$ char hop[0]; }; -@@ -6015,6 +6016,7 @@ static void build_route(struct sip_pvt * +@@ -6222,6 +6223,7 @@ static void build_route(struct sip_pvt * /* Make a struct route */ thishop = malloc(sizeof(*thishop) + len); if (thishop) { @@ -28,7 +25,7 @@ $FreeBSD$ ast_copy_string(thishop->hop, rr, len); ast_log(LOG_DEBUG, "build_route: Record-Route hop: <%s>\n", thishop->hop); /* Link in */ -@@ -6040,31 +6042,41 @@ static void build_route(struct sip_pvt * +@@ -6247,31 +6249,41 @@ static void build_route(struct sip_pvt * /* Only append the contact if we are dealing with a strict router */ if (!head || (!ast_strlen_zero(head->hop) && strstr(head->hop,";lr") == NULL) ) { @@ -94,7 +91,21 @@ $FreeBSD$ } } } -@@ -10352,7 +10364,11 @@ static int handle_request_invite(struct +@@ -9248,6 +9260,13 @@ static int build_reply_digest(struct sip + secret = p->peersecret; + md5secret = p->peermd5secret; + } ++ /* No authentication. Try to get auth info from channel vars */ ++ if (ast_strlen_zero(username)) ++ { ++ username = pbx_builtin_getvar_helper(p->owner, "SIP_AUTH_NAME"); ++ secret = pbx_builtin_getvar_helper(p->owner, "SIP_AUTH_SECRET"); ++ md5secret = pbx_builtin_getvar_helper(p->owner, "SIP_AUTH_MD5SECRET"); ++ } + if (ast_strlen_zero(username)) /* We have no authentication */ + return -1; + +@@ -10621,7 +10640,11 @@ static int handle_request_invite(struct gotdest = get_destination(p, NULL); get_rdnis(p, NULL); @@ -107,7 +118,7 @@ $FreeBSD$ build_contact(p); if (gotdest) { -@@ -10380,7 +10396,6 @@ static int handle_request_invite(struct +@@ -10649,7 +10672,6 @@ static int handle_request_invite(struct 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 */ @@ -115,7 +126,7 @@ $FreeBSD$ if (c) { /* Pre-lock the call */ ast_mutex_lock(&c->lock); -@@ -10466,7 +10481,12 @@ static int handle_request_invite(struct +@@ -10735,7 +10757,12 @@ static int handle_request_invite(struct transmit_response(p, "180 Ringing", req); break; case AST_STATE_UP: diff --git a/net/asterisk14/files/asterisk.sh.in b/net/asterisk14/files/asterisk.sh.in index 3774209eefe1..4489cb50be04 100644 --- a/net/asterisk14/files/asterisk.sh.in +++ b/net/asterisk14/files/asterisk.sh.in @@ -3,7 +3,6 @@ # PROVIDE: asterisk # REQUIRE: DAEMON # KEYWORD: shutdown - # # Add the following lines to /etc/rc.conf to enable asterisk: # diff --git a/net/asterisk14/files/patch-channels::chan_sip.c b/net/asterisk14/files/patch-channels::chan_sip.c index 2b2fae7a311f..30eca068f9b1 100644 --- a/net/asterisk14/files/patch-channels::chan_sip.c +++ b/net/asterisk14/files/patch-channels::chan_sip.c @@ -1,9 +1,6 @@ - -$FreeBSD$ - ---- channels/chan_sip.c.orig Tue Jan 24 16:25:53 2006 -+++ channels/chan_sip.c Tue Jan 24 16:30:44 2006 -@@ -337,7 +337,7 @@ static char global_vmexten[AST_MAX_EXTEN +--- channels/chan_sip.c.orig Fri Nov 17 15:51:56 2006 ++++ channels/chan_sip.c Fri Nov 17 15:53:30 2006 +@@ -340,7 +340,7 @@ static char global_vmexten[AST_MAX_EXTEN static char default_language[MAX_LANGUAGE] = ""; @@ -12,7 +9,7 @@ $FreeBSD$ static char default_callerid[AST_MAX_EXTENSION] = DEFAULT_CALLERID; static char default_fromdomain[AST_MAX_EXTENSION] = ""; -@@ -475,6 +475,7 @@ struct sip_invite_param { +@@ -483,6 +483,7 @@ struct sip_invite_param { struct sip_route { struct sip_route *next; @@ -20,7 +17,7 @@ $FreeBSD$ char hop[0]; }; -@@ -6015,6 +6016,7 @@ static void build_route(struct sip_pvt * +@@ -6222,6 +6223,7 @@ static void build_route(struct sip_pvt * /* Make a struct route */ thishop = malloc(sizeof(*thishop) + len); if (thishop) { @@ -28,7 +25,7 @@ $FreeBSD$ ast_copy_string(thishop->hop, rr, len); ast_log(LOG_DEBUG, "build_route: Record-Route hop: <%s>\n", thishop->hop); /* Link in */ -@@ -6040,31 +6042,41 @@ static void build_route(struct sip_pvt * +@@ -6247,31 +6249,41 @@ static void build_route(struct sip_pvt * /* Only append the contact if we are dealing with a strict router */ if (!head || (!ast_strlen_zero(head->hop) && strstr(head->hop,";lr") == NULL) ) { @@ -94,7 +91,21 @@ $FreeBSD$ } } } -@@ -10352,7 +10364,11 @@ static int handle_request_invite(struct +@@ -9248,6 +9260,13 @@ static int build_reply_digest(struct sip + secret = p->peersecret; + md5secret = p->peermd5secret; + } ++ /* No authentication. Try to get auth info from channel vars */ ++ if (ast_strlen_zero(username)) ++ { ++ username = pbx_builtin_getvar_helper(p->owner, "SIP_AUTH_NAME"); ++ secret = pbx_builtin_getvar_helper(p->owner, "SIP_AUTH_SECRET"); ++ md5secret = pbx_builtin_getvar_helper(p->owner, "SIP_AUTH_MD5SECRET"); ++ } + if (ast_strlen_zero(username)) /* We have no authentication */ + return -1; + +@@ -10621,7 +10640,11 @@ static int handle_request_invite(struct gotdest = get_destination(p, NULL); get_rdnis(p, NULL); @@ -107,7 +118,7 @@ $FreeBSD$ build_contact(p); if (gotdest) { -@@ -10380,7 +10396,6 @@ static int handle_request_invite(struct +@@ -10649,7 +10672,6 @@ static int handle_request_invite(struct 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 */ @@ -115,7 +126,7 @@ $FreeBSD$ if (c) { /* Pre-lock the call */ ast_mutex_lock(&c->lock); -@@ -10466,7 +10481,12 @@ static int handle_request_invite(struct +@@ -10735,7 +10757,12 @@ static int handle_request_invite(struct transmit_response(p, "180 Ringing", req); break; case AST_STATE_UP: diff --git a/net/asterisk16/files/asterisk.sh.in b/net/asterisk16/files/asterisk.sh.in index 3774209eefe1..4489cb50be04 100644 --- a/net/asterisk16/files/asterisk.sh.in +++ b/net/asterisk16/files/asterisk.sh.in @@ -3,7 +3,6 @@ # PROVIDE: asterisk # REQUIRE: DAEMON # KEYWORD: shutdown - # # Add the following lines to /etc/rc.conf to enable asterisk: # diff --git a/net/asterisk16/files/patch-channels::chan_sip.c b/net/asterisk16/files/patch-channels::chan_sip.c index 2b2fae7a311f..30eca068f9b1 100644 --- a/net/asterisk16/files/patch-channels::chan_sip.c +++ b/net/asterisk16/files/patch-channels::chan_sip.c @@ -1,9 +1,6 @@ - -$FreeBSD$ - ---- channels/chan_sip.c.orig Tue Jan 24 16:25:53 2006 -+++ channels/chan_sip.c Tue Jan 24 16:30:44 2006 -@@ -337,7 +337,7 @@ static char global_vmexten[AST_MAX_EXTEN +--- channels/chan_sip.c.orig Fri Nov 17 15:51:56 2006 ++++ channels/chan_sip.c Fri Nov 17 15:53:30 2006 +@@ -340,7 +340,7 @@ static char global_vmexten[AST_MAX_EXTEN static char default_language[MAX_LANGUAGE] = ""; @@ -12,7 +9,7 @@ $FreeBSD$ static char default_callerid[AST_MAX_EXTENSION] = DEFAULT_CALLERID; static char default_fromdomain[AST_MAX_EXTENSION] = ""; -@@ -475,6 +475,7 @@ struct sip_invite_param { +@@ -483,6 +483,7 @@ struct sip_invite_param { struct sip_route { struct sip_route *next; @@ -20,7 +17,7 @@ $FreeBSD$ char hop[0]; }; -@@ -6015,6 +6016,7 @@ static void build_route(struct sip_pvt * +@@ -6222,6 +6223,7 @@ static void build_route(struct sip_pvt * /* Make a struct route */ thishop = malloc(sizeof(*thishop) + len); if (thishop) { @@ -28,7 +25,7 @@ $FreeBSD$ ast_copy_string(thishop->hop, rr, len); ast_log(LOG_DEBUG, "build_route: Record-Route hop: <%s>\n", thishop->hop); /* Link in */ -@@ -6040,31 +6042,41 @@ static void build_route(struct sip_pvt * +@@ -6247,31 +6249,41 @@ static void build_route(struct sip_pvt * /* Only append the contact if we are dealing with a strict router */ if (!head || (!ast_strlen_zero(head->hop) && strstr(head->hop,";lr") == NULL) ) { @@ -94,7 +91,21 @@ $FreeBSD$ } } } -@@ -10352,7 +10364,11 @@ static int handle_request_invite(struct +@@ -9248,6 +9260,13 @@ static int build_reply_digest(struct sip + secret = p->peersecret; + md5secret = p->peermd5secret; + } ++ /* No authentication. Try to get auth info from channel vars */ ++ if (ast_strlen_zero(username)) ++ { ++ username = pbx_builtin_getvar_helper(p->owner, "SIP_AUTH_NAME"); ++ secret = pbx_builtin_getvar_helper(p->owner, "SIP_AUTH_SECRET"); ++ md5secret = pbx_builtin_getvar_helper(p->owner, "SIP_AUTH_MD5SECRET"); ++ } + if (ast_strlen_zero(username)) /* We have no authentication */ + return -1; + +@@ -10621,7 +10640,11 @@ static int handle_request_invite(struct gotdest = get_destination(p, NULL); get_rdnis(p, NULL); @@ -107,7 +118,7 @@ $FreeBSD$ build_contact(p); if (gotdest) { -@@ -10380,7 +10396,6 @@ static int handle_request_invite(struct +@@ -10649,7 +10672,6 @@ static int handle_request_invite(struct 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 */ @@ -115,7 +126,7 @@ $FreeBSD$ if (c) { /* Pre-lock the call */ ast_mutex_lock(&c->lock); -@@ -10466,7 +10481,12 @@ static int handle_request_invite(struct +@@ -10735,7 +10757,12 @@ static int handle_request_invite(struct transmit_response(p, "180 Ringing", req); break; case AST_STATE_UP: |