[asterisk-commits] oej: branch group/sip_session_timers r88711 - /team/group/sip_session_timers/...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Nov 5 14:17:38 CST 2007


Author: oej
Date: Mon Nov  5 14:17:38 2007
New Revision: 88711

URL: http://svn.digium.com/view/asterisk?view=rev&rev=88711
Log:
Reformat, including patch from bug tracker, fixing manager channel listing too.

(Can't test compile, so please check. Asterisk OS/X is broken)

Modified:
    team/group/sip_session_timers/channels/chan_sip.c

Modified: team/group/sip_session_timers/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/group/sip_session_timers/channels/chan_sip.c?view=diff&rev=88711&r1=88710&r2=88711
==============================================================================
--- team/group/sip_session_timers/channels/chan_sip.c (original)
+++ team/group/sip_session_timers/channels/chan_sip.c Mon Nov  5 14:17:38 2007
@@ -6834,17 +6834,17 @@
 /*! \brief Transmit 422 response with Min-SE header (Session-Timers)  */
 static int transmit_response_with_minse(struct sip_pvt *p, const char *msg, const struct sip_request *req, int minse_int)
 {
-    struct sip_request resp;
-    char minse_str[20];
-
-    respprep(&resp, p, msg, req);
-    append_date(&resp);
+	struct sip_request resp;
+	char minse_str[20];
+
+	respprep(&resp, p, msg, req);
+	append_date(&resp);
 
 	snprintf(minse_str, sizeof(minse_str), "%d", minse_int);
 	add_header(&resp, "Min-SE", minse_str);
 
-    add_header_contentLength(&resp, 0);
-    return send_response(p, &resp, XMIT_UNRELIABLE, 0);
+	add_header_contentLength(&resp, 0);
+	return send_response(p, &resp, XMIT_UNRELIABLE, 0);
 }
 
 
@@ -11457,8 +11457,6 @@
 	astman_append(s, "\r\n\r\n" );
 	return 0;
 }
-
-
 
 /*! \brief Show one peer in detail */
 static char *sip_show_peer(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
@@ -11613,7 +11611,7 @@
 		print_codec_to_cli(fd, &peer->prefs);
 		ast_cli(fd, ")\n");
 
-		ast_cli(fd, "  Auto-Framing:  %s \n", cli_yesno(peer->autoframing));
+		ast_cli(fd, "  Auto-Framing :  %s \n", cli_yesno(peer->autoframing));
 		ast_cli(fd, "  100 on REG   : %s\n", ast_test_flag(&peer->flags[1], SIP_PAGE2_REGISTERTRYING) ? "Yes" : "No");
 		ast_cli(fd, "  Status       : ");
 		peer_status(peer, status, sizeof(status));
@@ -11626,11 +11624,10 @@
  				ast_cli(fd, "                 %s = %s\n", v->name, v->value);
 		}
 
