My problem is that for incoming calls, I can hear the other person, but the other person cannot hear me. I am theorizing it has something to do with codec negotiation.
My setup is like this:
I have a regular phone number through my SIP provider, www.cellip.com.
I have an asterisk installation running Asterisk 18.104.22.168 on Debian linux. Asterisk registers with the sip provider fine and gets the incoming call.
I have an X-Lite softphone that registers with Asterisk.
I can place outbound calls from the softphone through asterisk to an outside number and they work fine, sound goes both ways.
When I get an incoming call, if the call goes to the voicemail in asterisk, everything works fine (you can hear the voicemail prompt, and the message you leave doesn’t end up silent), so I would assume that the Provider<->Asterisk side of things is ok.
When I get an incoming call and answer it with X-Lite, I can hear the other person fine, but they cannot hear me.
Both the X-Lite and the Asterisk are behind nat, different nats. The nat setup seems to be fine. I have configured asterisk with externip= and localnet= and I can see the packets for the rtp stream going through. I have run tcpdump on the asterisk server and wireshark on the X-lite machine and I can see rtp packets containing audio data coming from the provider, getting sent out by asterisk, and received by x-lite. I can also see packets sent by x-lite containing audio data getting received by asterisk and getting sent out by asterisk to my provider.
However, one thing is confusing me. This is from the packet capture from the asterisk machine (local ip 172.26.44.8):
No. Time Source Sport Destination Dport Protocol Info 2431 31.340843 <xlite machine> 4992 172.26.44.8 5070 RTP PT=ITU-T G.711 PCMU, SSRC=0x995F41DC, Seq=5184, Time=172280 2432 31.341082 172.26.44.8 5076 <sip provider> 40914 RTP PT=ITU-T G.711 PCMU, SSRC=0x995F41DC, Seq=5184, Time=172280 2433 31.359743 <sip provider> 40914 172.26.44.8 5076 RTP PT=ITU-T G.711 PCMA, SSRC=0xEB8C83C, Seq=14571, Time=1008742139 2434 31.359926 172.26.44.8 5070 <xlite machine> 4992 RTP PT=ITU-T G.711 PCMA, SSRC=0xEB8C83C, Seq=14571, Time=1008742139
As you can see, the incoming audio from the provider is in a-law format, but the outbound audio to the provider is in u-law format. Is this supposed to work?
disallow=all allow=alaw allow=ulaw
I used “sip show channel” to look at the parameters for the channel between asterisk<->provider:
* SIP Call Curr. trans. direction: Incoming Call-ID: AA98CBE9-870111E1-A43AE433-C5F01355@22.214.171.124 Owner channel ID: SIP/cellip13-00000022 Our Codec Capability: 0xc (ulaw|alaw) Non-Codec Capability (DTMF): 1 Their Codec Capability: 0x90f (g723|gsm|ulaw|alaw|g726|g729) Joint Codec Capability: 0xc (ulaw|alaw) Format: 0x8 (alaw)