[asterisk-bugs] [Asterisk 0006683]: [patch] Fix for CallerID on Indian PSTN

noreply at bugs.digium.com noreply at bugs.digium.com
Sat Dec 22 07:19:41 CST 2007


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=6683 
====================================================================== 
Reported By:                abhi
Assigned To:                murf
====================================================================== 
Project:                    Asterisk
Issue ID:                   6683
Category:                   Channels/chan_zap
Reproducibility:            N/A
Severity:                   feature
Priority:                   normal
Status:                     feedback
Asterisk Version:            SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 45596 
Disclaimer on File?:        Yes 
Request Review:              
====================================================================== 
Date Submitted:             03-08-2006 16:50 CST
Last Modified:              12-22-2007 07:19 CST
====================================================================== 
Summary:                    [patch] Fix for CallerID on Indian PSTN
Description: 
The default asterisk does not detect the caller id in India. Its a DTMF
based system here, where the caller id is sent after the first ring (this
as per tests on the second biggest provider Bharti, still go to test with
VSNL, will update about the same).

Using certain minor changes, could get it working in both the modes.
(polarity and ring), though the polarity mode is more of a hack (since we
initialize the state of the channel with AST_STATE_PRERING rather than
AST_STATE_RING and get the digits). Basically we needed to do dtmf
detection which is done only in PRERING state, so either we could
initialize the state with PRERING (wrong way), or do the detection in RING
state (aftert the first ring) as well.

   For the polarity mode, chan_zap.c diff is  diff.chan_zap.c.polarity.

   For the start of caller id on ring, the present chan_zap.c code detects
the caller id only in bell202 mode. After adding the part to do dtmf
detection, this work, though had to make a hack there to make it stop CID
detection when we receive ZT_EVENT_RINGBEGIN (also this event is not
handled in zt_handle_event). attached diff.chan_zap.c.ring is for the same.

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

---------------------------------------------------------------------- 
 ramaseshireddy - 12-22-07 07:19  
---------------------------------------------------------------------- 
CLI> [Dec 22 07:45:57] DEBUG[18074]: chan_zap.c:7369 do_monitor: Monitor
doohicky got event Ring Begin on channel 3

[Dec 22 07:45:58] DEBUG[18074]: chan_zap.c:7369 do_monitor: Monitor
doohicky got event Ring/Answered on channel 3

[Dec 22 07:45:58] DEBUG[18074]: dsp.c:1663 ast_dsp_set_busy_pattern: dsp
busy pattern set to 0,0

[Dec 22 07:45:58] DEBUG[18074]: chan_zap.c:5620 zt_new:
http://bugs.digium.com/view.php?id=372 If (core)
Needs a rethink i = 81c6580, i->rdnis = 81c72b8

    -- Starting simple switch on 'Zap/3-1'
[Dec 22 07:45:58] DEBUG[18074]: chan_zap.c:6366 ss_thread: Early Receiving
DTMF  onchannel Zap/3-1

