# Request for modifications in chan\_zap.c to get callerid

**URL:** <https://community.asterisk.org/t/request-for-modifications-in-chan-zap-c-to-get-callerid/8678>\
**Category:** Asterisk Support\
**Created:** [August 21, 2006, 6:59am UTC](https://community.asterisk.org/t/request-for-modifications-in-chan-zap-c-to-get-callerid/8678 "2006-08-21T06:59:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![crazymoonboy](https://avatars.discourse-cdn.com/v4/letter/c/ee59a6/32.png) [@crazymoonboy](https://community.asterisk.org/u/crazymoonboy)\
**Post date:** [August 21, 2006, 6:59am UTC](https://community.asterisk.org/t/request-for-modifications-in-chan-zap-c-to-get-callerid/8678/1 "2006-08-21T06:59:34Z")

</div>

Hi friends,

Here I am posting my problem. I am getting this problem since 8 days. I have studied documentation and looked previous posts in forums. But, I am unable to solve this problem. Please show me a solution. I am from Andhrapradesh, India.

We have installed Asterisk with Digium 04B card (4 FXO ports). Now, I have connected my PSTN (BSNL) line directly to first port. I am making outgoing calls and receiving incoming calls successfully through my Asterisk. The problem is: When I am receiving a call from outside (PSTN-Eg. Mobile), I am not getting the callerid number of the caller and getting callerid as “Asterisk” in my softphones (XLite).

From Internet, I came to know that

1. In India, we have to give dtmf and ring for cidsignallling and cidstart respectively.
2. Default Asterisk setup doesn’t recognise callerid in India. To recognize callerid in India, we have to do or change some modifications in chan\_zap.c source file. Is it right?

Here I am giving my config files and error message. Please see it.

zaptel.conf contents:  
loadzone = us  
defaultzone=us  
fxsks=1-4

zapata.conf contents:  
[channels]  
context=incoming  
signalling=fxs\_ks  
busydetect=1  
busycount=7  
relaxdtmf=yes  
callwaiting=yes  
callwaitingcallerid=yes  
threewaycalling=yes  
cancallforward=yes  
echocancelwhenbridged=yes  
rxgain=0.0  
txgain=0.0  
callerid=asreceived  
language=en  
usecallerid=yes  
hidecallerid=no  
echocancel=yes  
transfer=yes  
immediate=no  
musiconhold=default  
ringtimeout=8000  
cidsignalling=dtmf  
cidstart=ring  
group=1  
callgroup=1  
pickupgroup=1  
channel =\> 1

sip.conf contents:  
[105]  
type=friend  
username=105  
secret=ravi  
callerid="RaviKanth"  
host=dynamic  
context=leader  
canreinvite=no  
nat=yes  
dtmfmode=rfc2833  
allow=all

extensions.conf contents:  
[incoming]  
exten =\> s,1,Wait(10)  
exten =\> s,n,Answer  
exten =\> s,n,Noop('Callerid is '${CALLERID})  
exten =\> s,n,Noop('Calleridname is '${CALLERIDNAME})  
exten =\> s,n,Noop(Calleridnum is '${CALLERIDNUM})  
exten =\> s,n,SetMusicOnHold(default)  
exten =\> s,n,Set(TIMEOUT(digit)=5)  
exten =\> s,n,Set(TIMEOUT(response)=10)  
exten =\> s,n,Background(/tmp/virg2)  
exten =\> s,n,Goto(s,1)  
exten =\> s,n,Hangup()  
include =\> leader

[leader]  
exten =\> 105,1,Dial(SIP/105,15)  
exten =\> 105,2,Voicemail(u105)  
exten =\> 105,3,Voicemail(b105)  
exten =\> 105,4,Hangup  
exten =\> \_9XXXXXXXXXX,1,Dial(Zap/1/${EXTEN:1}) ; Mobile phone  
exten =\> \_5XXXXXXXX,1,Dial(Zap/1/${EXTEN:1}) ; Local Landline  
include =\> internal

[internal]  
exten =\> 105, 1, Dial(SIP/105,15)

When somebody calls from outside (Eg: mobile), I am getting this below error message on Asterisk console:

\*CLI\> – Starting simple switch on 'Zap/1-1’  
Aug 18 14:53:13 ERROR[15499]: callerid.c:276 callerid\_feed: fsk\_serie made mylen \< 0 (-16)  
Aug 18 14:53:13 WARNING[15499]: chan\_zap.c:6087 ss\_thread: CallerID feed failed: Success  
Aug 18 14:53:13 WARNING[15499]: chan\_zap.c:6131 ss\_thread: CallerID returned with error on channel ‘Zap/1-1’  
– Executing Wait(“Zap/1-1”, “10”) in new stack  
– Executing Answer(“Zap/1-1”, “”) in new stack  
– Executing NoOp(“Zap/1-1”, " 18082006-14:53:24") in new stack  
– Executing NoOp(“Zap/1-1”, "CallerID is ") in new stack  
– Executing NoOp(“Zap/1-1”, "CallerID Name is ") in new stack  
– Executing NoOp(“Zap/1-1”, "CallerID Number is ") in new stack  
– Executing SetMusicOnHold(“Zap/1-1”, “default”) in new stack  
– Executing Set(“Zap/1-1”, “TIMEOUT(digit)=5”) in new stack  
– Digit timeout set to 5  
– Executing Set(“Zap/1-1”, “TIMEOUT(response)=10”) in new stack  
– Response timeout set to 10  
– Executing BackGround(“Zap/1-1”, “/tmp/virg2”) in new stack  
– Playing ‘/tmp/virg2’ (language ‘en’)  
== CDR updated on Zap/1-1  
– Executing Dial(“Zap/1-1”, “SIP/105|15|t|12”) in new stack  
– Called 105  
– SIP/105-00798410 is ringing  
– Nobody picked up in 15000 ms  
– Executing VoiceMail(“Zap/1-1”, “u105”) in new stack  
– Playing ‘vm-theperson’ (language ‘en’)  
– Playing ‘digits/1’ (language ‘en’)  
– Playing ‘digits/0’ (language ‘en’)  
– Playing ‘digits/5’ (language ‘en’)  
– Playing ‘vm-isunavail’ (language ‘en’)  
– Playing ‘vm-intro’ (language ‘en’)  
== Spawn extension (incoming, 105, 2) exited non-zero on ‘Zap/1-1’  
– Hungup ‘Zap/1-1’

Please tell me. Looking forward to your response. Thank you.

Regards,  
Chandra.
