[Home]

Summary:ASTERISK-13807: [patch] global mohinterpret setting is ignored
Reporter:Dmitry Andrianov (dimas)Labels:
Date Opened:2009-03-23 17:20:17Date Closed:2009-05-04 17:48:59
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Channels/chan_iax2
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) v1-14728.patch
Description:iax.conf says that:

; This option may be specified globally, or on a per-user or per-peer basis.

in fact, when option is specified globally (in the [general] section), its value is ignored. I believe this is because global value does not get copied into pvt structure on build_peer.

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

The patch fixes the issue and copies couple of other fields which can be also specified globally.
Comments:By: Dmitry Andrianov (dimas) 2009-04-28 17:03:57

c'mon guys, it's been month :)

By: David Vossel (dvossel) 2009-05-04 11:12:44

I tested 1.4, 1.6.0, and trunk without this patch.  mohinterpret seemed to work fine for me. I believe it is copied into the user/peer later on, not in the build_peer/build_user function like other global variables are.  


I'm going to go ahead and close this issue.  If you feel I am in error, feel free to reopen it.  Please provide an iax.conf and details on how you reproduce the issue if you choose to reopen it.

By: Dmitry Andrianov (dimas) 2009-05-04 15:43:02

URL: http://svn.digium.com/svn/asterisk/tags/1.4.24.1

My experiment is simple:
edit chan_iax2.c and right after the line 3838 of iax2_indicate add
  ast_log(LOG_NOTICE,"pvt->mohinterpret=%s\n",pvt->mohinterpret);

Then edit iax.conf and set global
  mohinterpret=passthrough

Now I registered two extensions - 2002 (IAX, Zoiper) and 1001 (SIP, X-Lite). Added

  exten => 10,1,Answer
  exten => 10,n,DIAL(IAX2/2002)

to dialplan and finally placed the call from SIP softphone to 10.

*CLI>     -- Executing [10@default:1] Answer("SIP/1001-08bdb688", "") in new stack
   -- Executing [10@default:2] Dial("SIP/1001-08bdb688", "IAX2/2002") in new stack
[Feb 10 15:56:58] DEBUG[11123]: chan_iax2.c:3202 create_addr: prepending 2 to prefs
   -- Called 2002
   -- Call accepted by 176.16.0.2 (format gsm)
   -- Format for call is gsm
   -- IAX2/2002-5349 is ringing
   -- IAX2/2002-5349 answered SIP/1001-08bdb688

When I put "HOLD" button in X-Lite, I see the following in the Asterisk console:

[Feb 10 15:57:10] NOTICE[11123]: chan_iax2.c:3849 iax2_indicate: pvt->mohinterpret=
   -- Started music on hold, class 'default', on IAX2/2002-5349

Which makes me believe the setting is ignored.

By: David Vossel (dvossel) 2009-05-04 17:13:56

chan_iax.c line 1742. global mohinterpret is copied to pvt.  in check_access() line 5449. mohinterpret from user is copied into pvt if it exists.  

---------------
*CLI> [May  4 17:00:31] NOTICE[28123]: chan_iax2.c:1748 __find_callno: COPY mohinterpret global :moh_test to pvt
   -- Accepted AUTHENTICATED TBD call from 10.24.20.218
   -- Accepting DIAL from 10.24.20.218, formats = 0x4
   -- Executing [6001@local:1] Dial("IAX2/iaxy-7208", "SIP/6001") in new stack
   -- Called 6001
   -- SIP/6001-010caf10 is ringing
[May  4 17:00:34] NOTICE[28140]: chan_iax2.c:3869 iax2_indicate: pvt->mohinterpret=moh_test
   -- SIP/6001-010caf10 answered IAX2/iaxy-7208
[May  4 17:00:35] NOTICE[28140]: chan_iax2.c:3869 iax2_indicate: pvt->mohinterpret=moh_test
[May  4 17:00:35] NOTICE[28140]: chan_iax2.c:3869 iax2_indicate: pvt->mohinterpret=moh_test
[May  4 17:00:35] NOTICE[28140]: chan_iax2.c:3869 iax2_indicate: pvt->mohinterpret=moh_test
[May  4 17:00:36] NOTICE[28118]: chan_sip.c:16610 sip_poke_noanswer: Peer 'SIP_cupbear' is now UNREACHABLE!  Last qualify: 0
[May  4 17:00:38] NOTICE[28140]: chan_iax2.c:3869 iax2_indicate: pvt->mohinterpret=moh_test
   -- Started music on hold, class 'moh_test', on IAX2/iaxy-7208
   -- Stopped music on hold on IAX2/iaxy-7208
 == Spawn extension (local, 6001, 1) exited non-zero on 'IAX2/iaxy-7208'
   -- Hungup 'IAX2/iaxy-7208'
------------------------

In iax.conf, globaly mohinterpret=moh_test. The friend has no mohinterpret set. global mohinterpret "moh_test" is copied into the pvt, works as expected for me (as seen in cli output).  I tried global mohinterpret = passthrough as well, worked as expected.

