Missed calls - strange bahavior when trying to callback

Hello,
I have a strange issue when trying to call back numbers that get into missed calls on my Cisco 7960 phone (but same thing with Yealink), so i think it is an asterisk configuration issue.
In my missed calls I have records like this:

From 012345678
102

From 012345678 is the calling number, 102 is my internal number, but when I click the Dial my phone calls itself (the internal number 102) instead of the calling number…

The configuration in extensions looks like this:

exten => 102,1,Dial(SIP/102,30,rtT)
exten => 102,n,Voicemail(u102)
exten => 102,n,Hangup()

I have also tried to add:
exten => 102,1,Set(CALLERID(name)=${CALLERID(num)})
exten => 102,n,Set(CALLERID(num)=${CALLERID(num)})
but it doesn’t change anything…

Thank you for any suggestions
Kind regards,
Jernej

hmm, this is strange - a few things I’m curious about:

  • Based on the Cisco instructions for the phone you can hit “edit” (for example to add 1 for long distance) - When you highlight the number in your missed call log and hit “edit” - does it edit 012345678 or does it edit 102?
    http://www.cisco.com/en/US/docs/voice_ip_comm/cuipph/7960g_7940g/sip/english/user/guide/sipuget.html#wp1003632

  • What is your call logic for 012345678 in the phone’s outbound dialing context? (Can you post CLI verbose output when you press “dial” on the phone’s missed call menu?) For example this would cause the behavior you are experiencing:

[phone-outbound-context]
exten => 012345678,1,Goto(internal-extensions-context,102,1)

  • When you mod the CID - what shows on the CLI? (Dial from 012345678 to 102. Post CLI verbose output)
    Using this logic:
    exten => 102,1,Set(CALLERID(name)=${CALLERID(num)})
    exten => 102,n,Set(CALLERID(num)=${CALLERID(num)})
    exten => 102,n,Dial(SIP/102,30,rtT)
    exten => 102,n,Voicemail(u102)
    exten => 102,n,Hangup()

Last step would be SIP debug to make sure Asterisk is sending the correct CID - if it is, the this would point to the issue being with the phone.

Hi billychia!
Thank you for your reply. Here is the additional data.

[quote=“billychia”]hmm, this is strange - a few things I’m curious about:

  • Based on the Cisco instructions for the phone you can hit “edit” (for example to add 1 for long distance) - When you highlight the number in your missed call log and hit “edit” - does it edit 012345678 or does it edit 102? [/quote]
    It edits 102

the phones are in the same context (default)

output when I press “dial” is:
== Using SIP RTP CoS mark 5
– Executing [102@default:1] Dial(“SIP/102-000002af”, “SIP/102,30,rt”) in new stack
== Using SIP RTP CoS mark 5
– Called 102
– SIP/102-000002b0 is ringing
== Spawn extension (default, 102, 1) exited non-zero on ‘SIP/102-000002af’

== Using SIP RTP CoS mark 5
– Executing [102@default:1] Set(“SIP/012345678-000002ab”, “CALLERID(name)=012345678”) in new stack
– Executing [102@default:2] Set(“SIP/012345678-000002ab”, “CALLERID(num)=012345678”) in new stack
– Executing [102@default:3] Dial(“SIP/012345678-000002ab”, “SIP/102,30,rt”) in new stack
== Using SIP RTP CoS mark 5
– Called 102
– SIP/102-000002ac is ringing
== Spawn extension (default, 102, 3) exited non-zero on ‘SIP/012345678-000002ab’

[quote]
Last step would be SIP debug to make sure Asterisk is sending the correct CID - if it is, the this would point to the issue being with the phone.[/quote]
not sure how to check that

Many thanks for suggestions!

There are several ways to get a SIP packet capture - you can use wireshark or tcpdump. The easiest way is probably just to use the Asterisk CLI command:

sip set debug on

If you have a lot of calls active you will see a great deal of output. To stop the debug use:

sip set debug off

You are going to be looking for the “from” header in the SIP packet. It should look something like this:

From: “012345678” sip:012345678@10.24.12.209;tag=as0b874751

The trick here is to find the packet that is the INVITE from Asterisk to the phone. (from 012345678 to 102) Full packet should look something like this:

INVITE sip:adorner@10.24.12.211:5060;ob SIP/2.0
Via: SIP/2.0/UDP 10.24.12.209:5060;branch=z9hG4bK22750d56;rport
Max-Forwards: 70
From: “012345678” sip:012345678@10.24.12.209;tag=as0b874751
To: sip:adorner@10.24.12.211:5060;ob
Contact: sip:012345678@10.24.12.209:5060
Call-ID: 40ccbeea68bf20d1737a0014010c5881@10.24.12.209:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX 11.2.1
Date: Thu, 04 Jul 2013 21:16:11 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 262

Basically if you’ve got the correct info in the From header, then Asterisk is sending the correct data and there is strong evidence that you have a glitch with your phone(s).

Other places I might look

  • are you setting callerID in sip.conf?
  • have you tried setting name and num to different things? (like “testname 012345678” - maybe the phone interprets CID in a strange way and if the name is omitted is plugs in the number.)
  • are you on the latest version of the phone firmware?

Here is the SIP debug… Does it look right?

