CallerID doesn't work

Hi,

I can not set CallerID when making outbound calls. I searhed google and read forums but it doesn’t work.
It always show 02122134114 number.
I removed callerid setting in sip.conf file. Here is my sip.conf file.

[OutboundSIP]
type=friend
context=InboundSIP
username=02122134114
fromuser=02122134114
secret=02122134114
host=84.11.111.1
fromdomain=84.11.111.1
qualify=yes
insecure=very
nat=yes
disallow=all
allow=g729

And the register string:

register => 02122134114:02122134114@84.11.111.1/02122134114

And my dialplan:

[ContextMy]

exten => _X.,1,Set(CALLERID(all)=ABCDEF <02124441234>)
exten => _X.,n,NoOp(${CALLERID(all)})
exten => _X.,n,Dial(SIP/${EXTEN}@OutboundSIP,30)

I talked with my SIP provider and they told me check Contact and From data.

I set sip debug and I saw this:


From: “asterisk” sip:02122134114@84.11.111.1;tag=asla2036d1

Contact: sip:05302353453@192.168.2.151

Can you help me to figure out this please.

Hi

what does “exten => _X.,n,NoOp(${CALLERID(all)})” show in the verbose output ?

Also try setting the number and name separately

Ian

Regardless of the handling of caller ID (and unless you are an official telephony provider, it would be unusual for a telephony provider to allow you to set an arbitrary caller ID), you are sending a private address in your Contact header, which means there are problems with your NAT handling.

But when I disable NAT the problem continues.

How can I change SIP From content?

NAT has to work for the correct IP address to appear in the Contact header! If, for the sake of argument, the service provider is trying to use the Contact header for the CLI, they might well reject a Contact header containing an unusable IP address.

What may the Nat problem?

Is it related with firewall settings?
We are using Endian Firewall…

I’m not an expert on NAT on Asterisk, but my guess is that your machine is dual homed with both public and private addresses and may or may not be actually doing NAT. The machine then thinks that its private address is a valid public address, for some reason. If it is not dual homed, then the registration process has resulted in it giving out a valid public address, but only for the From address.

Specific details of the topology including which interfaces are on which network and where any explicit address translation is taking place would probably be helpful.

All I can say for certain is that you shouldn’t be sending a 192.168 address, in a Contact header, to an external party.

Hi

Before going off topic too far what does the Noop report back the callerid being set as ?

if its not being set in the first place and calls are working OK then the contact header may be a red herring.

post the verbose out put of a call showing what the noop says the callerid is.

also what are your setting for trustrpid and sendrpid ?

Ian

I set
trustrpid = yes
sendrpid = yes

and

trustrpid = no
sendrpid = yes

both version I couldn’t make a call.
Then I comment outed

;trustrpid = no
;sendrpid = yes

And changed plan :

exten => _X.,1,Set(CALLERID(all)=Test <02124441234>)
exten => _X.,n,NoOp(${CALLERID(all)})
exten => _X.,n,Dial(SIP/${EXTEN}@OutboundSIP,30)

And here is the results:

Audio is at 192.168.2.151 port 16878
Adding codec 0x100 (g729) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to 84.11.111.1:5060:
INVITE sip:05305235244@84.11.111.1 SIP/2.0
Via: SIP/2.0/UDP 192.168.2.151:5060;branch=z9hG4bK128baabc;rport
From: “asterisk” sip:02122134114@84.11.111.1;tag=as6c07d647
To: sip:05305235244@84.11.111.1
Contact: sip:02122134114@192.168.2.151
Call-ID: 568ef10e2f91e30b5bb53cde01267aa0@84.11.111.1
CSeq: 102 INVITE
User-Agent: Asterisk PBX
Max-Forwards: 70
Date: Wed, 14 Oct 2009 14:12:55 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces
Content-Type: application/sdp
Content-Length: 263

v=0
o=root 3586 3586 IN IP4 192.168.2.151
s=session
c=IN IP4 192.168.2.151
t=0 0
m=audio 16878 RTP/AVP 18 101
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv


