[asterisk-bugs] [Asterisk 0008587]: [patch] Caller Id and Message Waiting Indicator problems

noreply at bugs.digium.com noreply at bugs.digium.com
Mon Nov 5 04:54:39 CST 2007


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=8587 
====================================================================== 
Reported By:                meneault
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   8587
Category:                   Channels/chan_zap
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     ready for testing
Asterisk Version:            SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 48462 
Disclaimer on File?:        Yes 
Request Review:              
====================================================================== 
Date Submitted:             12-14-2006 08:47 CST
Last Modified:              11-05-2007 04:54 CST
====================================================================== 
Summary:                    [patch] Caller Id and Message Waiting Indicator
problems
Description: 
I've got two issues but i didn't open two bugs because they are quite
related.

Issue 1) In France callerid signalling is V23 and callerid start is RING.
Current callerid works well except when callerid is associated to a
"message waiting indicator"(mwi) message. In this case callerid spill is
just ignored by chan_zap.
It is due to the fact that callerid's mdmf type is 0x80 and callerid with
mwi is 0x82 (mdmf fields are the same). So the patch to callerid_feed is
straight forward.

But well when a message waiting indication arrives it should'nt be treated
as normal call so my patch makes the fxo channel start at 'mwi' extension
if it exist.

Issue 2) Current code try to generate mwi signal to fxs channel when their
mailbox state change. It is using ONHOOKTRANSFER to do so and it doesn't
work for french phones (based on ETSI standard, so it mail fail for others
aswell).
To work, we should ring once to wake up the phone and then transmit mwi
data, no rings should follow the transmission.


I added an option to the native format request so as to ring and stop when
cidspill has been sent, that's 'm' option.
ex:
Dial(Zap/1m), to ring using default cadence and stop after first ring (ie
cidspill is sent).

Dial(Zap/1m1), to ring using custom cadence and stop after cidspill sent
(depending on the cadence)

Message waiting indicator will be set if channel's ${HASVOICEMAIL} is set
to 1.
Message waiting indicator will be cleared otherwise.


In France : 
defining  cadence=250,1500,1500,3000
and then doing Dial(Zap/1m1) works well.

So when mailbox state changed instead of doing an onhooktransfer, we
should Dial (Zap/1m1).

The best way I found to do this and keep backward compatibility is to
launch the pbx in a specific extension.

I added an option to zapata.conf so as to decide what to do when mailbox
state changed for a FXS channel (option called 'onmboxchange').
 - Either 'sendmwi', default mode (for backward compatibility), to send
data using onhooktransfer.
- Or 'jumptomboxchanged', to start the pbx on 'mboxchanged' extension in
the channel's default context. The variable {HASVOICEMAIL} will be set to 1
if mailbox is not empty and set to 0 otherwise. Then the user is free to
decide what to do when it's mailbox state changed.

Ok to sum up:
here's is my config:

zapata.conf

cadence=250,1500,1500,3000
onmboxchange=jumptomboxchanged

extensions.conf

[fxschannel] ;=> that's the extension for my Zap/1 FXS channel
; our mailbox state changed, we will send the mwi to our phones Zap/1
exten => mboxchanged,1,NoOp(Status of mailbox changed ${HASVOICEMAIL})
; timeout is 3 seconds, enough time to send the cidspill
exten => mboxchanged,2,Dial(Zap/1m1,3)
exten => mboxchanged,3,Hangup()
exten => mboxchanged,103,Hangup()

[fxochannel]
; we received mwi from telco provider
exten => mwi,1,NoOp(Got Messages Indication from telco ${HASVOICEMAIL})
; here we decide to send it to our phones
; CALLERID should be valid also if we want to check calling number
exten => mwi,2,Dial(Zap/1m1,3)
exten => mwi,3,Hangup()
exten => mwi,103,Hangup()

====================================================================== 

---------------------------------------------------------------------- 
 meneault - 11-05-07 04:54  
---------------------------------------------------------------------- 
Ok I have updated my running asterisk to the last revision (from trunk) i.e
88490.
So here are my new patches:
 callerid-h_patch_trunk_rev88490 (callerid.h patch)
 callerid-c_patch_trunk_rev88490 (callerid.c patch)
 chan_zap-c_patch_trunk_rev88490 (chan_zap.c patch)

Please note that this is an improved version of my older patch (better
code quality and design). 
One example of this is that I moved out the mailbox change code (from
do_monitor ) into a separate inline function for code clarity.

As ever my patch is meant to be backward compatible (i.e. no regression). 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
11-05-07 04:54  meneault       Note Added: 0073072                          
======================================================================




More information about the asterisk-bugs mailing list