Codec problem

Hello

I have problem with calls from SJphone to Linksys SPA-922. When I make call in this direction I cannot hear on SPA the caller but caller can hear me. When I initiate call from SPA, then everything go well. There is no firewall in between SJphone and asterisk nor SPA and asterisk. After a long investigation I found the problem.

Problem is that when SJphone initiates the call it results that voice from SJphone is encoded using GSM codes (which SPA doesn’t support). Other directin is encoded using G711 supported by both sides.

I am using SIP protocol.
canreinvite=no (I prefer that due to complexity of network.)
All voice traffic goes through asterisk.

My first question is: Is it expected behavior that call is established using codecs that booth sides do not accept? Or am I doing something wrong?

Second question: Can asterisk translate voice from one codec to another?

Of course, I can workaround by adding disallow=gsm for SJphone to sip.conf but this is not what I want. I want to disallow gsm when somebody calls SPA.
Or better, I want to recode gsm to something understandable by SPA while allow one SJphone talking to another SJphone using GSM codec.

Thanks

Marek

PS: If I am asking wrong forum, please let me know.

Hi

If had posted your sip.conf for these extensions we might be able to see a little clearer.

But in reality asterisk will negotiate codecs with no problem as long as they are setup correctly. It should also transcode OK

Ian

Does transcode need to be enabled somewhere?
But anyway. My SPA does not support GSM codec and call was negotiated using GSM for one direction (from SJphone to SPA). I tried replace SJphone with Express Talk - same result.

My sip.conf is:
[general]
context=default
allowoverlap=yes
bindport=5060
bindaddr=0.0.0.0
srvlookup=yes
t38pt_udptl = yes
t38pt_rtp=no
t38pt_tcp=no
canreinvite=yes

[SPA]
type=friend
secret=…
host=dynamic
username=…
canreinvite=no
context=mycontext

[SJphone]
type=friend
secret=…
host=dynamic
username=…
canreinvite=no
context=mycontext

Try

[SPA]
type=friend
secret=…
host=dynamic
username=…
canreinvite=no
context=mycontext
disallow=all
allow=alaw

[SJphone]
type=friend
secret=…
host=dynamic
username=…
canreinvite=no
context=mycontext
disallow=all
allow=gsm

It works exactly as I want. :smiley:

Thanks a lot.

To be more exact just adding
disallow=all
allow=alaw
to SPA is enough.

(I still think that asterisk is deciding wrong way. It has to respect negotiation and not just rely on what is allowed in configuration.)

Hi

[quote]To be more exact just adding
disallow=all
allow=alaw
to SPA is enough. [/quote]

If you just want the sjphone to use only GSM then define that, other wise its down to the UA to negatiate and they dont seem to be doing it.

Basicly its good prctice to define codecs.

Ian