<— SIP read from 84.11.111.1:5060 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.2.151:5060;rport=5060;received=213.194.109.226;branch=z9hG4bK128baabc
From: “asterisk” sip:02122134114@84.11.111.1:5060;tag=as6c07d647
To: sip:05305235244@84.11.111.1:5060
Call-ID: 568ef10e2f91e30b5bb53cde01267aa0@84.11.111.1
CSeq: 102 INVITE
Content-Length: 0

<------------->
— (7 headers 0 lines) —

<— SIP read from 84.11.111.1:5060 —>
SIP/2.0 183 Session Progress
Via: SIP/2.0/UDP 192.168.2.151:5060;rport=5060;received=213.194.109.226;branch=z9hG4bK128baabc
To: sip:05305235244@84.11.111.1:5060;tag=3464518420-487772
From: “asterisk” sip:02122134114@84.11.111.1:5060;tag=as6c07d647
Call-ID: 568ef10e2f91e30b5bb53cde01267aa0@84.11.111.1
CSeq: 102 INVITE
Allow: INVITE, BYE, OPTIONS, CANCEL, ACK, REGISTER, NOTIFY, INFO, REFER, SUBSCRIBE, PRACK, UPDATE, MESSAGE, PUBLISH
Contact: sip:05305235244@84.11.111.1:5060
Call-Info: sip:84.11.111.1;method="NOTIFY;Event=telephone-event;Duration=1000"
Content-Length: 0

<------------->
— (10 headers 0 lines) —

<— SIP read from 84.11.111.1:5060 —>
SIP/2.0 183 Session Progress
Via: SIP/2.0/UDP 192.168.2.151:5060;rport=5060;received=213.194.109.226;branch=z9hG4bK128baabc
To: sip:05305235244@84.11.111.1:5060;tag=3464518420-487772
From: “asterisk” sip:02122134114@84.11.111.1:5060;tag=as6c07d647
Call-ID: 568ef10e2f91e30b5bb53cde01267aa0@84.11.111.1
CSeq: 102 INVITE
Allow: INVITE, BYE, OPTIONS, CANCEL, ACK, REGISTER, NOTIFY, INFO, REFER, SUBSCRIBE, PRACK, UPDATE, MESSAGE, PUBLISH
Contact: sip:05305235244@84.11.111.1:5060
Call-Info: sip:84.11.111.1;method="NOTIFY;Event=telephone-event;Duration=1000"
Content-Type: application/sdp
Content-Length: 205

v=0
o=btnxtmsc1 32802 33538 IN IP4 84.11.111.1
s=sip call
c=IN IP4 84.11.111.1
t=0 0
m=audio 21504 RTP/AVP 18 101
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=fmtp:18 annexb=no
a=ptime:20

<------------->
— (11 headers 10 lines) —
Found RTP audio format 18
Found RTP audio format 101
Peer audio RTP is at port 84.11.111.1:21504
Found audio description format telephone-event for ID 101
Capabilities: us - 0x100 (g729), peer - audio=0x100 (g729)/video=0x0 (nothing), combined - 0x100 (g729)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event), peer - 0x1 (telephone-event), combined - 0x1 (telephone-event)
Peer audio RTP is at port 84.11.111.1:21504
== Parsing ‘/etc/asterisk/manager.conf’: Found
== Parsing ‘/etc/asterisk/manager_additional.conf’: Found
== Parsing ‘/etc/asterisk/manager_custom.conf’: Found
== Manager ‘phpagi’ logged on from 192.168.2.61

<— SIP read from 84.11.111.1:5060 —>
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 192.168.2.151:5060;rport=5060;received=213.194.109.226;branch=z9hG4bK128baabc
To: sip:05305235244@84.11.111.1:5060;tag=3464518420-487772
From: “asterisk” sip:02122134114@84.11.111.1:5060;tag=as6c07d647
Call-ID: 568ef10e2f91e30b5bb53cde01267aa0@84.11.111.1
CSeq: 102 INVITE
Allow: INVITE, BYE, OPTIONS, CANCEL, ACK, REGISTER, NOTIFY, INFO, REFER, SUBSCRIBE, PRACK, UPDATE, MESSAGE, PUBLISH
Contact: sip:05305235244@84.11.111.1:5060
Call-Info: sip:84.11.111.1;method="NOTIFY;Event=telephone-event;Duration=1000"
Content-Type: application/sdp
Content-Length: 205

