Issues/Recommendations with Mobile SIP Softphones

Hi Guys,

I’ll start by saying that I’m pretty green when it comes to both Asterisk and Freepbx. I’ve setup an Asterisk Now VM at home and having been playing with Freepbx for a few weeks. Everything I touched worked which is a testiment to the developers hard work however I was only using extensions, no SIP trunk configured yet.

Last week I decided to bite the bullet and I bought a Cisco 7940G and signed up for a SIP trunk with a local provider. No issues getting the Cisco 7940G working or the SIP trunk. In fact it was probably a bit to easy. I configured my dial plans on the outbound route to allow Irish landline numbers for all area codes (and there is a lot in this country) and all tests worked fine. Now, this is where it all started to go weird for me.

I added the dial plans for Irish Mobile numbers and the Cisco Handset and any of the Desktop SIP clients I was testing with were working fine. They could all dial out with no issues however the Mobile SIP clients were recieving a 603 Declined error. I researched this to the best of my ability and I believe that it’s a Codec Mismatch issue. I’m only using the free SIP clients for IOS and Android at the moment so I’m relying on ULAW and ALAW for codecs. The strange thing though is if I dial a specific LandLine number the Mobile SIP clients work fine but only for 1 landline number.

Would anyone have any advise for me on what I could look at here. If you need any further information from me just ask away.

Cheers,
Laoistom

A couple of thoughts
It sounds like you could have benefited from pattern matching in your dial plans more vs entertering all the various permutations of numbers.

If you can post logs from the asterisk console for a failed call or at least the lines around where the call fails, that would be helpful

Do you have extension routing, or class of service modules active? Did the SIP soft clients get configured to use a specific context? Also, what codecs are the soft clients configured to use? Order matters here. Finally, if you do a sip show peers from the asterisk cli or look in the peers report of the asterisk info report in the GUI, are the soft clients registered successfully with asterisk?

There are several causes for 603 errors. Codec problems are just the start. You could also be running into encryption problems, bad dial strings, or other settings in your SIP setup.

It sounds like you’ve really gone way too far in your setup. I set up systems all the time and I never have to add more than a couple of rules for getting calls into and out of the system.

Ok Firstly thanks for taking the time to help me.

Lets start from the top I suppose :

Regarding Pattern Matching, I had a good rattle at that and dispite having a pattern such as this (05XNNXXXXX) I was able to dial numbers such as 05786XXXXX but 05793XXXXX would deny automatically.

Anyway I’ve cleaned out the Dial Patterns to just a few patterns till I get to the bottom of this.

I’ve posted logs as asked for a failed call from my Mobile SIP client running on iOS.

I do have the extension routing module enabled and registered

Regarding configuring the soft clients to use a specific context I’ll be honest here and say I’m not entirely sure what this means. I’ll put my research hat on as soon as I stop typing and see if I can figure this part out.

Below is a screenshot of the Codecs listed in both Linphone Client and Zoiper Client on iOS

Here is the result of sip show peers command on my asterisk CLI. Extension 501 here is my iOS client

localhostCLI> sip show peers
Name/username Host Dyn Forcerport Comedia ACL Port Status Description
500/500 10.50.0.26 D Yes Yes A 5060 OK (85 ms)
501/501 192.168.101.101 D Yes Yes A 5060 OK (20 ms)
502/502 (Unspecified) D Yes Yes A 0 UNKNOWN
503/503 (Unspecified) D Yes Yes A 0 UNKNOWN
504/504 192.168.100.19 D Yes Yes A 5060 UNREACHABLE
510 (Unspecified) D Yes Yes A 0 UNKNOWN
550 (Unspecified) D Yes Yes A 0 UNKNOWN
551/551 (Unspecified) D Yes Yes A 0 UNKNOWN
IrishVoip/laoistom
irishv 77.72.174.129 Yes Yes 5060 OK (40 ms)
9 sip peers [Monitored: 3 online, 6 offline Unmonitored: 0 online, 0 offline]