<— SIP read from UDP:10.30.10.176:52783 —>
SIP/2.0 487 Request Cancelled
Via: SIP/2.0/UDP 10.30.10.35:5060;branch=z9hG4bK24ae0c89
From: “012345678” sip:102@10.30.10.35;tag=as49a7af5e
To: sip:102@10.30.10.176:5060;transport=udp;tag=001bd40b6a77000b09ff4f8e-228e3d54
Call-ID: 26eaf129177b56ec1a70d9b43c9a73d4@10.30.10.35
Date: Sat, 13 Jul 2013 08:38:24 GMT
CSeq: 102 INVITE
Server: Cisco-CP7960G/8.0
Contact: sip:102@10.30.10.176:5060;transport=udp
Allow: ACK,BYE,CANCEL,INVITE,NOTIFY,OPTIONS,REFER,REGISTER,UPDATE
Remote-Party-ID: “102” sip:102@10.30.10.35;party=called;id-type=subscriber;privacy=off;screen=yes
Content-Length: 0

I have not set the callerID in sip.conf - even doing that doesn’t change anything
Setting name and num to different things changes the caller line, but clicking dial still calls back to “self”

Firmware version is probably P0S3-08-9-00 ?
Cisco Systems, Inc. Copyright 2000-2005
Cisco IP phone MAC: xxxx:xxxx:xxxx
Loadid: SW: P0S3-08-9-00 ARM: PAS3ARM1 Boot: PC030301 DSP: 4.0(2.0)[A0]

Thank you again!

Actually, this line looks strange:

From: “012345678” sip:102@10.30.10.35;tag=as49a7af5e

Notice how in my sip debug the number in quotes and the username@host is the same:

From: “012345678” sip:012345678@10.24.12.209;tag=as0b874751

You have 102@10.30.10.35 - this is probably what your Cisco phone is interpreting and why it is placing 102 in the call log. But - why is Asterisk sending this in the SIP packet? Hmm… need to dig deeper to find out

I have a few more questions:

  • What version of Asterisk are you running? (If you are not on 1.8 or 11 then this could be part of the problem.)
  • Can you post your full sip.conf and extensions.conf (If they are long you can post on pastebin.com and then just put the link here.)
  • Are you using the phone to call itself? If so, do you experience the same behavior if you call from another endpoint?
  • Can you describe your call path? (how many phones are connected, which phone is calling which and via which extensions.)

Hello,
I had Asterisk 1.6.2.9-2+squeeze10, so I upgraded to Asterisk 11.5.0, but the problem remains.

My sip.conf looks like this:

[general]

register => 1234567:password@10.253.1.31/1234567
register => 2345678:password@10.253.1.31/2345678

maxexpiry=3600 ; 3600
defaultexpiry=1800
port=5060
bindaddr=0.0.0.0
qualify=no
disallow=all
allow=alaw
allow=ulaw
callcounter=yes

[siol]
type=friend
username=37755440
secret=secretpass
fromuser=37755440
host=10.253.1.31
dtmfmode=inband
fromdomain=voip.siol
context=house
insecure=port,invite
disallow=all
allow=alaw
nat=yes
qualify=yes
canreinvite=no

[101]
type=friend
defaultuser=101
fromuser=101
context=house
host=dynamic
secret=secretpass
disallow=all
allow=alaw
mailbox=101
directmedia=nonat
nat=never
notifyringing = yes
notifybusy = yes
notifyhold = yes
callgroup=1
pickupgroup=1

[100]
type=friend
defaultuser=100
fromuser=100
context=house
host=dynamic
secret=secretpass
disallow=all
allow=alaw
mailbox=100
directmedia=nonat
nat=never
notifyringing = yes
notifybusy = yes
notifyhold = yes
callgroup=1
pickupgroup=1

[102]
type=friend
defaultuser=102
fromuser=102
context=house
host=dynamic
secret=secretpass
disallow=all
allow=alaw
mailbox=102
directmedia=nonat
nat=never
notifyringing = yes
notifybusy = yes
notifyhold = yes
busylevel = 1
callgroup=1
pickupgroup=1

My extensions.conf is like that:

[house]

exten => _*8.,1,Pickup(${EXTEN:3}@house)

exten => 100,hint,SIP/100
exten => 100,1,Set(CALLERID(all)=${CALLERID(num)})
exten => 100,n,Dial(SIP/100,60,rtT)
exten => 100,n,Voicemail(u100)
exten => 100,n,Hangup()

exten => 101,hint,SIP/101
exten => 101,1,Dial(SIP/101,30)
exten => 101,n,Voicemail(u101)
exten => 101,n,Hangup()

exten => 102,hint,SIP/102
exten => 102,1,Set(CALLERID(name)=${CALLERID(num)})
exten => 102,n,Set(CALLERID(num)=${CALLERID(num)})
exten => 102,n,Dial(SIP/102,30,rt)
exten => 102,n,Voicemail(u102)
exten => 102,n,Hangup()

exten => _1234567,1,Dial(SIP/100&SIP/101&SIP/102,60,rtT)
exten => _1234567,n,Playback(vm-nobodyavail)
exten => _1234567,n,Hangup()

There is nothing special in the configuration I think. I experience the same behavior if i call from one phone to the other or if I call from outside.
There are only a few phones connected - you can see the config in sip.conf

I have the same issue at another site with Yealink phones.


Also, you have two secrets in one section, you have both canreinvite and directmedia (the latter is the new name for the former), peer would almost certainly be better than friend.  You have nat= (which doesn't apply to normal NAT cases, but you don't have one of externip, exteraddr or stunaddr.

Also, you have two secrets in one section, you have both canreinvite and directmedia (the latter is the new name for the former), peer would almost certainly be better than friend. You have nat= (which doesn’t apply to normal NAT cases, but you don’t have one of externip, exteraddr or stunaddr.

Commenting out fromuser=### and directmedia=nonat from sip.conf solved the issue!

Many thanks to billychia and david55!

Jernej