v=0
o=btnxtmsc1 32802 33538 IN IP4 84.11.111.1
s=sip call
c=IN IP4 84.11.111.1
t=0 0
m=audio 21504 RTP/AVP 18 101
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=fmtp:18 annexb=no
a=ptime:20

<------------->
— (11 headers 10 lines) —
Found RTP audio format 18
Found RTP audio format 101
Peer audio RTP is at port 84.11.111.1:21504
Found audio description format telephone-event for ID 101
Capabilities: us - 0x100 (g729), peer - audio=0x100 (g729)/video=0x0 (nothing), combined - 0x100 (g729)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event), peer - 0x1 (telephone-event), combined - 0x1 (telephone-event)
Peer audio RTP is at port 84.11.111.1:21504

<— SIP read from 192.168.2.115:53189 —>

<------------->

<— SIP read from 84.11.111.1:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.2.151:5060;rport=5060;received=213.194.109.226;branch=z9hG4bK128baabc
To: sip:05305235244@84.11.111.1:5060;tag=3464518420-487772
From: “asterisk” sip:02122134114@84.11.111.1:5060;tag=as6c07d647
Call-ID: 568ef10e2f91e30b5bb53cde01267aa0@84.11.111.1
CSeq: 102 INVITE
Allow: INVITE, BYE, OPTIONS, CANCEL, ACK, REGISTER, NOTIFY, INFO, REFER, SUBSCRIBE, PRACK, UPDATE, MESSAGE, PUBLISH
Contact: sip:05305235244@84.11.111.1:5060
Call-Info: sip:84.11.111.1;method="NOTIFY;Event=telephone-event;Duration=1000"
Content-Type: application/sdp
Content-Length: 205

v=0
o=btnxtmsc1 32802 33538 IN IP4 84.11.111.1
s=sip call
c=IN IP4 84.11.111.1
t=0 0
m=audio 21504 RTP/AVP 18 101
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=fmtp:18 annexb=no
a=ptime:20

<------------->
— (11 headers 10 lines) —
Found RTP audio format 18
Found RTP audio format 101
Peer audio RTP is at port 84.11.111.1:21504
Found audio description format telephone-event for ID 101
Capabilities: us - 0x100 (g729), peer - audio=0x100 (g729)/video=0x0 (nothing), combined - 0x100 (g729)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event), peer - 0x1 (telephone-event), combined - 0x1 (telephone-event)
Peer audio RTP is at port 84.11.111.1:21504
list_route: hop: sip:05305235244@84.11.111.1:5060
set_destination: Parsing sip:05305235244@84.11.111.1:5060 for address/port to send to
set_destination: set destination to 84.11.111.1, port 5060
Transmitting (NAT) to 84.11.111.1:5060:
ACK sip:05305235244@84.11.111.1:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.2.151:5060;branch=z9hG4bK468e6b22;rport
From: “asterisk” sip:02122134114@84.11.111.1;tag=as6c07d647
To: sip:05305235244@84.11.111.1;tag=3464518420-487772
Contact: sip:02122134114@192.168.2.151
Call-ID: 568ef10e2f91e30b5bb53cde01267aa0@84.11.111.1
CSeq: 102 ACK
User-Agent: Asterisk PBX
Max-Forwards: 70
Content-Length: 0


   > Channel SIP/BorusanOutboundSIP-08fe74c8 was answered.