Here is a snippet of my logs from a failed call


== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Executing [0851657409@from-internal:1] Macro(“SIP/501-00000069”, “user-callerid,LIMIT”) in new stack
– Executing [s@macro-user-callerid:1] Set(“SIP/501-00000069”, “TOUCH_MONITOR=1455221792.105”) in new stack
– Executing [s@macro-user-callerid:2] Set(“SIP/501-00000069”, “AMPUSER=501”) in new stack
– Executing [s@macro-user-callerid:3] GotoIf(“SIP/501-00000069”, “0?report”) in new stack
– Executing [s@macro-user-callerid:4] ExecIf(“SIP/501-00000069”, “1?Set(REALCALLERIDNUM=501)”) in new stack
– Executing [s@macro-user-callerid:5] Set(“SIP/501-00000069”, “AMPUSER=501”) in new stack
– Executing [s@macro-user-callerid:6] GotoIf(“SIP/501-00000069”, “0?limit”) in new stack
– Executing [s@macro-user-callerid:7] Set(“SIP/501-00000069”, “AMPUSERCIDNAME=Thomas Quigley iPhone”) in new stack
– Executing [s@macro-user-callerid:8] GotoIf(“SIP/501-00000069”, “0?report”) in new stack
– Executing [s@macro-user-callerid:9] Set(“SIP/501-00000069”, “AMPUSERCID=501”) in new stack
– Executing [s@macro-user-callerid:10] Set(“SIP/501-00000069”, “__DIAL_OPTIONS=Ttr”) in new stack
– Executing [s@macro-user-callerid:11] Set(“SIP/501-00000069”, “CALLERID(all)=“Thomas Quigley iPhone” <501>”) in new stack
– Executing [s@macro-user-callerid:12] GotoIf(“SIP/501-00000069”, “0?limit”) in new stack
– Executing [s@macro-user-callerid:13] ExecIf(“SIP/501-00000069”, “1?Set(GROUP(concurrency_limit)=501)”) in new stack
– Executing [s@macro-user-callerid:14] GosubIf(“SIP/501-00000069”, “7?sub-ccss,s,1(from-internal,0851657409)”) in new stack
– Executing [s@sub-ccss:1] ExecIf(“SIP/501-00000069”, “0?Return()”) in new stack
– Executing [s@sub-ccss:2] Set(“SIP/501-00000069”, “CCSS_SETUP=TRUE”) in new stack
– Executing [s@sub-ccss:3] GosubIf(“SIP/501-00000069”, “0?monitor_config,1(from-internal,0851657409):monitor_default,1(from-internal,0851657409)”) in new stack
– Executing [monitor_default@sub-ccss:1] GotoIf(“SIP/501-00000069”, “0?is_exten”) in new stack
– Executing [monitor_default@sub-ccss:2] StackPop(“SIP/501-00000069”, “”) in new stack
– Executing [monitor_default@sub-ccss:3] Return(“SIP/501-00000069”, “FALSE”) in new stack
– Executing [s@macro-user-callerid:15] ExecIf(“SIP/501-00000069”, “0?Set(CHANNEL(language)=)”) in new stack
– Executing [s@macro-user-callerid:16] GotoIf(“SIP/501-00000069”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,30)
– Executing [s@macro-user-callerid:30] Set(“SIP/501-00000069”, “CALLERID(number)=501”) in new stack
– Executing [s@macro-user-callerid:31] Set(“SIP/501-00000069”, “CALLERID(name)=Thomas Quigley iPhone”) in new stack
– Executing [s@macro-user-callerid:32] Set(“SIP/501-00000069”, “CDR(cnum)=501”) in new stack
– Executing [s@macro-user-callerid:33] Set(“SIP/501-00000069”, “CDR(cnam)=Thomas Quigley iPhone”) in new stack
– Executing [s@macro-user-callerid:34] Set(“SIP/501-00000069”, “CHANNEL(language)=en”) in new stack
– Executing [0851657409@from-internal:2] Set(“SIP/501-00000069”, “ROUTEUSER=501”) in new stack
– Executing [0851657409@from-internal:3] GotoIf(“SIP/501-00000069”, “1?notblind”) in new stack
– Goto (from-internal,0851657409,6)
– Executing [0851657409@from-internal:6] GotoIf(“SIP/501-00000069”, “1?restrictedroute-cfcd208495d565ef66e7dff9f98764da,0851657409,2:outbound-allroutes,0851657409,2”) in new stack
– Goto (restrictedroute-cfcd208495d565ef66e7dff9f98764da,0851657409,2)
[2016-02-11 20:16:32] WARNING[14728][C-00000738]: pbx.c:6646 __ast_pbx_run: Channel ‘SIP/501-00000069’ sent to invalid extension but no invalid handler: context,exten,priority=restrictedroute-cfcd208495d565ef66e7dff9f98764da,0851657409,2
– Executing [h@restrictedroute-cfcd208495d565ef66e7dff9f98764da:1] Hangup(“SIP/501-00000069”, “”) in new stack
== Spawn extension (restrictedroute-cfcd208495d565ef66e7dff9f98764da, h, 1) exited non-zero on ‘SIP/501-00000069’
[2016-02-11 20:16:49] WARNING[30618]: chan_sip.c:4082 retrans_pkt: Timeout on e63a8abb13d80c9440132cd7c08e82b2 on non-critical invite transaction.