-		ast_cli(fd, "  Session-Timers   : %s\n", stmode2str(peer->st_mode_oper));
-		ast_cli(fd, "  Session-Refresher: %s\n", strefresher2str(peer->st_ref));
-		ast_cli(fd, "  Session-Expires  : %d secs\n", peer->st_max_se);
-		ast_cli(fd, "  Min-SE           : %d secs\n", peer->st_min_se);
-
+		ast_cli(fd, "  Sess-Timers  : %s\n", stmode2str(peer->st_mode_oper));
+		ast_cli(fd, "  Sess-Refresh : %s\n", strefresher2str(peer->st_ref));
+		ast_cli(fd, "  Sess-Expires : %d secs\n", peer->st_max_se);
+		ast_cli(fd, "  Min-Sess     : %d secs\n", peer->st_min_se);
 		ast_cli(fd,"\n");
 		unref_peer(peer);
 	} else  if (peer && type == 1) { /* manager listing */
@@ -11673,6 +11670,10 @@
 		astman_append(s, "SIP-UserPhone: %s\r\n", (ast_test_flag(&peer->flags[0], SIP_USEREQPHONE)?"Y":"N"));
 		astman_append(s, "SIP-VideoSupport: %s\r\n", (ast_test_flag(&peer->flags[1], SIP_PAGE2_VIDEOSUPPORT)?"Y":"N"));
 		astman_append(s, "SIP-TextSupport: %s\r\n", (ast_test_flag(&peer->flags[1], SIP_PAGE2_TEXTSUPPORT)?"Y":"N"));
+		astman_append(s, "SIP-Sess-Timers: %s\r\n", stmode2str(peer->st_mode_oper));
+		astman_append(s, "SIP-Sess-Refresh: %s\r\n", strefresher2str(peer->st_ref));
+		astman_append(s, "SIP-Sess-Expires: %d\r\n", peer->st_max_se);
+		astman_append(s, "SIP-Sess-Min: %d\r\n", peer->st_min_se);
 
 		/* - is enumerated */
 		astman_append(s, "SIP-DTMFmode: %s\r\n", dtmfmode2str(ast_test_flag(&peer->flags[0], SIP_DTMF)));
@@ -11766,6 +11767,11 @@
 		print_group(a->fd, user->pickupgroup, 0);
 		ast_cli(a->fd, "  Callerid     : %s\n", ast_callerid_merge(cbuf, sizeof(cbuf), user->cid_name, user->cid_num, "<unspecified>"));
 		ast_cli(a->fd, "  ACL          : %s\n", cli_yesno(user->ha != NULL));
+ 		ast_cli(a->fd, "  Sess-Timers  : %s\n", stmode2str(user->st_mode_oper));
+ 		ast_cli(a->fd, "  Sess-Refresh : %s\n", strefresher2str(user->st_ref));
+ 		ast_cli(a->fd, "  Sess-Expires : %d secs\n", user->st_max_se);
+ 		ast_cli(a->fd, "  Sess-Min-SE  : %d secs\n", user->st_min_se);
+
 		ast_cli(a->fd, "  Codec Order  : (");
 		print_codec_to_cli(a->fd, &user->prefs);
 		ast_cli(a->fd, ")\n");
@@ -11776,11 +11782,6 @@
 			for (v = user->chanvars ; v ; v = v->next)
  				ast_cli(a->fd, "                 %s = %s\n", v->name, v->value);
 		}
-
- 		ast_cli(a->fd, "  Session-Timers   : %s\n", stmode2str(user->st_mode_oper));
- 		ast_cli(a->fd, "  Session-Refresher: %s\n", strefresher2str(user->st_ref));
- 		ast_cli(a->fd, "  Session-Expires  : %d secs\n", user->st_max_se);
- 		ast_cli(a->fd, "  Min-SE           : %d secs\n", user->st_min_se);
 
 		ast_cli(a->fd,"\n");
 
@@ -12014,10 +12015,10 @@
 	ast_cli(a->fd, "  Auto-Framing:           %s\n", cli_yesno(global_autoframing));
 	ast_cli(a->fd, "  Outb. proxy:            %s %s\n", ast_strlen_zero(global_outboundproxy.name) ? "<not set>" : global_outboundproxy.name,
 							global_outboundproxy.force ? "(forced)" : "");
-	ast_cli(a->fd, "  Session-Timers:         %s\n", stmode2str(global_st_mode));
-	ast_cli(a->fd, "  Session-Refresher:      %s\n", strefresher2str (global_st_refresher));
-	ast_cli(a->fd, "  Session-Expires:        %d secs\n", global_max_se);
-	ast_cli(a->fd, "  Min-SE:                 %d secs\n", global_min_se);
+	ast_cli(a->fd, "  Session Timers:         %s\n", stmode2str(global_st_mode));
+	ast_cli(a->fd, "  Session Refresher:      %s\n", strefresher2str (global_st_refresher));
+	ast_cli(a->fd, "  Session Expires:        %d secs\n", global_max_se);
+	ast_cli(a->fd, "  Session Min-SE:         %d secs\n", global_min_se);
 
 	ast_cli(a->fd, "\nDefault Settings:\n");
 	ast_cli(a->fd, "-----------------\n");
@@ -13565,14 +13566,15 @@
 				}
 				p->st_active = TRUE;
 				p->st_active_peer_ua = TRUE;
+				start_session_timer(p);
 			} else {
 				/* UAS doesn't support Session-Timers */
 				if (st_get_mode(p) == SESSION_TIMER_MODE_ORIGINATE) {
 					p->st_ref = SESSION_TIMER_REFRESHER_UAC;
 					p->st_active_peer_ua = FALSE;
+					start_session_timer(p);
 				}
 			}
-			start_session_timer(p);
 		}
 
 




More information about the asterisk-commits mailing list