1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. If you had a PIAF Forum account in the vBulletin days, log in with your old credentials. Otherwise, sign up again and we'll get you back in business as soon as we can.
  3. A serious FreePBX vulnerability has been reported. Update your Framework Module immediately. Click here for details.

NO JOY Callcentric Intermittent Issues! Cannot Receive Calls 100%

Discussion in 'Trunks' started by Brian Simmons, Oct 23, 2013.

  1. Brian Simmons Active Member

    I have a Callcentric account and I'm having issues. Sometimes incoming calls will work as expected and other times the call never makes it to the PIAF server. I do not have any issues placing phone calls through Callcentric.

    For example, the attached call log shows a couple of incoming calls - one at 3:50pm and another one at 3:54pm. Both of these calls came in and worked as expects.

    However, look at the Callcentric call log and you can see that I attempted another call inbetween these two calls at 3:51pm. This call did not connect and instead the caller was played a "The person you are trying to reach is currently unavailable. Please try your call again later. Message 1004" which is a callcentric error that means the call could not be connected to the user's system.

    Any ideas what may be causing this issue? I did not change anything between these calls, yet some work and some do not.

    Here is the Callcentric call log:
    Calls report: Oct 16, 2013 12:00 AM - Oct 23, 2013 11:59 PM
    Date/Time Calling # Called # Extension Duration Amount Tax Total Destination
    Total In-plan Out-plan
    Oct 23, 03:54 PM Greenville SC
    1864990XXXX 1864676XXXX 102 0 min 0 min 0 min $0.0000 $0.0000 $0.0000 Incoming
    Oct 23, 03:51 PM Greenville SC
    1864990XXXX 1864676XXXX 102 0 min 0 min 0 min $0.0000 $0.0000 $0.0000 Incoming
    Oct 23, 03:50 PM 1864676XXXX 1864990XXXX 102 1 min 1 min 0 min $0.0000 $0.0000 $0.0000 United States Domestic
    Oct 23, 03:49 PM 1777XXXXXXX 1864990XXXX 100 0 min 0 min 0 min $0.0000 $0.0000 $0.0000
    United States Domestic

    Attached Files:

    Last edited by Brian Simmons, Oct 23, 2013
  2. Brian Simmons Active Member

    Here is the code that I added to my extensions_custom_conf file
    Code:
    [from-sip-external-custom]
    exten => _.,1,NoOp(Received incoming SIP connection from unknown peer to ${EXTEN})
    exten => _.,n,Set(DID=${IF($["${EXTEN:1:2}"=""]?s:${EXTEN})})
    exten => _.,n,Goto(s,1)
    ; CallCentric Check
    exten => s,1,GotoIf($["${DID}"="1777XXXXXXX"]?callcentric)
    exten => s,n,GotoIf($["${DID}"="1777XXXXXXX101"]?callcentric)
    exten => s,n,GotoIf($["${DID}"="1777XXXXXXX102"]?callcentric)
    ; Regular Check
    exten => s,n,GotoIf($["${ALLOW_SIP_ANON}"="yes"]?checklang:noanonymous)
    ; CallCentric DID Code
    exten => s,n(callcentric),Set(Var_FROM_DOMAIN=${CUT(CUT(SIP_HEADER(TO),@,2),>,1)})
    exten => s,n,GotoIF($["${Var_FROM_DOMAIN}" = "callcentric.com"]?callcentric-next)
    exten => s,n,GotoIF($["${Var_FROM_DOMAIN}" = "ss.callcentric.com"]?callcentric-next)
    exten => s,n,GotoIF($["${Var_FROM_DOMAIN}" = "66.193.176.35"]?callcentric-next:checklang)
    exten => s,n(callcentric-next),Set(Var_TO_DID=${CUT(CUT(SIP_HEADER(TO),@,1),:,2)})
    exten => s,n,GotoIF($["${Var_TO_DID}" = ""]?checklang)
    exten => s,n,Set(DID=${Var_TO_DID})
    ; Regular script continues
    exten => s,n(checklang),GotoIf($["${SIPLANG}"!=""]?setlanguage:from-trunk,${DID},1)
    exten => s,n(setlanguage),Set(CHANNEL(language)=${SIPLANG})
    exten => s,n,Goto(from-trunk,${DID},1)
    exten => s,n(noanonymous),Set(TIMEOUT(absolute)=15)
    exten => s,n,Answer
    exten => s,n,Wait(2)
    exten => s,n,Playback(ss-noservice)
    exten => s,n,Playtones(congestion)
    exten => s,n,Congestion(5)
    exten => h,1,Hangup
    exten => i,1,Hangup
    exten => t,1,Hangup
    
    Here is the code I added to my sip_customs_conf file:
    Code:
    ; Callcentric Entries
    context=from-sip-external-custom
    srvlookup=yes
    session-timers=refuse
    session-expires=180
    session-minse=90
    session-refresher=uas
    
    Here is the Outgoing settings that I use on my trunks for Callcentric (please note the extra extension numbers on the callcentric DID:
    Code:
    type=friend
    username=1777XXXXXXX101
    qualify=yes
    context=from-sip-external-custom
    host=callcentric.com
    defaultuser=1777XXXXXXX101
    secret=SecretPassword
    fromuser=1777XXXXXXX101
    fromdomain=callcentric.com
    insecure=port,invite
    dtmfmode=rfc2833
    disallow=all
    allow=ulaw
    sendrpid=yes
    trustrpid=no
    
    [IMG]


    Any help or suggestions would be appreciated. I'm at my wits end at this point. I have started a trouble ticket with Callcentric as well to see if it is something on their end.
  3. Brian Simmons Active Member

    I got a reply back from Callcentric on the trouble ticket. This is what they had to say. Is this something I can do with PIAF? I know you can edit some files but not others. Thanks!

    Oct 23, 2013 03:41 PM : Customer service
    Hello,

    Please add the following within your sip_custom_post.conf file:

    [callcentric1](callcentric);
    host=alpha1.callcentric.com

    [callcentric2](callcentric);
    host=alpha2.callcentric.com

    [callcentric3](callcentric);
    host=alpha3.callcentric.com

    [callcentric4](callcentric);
    host=alpha4.callcentric.com

    [callcentric5](callcentric);
    host=alpha5.callcentric.com

    [callcentric6](callcentric);
    host=alpha6.callcentric.com

    [callcentric7](callcentric);
    host=alpha7.callcentric.com

    [callcentric8](callcentric);
    host=alpha8.callcentric.com

    [callcentric9](callcentric);
    host=alpha9.callcentric.com

    [callcentric10](callcentric);
    host=alpha10.callcentric.com

    [callcentric10](callcentric);
    host=alpha11.callcentric.com

    [callcentric11](callcentric);
    host=alpha11.callcentric.com

    [callcentric12](callcentric);
    host=alpha12.callcentric.com

    [callcentric13](callcentric);
    host=alpha13.callcentric.com

    [callcentric14](callcentric);
    host=alpha14.callcentric.com

    [callcentric15](callcentric);
    host=alpha15.callcentric.com

    [callcentric16](callcentric);
    host=alpha16.callcentric.com

    [callcentric17](callcentric);
    host=alpha17.callcentric.com

    [callcentric18](callcentric);
    host=alpha18.callcentric.com

    [callcentric19](callcentric);
    host=alpha19.callcentric.com

    [callcentric20](callcentric);
    host=alpha20.callcentric.com

    After adding that text to the file mentioned please reboot your PBX.

    If the issue persists, please provide us with screenshots of your Inbound Routes, Callcentric trunk, and sip_general_custom.conf file.

    If you have any more questions, feel free to ask us.
  4. Hyksos Guru

  5. Brian Simmons Active Member

    Callcentric suggested that I create incoming routes for the 1777XXXXXXX101 and 1777XXXXXXX102 DIDs which I did. That did not stop the intermitant issue where some calls get through to the PIAF system (I can see them in the logs and the calls are completed as expected) while some calls fail (I do not see anything in the asterisk log and the caller hears the Callcentric Error message 1004 which means the calls are not connecting to the user agent).

    Is there something that could be wonky with the iptables or something else that might be causing the system to reject some calls, but not others. Would those types of flat out rejections still appear in the asterisk log? If so, then that isn't my problem because there is nothing in the asterisk logs when the call fails.

    Really guys, I'm struggling with this one. I cannot explain why some calls work perfectly and other calls never seem to make it to the PIAF system (at least not far enough to cause any logging to occur in the asterisk log).

    Any help would really be nice!

    Thanks,
  6. voipRookie Member

    I don't use Callcentric extensions but I do have a couple of Callcentric DIDs which seem to work fine. This is how I've set up my iptables for Callcentric. YMMV.

    I have this line in /etc/sysconfig/iptables:

    Code:
    -A INPUT -p udp -m multiport -s callcentric.com --dports 5060:5069,4569 -j ACCEPT
    which results in these IP addresses showing up in the output of iptables -L:

    Code:
    ACCEPT    udp  --  alpha13.callcentric.com  anywhere            multiport dports sip:i-net-2000-npr,iax
    ACCEPT    udp  --  alpha14.callcentric.com  anywhere            multiport dports sip:i-net-2000-npr,iax
    ACCEPT    udp  --  alpha15.callcentric.com  anywhere            multiport dports sip:i-net-2000-npr,iax
    ACCEPT    udp  --  alpha16.callcentric.com  anywhere            multiport dports sip:i-net-2000-npr,iax
    ACCEPT    udp  --  alpha17.callcentric.com  anywhere            multiport dports sip:i-net-2000-npr,iax
    ACCEPT    udp  --  alpha18.callcentric.com  anywhere            multiport dports sip:i-net-2000-npr,iax
    ACCEPT    udp  --  alpha19.callcentric.com  anywhere            multiport dports sip:i-net-2000-npr,iax
    ACCEPT    udp  --  alpha11.callcentric.com  anywhere            multiport dports sip:i-net-2000-npr,iax
    ACCEPT    udp  --  alpha12.callcentric.com  anywhere            multiport dports sip:i-net-2000-npr,iax 
  7. Brian Simmons Active Member

    I had been using
    Code:
    -A INPUT -p udp -m udp -s callcentric.com --dport 5010 -j ACCEPT
    
    I put your code in instead.

    However it still doesn't work. I am about 99% sure it has to do with this code that I have in the extensions_custom.conf file.
    Code:
    [from-sip-external-custom]
    exten => _.,1,NoOp(Received incoming SIP connection from unknown peer to ${EXTEN})
    exten => _.,n,Set(DID=${IF($["${EXTEN:1:2}"=""]?s:${EXTEN})})
    exten => _.,n,Goto(s,1)
    ; CallCentric Check
    exten => s,1,GotoIf($["${DID}"="1777xxxxxxx"]?callcentric)
    exten => s,n,GotoIf($["${DID}"="1777xxxxxxx101"]?callcentric)
    exten => s,n,GotoIf($["${DID}"="1777xxxxxxx102"]?callcentric)
    ; Regular Check
    exten => s,n,GotoIf($["${ALLOW_SIP_ANON}"="yes"]?checklang:noanonymous)
    ; CallCentric DID Code
    exten => s,n(callcentric),Set(Var_FROM_DOMAIN=${CUT(CUT(SIP_HEADER(TO),@,2),>,1)})
    exten => s,n,GotoIF($["${Var_FROM_DOMAIN}" = "callcentric.com"]?callcentric-next)
    exten => s,n,GotoIF($["${Var_FROM_DOMAIN}" = "ss.callcentric.com"]?callcentric-next)
    exten => s,n,GotoIF($["${Var_FROM_DOMAIN}" = "66.193.176.35"]?callcentric-next:checklang)
    exten => s,n(callcentric-next),Set(Var_TO_DID=${CUT(CUT(SIP_HEADER(TO),@,1),:,2)})
    exten => s,n,GotoIF($["${Var_TO_DID}" = ""]?checklang)
    exten => s,n,Set(DID=${Var_TO_DID})
    ; Regular script continues
    exten => s,n(checklang),GotoIf($["${SIPLANG}"!=""]?setlanguage:from-trunk,${DID},1)
    exten => s,n(setlanguage),Set(CHANNEL(language)=${SIPLANG})
    exten => s,n,Goto(from-trunk,${DID},1)
    exten => s,n(noanonymous),Set(TIMEOUT(absolute)=15)
    exten => s,n,Answer
    exten => s,n,Wait(2)
    exten => s,n,Playback(ss-noservice)
    exten => s,n,Playtones(congestion)
    exten => s,n,Congestion(5)
    exten => h,1,Hangup
    exten => i,1,Hangup
    exten => t,1,Hangup
    
    For example, at some point I changed the code slightly and got this in the asterisk log....
    Code:
    [code][2013-10-24 13:21:00] VERBOSE[30888][C-000005c1] pbx.c: == Spawn extension (tc-maint, s, 5) exited non-zero on 'Local/s@tc-maint-00000578;2'
    [2013-10-24 13:21:27] VERBOSE[1812][C-000005c2] netsock2.c: == Using SIP RTP TOS bits 184
    [2013-10-24 13:21:27] VERBOSE[1812][C-000005c2] netsock2.c: == Using SIP RTP CoS mark 5
    [2013-10-24 13:21:27] VERBOSE[30938][C-000005c2] pbx.c: -- Executing [1777xxxxxxx101@from-sip-external-custom:1] NoOp("SIP/Callcentric-0000002c", "Received incoming SIP connection from unknown peer to 1777xxxxxxx101") in new stack
    [2013-10-24 13:21:27] VERBOSE[30938][C-000005c2] pbx.c: -- Executing [1777xxxxxxx101@from-sip-external-custom:2] Set("SIP/Callcentric-0000002c", "DID=1777xxxxxxx101") in new stack
    [2013-10-24 13:21:27] VERBOSE[30938][C-000005c2] pbx.c: -- Executing [1777xxxxxxx101@from-sip-external-custom:3] Goto("SIP/Callcentric-0000002c", "s,1") in new stack
    [2013-10-24 13:21:27] VERBOSE[30938][C-000005c2] pbx.c: -- Goto (from-sip-external-custom,s,1)
    [2013-10-24 13:21:27] VERBOSE[30938][C-000005c2] pbx.c: -- Executing [s@from-sip-external-custom:1] GotoIf("SIP/Callcentric-0000002c", "0?callcentric") in new stack
    [2013-10-24 13:21:27] VERBOSE[30938][C-000005c2] pbx.c: -- Executing [s@from-sip-external-custom:2] GotoIf("SIP/Callcentric-0000002c", "0?checklang:noanonymous") in new stack
    [2013-10-24 13:21:27] VERBOSE[30938][C-000005c2] pbx.c: -- Goto (from-sip-external-custom,s,13)
    [2013-10-24 13:21:27] VERBOSE[30938][C-000005c2] pbx.c: -- Executing [s@from-sip-external-custom:13] Set("SIP/Callcentric-0000002c", "TIMEOUT(absolute)=15") in new stack
    [2013-10-24 13:21:27] VERBOSE[30938][C-000005c2] func_timeout.c: -- Channel will hangup at 2013-10-24 13:21:42.622 EDT.
    [2013-10-24 13:21:27] VERBOSE[30938][C-000005c2] pbx.c: -- Executing [s@from-sip-external-custom:14] Answer("SIP/Callcentric-0000002c", "") in new stack
    [2013-10-24 13:21:28] VERBOSE[30938][C-000005c2] pbx.c: -- Executing [s@from-sip-external-custom:15] Wait("SIP/Callcentric-0000002c", "2") in new stack
    [2013-10-24 13:21:30] VERBOSE[30938][C-000005c2] pbx.c: -- Executing [s@from-sip-external-custom:16] Playback("SIP/Callcentric-0000002c", "ss-noservice") in new stack
    [2013-10-24 13:21:30] VERBOSE[30938][C-000005c2] file.c: -- <SIP/Callcentric-0000002c> Playing 'ss-noservice.gsm' (language 'en')
    [2013-10-24 13:21:35] VERBOSE[30938][C-000005c2] pbx.c: -- Executing [s@from-sip-external-custom:17] PlayTones("SIP/Callcentric-0000002c", "congestion") in new stack
    [2013-10-24 13:21:35] VERBOSE[30938][C-000005c2] pbx.c: -- Executing [s@from-sip-external-custom:18] Congestion("SIP/Callcentric-0000002c", "5") in new stack
    [2013-10-24 13:21:36] VERBOSE[30938][C-000005c2] pbx.c: == Spawn extension (from-sip-external-custom, s, 18) exited non-zero on 'SIP/Callcentric-0000002c'
    [2013-10-24 13:21:36] VERBOSE[30938][C-000005c2] pbx.c: -- Executing [h@from-sip-external-custom:1] Hangup("SIP/Callcentric-0000002c", "") in new stack
    I dont really understand the dial plan logic very much, so I'm not sure if that is correct. It is code that someone else wrote, with the exception that I added the extra two lines under the "callcentric check" section where I have the DID with extension numbers.
    Last edited by Brian Simmons, Oct 24, 2013
  8. Brian Simmons Active Member

    If I remove those two "extension" lines of code, then I get this in my call log.

    Code:
    [2013-10-24 13:43:02] NOTICE[31572] pbx_spool.c: Call completed to Local/s@tc-maint
    [2013-10-24 13:43:43] VERBOSE[1812][C-000005e4] netsock2.c: == Using SIP RTP TOS bits 184
    [2013-10-24 13:43:43] VERBOSE[1812][C-000005e4] netsock2.c: == Using SIP RTP CoS mark 5
    [2013-10-24 13:43:43] VERBOSE[31587][C-000005e4] pbx.c: -- Executing [1777xxxxxxx102@from-sip-external-custom:1] NoOp("SIP/Callcentric-0000002e", "Received incoming SIP connection from unknown peer to 1777xxxxxxx102") in new stack
    [2013-10-24 13:43:43] VERBOSE[31587][C-000005e4] pbx.c: -- Executing [1777xxxxxxx102@from-sip-external-custom:2] Set("SIP/Callcentric-0000002e", "DID=1777xxxxxxx102") in new stack
    [2013-10-24 13:43:43] VERBOSE[31587][C-000005e4] pbx.c: -- Executing [1777xxxxxxx102@from-sip-external-custom:3] Goto("SIP/Callcentric-0000002e", "s,1") in new stack
    [2013-10-24 13:43:43] VERBOSE[31587][C-000005e4] pbx.c: -- Goto (from-sip-external-custom,s,1)
    [2013-10-24 13:43:43] VERBOSE[31587][C-000005e4] pbx.c: -- Executing [s@from-sip-external-custom:1] GotoIf("SIP/Callcentric-0000002e", "0?callcentric") in new stack
    [2013-10-24 13:43:43] VERBOSE[31587][C-000005e4] pbx.c: -- Executing [s@from-sip-external-custom:2] GotoIf("SIP/Callcentric-0000002e", "0?checklang:noanonymous") in new stack
    [2013-10-24 13:43:43] VERBOSE[31587][C-000005e4] pbx.c: -- Goto (from-sip-external-custom,s,13)
    [2013-10-24 13:43:43] VERBOSE[31587][C-000005e4] pbx.c: -- Executing [s@from-sip-external-custom:13] Set("SIP/Callcentric-0000002e", "TIMEOUT(absolute)=15") in new stack
    [2013-10-24 13:43:43] VERBOSE[31587][C-000005e4] func_timeout.c: -- Channel will hangup at 2013-10-24 13:43:58.891 EDT.
    [2013-10-24 13:43:43] VERBOSE[31587][C-000005e4] pbx.c: -- Executing [s@from-sip-external-custom:14] Answer("SIP/Callcentric-0000002e", "") in new stack
    [2013-10-24 13:43:44] VERBOSE[31587][C-000005e4] pbx.c: -- Executing [s@from-sip-external-custom:15] Wait("SIP/Callcentric-0000002e", "2") in new stack
    [2013-10-24 13:43:46] VERBOSE[31587][C-000005e4] pbx.c: -- Executing [s@from-sip-external-custom:16] Playback("SIP/Callcentric-0000002e", "ss-noservice") in new stack
    [2013-10-24 13:43:46] VERBOSE[31587][C-000005e4] file.c: -- <SIP/Callcentric-0000002e> Playing 'ss-noservice.gsm' (language 'en')
    [2013-10-24 13:43:51] VERBOSE[31587][C-000005e4] pbx.c: -- Executing [s@from-sip-external-custom:17] PlayTones("SIP/Callcentric-0000002e", "congestion") in new stack
    [2013-10-24 13:43:51] VERBOSE[31587][C-000005e4] pbx.c: -- Executing [s@from-sip-external-custom:18] Congestion("SIP/Callcentric-0000002e", "5") in new stack
    [2013-10-24 13:43:52] VERBOSE[31587][C-000005e4] pbx.c: == Spawn extension (from-sip-external-custom, s, 18) exited non-zero on 'SIP/Callcentric-0000002e'
    [2013-10-24 13:43:52] VERBOSE[31587][C-000005e4] pbx.c: -- Executing [h@from-sip-external-custom:1] Hangup("SIP/Callcentric-0000002e", "") in new stack
    [2013-10-24 13:43:52] VERBOSE[31587][C-000005e4] pbx.c: == Spawn extension (from-sip-external-custom, h, 1) exited non-zero on 'SIP/Callcentric-0000002e'
  9. Brian Simmons Active Member

    So callcentric wants me to turn the Asterisk SIP setting to 'Allow Guest". Is this wise? Is it a security issue?

  10. Brian Simmons Active Member

    So the system will work if I turn "Allow Guest" SIP settings. All calls get through and dont fail. So it must be Callcentric's connection/headers that do this. Why some calls go through and some calls fail when those settings are set to "No" is beyond me. But the fact that it works sometimes and not others and the fact that it always works with the "allow guest" settings, points to a Callcentric issue IMHO.

    I'd also like to get other people's opinion on providers. We need 5 or more channels and we are guessing we make 4000 outbound minutes and about the same inbound min per month.
    Last edited by Brian Simmons, Oct 25, 2013
  11. voipRookie Member

    I believe one of the purposes of the from-sip-external-custom context was to allow Callcentric to work without having to set "Allow Anonymous Inbound SIP Calls" to yes. Have you tested/tried this combination?

    "Allow SIP Guest" set to "Yes"
    "Allow Anonymous Inbound SIP Calls" to "No"
  12. Brian Simmons Active Member

    The official response from Callcentric regarding the cause of the issue is this....


    If that helps someone come up with a solution for the problem, I would greatly appreciate it. I may try to play with the dial plan and see if I cannot get something to work, but I'm just poking around and not an expert by any stretch.
  13. Hyksos Guru

    You never actually said if you included all their hostnames in the config files and restarted asterisk.
    Nothing weird or out of the ordinary is going on here. Some people here are for sure using callcentric.

    You want allow sip guest to NO and anon sip calls to NO.
    You want asterisk to have a configuration for each host that will send you calls.
    You want all these possible network flow to be possible and rightly configured, at the asterisk level AND at the Firewall level AND at the router level.
    If fully NATed without port forwards you want qualify=yes for all host that will need to reach the PBX public ip.

    In theory this should be achievable through FreePBX GUI but like anytime callcentric is mentioned people propose custom config files to make it faster and less crowded.
    Messing around manually in the dialplan to make incoming calls work is something I will help with only when concrete and irrefutable proof of it's necessity is demonstrated.

    An unknown peer to asterisk is just that, an unknown peer that your system need to know about in advance so you can close down the system to unknown peer.

    You should use "sip set debug on"

    Hope this help.
  14. voipRookie Member

    I've been playing around with Callcentric's suggestions above and with the suggestions made by @billsimon in this thread. I changed the context from "from-pstn" to "from-pstn-toheader" because I wanted to route inbound calls based on the dialed DID instead of 1777XXXXXXX. These changes allow both "Allow SIP Guest" and "Allow Anonymous Inbound SIP Calls" to be set to "No". After a few days of testing this seems to be working correctly for my setup.

    So to summarize the following changes were made:

    1. Added 20 entries for alpha1.callcentric.com thru alpha20.callcentric.com in /etc/asterisk/sip_custom_post.conf. Each entry has the following format where the two X's are replaced with 1 - 20.

    Code:
    [callcentric-alphaX]
    type=peer
    context=from-pstn-toheader
    qualify=yes
    host=alphaX.callcentric.com
    2. In the Callcentric trunk definition set context to "from-pstn-toheader".

    3. Set both "Allow SIP Guest" and "Allow Anonymous Inbound SIP Calls" to "No"

    4. Restarted asterisk using "amportal -restart"

    Thanks for everyone's feedback,
    Ron
  15. Trimline2 Guru

    Did you ever get this to work? I ask as a friend of mine is having difficulty with CC inbound as well, and I couldn't even see it coming in through the log. I tried adding the 20 entries in to the /etc/asterisk/sip_custom_post.conf, but that is way overboard as it shows 20 trunk registrations! Geesh, you would think CC would have figured this one out. If you got this dog to hunt, let us know how, otherwise it's LNP from CC... :)
  16. Other than allowing SIP Guest Yes this is the only fix as CC uses so many servers that do not resolve back to just callcentric.com in the DNS. As for showing 20 registrations what does that hurt? They are not really registrations you are only registering once in your main trunk config.
  17. Brian Simmons Active Member

    I have been force to turn the "Accept Guest Connections" under the asterisk SIP settings. Making that change will allow my to get all the incoming calls. If I turn that off, even trying all the suggestions made in this thread, I don't get all incoming calls. Some calls fail and the caller hears a Callcentric error message saying the call cannot be completed.

    In the end, after trying just about everything, I have added the 20 entries to the sip_custom_post.conf that was suggested by Callcentric early in the thread. I also use the [from-sip-external-custom]
    code that I posted a couple of posts above. That code doesn't effect the reliability of the incoming calls, but it does allow me to have several different incoming call routes based on the DID number even though there is just one Callcentric trunk set up.
  18. 1 Setup trunk and global options
    Edit the sip.conf file with your favorite text editor and make the following changes:

    • Add/change the [general] section with the following parameters:
      [general]
      dtmfmode = rfc2833
      context=from-callcentric
      srvlookup=yes
      register => 1777MYCCID:SUPERSECRET@callcentric.com
      session-timers=refuse
    • Add the following section to define the Callcentric trunk/peer:
      [callcentric]
      type=peer
      context=from-callcentric
      host=callcentric.com
      fromdomain=callcentric.com
      defaultuser=1777MYCCID
      fromuser=1777MYCCID
      secret=SUPERSECRET
      insecure=port,invite
      disallowed_methods=UPDATE
      directmedia=no
      videosupport=no
      disallow=all
      allow=ulaw
    • Add an extension to handle calls to/from your SIP phone. This is just a sample. Refer to Asterisk documentation and your SIP phone documentation for details. 123 is the extension of your phone.
      [123]
      context=to-callcentric
      type=friend
      username=123
      secret=PASSWORD
      host=dynamic
    • Make sure to save your changes once done.
    2 Configure inbound call handling
    Edit the extensions.conf file with your favorite text editor and make the following changes:

    • Add the following section to route calls FROM Callcentric TO your SIP phone with extension 123:
      [from-callcentric]
      exten => s,1,Dial(SIP/123)
    • Add the following section to route calls FROM your SIP phone TO Callcentric:
      [to-callcentric]
      exten => _XX,1,Dial(SIP/${EXTEN}@callcentric)
    • Make sure to save your changes once done. If necessary restart, or start the asterisk server using the proper command, /etc/init.d/asterisk restart, restart asterisk... etc.
    3 Connect to your asterisk PBX and verify connections
    Use the IP address or hostname for your PBX system along with 123 (the extension created earlier which is the username) and the password for the 123 extension to connect to your PBX system.

    • Connect to the asterisk console by running the following from the command line:
      asterisk -r
    • Verify that Asterisk is registered to Callcentric with the console command 'sip show registry'
      *CLI> sip show registry
      Host Username Refresh State
      callcentric.com:5060 1777MYCCID 17 Registered
    • Verify that your SIP phone is registered to Asterisk with the console command 'sip show peers'
      pbx*CLI> sip show peers
      Name/username 123/123
      Host 10.11.22.33
      Dyn Nat ACL D
      Mask 255.255.255.255
      Port 5060
      Status Unmonitored


      If you see Host as "(Unspecified)" and Port as "0", then your SIP phone is not configured correctly.

    • Disconnect from Asterisk by typing exit. Asterisk will remain running in this case.
    4 That's it! You can now make a phone call

    You can make a test call to 17771234567

    This should work, but I have also had the issue's described above until I added the extra entries. Don't forget you need to open your firewall to those servers as well or the data will never even get to your PBX.
  19. David Foxworth New Member

    However it still doesn't work. I am about 99% sure it has to do with this code that I have in the extensions_custom.conf file.

    Make the changes I have indicated below in your code:

    Code:
    [from-sip-external-custom]
    exten => _.,1,NoOp(Received incoming SIP connection from unknown peer to ${EXTEN})
    exten => _.,n,Set(DID=${IF($["${EXTEN:1:2}"=""]?s:${EXTEN})})
    exten => _.,n,Goto(s,1)
    ; CallCentric Check
    exten => s,1,GotoIf($["${DID}":"1777xxxxxxx*"]?callcentric)                  <----------------------------------------------  Change this line as you see here
    exten => s,n,GotoIf($["${DID}"="1777xxxxxxx101"]?callcentric)                <----------------------------------------------  Remove this line
    exten => s,n,GotoIf($["${DID}"="1777xxxxxxx102"]?callcentric)                <----------------------------------------------  Remove this line
    ; Regular Check
    exten => s,n,GotoIf($["${ALLOW_SIP_ANON}"="yes"]?checklang:noanonymous)
    ; CallCentric DID Code
    exten => s,n(callcentric),Set(Var_FROM_DOMAIN=${CUT(CUT(SIP_HEADER(TO),@,2),>,1)})
    exten => s,n,GotoIF($["${Var_FROM_DOMAIN}" = "callcentric.com"]?callcentric-next)
    exten => s,n,GotoIF($["${Var_FROM_DOMAIN}" = "ss.callcentric.com"]?callcentric-next)
    exten => s,n,GotoIF($["${Var_FROM_DOMAIN}" = "66.193.176.35"]?callcentric-next:checklang)
    exten => s,n(callcentric-next),Set(Var_TO_DID=${CUT(CUT(SIP_HEADER(TO),@,1),:,2)})
    exten => s,n,GotoIF($["${Var_TO_DID}" = ""]?checklang)
    exten => s,n,Set(DID=${Var_TO_DID})
    ; Regular script continues
    exten => s,n(checklang),GotoIf($["${SIPLANG}"!=""]?setlanguage:from-trunk,${DID},1)
    exten => s,n(setlanguage),Set(CHANNEL(language)=${SIPLANG})
    exten => s,n,Goto(from-trunk,${DID},1)
    exten => s,n(noanonymous),Set(TIMEOUT(absolute)=15)
    exten => s,n,Log(WARNING,"Rejecting unknown SIP connection from ${CHANNEL(recvip)}")    <----------  Add this line, nothing to do with your issue, will log the reject so fail2ban works
    exten => s,n,Answer
    exten => s,n,Wait(2)
    exten => s,n,Playback(ss-noservice)
    exten => s,n,Playtones(congestion)
    exten => s,n,Congestion(5)
    exten => h,1,Hangup
    exten => i,1,Hangup
    exten => t,1,Hangup
    
    For example, at some point I changed the code slightly and got this in the asterisk log....
    Code:
    [code][2013-10-24 13:21:00] VERBOSE[30888][C-000005c1] pbx.c: == Spawn extension (tc-maint, s, 5) exited non-zero on 'Local/s@tc-maint-00000578;2'
    [2013-10-24 13:21:27] VERBOSE[1812][C-000005c2] netsock2.c: == Using SIP RTP TOS bits 184
    [2013-10-24 13:21:27] VERBOSE[1812][C-000005c2] netsock2.c: == Using SIP RTP CoS mark 5
    [2013-10-24 13:21:27] VERBOSE[30938][C-000005c2] pbx.c: -- Executing [1777xxxxxxx101@from-sip-external-custom:1] NoOp("SIP/Callcentric-0000002c", "Received incoming SIP connection from unknown peer to 1777xxxxxxx101") in new stack
    [2013-10-24 13:21:27] VERBOSE[30938][C-000005c2] pbx.c: -- Executing [1777xxxxxxx101@from-sip-external-custom:2] Set("SIP/Callcentric-0000002c", "DID=1777xxxxxxx101") in new stack
    [2013-10-24 13:21:27] VERBOSE[30938][C-000005c2] pbx.c: -- Executing [1777xxxxxxx101@from-sip-external-custom:3] Goto("SIP/Callcentric-0000002c", "s,1") in new stack
    [2013-10-24 13:21:27] VERBOSE[30938][C-000005c2] pbx.c: -- Goto (from-sip-external-custom,s,1)
    [2013-10-24 13:21:27] VERBOSE[30938][C-000005c2] pbx.c: -- Executing [s@from-sip-external-custom:1] GotoIf("SIP/Callcentric-0000002c", "0?callcentric") in new stack
    [2013-10-24 13:21:27] VERBOSE[30938][C-000005c2] pbx.c: -- Executing [s@from-sip-external-custom:2] GotoIf("SIP/Callcentric-0000002c", "0?checklang:noanonymous") in new stack
    [2013-10-24 13:21:27] VERBOSE[30938][C-000005c2] pbx.c: -- Goto (from-sip-external-custom,s,13)
    [2013-10-24 13:21:27] VERBOSE[30938][C-000005c2] pbx.c: -- Executing [s@from-sip-external-custom:13] Set("SIP/Callcentric-0000002c", "TIMEOUT(absolute)=15") in new stack
    [2013-10-24 13:21:27] VERBOSE[30938][C-000005c2] func_timeout.c: -- Channel will hangup at 2013-10-24 13:21:42.622 EDT.
    [2013-10-24 13:21:27] VERBOSE[30938][C-000005c2] pbx.c: -- Executing [s@from-sip-external-custom:14] Answer("SIP/Callcentric-0000002c", "") in new stack
    [2013-10-24 13:21:28] VERBOSE[30938][C-000005c2] pbx.c: -- Executing [s@from-sip-external-custom:15] Wait("SIP/Callcentric-0000002c", "2") in new stack
    [2013-10-24 13:21:30] VERBOSE[30938][C-000005c2] pbx.c: -- Executing [s@from-sip-external-custom:16] Playback("SIP/Callcentric-0000002c", "ss-noservice") in new stack
    [2013-10-24 13:21:30] VERBOSE[30938][C-000005c2] file.c: -- <SIP/Callcentric-0000002c> Playing 'ss-noservice.gsm' (language 'en')
    [2013-10-24 13:21:35] VERBOSE[30938][C-000005c2] pbx.c: -- Executing [s@from-sip-external-custom:17] PlayTones("SIP/Callcentric-0000002c", "congestion") in new stack
    [2013-10-24 13:21:35] VERBOSE[30938][C-000005c2] pbx.c: -- Executing [s@from-sip-external-custom:18] Congestion("SIP/Callcentric-0000002c", "5") in new stack
    [2013-10-24 13:21:36] VERBOSE[30938][C-000005c2] pbx.c: == Spawn extension (from-sip-external-custom, s, 18) exited non-zero on 'SIP/Callcentric-0000002c'
    [2013-10-24 13:21:36] VERBOSE[30938][C-000005c2] pbx.c: -- Executing [h@from-sip-external-custom:1] Hangup("SIP/Callcentric-0000002c", "") in new stack


    Here is the problem, and I am no expert, so others may be able to point other things out. But with the extra code above in your extensions_custom.conf file, you should not need the
    sip_custom_post.conf file. If the incoming call from CallCentric is not to one of your registered peers, then it will fall into the context [from-sip-external-custom], which will
    then check to see if the DID is "1777xxxxxxx", and if so, it will then execute the lines under the "CallCentric DID code", otherwise it will fall through to the "Regular script continues",
    which will then reject the call, which is what you are experiencing.

    I don't completely understand the GoToIf application but according to your Asterisk logs, the incoming call is coming from an unknown peer "1777xxxxxxx101", which is what you should
    see for a call coming in from CallCentric. Now then, under the "CallCentric Check", the first GoToIf will fail because it is looking for the number without the 101 or 102 extension. From what I understand about the GoToIf application, it should simply fall through to the next check, however, it doesn't, instead it jumps down to the "Regular Check" part. Check the entries in your log with this "GotoIf("SIP/Callcentric-0000002c", "0?callcentric")", that is where the issue starts. The 0?callcentric means that the expression in the GoToIf returned a 0 or not true, so it should fall through to the next check, but it doesn't.

    The change that I recommended is a wildcard check, so it looks for "1777xxxxxxx" optionally followed by any extension. That should succeed and jump to the "CallCentric DID code". I am assuming
    that in your code you are replacing the xxxxxxx with your actual CallCentric DID.

    As mentioned above, with this extra code, you should not need to allow anonymous connections and you should not need the sip_custom_post.conf entries.
    Last edited by David Foxworth, Nov 25, 2013

Share This Page