Regards,

Laois tom

There are some “unusual” things in your output.

The first (and scariest) is that your 501 extension is coming in from 10.x.x.x while your system otherwise appears to be connected to 192.168.x.x. There’s some odd routing within the 192.168 address as well. You have one subnet set up as 192.168.100.x and one set up as 192.168.101.x. Your server appears to be getting through to them alright, though, so the networking issues are probably not a big part of the issues.

It appears that you have outbound route set up as a restricted route. I’m going to guess a PIN Number or you limited the outbound route with a required extension? Maybe you have an IP Address allow/deny pair that’s in your way?

So, to get started, I recommend removing the matching pattern on your outbound route that is set up in your trunk. At the same time, remove the matching pattern on your trunk (If you have one).

Once you are done with that, try calling from your local extensions. Call from 500 to 501. Then, try 501 to 500. Make sure you get good connections (sound and everything).

Once that’s working, dial a number you know should be working outside of your network. Time and temperature at a bank are usually pretty good. If you can, find a number that you can connect to that doesn’t actually require you to do anything. Check the outcome of that connection in the logs.

The page “Sangoma Documentation” has some good information about restricted routes.

Guys thanks for coming back to me so quick with your suggestions. I had wondered about that restricted route entry in the log and couldn’t find a single mention of it anywhere FreePBX.

In the mean time I decided to check everything that both of ye suggested. In my outbound route under Extension routing I found that for some reason my extension (501) was in the blocked field, this is dispite the fact that I have made doubly sure before I wrote this post that I had it in the allowed field. Again as I said at the start, I’m totally green to Asterisk and FreePBX so I clearly did something stupid. Anyway, I have now moved my extension into the Allowed list and I have configured my Codecs in my Soft SIP Client to match the order of the Codecs offered in FreePBX Advanced Sip Settings. It’s now working exactly as I would have expected. So thank you again guys for all your help and for taking time out of your day to assist me.

On a side note, @Dave Burgess my networking at home is (in a word) overkill. I have 14 subnets performing all sorts of roles. All running in a Layer3 configuration with ACL’s all over the shop. I’m totally green to Asterisk and FreePBX but not to networking, I’m a CCNP certified engineer so I can stand over my network :smile:

Again thanks very much guys. You’ve made an Irish man happy tonight.

Beers on me