-- Executing [05305235244@ContextBorusan:1] Set("SIP/BorusanOutboundSIP-08fe74c8", "DATETIME=14102009_171301") in new stack
-- Executing [05305235244@ContextBorusan:2] NoOp("SIP/BorusanOutboundSIP-08fe74c8", "DATETIME: 14102009_171301") in new stack
-- Executing [05305235244@ContextBorusan:3] Set("SIP/BorusanOutboundSIP-08fe74c8", "CALLFILENAME=05305235244__14102009_171301") in new stack
-- Executing [05305235244@ContextBorusan:4] NoOp("SIP/BorusanOutboundSIP-08fe74c8", "CALLFILENAME: 05305235244__14102009_171301") in new stack
-- Executing [05305235244@ContextBorusan:5] Monitor("SIP/BorusanOutboundSIP-08fe74c8", "wav|05305235244__14102009_171301|m") in new stack
-- Executing [05305235244@ContextBorusan:6] Set("SIP/BorusanOutboundSIP-08fe74c8", "CALLERID(all)=Test <02124441234>") in new stack
-- Executing [05305235244@ContextBorusan:7] NoOp("SIP/BorusanOutboundSIP-08fe74c8", ""Test" <02124441234>") in new stack
-- Executing [05305235244@ContextBorusan:8] Dial("SIP/BorusanOutboundSIP-08fe74c8", "SIP/05305235244@BorusanOutboundSIP|30") in new stack

Audio is at 192.168.2.151 port 18224
Adding codec 0x100 (g729) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to 84.11.111.1:5060:
INVITE sip:05305235244@84.11.111.1 SIP/2.0
Via: SIP/2.0/UDP 192.168.2.151:5060;branch=z9hG4bK1483138e;rport
From: “Test” sip:02122134114@84.11.111.1;tag=as2b216624
To: sip:05305235244@84.11.111.1
Contact: sip:02122134114@192.168.2.151
Call-ID: 2eb786846f824d052e4a59d93af7c221@84.11.111.1
CSeq: 102 INVITE
User-Agent: Asterisk PBX
Max-Forwards: 70
Date: Wed, 14 Oct 2009 14:13:01 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces
Content-Type: application/sdp
Content-Length: 263

v=0
o=root 3586 3586 IN IP4 192.168.2.151
s=session
c=IN IP4 192.168.2.151
t=0 0
m=audio 18224 RTP/AVP 18 101
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv


-- Called 05305235244@BorusanOutboundSIP

<— SIP read from 84.11.111.1:5060 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.2.151:5060;rport=5060;received=213.194.109.226;branch=z9hG4bK1483138e
From: “Test” sip:02122134114@84.11.111.1:5060;tag=as2b216624
To: sip:05305235244@84.11.111.1:5060
Call-ID: 2eb786846f824d052e4a59d93af7c221@84.11.111.1
CSeq: 102 INVITE
Content-Length: 0

<------------->
— (7 headers 0 lines) —

<— SIP read from 84.11.111.1:5060 —>
SIP/2.0 486 Busy here
Via: SIP/2.0/UDP 192.168.2.151:5060;rport=5060;received=213.194.109.226;branch=z9hG4bK1483138e
To: sip:05305235244@84.11.111.1:5060;tag=3464518424-49699
From: “Test” sip:02122134114@84.11.111.1:5060;tag=as2b216624
Call-ID: 2eb786846f824d052e4a59d93af7c221@84.11.111.1
CSeq: 102 INVITE
Allow: INVITE, BYE, OPTIONS, CANCEL, ACK, REGISTER, NOTIFY, INFO, REFER, SUBSCRIBE, PRACK, UPDATE, MESSAGE, PUBLISH
Contact: sip:05305235244@84.11.111.1:5060
Call-Info: sip:84.11.111.1;method="NOTIFY;Event=telephone-event;Duration=1000"
Content-Length: 0

<------------->
— (10 headers 0 lines) —
– Got SIP response 486 “Busy here” back from 84.11.111.1
Transmitting (NAT) to 84.11.111.1:5060:
ACK sip:05305235244@84.11.111.1 SIP/2.0
Via: SIP/2.0/UDP 192.168.2.151:5060;branch=z9hG4bK1483138e;rport
From: “Test” sip:02122134114@84.11.111.1;tag=as2b216624
To: sip:05305235244@84.11.111.1;tag=3464518424-49699
Contact: sip:02122134114@192.168.2.151
Call-ID: 2eb786846f824d052e4a59d93af7c221@84.11.111.1
CSeq: 102 ACK
User-Agent: Asterisk PBX
Max-Forwards: 70
Content-Length: 0


