Idefisk
Tools
Tutorials
Reviews
VoIP Providers
Archives
AsteriskGuru Archives
Mailing List Archives
FAQ
Search
Memberlist
Usergroups
Register
Profile
Log in to check your private messages
Log in
[Asterisk-cvs] asterisk/channels chan_sip.c,1.195,1.196
AsteriskGuru Archives Forum Index
->
Asterisk-CVS
View previous topic
::
View next topic
Author
Message
martinp at lists.digium.c
Guest
Posted: Wed Oct 15, 2003 9:46 pm
Post subject: [Asterisk-cvs] asterisk/channels chan_sip.c,1.195,1.196
Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv27954/channels
Modified Files:
chan_sip.c
Log Message:
In the SIP -> SIP if the called party disconnects with 486 make sure that the calling party gets 486 also
Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.195
retrieving revision 1.196
diff -u -d -r1.195 -r1.196
--- chan_sip.c 15 Oct 2003 17:32:19 -0000 1.195
+++ chan_sip.c 15 Oct 2003 22:12:05 -0000 1.196
@@ -1010,6 +1010,31 @@
static int transmit_response_reliable(struct sip_pvt *p, char *msg, struct sip_request *req);
+static int hangup_sip2cause(int cause)
+{
+ switch(cause)
+ {
+ case 486:
+ return AST_CAUSE_BUSY;
+ default:
+ return AST_CAUSE_NORMAL;
+ }
+ /* Never reached */
+ return 0;
+}
+
+static char *hangup_cause2sip(int cause)
+{
+ switch(cause)
+ {
+ case AST_CAUSE_BUSY:
+ return "486 Busy";
+ default:
+ return NULL;
+ }
+ /* Never reached */
+ return 0;
+}
static int sip_hangup(struct ast_channel *ast)
{
@@ -1061,8 +1086,13 @@
INVITE, but do set an autodestruct just in case. */
needdestroy = 0;
sip_scheddestroy(p, 15000);
- } else
- transmit_response_reliable(p, "403 Forbidden", &p->initreq);
+ } else {
+ char *res;
+ if (ast->hangupcause && ((res = hangup_cause2sip(ast->hangupcause)))) {
+ transmit_response_reliable(p, res, &p->initreq);
+ } else
+ transmit_response_reliable(p, "403 Forbidden", &p->initreq);
+ }
} else {
if (!p->pendinginvite) {
/* Send a hangup */
@@ -4456,19 +4486,6 @@
ast_log(LOG_DEBUG, "Found 302 Redirect to extension '%s'\n", s);
if (p->owner)
strncpy(p->owner->call_forward, s, sizeof(p->owner->call_forward) - 1);
-}
-
-static int hangup_sip2cause(int cause)
-{
- switch(cause)
- {
- case 486:
- return AST_CAUSE_BUSY;
- default:
- return AST_CAUSE_NORMAL;
- }
- /* Never reached */
- return 0;
}
static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_request *req)
Back to top
Display posts from previous:
All Posts
1 Day
7 Days
2 Weeks
1 Month
3 Months
6 Months
1 Year
Oldest First
Newest First
AsteriskGuru Archives Forum Index
->
Asterisk-CVS
All times are GMT
Page
1
of
1
Jump to:
Select a forum
Asterisk Mailing Lists
----------------
Asterisk-Users
Asterisk-Dev
Asterisk-CVS
Asterisk-Biz
Asterisk-Doc
Asterisk-BSD
Asterisk-Announce
Asterisk Call Centers
Asterisk-Video
Asterisk-Speech-Rec
Bristuff-Users
You
cannot
post new topics in this forum
You
cannot
reply to topics in this forum
You
cannot
edit your posts in this forum
You
cannot
delete your posts in this forum
You
cannot
vote in polls in this forum
Powered by
phpBB
© 2001, 2005 phpBB Group