[Home]

Summary:ASTERISK-00151: Format shown as number, not name for authenticated iax2 calls
Reporter:km (km)Labels:
Date Opened:2003-08-22 13:05:33Date Closed:2004-09-25 02:40:13
Priority:TrivialRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) chan_iax2.diff
Description:When you have a call coming in authenticated, it will report back the codec number, and not the codec name.  Below patch will fix problem.

****** ADDITIONAL INFORMATION ******

Index: chan_iax2.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_iax2.c,v
retrieving revision 1.38
diff -u -r1.38 chan_iax2.c
--- chan_iax2.c 16 Aug 2003 05:10:35 -0000 1.38
+++ chan_iax2.c 22 Aug 2003 18:10:39 -0000
@@ -4270,8 +4270,8 @@
if (strcmp(iaxs[fr.callno]->exten, "TBD")) {
iaxs[fr.callno]->state |= IAX_STATE_STARTED;
if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Accepting AUTHENTICATED call from %s, requested format = %d, actual format = %d\n",
- inet_ntoa(sin.sin_addr), iaxs[fr.callno]->peerformat,format);
+ ast_verbose(VERBOSE_PREFIX_3 "Accepting AUTHENTICATED call from %s, requested format = %s, actual format = %s\n",
+ inet_ntoa(sin.sin_addr), ast_getformatname(iaxs[fr.callno]->peerformat),ast_getformatname(format));
iaxs[fr.callno]->state |= IAX_STATE_STARTED;
if(!(c = ast_iax2_new(iaxs[fr.callno], AST_STATE_RING, format)))
iax2_destroy_nolock(fr.callno);
Comments:By: Mark Spencer (markster) 2003-08-22 13:37:13

ast_getformatname() does not handle multi formats.  Since capabilities and negotiated formats can, in some cases, be bitmasks of multiple formats, it's not valid.  ast_getformatname() will have to be extended to have more functionality before that could be done (and would presumably require a buffer be passed to it, e.g.:

char *ast_getformatname(unsigned char *workspace, int workspacelen, unsigned int format);

Talk to Corydon76 and get him to implement it this way (including enormous patch) and he can fix this bug at the same time.