[Dec 22 07:45:58] DEBUG[18074]: chan_zap.c:5078 zt_read: DTMF digit: 4 on
Zap/3-1
[Dec 22 07:45:58] DEBUG[18074]: chan_zap.c:6383 ss_thread: Seshi got digit
'4'
[Dec 22 07:45:58] DEBUG[18074]: chan_zap.c:5078 zt_read: DTMF digit: 9 on
Zap/3-1
[Dec 22 07:45:59] DEBUG[18074]: chan_zap.c:5078 zt_read: DTMF digit: 8 on
Zap/3-1
[Dec 22 07:45:59] DEBUG[18074]: chan_zap.c:6383 ss_thread: Seshi got digit
'9'
[Dec 22 07:45:59] DEBUG[18074]: chan_zap.c:5078 zt_read: DTMF digit: 7 on
Zap/3-1
[Dec 22 07:45:59] DEBUG[18074]: chan_zap.c:6383 ss_thread: Seshi got digit
'8'
[Dec 22 07:45:59] DEBUG[18074]: chan_zap.c:5078 zt_read: DTMF digit: 5 on
Zap/3-1
[Dec 22 07:45:59] DEBUG[18074]: chan_zap.c:6383 ss_thread: Seshi got digit
'7'
[Dec 22 07:45:59] DEBUG[18074]: chan_zap.c:5078 zt_read: DTMF digit: 0 on
Zap/3-1
[Dec 22 07:45:59] DEBUG[18074]: chan_zap.c:6383 ss_thread: Seshi got digit
'5'
[Dec 22 07:45:59] DEBUG[18074]: chan_zap.c:5078 zt_read: DTMF digit: 6 on
Zap/3-1
[Dec 22 07:45:59] DEBUG[18074]: chan_zap.c:5078 zt_read: DTMF digit: 4 on
Zap/3-1
[Dec 22 07:45:59] DEBUG[18074]: chan_zap.c:6383 ss_thread: Seshi got digit
'0'
[Dec 22 07:45:59] DEBUG[18074]: chan_zap.c:6383 ss_thread: Seshi got digit
'6'
[Dec 22 07:45:59] DEBUG[18074]: chan_zap.c:6383 ss_thread: Seshi got digit
'4'
[Dec 22 07:46:00] DEBUG[18074]: chan_zap.c:4774 __zt_exception: Exception
on 9, channel 3
[Dec 22 07:46:00] DEBUG[18074]: chan_zap.c:3864 zt_handle_event: Got event
Ring Begin(18) on channel 3 (index 0)
[Dec 22 07:46:00] DEBUG[18074]: chan_zap.c:4774 __zt_exception: Exception
on 9, channel 3
[Dec 22 07:46:00] DEBUG[18074]: chan_zap.c:3864 zt_handle_event: Got event
Ring/Answered(2) on channel 3 (index 0)
[Dec 22 07:46:00] DEBUG[18074]: chan_zap.c:4247 zt_handle_event: Setting
IDLE polarity due to ring. Old polarity was 0
[Dec 22 07:46:00] DEBUG[18074]: chan_zap.c:4272 zt_handle_event: Ring
detected
[Dec 22 07:46:00] DEBUG[18074]: chan_zap.c:6395 ss_thread: seshi got
string '49875064'

[Dec 22 07:46:00] DEBUG[18074]: chan_zap.c:6398 ss_thread: seshi is
'49875064', flags 0

[Dec 22 07:46:00] DEBUG[18074]: pbx.c:1699 pbx_extension_helper: Launching
'Set'
    -- Executing [s at from-pstn:1] Set("Zap/3-1", "user=9000") in new stack
[Dec 22 07:46:00] DEBUG[18074]: pbx.c:1543
pbx_substitute_variables_helper_full: Function result is '49875064'
[Dec 22 07:46:00] DEBUG[18074]: pbx.c:1699 pbx_extension_helper: Launching
'NoOp'
    -- Executing [s at from-pstn:2] NoOp("Zap/3-1", "caller ID Number is
49875064") in new stack
[Dec 22 07:46:00] DEBUG[18074]: pbx.c:1699 pbx_extension_helper: Launching
'Macro'
    -- Executing [s at from-pstn:3] Macro("Zap/3-1", "PSTN|9000|1") in new
stack






Actually my mobile number is 9949875064 but it is displaying 49875064.
I am using Bharati (AIRTEL) service provide line.

And another thing is that it is not displaying STD CODE for incoming
calls.
i have used following configurations.



;;; line="3 WCTDM/0/2 FXSKS (In use)"
signalling=fxs_ks
usecallerid=yes
cidsignalling=dtmf
cidstart=polarity_in
;relaxdtmf=yes
;rxwink=300
;pulsedial=yes
;answeronpolarityswitch=yes
;hanguponpolarityswitch=yes
callerid=asreceived
group=0
context=from-pstn
channel => 3
context=default

;;; line="4 WCTDM/0/3 FXSKS (In use)"
signalling=fxs_ks
usecallerid=yes
cidsignalling=dtmf
cidstart=polarity
callerid=asreceived
group=0
context=from-pstn
channel => 4
context=default 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
12-22-07 07:19  ramaseshireddy Note Added: 0075843                          
======================================================================




More information about the asterisk-bugs mailing list