Summary: | ASTERISK-12609: [patch] fix mohinterpret and mohsuggest settings from general section in chan_iax2.c | ||
Reporter: | Decryptus (decryptus_proformatique) | Labels: | |
Date Opened: | 2008-08-18 11:25:19 | Date Closed: | 2008-09-02 13:05:49 |
Priority: | Minor | Regression? | No |
Status: | Closed/Complete | Components: | Channels/chan_iax2 |
Versions: | Frequency of Occurrence | ||
Related Issues: | |||
Environment: | Attachments: | ( 0) chan_iax2_moh_general_settings.patch ( 1) chan_iax2_mohinterpret_mohsuggest_general_settings.patch ( 2) config.sample | |
Description: | iax.conf: [general] mohinterpret = example When the moh activated, we can see in the CLI: WARNING[13803]: res_musiconhold.c:660 get_mohbyname: Music on Hold class 'exa' not found -- Started music on hold, class 'default', on channel 'IAX2/asteriskisdn-10727' | ||
Comments: | By: Leif Madsen (lmadsen) 2008-08-27 11:47:33 I am unable to reproduce this with SVN trunk r140246. The way I did it was configure mohinterpret=example in iax.conf in the [general] section. Created an example MOH class in musiconhold.conf, created the directory in /var/lib/asterisk/moh/example/ and copied some MOH files into the directory. I then created an IAX friend and a SIP friend. Called the SIP friend via the IAX friend, then the SIP friend put the IAX peer on hold. Here is the output from the CLI: *CLI> -- Accepting UNAUTHENTICATED call from 192.168.128.103: > requested format = gsm, > requested prefs = (), > actual format = gsm, > host prefs = (), > priority = mine -- Executing [100@13336:1] Dial("IAX2/testing_iax2-82", "SIP/testing_sip") in new stack == Using SIP RTP CoS mark 5 -- Called testing_sip -- SIP/testing_sip-0e112818 is ringing -- SIP/testing_sip-0e112818 answered IAX2/testing_iax2-82 -- Started music on hold, class 'example', on IAX2/testing_iax2-82 -- Stopped music on hold on IAX2/testing_iax2-82 == Spawn extension (13336, 100, 1) exited non-zero on 'IAX2/testing_iax2-82' -- Hungup 'IAX2/testing_iax2-82' Perhaps you are doing something different than me? I have looked at the code and the patch, and I have the sizeof(user->mohinterpret) in the current SVN trunk, but it seems to be working for me. By: Decryptus (decryptus_proformatique) 2008-09-01 04:50:22 I am able to reproduce this with SVN trunk r140491. I created an IAX peer between Asterisk 1.2 and Asterisk 1.6. I registered an IAX softphone on the Asterisk 1.6 (IAX2/101). When I call the softphone and the softphone put the IAX peer on hold, I have an error. Here is the output from the CLI: *CLI> core set verbose 5 Verbosity was 0 and is now 5 *CLI> -- Accepting AUTHENTICATED call from 192.168.0.253: > requested format = alaw, > requested prefs = (alaw), > actual format = alaw, > host prefs = (alaw), > priority = mine -- Executing [101@from-iax2:1] Dial("IAX2/trunk-5572", "IAX2/101") in new stack [Sep 1 11:35:03] DEBUG[8170]: chan_iax2.c:3420 create_addr: prepending 8 to prefs -- Called 101 -- Call accepted by 192.168.0.118 (format alaw) -- Format for call is alaw -- IAX2/101-1549 is ringing -- IAX2/101-1549 answered IAX2/trunk-5572 -- Channel 'IAX2/101-1549' ready to transfer [Sep 1 11:35:10] DEBUG[8170]: res_musiconhold.c:739 get_mohbyname: Music on Hold class 'exa' not found in memory -- Started music on hold, class 'default', on IAX2/trunk-5572 I attached my configuration in the file: config.sample. Thx ;) By: Decryptus (decryptus_proformatique) 2008-09-01 12:31:04 I reproduced the same error with your test. *CLI> core set verbose 5 Verbosity was 0 and is now 5 -- Accepting AUTHENTICATED call from 192.168.0.118: > requested format = gsm, > requested prefs = (), > actual format = alaw, > host prefs = (alaw), > priority = mine -- Executing [100@from-iax:1] Dial("IAX2/101-4411", "SIP/100") in new stack == Using SIP RTP CoS mark 5 -- Called 100 -- SIP/100-0824c8a0 is ringing -- SIP/100-0824c8a0 answered IAX2/101-4411 [Sep 1 19:37:21] DEBUG[2655]: res_musiconhold.c:739 get_mohbyname: Music on Hold class 'exa' not found in memory -- Started music on hold, class 'default', on IAX2/101-4411 -- Stopped music on hold on IAX2/101-4411 *CLI> core show version Asterisk SVN-trunk-r140491 built by root @ asterisk on a i686 running Linux on 2008-08-31 22:07:43 UTC By: Leif Madsen (lmadsen) 2008-09-02 10:58:12 Sorry, I tried with the same settings as you using the same revision you checked out, and I still can't reproduce the issue. The only thing I can see different now is that you're using i686 and I'm using x86_64... Here is my output: *CLI> -- Accepting AUTHENTICATED call from 192.168.128.104: > requested format = gsm, > requested prefs = (), > actual format = alaw, > host prefs = (alaw), > priority = mine -- Executing [103@13336:1] Dial("IAX2/101-14221", "SIP/testing_sip") in new stack == Using SIP RTP CoS mark 5 -- Called testing_sip -- SIP/testing_sip-1b9e0ab8 is ringing -- SIP/testing_sip-1b9e0ab8 answered IAX2/101-14221 -- Started music on hold, class 'example', on IAX2/101-14221 == Spawn extension (13336, 103, 1) exited non-zero on 'IAX2/101-14221' -- Stopped music on hold on IAX2/101-14221 -- Hungup 'IAX2/101-14221' *CLI> core show version Asterisk SVN-trunk-r140491 built by root @ localhost.localdomain on a x86_64 running Linux on 2008-09-02 09:28:10 UTC By: Decryptus (decryptus_proformatique) 2008-09-02 12:03:57 So ? What we do ? ;) When I add some traces, the value of "sizeof(user->mohinterpret)" is 4 at the line 11236. --------------------------------------------- So, to be coherent, I don't understand why at the line 11234 of chan_iax.c, we can see: ast_copy_string(accountcode, v->value, sizeof(accountcode)); and not: ast_copy_string(accountcode, v->value, sizeof(user->accountcode)); --------------------------------------------- Thx ;) By: Digium Subversion (svnbot) 2008-09-02 13:05:47 Repository: asterisk Revision: 140605 U branches/1.4/channels/chan_iax2.c ------------------------------------------------------------------------ r140605 | seanbright | 2008-09-02 13:05:46 -0500 (Tue, 02 Sep 2008) | 8 lines Make sure to use the correct length of the mohinterpret and mohsuggest buffers when copying configuration values. (closes issue ASTERISK-12609) Reported by: decryptus_proformatique Patches: chan_iax2_mohinterpret_mohsuggest_general_settings.patch uploaded by decryptus (license 555) ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=140605 |