[asterisk-users] Dealing with progress codes

Juan Rodríguez jerdguez at gmail.com
Thu Oct 30 13:40:52 CDT 2008


1500 prefixes is not a big number. You can use a little script for it (less
than 50 lines).
With a script connecting to a DB server and looking for the prefix, is a
good solution. This way you don't need to force the user to dial the the
leading 1 (or not to do it), you just look on the DB server and if it does
not matches a local prefix then you dial with the leading 1.

I do not recommend you having all that prefixes on the Dialplan, because it
is difficult to maintain.


On Thu, Oct 30, 2008 at 10:14 AM, arkda <thrills3k3r at gmail.com> wrote:

> Thanks for the reply!
>
> Generally that's what I do, script local area codes and prefixes so that
> dialing 1 is necessary only for long distance calls. The problem here is
> that there are over 1500 area codes and prefixes (DC area) that are required
> by the carrier to not be dialed with a 1 (ie, local calls). If push comes to
> shove, I'll implement them all in the dialplan, but this just seems like a
> poor way of handling it.
>
> Running another Dial statement after a timeout with r will put the possible
> wait time close to a minute if the callee doesn't answer and voicemail picks
> up (I try to estimate as long as 30 seconds for voicemail pickup). I may
> turn this on for a temporary fix, but it's not an acceptable solution long
> term.
>
>
> On Thu, Oct 30, 2008 at 12:08 AM, Juan Rodríguez <jerdguez at gmail.com>wrote:
>
>> Arka:
>> I thought you would reroute the call with (or without) the leading one,
>> so, just Dial again.
>>
>> This will work and your users wont notice a BIG difference if the call is
>> answered. The problem is if the call is not answer, because if you have a
>> busy number, then your users will get something like "ring, ring...ring,
>> beep,beep...".
>>
>> For a better solution I would recommend you to get at least your local
>> prefixes and use the correct dial string with patterns. This can be achieved
>> with a script.
>>
>>
>> On Wed, Oct 29, 2008 at 6:15 PM, arkda <thrills3k3r at gmail.com> wrote:
>>
>>> I left something out on that last message, sorry.
>>>
>>> With r, not R, it will mask the message with ringing. I could then fail
>>> it over to another dial out, however from testing I've found that my users
>>> expect something to happen within 30 seconds (voicemail, pickup, etc.) The
>>> worse-case scenario would be using r a time of 60 seconds. I've been
>>> thinking of implementing this as a temp fix, but not something I want to
>>> leave in place.
>>>
>>>
>>>
>>> On Wed, Oct 29, 2008 at 5:46 PM, arkda <thrills3k3r at gmail.com> wrote:
>>>
>>>> Thanks for the reply!
>>>>
>>>> I've played around with R to solve this (probably should have mentioned
>>>> that), however I wasn't able to make it work. The message is still played
>>>> (this message is from the provider). It will move to the next line in the
>>>> dialplan, but as soon as users hear the message they hang up.
>>>>
>>>> Since the progress code comes before actual audio is played to the
>>>> caller there has to be a way of catching this and dealing with it in the
>>>> dialplan, but nothing I've tried so far works.
>>>>
>>>>
>>>> On Wed, Oct 29, 2008 at 12:25 AM, Juan Rodríguez <jerdguez at gmail.com>wrote:
>>>>
>>>>> Try using a R or r on the Dial command, the R option is better for you
>>>>> in my opinion.
>>>>> i.e Dial(Zap/G2/1${EXTEN},30,R) or Dial(Zap/G2/1${EXTEN}|30|R)
>>>>>
>>>>> The R option is going to generate a ring tone when the callee indicates
>>>>> ringing and is going wait for an Answer. As Progress is just for early
>>>>> media, you wont get that message.
>>>>>
>>>>> For more info on the Dial command see:
>>>>>
>>>>> http://www.voip-info.org/wiki-Asterisk+cmd+Dial
>>>>>
>>>>>
>>>>>
>>>>> On Tue, Oct 28, 2008 at 6:56 PM, arkda <thrills3k3r at gmail.com> wrote:
>>>>>
>>>>>> Some additional information.
>>>>>>
>>>>>> I played with ${DIALEDSTATUS} in place of ${HANGUPCAUSE} and got an
>>>>>> unusual result:
>>>>>>
>>>>>> [Oct 28 16:50:54] WARNING[17503]: chan_sip.c:1950 retrans_pkt: Maximum
>>>>>> retries exceeded on transmission
>>>>>> NzJlOWI0NjI5NTMwMmEwZTExYzZiZTM5YWY4MDk0MzA. for seqno 2 (Critical Response)
>>>>>>
>>>>>> This occurs about a second after the user hangs up on the error
>>>>>> message being played from the provider. I have a feeling it's trying to
>>>>>> execute the next step in the dialplan but unable since the caller hung up.
>>>>>>
>>>>>> Thoughts, criticism, insults all welcome!
>>>>>>
>>>>>>
>>>>>> On Tue, Oct 28, 2008 at 12:53 PM, arkda <thrills3k3r at gmail.com>wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> I've ran into an issue with a PRI provider in a major metropolitan
>>>>>>> area that I haven't needed to deal with before and I was hoping someone
>>>>>>> might have some insight on how to handle this within the Asterisk dialplan.
>>>>>>>
>>>>>>> At this location users can't always tell if a number is long distance
>>>>>>> or not (there are a lot of area codes and prefixes in the vicinity).
>>>>>>> Additionally, users are required by the provider to dial the full 10 digit
>>>>>>> number even if a call is local since a local call could be for a few
>>>>>>> different area codes and prefixes. The problem is the provider requires a 1
>>>>>>> in front of the number for long distance calls, but errors out if the call
>>>>>>> has a 1 in front and the call is local.
>>>>>>>
>>>>>>> As a result, users are complaining that they are constantly having to
>>>>>>> redial with or without the 1. I've tracked down this behavior when a call
>>>>>>> fails:
>>>>>>>
>>>>>>>     -- Executing [5551515121 at internal:1] Set("SIP/user9-b696fb58",
>>>>>>> "GROUP(default)=dialpool") in new stack
>>>>>>>     -- Executing [5551515121 at internal:2]
>>>>>>> GotoIf("SIP/user9-b696fb58", "1?5") in new stack
>>>>>>>     -- Goto (internal,5551515121,5)
>>>>>>>     -- Executing [5551515121 at internal:5] Set("SIP/user9-b696fb58",
>>>>>>> "GROUP(default)=dialpool") in new stack
>>>>>>>     -- Executing [5551515121 at internal:6]
>>>>>>> Answer("SIP/user9-b696fb58", "") in new stack
>>>>>>>     -- Executing [5551515121 at internal:7] Set("SIP/user9-b696fb58",
>>>>>>> "CALLERID(num)=5552223333") in new stack
>>>>>>>     -- Executing [5551515121 at internal:8] Set("SIP/user9-b696fb58",
>>>>>>> "CALLERID(name)=HiThere") in new stack
>>>>>>>     -- Executing [5551515121 at internal:9] NoOp("SIP/user9-b696fb58",
>>>>>>> "--out the pri--") in new stack
>>>>>>>     -- Executing [5551515121 at internal:10] Dial("SIP/user9-b696fb58",
>>>>>>> "Zap/G2/15551515121") in new stack
>>>>>>>     -- Requested transfer capability: 0x00 - SPEECH
>>>>>>>     -- Called G2/15551515121
>>>>>>>     -- Zap/22-1 is proceeding passing it to SIP/user9-b696fb58
>>>>>>>     -- PROGRESS with cause code 31 received
>>>>>>>     -- Zap/22-1 is making progress passing it to SIP/user9-b696fb58
>>>>>>>     -- Hungup 'Zap/22-1'
>>>>>>>   == Spawn extension (internal, 5551515121, 10) exited non-zero on
>>>>>>> 'SIP/user9-b696fb58'
>>>>>>>
>>>>>>> The above call was a call that is considered local by the provider.
>>>>>>> The caller is then redirected to a message (by the provider) saying 'You do
>>>>>>> not need to dial a one or zero...' and the message repeats indefinitely.
>>>>>>>
>>>>>>> I'd like to figure out how to handle this in the dial plan so users
>>>>>>> do not even know anything happened. To test to see if I could stop the call
>>>>>>> progress and reroute it I've tried this so far:
>>>>>>>
>>>>>>> exten => _NXXXXXXXXX,1,Set(GROUP(default)=dialpool)
>>>>>>> exten => _NXXXXXXXXX,2,GotoIf($[${GROUP_COUNT(priout at default
>>>>>>> )}<19]?5)
>>>>>>> exten => _NXXXXXXXXX,3,GotoIf($[${GROUP_COUNT(congest at default
>>>>>>> )}>18]?BLOCK)
>>>>>>> exten => _NXXXXXXXXX,4,NoOp
>>>>>>> exten => _NXXXXXXXXX,5,Set(GROUP(default)=dialpool)
>>>>>>> exten => _NXXXXXXXXX,6,Answer()
>>>>>>> exten => _NXXXXXXXXX,7,Set(CALLERID(num)=${CLR})
>>>>>>> exten => _NXXXXXXXXX,8,Set(CALLERID(name)=HiThere)
>>>>>>> exten => _NXXXXXXXXX,9,NoOp(--out the pri--)
>>>>>>> ; Primary Dialout
>>>>>>> exten => _NXXXXXXXXX,10,Dial(Zap/G2/1${EXTEN})
>>>>>>> exten => _NXXXXXXXXX,11,GotoIf,($[${HANGUPCAUSE} = 31]?YAY)
>>>>>>> exten => _NXXXXXXXXX,12,Hangup()
>>>>>>> ; Call limiter
>>>>>>> exten => _NXXXXXXXXX,n(BLOCK),Answer()
>>>>>>> exten => _NXXXXXXXXX,n(BLOCK),Playback(all-circuits-busy-now)
>>>>>>> exten => _NXXXXXXXXX,n(BLOCK),Playback(pls-try-call-later)
>>>>>>> exten => _NXXXXXXXXX,n(BLOCK),Hangup()
>>>>>>> ; 1 tester
>>>>>>> exten => _NXXXXXXXXX,n(YAY),Answer()
>>>>>>> exten => _NXXXXXXXXX,n(YAY),Playback(beep)
>>>>>>> exten => _NXXXXXXXXX,n(YAY),Hangup()
>>>>>>>
>>>>>>> It doesn't work. The user simply hangs up when the message is heard
>>>>>>> and the next line in the dialplan isn't followed. How can I detect that a
>>>>>>> call has received a progress code 31 then reroute it to another extension?
>>>>>>> From what I found on voip-info.org (
>>>>>>> http://www.voip-info.org/wiki/index.php?page=Asterisk+variable+hangupcause) this should work. What am I missing?
>>>>>>>
>>>>>>> The server is running Asterisk 1.4.21.1, zaptel 1.4.11, libpri
>>>>>>> 1.4.5, compiled from source.
>>>>>>>
>>>>>>> Thanks in advance!
>>>>>>>
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>>>>>
>>>>>> asterisk-users mailing list
>>>>>> To UNSUBSCRIBE or update options visit:
>>>>>>   http://lists.digium.com/mailman/listinfo/asterisk-users
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Juan E. Rodríguez
>>>>> Cel. 829-886-5565
>>>>> Work: 809-724-9227
>>>>>
>>>>> _______________________________________________
>>>>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>>>>
>>>>> asterisk-users mailing list
>>>>> To UNSUBSCRIBE or update options visit:
>>>>>   http://lists.digium.com/mailman/listinfo/asterisk-users
>>>>>
>>>>
>>>>
>>>
>>> _______________________________________________
>>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>>
>>> asterisk-users mailing list
>>> To UNSUBSCRIBE or update options visit:
>>>   http://lists.digium.com/mailman/listinfo/asterisk-users
>>>
>>
>>
>>
>> --
>> Juan E. Rodríguez
>> Cel. 829-886-5565
>> Work: 809-724-9227
>>
>> _______________________________________________
>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>
>> asterisk-users mailing list
>> To UNSUBSCRIBE or update options visit:
>>   http://lists.digium.com/mailman/listinfo/asterisk-users
>>
>
>
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>



-- 
Juan E. Rodríguez
Cel. 829-886-5565
Work: 809-724-9227
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20081030/71c00325/attachment.htm 


More information about the asterisk-users mailing list