-- SIP/BorusanOutboundSIP-08ff2500 is busy

== Everyone is busy/congested at this time (1:1/0/0)
== Auto fallthrough, channel ‘SIP/BorusanOutboundSIP-08fe74c8’ status is 'BUSY’
Really destroying SIP dialog ‘2eb786846f824d052e4a59d93af7c221@84.11.111.1’ Method: INVITE

<— SIP read from 84.11.111.1:5060 —>
BYE sip:02122134114@192.168.2.151:5060 SIP/2.0
Max-Forwards: 69
To: “asterisk” sip:02122134114@84.11.111.1:5060;tag=as6c07d647
From: sip:05305235244@84.11.111.1:5060;tag=3464518420-487772
Call-ID: 568ef10e2f91e30b5bb53cde01267aa0@84.11.111.1
CSeq: 2 BYE
Allow: INVITE, BYE, OPTIONS, CANCEL, ACK, REGISTER, NOTIFY, INFO, REFER, SUBSCRIBE, PRACK, UPDATE, MESSAGE, PUBLISH
Via: SIP/2.0/UDP 84.11.111.1:5060;branch=z9hG4bKcc49be00910d1e0ca8f9502b1d2e89d3
Contact: sip:05305235244@84.11.111.1:5060
Content-Length: 0

<------------->
— (10 headers 0 lines) —
Sending to 84.11.111.1 : 5060 (NAT)

<— Transmitting (NAT) to 84.11.111.1:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 84.11.111.1:5060;branch=z9hG4bKcc49be00910d1e0ca8f9502b1d2e89d3;received=84.11.111.1
From: sip:05305235244@84.11.111.1:5060;tag=3464518420-487772
To: “asterisk” sip:02122134114@84.11.111.1:5060;tag=as6c07d647
Call-ID: 568ef10e2f91e30b5bb53cde01267aa0@84.11.111.1
CSeq: 2 BYE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces
Content-Length: 0

Hi,

I stil couldn’t find a solution this.
I reinstall completely to another machine.

And setup 2 ethernet cards.
One is for local network, so we can make calls from clients.
Second is for out VOIP company’s gateway.

As I understand in Contact header I must use VOIP company’s IP.
But how can I tell Asterisk use second ethernet to make a call?
Or how can I change Contact header value?

Thanks…

By the way my contact and from seems ok, I guess?

I think the problem is different…

INVITE sip:05305235244@84.44.127.6 SIP/2.0
Via: SIP/2.0/UDP 192.168.2.89:5060;branch=z9hG4bK67081ddc;rport
From: “[color=#FF0000]12121234567[/color]” sip:02122134114@84.11.111.1;tag=as1db075e7
To: sip:05305235244@84.44.127.6
Contact: sip:02122134114@192.168.2.89
Call-ID: 538b2c0e4a4ad07a1c731a540efd1899@84.11.111.1
CSeq: 102 INVITE
User-Agent: Asterisk PBX
Max-Forwards: 70
Date: Fri, 16 Oct 2009 12:08:41 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces
Content-Type: application/sdp
Content-Length: 261

The field you highlighted in red is intended for human consumption, and would typically be the person’s name, as in internet email. The only thing that should be machine processed is the bit between starting <sip:

Actually I highligted,red and bold that number. And it is the CALLERID.

But I guess it should be in this format, right?

From: “abc” <12121234567> sip:02122134114@84.11.111.1;tag=as1db075e7

No. It should be in this format:

However, this may conflict with the way that the VOiP provider authenticates you. (I think they have to use register to get your IP address, then authenticate based on that, if they want to allow you to set the caller ID, i.e. insecure = invite if Asterisk were the ISP end, or they have to use proxy-authenticate.)

They may well expect the initial 0.