[svn-commits] mmichelson: branch group/pimp_my_sip r380102 - /team/group/pimp_my_sip/res/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Jan 25 11:03:24 CST 2013


Author: mmichelson
Date: Fri Jan 25 11:03:20 2013
New Revision: 380102

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=380102
Log:
Add more warning messages to failure scenarios.

This helped me to realize that my configured endpoint
did not have proper capabilities configured.


Modified:
    team/group/pimp_my_sip/res/res_sip_sdp_audio.c

Modified: team/group/pimp_my_sip/res/res_sip_sdp_audio.c
URL: http://svnview.digium.com/svn/asterisk/team/group/pimp_my_sip/res/res_sip_sdp_audio.c?view=diff&rev=380102&r1=380101&r2=380102
==============================================================================
--- team/group/pimp_my_sip/res/res_sip_sdp_audio.c (original)
+++ team/group/pimp_my_sip/res/res_sip_sdp_audio.c Fri Jan 25 11:03:20 2013
@@ -125,6 +125,7 @@
 
 	/* Ensure that the address provided is valid */
 	if ((addrs_cnt = ast_sockaddr_resolve(&addrs, host, PARSE_PORT_FORBID, AST_AF_UNSPEC)) <= 0) {
+		ast_log(LOG_ERROR, "Failed to resolve %s\n", host);
 		/* The provided host was actually invalid so we kill the session as it would just end up being broken */
 		if (session->channel) {
 			ast_channel_hangupcause_set(session->channel, AST_CAUSE_BEARERCAPABILITY_NOTAVAIL);
@@ -135,6 +136,7 @@
 	/* To properly apply formats to the channel we need to keep track of capabilities */
 	if (!(cap = ast_format_cap_alloc_nolock()) ||
 	    !(peercap = ast_format_cap_alloc_nolock())) {
+		ast_log(LOG_ERROR, "Failed to allocate audio capabilities\n");
 		res = -1;
 		goto cleanup;
 	}
@@ -173,9 +175,14 @@
 	ast_format_cap_remove_bytype(cap, AST_FORMAT_TYPE_VIDEO);
 
 	if (!(jointcap = ast_format_cap_joint(cap, peercap))) {
+		char usbuf[64];
+		char thembuf[64];
 		if (session->channel) {
 			ast_channel_hangupcause_set(session->channel, AST_CAUSE_BEARERCAPABILITY_NOTAVAIL);
 		}
+		ast_getformatname_multiple(usbuf, sizeof(usbuf), cap);
+		ast_getformatname_multiple(thembuf, sizeof(thembuf), peercap);
+		ast_log(LOG_WARNING, "No joint capabilities between our configuration(%s) and incoming SDP(%s)\n", usbuf, thembuf);
 		res = -1;
 		goto cleanup;
 	}




More information about the svn-commits mailing list