Codec translation error on routing

I am new to this community, my best greetings to all.

Problem come from routing from Linksys SPA 3000 PSTN to VOIP adapter.
FreePBX on raspberry B3+, Trunk coming from provider and PSTN.
All extensions and VOIP Line work fine, PSTN trunk exhibit some threat.
After some stack manipulation conversation terminate with Codec translation Error.
Sipura SPA3000 trunk never passed to inbound route, it play message then remain there without channel.
Actually I decided to buy a new grandstream HT503 to replace SPA 3000. 2 unit where bought more than 10 year ago and never used. Today seems from many post I read it need firmware update but no more support exists.

Not sure issue come from SPA3000 or misconfiguration, I lost too much time on configuration attempt, from forum opinion log show misconfig or possible SPA failure?
Best regards
Roberto

[2018-11-05 14:09:19] NOTICE[1107] chan_sip.c: – Registration for ‘[email protected]’ timed out, trying again (Attempt #175)
[2018-11-05 14:09:19] VERBOSE[1107] chan_sip.c: Got SIP response 502 “Not Implemented” back from 192.168.1.210:5062
[2018-11-05 14:09:39] NOTICE[1107] chan_sip.c: – Registration for ‘[email protected]’ timed out, trying again (Attempt #176)
[2018-11-05 14:09:39] VERBOSE[1107] chan_sip.c: Got SIP response 502 “Not Implemented” back from 192.168.1.210:5062
[2018-11-05 14:09:50] VERBOSE[12350] pbx_variables.c: Setting global variable ‘SIPDOMAIN’ to ‘192.168.1.200’
[2018-11-05 14:09:50] VERBOSE[2824][C-000000a9] pbx.c: Executing [[email protected]:1] NoOp(“PJSIP/anonymous-000000e8”, “Received incoming SIP connection from unknown peer to xxxx”) in new stack
[2018-11-05 14:09:50] VERBOSE[2824][C-000000a9] pbx.c: Executing [[email protected]:2] Set(“PJSIP/anonymous-000000e8”, “DID=kkkk”) in new stack
[2018-11-05 14:09:50] VERBOSE[2824][C-000000a9] pbx.c: Executing [[email protected]:3] Goto(“PJSIP/anonymous-000000e8”, “s,1”) in new stack
[2018-11-05 14:09:50] VERBOSE[2824][C-000000a9] pbx_builtins.c: Goto (from-sip-external,s,1)
[2018-11-05 14:09:50] VERBOSE[2824][C-000000a9] pbx.c: Executing [[email protected]:1] GotoIf(“PJSIP/anonymous-000000e8”, “1?setlanguage:checkanon”) in new stack
[2018-11-05 14:09:50] VERBOSE[2824][C-000000a9] pbx_builtins.c: Goto (from-sip-external,s,2)
[2018-11-05 14:09:50] VERBOSE[2824][C-000000a9] pbx.c: Executing [[email protected]:2] Set(“PJSIP/anonymous-000000e8”, “CHANNEL(language)=it”) in new stack
[2018-11-05 14:09:50] VERBOSE[2824][C-000000a9] pbx.c: Executing [[email protected]:3] GotoIf(“PJSIP/anonymous-000000e8”, “1?noanonymous”) in new stack
[2018-11-05 14:09:50] VERBOSE[2824][C-000000a9] pbx_builtins.c: Goto (from-sip-external,s,5)
[2018-11-05 14:09:50] VERBOSE[2824][C-000000a9] pbx.c: Executing [[email protected]:5] Set(“PJSIP/anonymous-000000e8”, “TIMEOUT(absolute)=15”) in new stack
[2018-11-05 14:09:50] VERBOSE[2824][C-000000a9] func_timeout.c: Channel will hangup at 2018-11-05 14:10:05.566 UTC.
[2018-11-05 14:09:50] WARNING[2824][C-000000a9] func_channel.c: Unknown or unavailable item requested: ‘recvip’
[2018-11-05 14:09:50] VERBOSE[2824][C-000000a9] pbx.c: Executing [[email protected]:6] Log(“PJSIP/anonymous-000000e8”, "WARNING,"Rejecting unknown SIP connection from “”) in new stack
[2018-11-05 14:09:50] WARNING[2824][C-000000a9] Ext. s: "Rejecting unknown SIP connection from "
[2018-11-05 14:09:50] VERBOSE[2824][C-000000a9] pbx.c: Executing [[email protected]:7] Answer(“PJSIP/anonymous-000000e8”, “”) in new stack
[2018-11-05 14:09:50] WARNING[2824][C-000000a9] translate.c: No translator path: (starting codec is not valid)
[2018-11-05 14:09:50] WARNING[2824][C-000000a9] translate.c: No translator path: (starting codec is not valid)
[2018-11-05 14:09:50] VERBOSE[2824][C-000000a9] pbx.c: Executing [[email protected]:8] Wait(“PJSIP/anonymous-000000e8”, “2”) in new stack
[2018-11-05 14:09:52] WARNING[2824][C-000000a9] channel.c: Unable to find a codec translation path: (g723) -> (ulaw)
[2018-11-05 14:09:52] ERROR[2824][C-000000a9] channel.c: Could not return write format to its original state
[2018-11-05 14:09:52] VERBOSE[2824][C-000000a9] pbx.c: Executing [[email protected]:9] Playback(“PJSIP/anonymous-000000e8”, “ss-noservice”) in new stack
[2018-11-05 14:09:52] VERBOSE[2824][C-000000a9] file.c: <PJSIP/anonymous-000000e8> Playing ‘ss-noservice.ulaw’ (language ‘it’)
[2018-11-05 14:09:57] VERBOSE[2824][C-000000a9] pbx.c: Executing [[email protected]:10] PlayTones(“PJSIP/anonymous-000000e8”, “congestion”) in new stack
[2018-11-05 14:09:57] VERBOSE[2824][C-000000a9] pbx.c: Executing [[email protected]:11] Congestion(“PJSIP/anonymous-000000e8”, “5”) in new stack
[2018-11-05 14:09:59] VERBOSE[2824][C-000000a9] pbx.c: Spawn extension (from-sip-external, s, 11) exited non-zero on ‘PJSIP/anonymous-000000e8’
[2018-11-05 14:09:59] VERBOSE[2824][C-000000a9] pbx.c: Executing [[email protected]:1] Hangup(“PJSIP/anonymous-000000e8”, “”) in new stack
[2018-11-05 14:09:59] VERBOSE[2824][C-000000a9] pbx.c: Spawn extension (from-sip-external, h, 1) exited non-zero on ‘PJSIP/anonymous-000000e8’
[2018-11-05 14:09:59] NOTICE[1107] chan_sip.c: – Registration for ‘[email protected]’ timed out, trying again (Attempt #177)
[2018-11-05 14:09:59] VERBOSE[1107] chan_sip.c: Got SIP response 502 “Not Implemented” back from 192.168.1.210:5062
[2018-11-05 14:10:19] NOTICE[1107] chan_sip.c: – Registration for ‘[email protected]’ timed out, trying again (Attempt #178)
[2018-11-05 14:10:19] VERBOSE[1107] chan_sip.c: Got SIP response 502 “Not Implemented” back from 192.168.1.210:5062
[2018-11-05 14:10:39] NOTICE[1107] chan_sip.c: – Registration for ‘[email protected]’ timed out, trying again (Attempt #179)
[2018-11-05 14:10:39] VERBOSE[1107] chan_sip.c: Got SIP response 502 “Not Implemented” back from 192.168.1.210:5062
[2018-11-05 14:10:59] NOTICE[1107] chan_sip.c: – Registration for ‘[email protected]’ timed out, trying again (Attempt #180)
[2018-11-05 14:10:59] VERBOSE[1107] chan_sip.c: Got SIP response 502 “Not Implemented” back from 192.168.1.210:5062

Can you show a call log?

Yes, sorry I hit save before posting it.

Without going into the authentication issues that can be seen, you need to establish the same codec on the FXO ATA and the trunk.
Assuming you will be using alaw, you need to set the codec on the ATA first in the list, it might be called alaw or g711a. You might have to enable codec priority for the ATA to honor your specific list.
On the trunk you need to specify the codec in this order, because the order is important:
disallow=all
allow=alaw

Hi Ariellgrin, Thank a lot for assistence, I cannot check before tomorrow but G711 is the first codec on Sipura,

disallow and allow plus qualify too where no more in place. On saturday I was sick and maybe I never saved configuration, I cannot test now, I promise you tomorrow I made a test and report there.
Thank a lot for now.
Roberto

In the picture you sent you can see that prefered codec is set to g711u which is ulaw, not alaw, that is why it is using g723 and causing a mismatch. You need to either change g711u to g711a on sipura or change allow=alaw to allow=ulaw on the trunk.
Also, it would be a good idea to set “use pref codec only” to yes.

Hi Ariel, using G711a has quite same behaviour. I plan check again tomorrow, today I was too busy.
I am far from where PBX is till saturday, I ask someone to do some short test then reconnect pstn line where it was.
A simple test on line with G711a reported this log, I can try late with “use pref codec only” set to yes.
Allow on first test was on more than one codec and both ulaw and alaw where listed on active.
Still I cannot figure what is happening to stack and no idea why it fail. I bought 2 SPA3000 unit ten or more year ago and never used before. One still is in mint box.
One or two test then before struggling again on this I wish check Grandstream HT503 to work.
Again thank you
Roberto

[2018-11-06 16:51:15] VERBOSE[32606][C-000000bb] pbx.c: Executing [[email protected]:1] NoOp(“PJSIP/anonymous-00000102”, “Received incoming SIP connection from unknown peer to 0xxxxx”) in new stack
[2018-11-06 16:51:15] VERBOSE[32606][C-000000bb] pbx.c: Executing [[email protected]:2] Set(“PJSIP/anonymous-00000102”, “DID=0xxxxx”) in new stack
[2018-11-06 16:51:15] VERBOSE[32606][C-000000bb] pbx.c: Executing [[email protected]:3] Goto(“PJSIP/anonymous-00000102”, “s,1”) in new stack
[2018-11-06 16:51:15] VERBOSE[32606][C-000000bb] pbx_builtins.c: Goto (from-sip-external,s,1)
[2018-11-06 16:51:15] VERBOSE[32606][C-000000bb] pbx.c: Executing [[email protected]:1] GotoIf(“PJSIP/anonymous-00000102”, “1?setlanguage:checkanon”) in new stack
[2018-11-06 16:51:15] VERBOSE[32606][C-000000bb] pbx_builtins.c: Goto (from-sip-external,s,2)
[2018-11-06 16:51:15] VERBOSE[32606][C-000000bb] pbx.c: Executing [[email protected]:2] Set(“PJSIP/anonymous-00000102”, “CHANNEL(language)=it”) in new stack
[2018-11-06 16:51:15] VERBOSE[32606][C-000000bb] pbx.c: Executing [[email protected]:3] GotoIf(“PJSIP/anonymous-00000102”, “1?noanonymous”) in new stack
[2018-11-06 16:51:15] VERBOSE[32606][C-000000bb] pbx_builtins.c: Goto (from-sip-external,s,5)
[2018-11-06 16:51:15] VERBOSE[32606][C-000000bb] pbx.c: Executing [[email protected]:5] Set(“PJSIP/anonymous-00000102”, “TIMEOUT(absolute)=15”) in new stack
[2018-11-06 16:51:15] VERBOSE[32606][C-000000bb] func_timeout.c: Channel will hangup at 2018-11-06 16:51:30.504 UTC.
[2018-11-06 16:51:15] WARNING[32606][C-000000bb] func_channel.c: Unknown or unavailable item requested: ‘recvip’
[2018-11-06 16:51:15] VERBOSE[32606][C-000000bb] pbx.c: Executing [[email protected]:6] Log(“PJSIP/anonymous-00000102”, "WARNING,"Rejecting unknown SIP connection from “”) in new stack
[2018-11-06 16:51:15] WARNING[32606][C-000000bb] Ext. s: "Rejecting unknown SIP connection from "
[2018-11-06 16:51:15] VERBOSE[32606][C-000000bb] pbx.c: Executing [[email protected]:7] Answer(“PJSIP/anonymous-00000102”, “”) in new stack
[2018-11-06 16:51:15] WARNING[32606][C-000000bb] translate.c: No translator path: (starting codec is not valid)
[2018-11-06 16:51:15] WARNING[32606][C-000000bb] translate.c: No translator path: (starting codec is not valid)
[2018-11-06 16:51:15] VERBOSE[32606][C-000000bb] pbx.c: Executing [[email protected]:8] Wait(“PJSIP/anonymous-00000102”, “2”) in new stack
[2018-11-06 16:51:17] WARNING[32606][C-000000bb] channel.c: Unable to find a codec translation path: (g723) -> (alaw)
[2018-11-06 16:51:17] ERROR[32606][C-000000bb] channel.c: Could not return write format to its original state
[2018-11-06 16:51:17] VERBOSE[32606][C-000000bb] pbx.c: Executing [[email protected]:9] Playback(“PJSIP/anonymous-00000102”, “ss-noservice”) in new stack
[2018-11-06 16:51:17] VERBOSE[32606][C-000000bb] file.c: <PJSIP/anonymous-00000102> Playing ‘ss-noservice.ulaw’ (language ‘it’)
[2018-11-06 16:51:21] VERBOSE[32606][C-000000bb] pbx.c: Executing [[email protected]:10] PlayTones(“PJSIP/anonymous-00000102”, “congestion”) in new stack
[2018-11-06 16:51:21] VERBOSE[32606][C-000000bb] pbx.c: Executing [[email protected]:11] Congestion(“PJSIP/anonymous-00000102”, “5”) in new stack
[2018-11-06 16:51:26] VERBOSE[32606][C-000000bb] pbx.c: Spawn extension (from-sip-external, s, 11) exited non-zero on ‘PJSIP/anonymous-00000102’
[2018-11-06 16:51:26] VERBOSE[32606][C-000000bb] pbx.c: Executing [[email protected]:1] Hangup(“PJSIP/anonymous-00000102”, “”) in new stack
[2018-11-06 16:51:26] VERBOSE[32606][C-000000bb] pbx.c: Spawn extension (from-sip-external, h, 1) exited non-zero on ‘PJSIP/anonymous-00000102’
[2018-11-06 16:51:30] NOTICE[1107] chan_sip.c: – Registration for ‘[email protected]’ timed out, trying again (Attempt #2)
[2018-11-06 16:51:30] VERBOSE[1107] chan_sip.c: Got SIP response 502 “Not Implemented” back from 192.168.1.210:5062

There was something here in the past couple of days about this. IIRC, anonymous connections can’t use anything but ALaw and ULaw.

The error listed about doesn’t look like a codec failure, it looks like a rejected call from a source that doesn’t have a trunk set up. If that’s the case, you probably need to set up the trunk to the device and turn off anonymous access.

I would set the trunk to chan_sip at least just to try, and make sure you take care of the codec mismatch.

Hi Dave, thank for your replay, I cannot grasp out the sense of your hint.
Anonymous access is set to OFF and I can just raise to Accept for a very short while to debug what is wrong if necessary.
Trunk is hardwired to Sipura SPA3000 (fixed address 192.168.1.210) PBX is 200), it is a temporary solution before to migrate PSTN to VOIP.
VOIP trunk work fine.

Hi Arielgrin, thank to point me to this, I see now PJSIP string, but I assure you (and you can see from last lines of SPA3000 reply) is set to chan_sip not PJSip.
Tomorrow when fab reopen I try inspect in deep.
regards

Again About Codec seems ininfluent, setting use only predefined still play message (in Italian) “dialed number isn’t in use, please check and dial again”, congestion conversation open.
Log:
[2018-11-07 18:39:06] VERBOSE[1107] chan_sip.c: Got SIP response 502 “Not Implemented” back from 192.168.1.210:5062
[2018-11-07 18:39:24] VERBOSE[12350] pbx_variables.c: Setting global variable ‘SIPDOMAIN’ to ‘192.168.1.200’
[2018-11-07 18:39:24] VERBOSE[26428][C-000000c5] pbx.c: Executing [[email protected]:1] NoOp(“PJSIP/anonymous-0000010c”, “Received incoming SIP connection from unknown peer to 0xxxx”) in new stack
[2018-11-07 18:39:24] VERBOSE[26428][C-000000c5] pbx.c: Executing [[email protected]:2] Set(“PJSIP/anonymous-0000010c”, “DID=0xxxx”) in new stack
[2018-11-07 18:39:24] VERBOSE[26428][C-000000c5] pbx.c: Executing [[email protected]:3] Goto(“PJSIP/anonymous-0000010c”, “s,1”) in new stack
[2018-11-07 18:39:24] VERBOSE[26428][C-000000c5] pbx_builtins.c: Goto (from-sip-external,s,1)
[2018-11-07 18:39:24] VERBOSE[26428][C-000000c5] pbx.c: Executing [[email protected]:1] GotoIf(“PJSIP/anonymous-0000010c”, “1?setlanguage:checkanon”) in new stack
[2018-11-07 18:39:24] VERBOSE[26428][C-000000c5] pbx_builtins.c: Goto (from-sip-external,s,2)
[2018-11-07 18:39:24] VERBOSE[26428][C-000000c5] pbx.c: Executing [[email protected]:2] Set(“PJSIP/anonymous-0000010c”, “CHANNEL(language)=it”) in new stack
[2018-11-07 18:39:24] VERBOSE[26428][C-000000c5] pbx.c: Executing [[email protected]:3] GotoIf(“PJSIP/anonymous-0000010c”, “1?noanonymous”) in new stack
[2018-11-07 18:39:24] VERBOSE[26428][C-000000c5] pbx_builtins.c: Goto (from-sip-external,s,5)
[2018-11-07 18:39:24] VERBOSE[26428][C-000000c5] pbx.c: Executing [[email protected]:5] Set(“PJSIP/anonymous-0000010c”, “TIMEOUT(absolute)=15”) in new stack
[2018-11-07 18:39:24] VERBOSE[26428][C-000000c5] func_timeout.c: Channel will hangup at 2018-11-07 18:39:39.958 UTC.
[2018-11-07 18:39:24] WARNING[26428][C-000000c5] func_channel.c: Unknown or unavailable item requested: ‘recvip’
[2018-11-07 18:39:24] VERBOSE[26428][C-000000c5] pbx.c: Executing [[email protected]:6] Log(“PJSIP/anonymous-0000010c”, "WARNING,"Rejecting unknown SIP connection from “”) in new stack
[2018-11-07 18:39:24] WARNING[26428][C-000000c5] Ext. s: "Rejecting unknown SIP connection from "
[2018-11-07 18:39:24] VERBOSE[26428][C-000000c5] pbx.c: Executing [[email protected]:7] Answer(“PJSIP/anonymous-0000010c”, “”) in new stack
[2018-11-07 18:39:24] VERBOSE[26428][C-000000c5] pbx.c: Executing [[email protected]:8] Wait(“PJSIP/anonymous-0000010c”, “2”) in new stack
[2018-11-07 18:39:26] NOTICE[1107] chan_sip.c: – Registration for ‘[email protected]’ timed out, trying again (Attempt #6)
[2018-11-07 18:39:26] VERBOSE[1107] chan_sip.c: Got SIP response 502 “Not Implemented” back from 192.168.1.210:5062
[2018-11-07 18:39:26] VERBOSE[26428][C-000000c5] pbx.c: Executing [[email protected]:9] Playback(“PJSIP/anonymous-0000010c”, “ss-noservice”) in new stack
[2018-11-07 18:39:26] VERBOSE[26428][C-000000c5] file.c: <PJSIP/anonymous-0000010c> Playing ‘ss-noservice.ulaw’ (language ‘it’)
[2018-11-07 18:39:31] VERBOSE[26428][C-000000c5] pbx.c: Executing [[email protected]:10] PlayTones(“PJSIP/anonymous-0000010c”, “congestion”) in new stack
[2018-11-07 18:39:31] VERBOSE[26428][C-000000c5] pbx.c: Executing [[email protected]:11] Congestion(“PJSIP/anonymous-0000010c”, “5”) in new stack
[2018-11-07 18:39:33] VERBOSE[26428][C-000000c5] pbx.c: Spawn extension (from-sip-external, s, 11) exited non-zero on ‘PJSIP/anonymous-0000010c’
[2018-11-07 18:39:33] VERBOSE[26428][C-000000c5] pbx.c: Executing [[email protected]:1] Hangup(“PJSIP/anonymous-0000010c”, “”) in new stack
[2018-11-07 18:39:33] VERBOSE[26428][C-000000c5] pbx.c: Spawn extension (from-sip-external, h, 1) exited non-zero on ‘PJSIP/anonymous-0000010c’
[2018-11-07 18:39:46] NOTICE[1107] chan_sip.c: – Registration for ‘[email protected]’ timed out, trying again (Attempt #7)
[2018-11-07 18:39:46] VERBOSE[1107] chan_sip.c: Got SIP response 502 “Not Implemented” back from 192.168.1.210:5062

Seems. I doubt that it is.

You just got a 502 response from the device at 192.168.1.210. That’s got to be a problem.

You are getting an authentication error from your unknown peer. This means that the Asterisk Trunk setup is not correct. I still think that this is the nexus of your problem and you need to fix this first.

You are going to need to fix this at some point. I have no idea what this is, but it definitely not good.

Your device at 192.168.1.210 is still not able to connect to the server.

The only reason it’s working at all is because it is starting an anonymous connection, which is dangerous for your wallet.

Here screenshot of trunk
Screenshot%20from%202018-11-07%2019%3A59%3A48

Hi Dave, I was in doubt about codec but why not to do another try, all codec/one at time codec where enabled without change in response, about other point we check one at time

Unimplemented is referred to registration, device execute dialing on PSTN, answer to PSTN line, this seems bad but not sure can be issue on stack. These messages are in response to registration string when no channel is in place.

And here there where two point :
1 as posted trunk is SIP not PJSIP
2 ok why is peer unknown?

I hope this can be close the real problem, I ask’d for help, I also have no idea what it mean and no record on help nor documentation.
At this point stack manipulation where pointing at SPA3000, after this connect channel to play message and say “dialed number is not in use, please check and retry”, “congestion tone” then hang up.

connection is active, so it answer the call, registration is wrong. From status chan sip registry:

And also this anonymous connection is OFF:

At end, too much time elapsed from first time I was using Asterisk, this is beautiful interface but hide to me too much details I was used from command line.
I don’t feel useful try to debug stack to pinpoint where SPA3000 offend.
After moving trunk to HT503 I post what happen. This is not readily available to test and we need wait next WE I can go to site.
Regards
Roberto

reflection about things…
Channel(recvip)
Why unknown? IP must be known otherwise it cannot route audio play to 192.168.1.210 (SPA3000)

On previous this appear after some stack manipulation when channel is active, so what hell is this?
Saturday I can try wireshark on PBX network. Definitive suspect is SPA3000 emit some offending code.
Not sure to remember too much about protocol details nor be able to still use wshark, again too much time elapsed, if it may be of some use I can try capture traffic and packet too.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.