[May  4 17:10:36] NOTICE[29101]: chan_iax2.c:3846 iax2_indicate: pvt->mohinterpret=passthrough

This was tested in both latest 1.4 branch code and the 1.4.24.1 tag.  I really don't know what I else I can do to resolve this.  Is there anything I'm missing?

By: Dmitry Andrianov (dimas) 2009-05-04 17:18:49

Make call in opposite direction :)

By: David Vossel (dvossel) 2009-05-04 17:25:40

ahhh, I see :)

By: Digium Subversion (svnbot) 2009-05-04 17:37:32

Repository: asterisk
Revision: 192213

U   branches/1.4/channels/chan_iax2.c

------------------------------------------------------------------------
r192213 | dvossel | 2009-05-04 17:37:31 -0500 (Mon, 04 May 2009) | 11 lines

global mohinterpret setting is ignored

mohinterpret and mohsuggest global variables were not copied over during build_users and build_peers.

(closes issue ASTERISK-13807)
Reported by: dimas
Patches:
     v1-14728.patch uploaded by dimas (license 88)
Tested by: dimas, dvossel


------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=192213

By: Digium Subversion (svnbot) 2009-05-04 17:44:52

Repository: asterisk
Revision: 192214

_U  trunk/
U   trunk/channels/chan_iax2.c

------------------------------------------------------------------------
r192214 | dvossel | 2009-05-04 17:44:52 -0500 (Mon, 04 May 2009) | 17 lines

Merged revisions 192213 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
 r192213 | dvossel | 2009-05-04 17:37:31 -0500 (Mon, 04 May 2009) | 11 lines
 
 global mohinterpret setting is ignored
 
 mohinterpret and mohsuggest global variables were not copied over during build_users and build_peers.
 
 (closes issue ASTERISK-13807)
 Reported by: dimas
 Patches:
       v1-14728.patch uploaded by dimas (license 88)
 Tested by: dimas, dvossel
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=192214

By: Digium Subversion (svnbot) 2009-05-04 17:47:20

Repository: asterisk
Revision: 192215

_U  branches/1.6.0/
U   branches/1.6.0/channels/chan_iax2.c

------------------------------------------------------------------------
r192215 | dvossel | 2009-05-04 17:47:20 -0500 (Mon, 04 May 2009) | 24 lines

Merged revisions 192214 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r192214 | dvossel | 2009-05-04 17:44:51 -0500 (Mon, 04 May 2009) | 17 lines
 
 Merged revisions 192213 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r192213 | dvossel | 2009-05-04 17:37:31 -0500 (Mon, 04 May 2009) | 11 lines
   
   global mohinterpret setting is ignored
   
   mohinterpret and mohsuggest global variables were not copied over during build_users and build_peers.
   
   (closes issue ASTERISK-13807)
   Reported by: dimas
   Patches:
         v1-14728.patch uploaded by dimas (license 88)
   Tested by: dimas, dvossel
 ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=192215

By: Digium Subversion (svnbot) 2009-05-04 17:48:12

Repository: asterisk
Revision: 192216

_U  branches/1.6.1/
U   branches/1.6.1/channels/chan_iax2.c

------------------------------------------------------------------------
r192216 | dvossel | 2009-05-04 17:48:12 -0500 (Mon, 04 May 2009) | 24 lines

Merged revisions 192214 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r192214 | dvossel | 2009-05-04 17:44:51 -0500 (Mon, 04 May 2009) | 17 lines
 
 Merged revisions 192213 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r192213 | dvossel | 2009-05-04 17:37:31 -0500 (Mon, 04 May 2009) | 11 lines
   
   global mohinterpret setting is ignored
   
   mohinterpret and mohsuggest global variables were not copied over during build_users and build_peers.
   
   (closes issue ASTERISK-13807)
   Reported by: dimas
   Patches:
         v1-14728.patch uploaded by dimas (license 88)
   Tested by: dimas, dvossel
 ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=192216

By: Digium Subversion (svnbot) 2009-05-04 17:48:59

Repository: asterisk
Revision: 192217

_U  branches/1.6.2/
U   branches/1.6.2/channels/chan_iax2.c

------------------------------------------------------------------------
r192217 | dvossel | 2009-05-04 17:48:59 -0500 (Mon, 04 May 2009) | 24 lines

Merged revisions 192214 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r192214 | dvossel | 2009-05-04 17:44:51 -0500 (Mon, 04 May 2009) | 17 lines
 
 Merged revisions 192213 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r192213 | dvossel | 2009-05-04 17:37:31 -0500 (Mon, 04 May 2009) | 11 lines
   
   global mohinterpret setting is ignored
   
   mohinterpret and mohsuggest global variables were not copied over during build_users and build_peers.
   
   (closes issue ASTERISK-13807)
   Reported by: dimas
   Patches:
         v1-14728.patch uploaded by dimas (license 88)
   Tested by: dimas, dvossel
 ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=192217