Outgoing SIP -> Cisco FXO problems

Hi Guys,

I have a Linksys IP phone (SPA941 with latest firmware) with Asterisk version 1.6.0.18 on FreeBSD 8 (64 Bit).

This is what I am trying to do (so it’s clear what I am trying to achieve):

tape.net/~gerry/asterisk/cisco26x0.html

I want to be able to receive incoming calls from the PSTN line to my IP phone and to also be able to make calls from my IP phone to the outside world via the FXO.

Inbound calls work just fine, I can ring my landline number from a cell phone, FXO picks up and asterisk does the rest of the magic from there. It’s outgoing calls that do not seem to work. I have configured extensions.conf so that any number dialed that starts with a 0 is sent to the Cisco unit. I have the following entry in my extensions.conf:

[quote][pstn-outbound]
exten => _0.,1,Dial(SIP/${EXTEN:1}@172.16.0.244) ; IP address of Cisco gateway
exten => _0.,2,Congestion
[/quote]

What is happening is, the call is being sent to the cisco unit, the cisco unit is starting the FXO and dialing the number (I know this is occuring because the ‘Line in use’ light on the FXO card comes on for a few seconds, then goes off (hang up)). Upon connecting a spare handset to the line, I can hear that the correct number got dialed just prior to the hang up.

If I connect a Cisco soft phone (Cisco IP communicator) via Cisco call manager which uses SCCP rather than SIP, i can make an external call via the FXO just fine.

This means there is a SIP problem, I think what is happening is:

  • Call is forwarded to the Cisco router
  • Cisco starts the FXO and dials
  • A SIP negotiation problem occurs
  • Call is terminated.

I think at this stage I need to examine the SIP protocol and see where things are going wrong. As I don’t understand the inner workings of the SIP protocol I am stuck, I can turn on SIP debugging on the Cisco end or the asterisk end but i don’t know what end is misbehaving. I would like to start with the asterisk end first. SIP->SIP communication works fine if I dial another IP phone on the network. I am using the g711 ulaw codec for everything.

Any suggestions? Am I able to get a capture of SIP traffic on a test call and put it up here (how do i do it)? If i get the capture, would you guys mind having a look and telling me what you think?

I’d be very grateful as I am pulling my hair out here.

Thanks In Advance,
Alex.

I am seeing this in asterisk:

[Jan 23 12:00:09] NOTICE[53207] config.c: Registered Config Engine curl
[Jan 23 12:00:17] VERBOSE[53207] logger.c: – Executing [097711694@local-phones:1] Dial(“SIP/1-00000000”, “SIP/97711694@172.16.0.244”) in new stack
[Jan 23 12:00:17] VERBOSE[53207] logger.c: – Called 97711694@172.16.0.244
[Jan 23 12:00:21] VERBOSE[53207] logger.c: – SIP/172.16.0.244-00000001 is making progress passing it to SIP/1-00000000
[Jan 23 12:00:21] VERBOSE[53207] logger.c: – SIP/172.16.0.244-00000001 answered SIP/1-00000000
[Jan 23 12:00:21] VERBOSE[53207] logger.c: – Native bridging SIP/1-00000000 and SIP/172.16.0.244-00000001
[Jan 23 12:00:22] VERBOSE[53207] logger.c: – Got SIP response 500 “Internal Server Error” back from 172.16.0.244
[Jan 23 12:00:22] VERBOSE[53207] logger.c: == Spawn extension (local-phones, 097711694, 1) exited non-zero on ‘SIP/1-00000000’

Ok… using ‘Transfer’ instead of ‘Dial’ in extensions.conf seems to work… But why?

I now have this instead:

[quote][pstn-outbound]
exten => _0.,1,Transfer(SIP/${EXTEN:1}@172.16.0.244) ; IP address of Cisco gateway
exten => _0.,2,Congestion
[/quote]

Ok got to the bottom of it.

Upgraded asterisk to 1.6.2.1 and all the problems that I had disappeared, I can use dial instead of transfer now in extensions.conf and it works fine. There must have been some bugfixes between versions for the things that were causing me issues. The upgrade also fixed the issue i was having with stuttered music on hold.

:mrgreen: :mrgreen: :mrgreen: :mrgreen: :smiley: :smiley: :smiley: :smiley: :smiley: :smiley: :smiley: