Possible causes of error "503 Service Unavailable"

We’re currently trying to interconnect the Asterisk PBX with a ZTE Softswitch. The scenario is this, using the account and password provisioned in the ZTE Softswitch, I created a SIP Trunk from the Asterisk Box, then using an extension, we tried making a PSTN call going to the ZTE SIP Trunk, but apparently an error message “503 Service Unavailable” was the result.

It was verified on the ZTE side that the account has registered successfully.

Any help on this.

Thanks.

It sounds like the ZTE switch is getting the call but does not know what to do with the extension specified. Watch the Asterisk command line when you make a call and look for a line like this: – Called 1234567@peer . Does the ZTE switch know what to do with the extension (in my example it is 1234567) from Asterisk? Is the extension in the correct context/calling-search-space on the ZTE switch?

here is the trace log from the asterisk. According to the ZTE operator that they were able to receive an incoming call request but the message they are seeing are “unauthorized”.

Please find below the logs, thanks for the help.

9005 is my extension, 7192371 is the called pstn number.
203.177.174.172 is teh extionsion IP Address

Apr 9 09:55:47 DEBUG[20507]: Setting NAT on RTP to 4 Apr 9 09:55:48 DEBUG[20507]: Stopping retransmission on '91023D22-3F72-4355-864E-32E311F63695@203.177.174.172' of Response 27996: Found Apr 9 09:55:48 DEBUG[20507]: Setting NAT on RTP to 4 Apr 9 09:55:48 DEBUG[20507]: Check for res for 9005 Apr 9 09:55:48 DEBUG[20507]: Call from user '9005' is 1 out of 0 Apr 9 09:55:48 DEBUG[20507]: build_route: Contact hop: <sip:9005@203.177.174.172:5060> Apr 9 09:55:48 VERBOSE[20507]: -- Executing Macro("SIP/9005-bb7e", "dialout|9|17192371") in new stack Apr 9 09:55:48 DEBUG[20507]: Expression is '1' Apr 9 09:55:48 VERBOSE[20507]: -- Executing GotoIf("SIP/9005-bb7e", "1?4") in new stack Apr 9 09:55:48 VERBOSE[20507]: -- Goto (macro-dialout,s,4) Apr 9 09:55:48 DEBUG[20507]: Expression is '0' Apr 9 09:55:48 VERBOSE[20507]: -- Executing GotoIf("SIP/9005-bb7e", "0?6") in new stack Apr 9 09:55:48 DEBUG[20507]: Not taking any branch Apr 9 09:55:48 VERBOSE[20507]: -- Executing SetCallerID("SIP/9005-bb7e", "Digitel_3959012") in new stack Apr 9 09:55:48 VERBOSE[20507]: -- Executing SetVar("SIP/9005-bb7e", "length=1") in new stack Apr 9 09:55:48 VERBOSE[20507]: -- Executing Dial("SIP/9005-bb7e", "SIP/Digitel_3959012/7192371") in new stack Apr 9 09:55:48 DEBUG[20507]: Setting NAT on RTP to 0 Apr 9 09:55:48 DEBUG[20507]: Outgoing Call for 7192371 Apr 9 09:55:48 DEBUG[20507]: 7192371 is not a local user Apr 9 09:55:48 VERBOSE[20507]: -- Called Digitel_3959012/7192371 Apr 9 09:55:49 DEBUG[20507]: Scheduled a registration timeout # 76814 Apr 9 09:55:49 DEBUG[20507]: Stopping retransmission on '5eea859b7392efa413ecd55f669bb551@127.0.0.1' of Request 710: Found Apr 9 09:55:49 DEBUG[20507]: Stopping retransmission on '5eea859b7392efa413ecd55f669bb551@127.0.0.1' of Request 711: Found Apr 9 09:55:49 DEBUG[20507]: Registration successful Apr 9 09:55:49 DEBUG[20507]: Cancelling timeout 76814 Apr 9 09:55:54 WARNING[20507]: Maximum retries exceeded on call 5270a4bc621ecef83fe2662918d09436@202.73.169.68 for seqno 102 (Critical Request) Apr 9 09:55:54 DEBUG[20507]: update_user_counter(7192371) - decrement outUse counter Apr 9 09:55:54 DEBUG[20507]: 7192371 is not a local user Apr 9 09:55:54 VERBOSE[20507]: == No one is available to answer at this time Apr 9 09:55:54 DEBUG[20507]: Exiting with DIALSTATUS=NOANSWER. Apr 9 09:55:54 VERBOSE[20507]: -- Executing Congestion("SIP/9005-bb7e", "") in new stack Apr 9 09:55:54 VERBOSE[20507]: == Spawn extension (macro-dialout, s, 8) exited non-zero on 'SIP/9005-bb7e' in macro 'dialout' Apr 9 09:55:54 VERBOSE[20507]: == Spawn extension (from-internal, 17192371, 1) exited non-zero on 'SIP/9005-bb7e' Apr 9 09:55:54 VERBOSE[20507]: -- Executing Macro("SIP/9005-bb7e", "hangupcall") in new stack Apr 9 09:55:54 VERBOSE[20507]: -- Executing ResetCDR("SIP/9005-bb7e", "w") in new stack Apr 9 09:55:54 DEBUG[20507]: cdr_mysql: inserting a CDR record. Apr 9 09:55:54 DEBUG[20507]: cdr_mysql: SQL command as follows: INSERT INTO cdr (calldate,clid,src,dst,dcontext,channel,dstchannel,lastapp,lastdata,duration,billsec,disposition,amaflags,accountcode) VALUES ('2005-04-09 09:55:48','Digitel_3959012','9005','17192371','from-internal', 'SIP/9005-bb7e','SIP/Digitel_3959012-cd8e','ResetCDR','w',6,0,'NO ANSWER',3,'') Apr 9 09:55:54 VERBOSE[20507]: -- Executing NoCDR("SIP/9005-bb7e", "") in new stack Apr 9 09:55:54 WARNING[20507]: CDR on channel 'SIP/9005-bb7e' not posted Apr 9 09:55:54 WARNING[20507]: CDR on channel 'SIP/9005-bb7e' lacks end Apr 9 09:55:54 VERBOSE[20507]: -- Executing Wait("SIP/9005-bb7e", "5") in new stack Apr 9 09:55:54 VERBOSE[20507]: == Spawn extension (macro-hangupcall, s, 3) exited non-zero on 'SIP/9005-bb7e' in macro 'hangupcall' Apr 9 09:55:54 VERBOSE[20507]: == Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/9005-bb7e' Apr 9 09:55:54 DEBUG[20507]: update_user_counter(9005) - decrement inUse counter Apr 9 09:55:54 DEBUG[20507]: Stopping retransmission on '91023D22-3F72-4355-864E-32E311F63695@203.177.174.172' of Response 27997: Not Found

Is Asterisk or the ZTE switch behind a firewall? I think you are running into NAT problems. Can any other SIP devices, on the same network as Asterisk, make calls to the ZTE switch?

Hi, i’ve tested the same account from a different asterisk server and same result (503 service unavailable). With regards to NAT, i’ve tested the sip account provided by ZTE directly using a softphone (xlite and sjphone) and it works fine. Tested it with a public ip and a private ip too.

Thanks for the help.

Any idea of what’s the problem here?

So the Asterisk server is behind a NAT device? If so try adding externip &
localnet definitions to your sip.conf

Yes your registration is OK but your DIAL peer is not defined correctly at ZTE side.