[resolved?] Problems Retrieving Parked Calls

Hi,

I’ve just got started with Asterisk.

I’ll give some background, Im a computer programmer, Linux enthusiast, and general geek.

I’ve just got my asterisk box setup, certainly a steep learning curve but after a few hours play got my it talking to IAX2 and SIP service providers with multiple extensions and voicemail.

I like this.

Im using 1.4.0-beta3, and Im really confused on how the different contexts key together (in terms of features.conf for parked calls, sip.conf, extensions.conf and voicemail.conf), there’s a lot of different sections, a lot of commands, and the extension language is out of this world (I love it!)

But first things first. Parking calls.

OK I can type from extension 5001, #700 and I get told “701”.

Fine.

Trouble is, when I type 701 on the phone to retrieve a call, I get a 404 status.

I’ve done a debug, and here’s the (what I think is) relevent bit (I have more if needed):

[code]Looking for 701 in default (domain 10.0.0.10)

<— Reliably Transmitting (no NAT) to 10.0.0.79:5060 —>
SIP/2.0 404 Not Found[/code]

extensions.conf contain:

[code][general]
static=yes
writeprotect=no
clearglobalvars=no

[globals]
CONSOLE=Console/dsp ; Console interface for demo
;CONSOLE=Zap/1
;CONSOLE=Phone/phone0
;IAXINFO=guest ; IAXtel username/password
;IAXINFO=myuser:mypass
;TRUNK=Zap/g2 ; Trunk interface

[default]

include => parkedcalls

; extensions
exten => 5001,1,Dial(SIP/simon.dean.grandstream,10,rtT)
exten => 5001,2,Voicemail(u5001)
exten => 5002,1,Dial(SIP/simon.dean.xlite,10,rtT)
exten => 5002,2,Voicemail(u5002)

; outgoing sipgate
exten => _9.,1,Dial(SIP/${EXTEN:1}@sipgate-out,30,rtT)
exten => _9.,2,Playback(invalid)
exten => _9.,3,Hangup

; voicemail extensions
exten => 4500,1,VoicemailMain
exten => 4501,1,VoiceMailMain(${CALLERID(num)})

; sipgate incoming
exten => 12345678,1,NoOp(— ${CALLERID} calling on sipgate (${EXTEN}) —)
exten => 12345678,2,Dial(SIP/simon.dean.xlite&SIP/simon.dean.grandstream,10)
exten => 12345678,3,Answer
exten => 12345678,3,Wait,1
exten => 12345678,4,Voicemail(u5001)
exten => 12345678,5,hangup

; voiptalk outgoing
exten => _0[1-9].,1,Dial(IAX2/12345678@voiptalk/44${EXTEN:1})
exten => _00.,1,Dial(IAX2/12345678voiptalk/${EXTEN:2})

; voiptalk incoming
exten => 0871xxxxxxx,1,Dial(SIP/simon.dean.xlite&SIP/simon.dean.grandstream,10)
exten => 0871xxxxxxx,2,Answer
exten => 0871xxxxxxx,3,Wait,1
exten => 0871xxxxxxx,4,Voicemail(u5001)
exten => 0871xxxxxxx,5,hangup
[/code]

If you need any more info, let me know.

Im not quite sure how the rtT flags are supposed to work on the extensions, well, I do, but Im not sure where they’re supposed to be used… ie, on the extensions themselves, or on the incoming line?

And Im not sure why I can’t internally transfer say by typing #5002… I just get an english sounding person tell me “sorry, this number is not yet in service” or something.

After I’ve typed the two I get:

* DTMF-relay event received: 2

<--- Transmitting (no NAT) to 10.0.0.79:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.0.0.79;branch=z9hG4bKf64f06bda4c3626b;received=10.0.0.79
From: <sip:simon.dean.grandstream@10.0.0.79>;tag=730b5819c0e22459
To: "07771xxxxxx" <sip:07771xxxxxx@10.0.0.10>;tag=as51c67530
Call-ID: 2665e86e2ff781a75a6d00c05aedb7f4@10.0.0.10
CSeq: 19192 INFO
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Contact: <sip:07771xxxxxx@10.0.0.10>
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog '2665e86e2ff781a75a6d00c05aedb7f4@10.0.0.10' in 32000 ms (Method: INFO)
set_destination: Parsing <sip:simon.dean.grandstream@10.0.0.79> for address/port to send to
set_destination: set destination to 10.0.0.79, port 5060
Reliably Transmitting (no NAT) to 10.0.0.79:5060:
BYE sip:simon.dean.grandstream@10.0.0.79 SIP/2.0
Via: SIP/2.0/UDP 10.0.0.10:5060;branch=z9hG4bK21cf7fc6;rport
From: "07771xxxxxx" <sip:07771xxxxxx@10.0.0.10>;tag=as51c67530
To: <sip:simon.dean.grandstream@10.0.0.79>;tag=730b5819c0e22459
Contact: <sip:07771xxxxxx@10.0.0.10>
Call-ID: 2665e86e2ff781a75a6d00c05aedb7f4@10.0.0.10
CSeq: 103 BYE
User-Agent: Asterisk PBX
Max-Forwards: 70
Content-Length: 0


---
neil*CLI> sip debug
<--- SIP read from 10.0.0.79:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.0.0.10:5060;branch=z9hG4bK21cf7fc6;rport
From: "07771xxxxxx" <sip:07771xxxxxx@10.0.0.10>;tag=as51c67530
To: <sip:simon.dean.grandstream@10.0.0.79>;tag=730b5819c0e22459
Call-ID: 2665e86e2ff781a75a6d00c05aedb7f4@10.0.0.10
CSeq: 103 BYE
User-Agent: Grandstream BT100 1.0.4.55
Contact: <sip:simon.dean.grandstream@10.0.0.79>
Allow: INVITE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE
Content-Length: 0

Hope you guys can lend me some answers.

Thanks
Simon

It seems I have it part working, in that I can now park calls on my internal phone system. I was noticing that after parking a call, the number (ie 701) wasn’t appearing on the dialplan through the CLI! Lost into the ether.

I noticed part of the conundrum was working on the xlite softphone and not on my BT 101 Grandstream, so I looked at the two entries in sip.conf and changed the grandstream entry from:

to

I was able towtweak everything, including the rtT flags in extenions.conf and managed to get most of this working including outgoing calls. Only problem is that I still can’t get to transfer incoming calls.

The nice lady, after typing the first digit after # just tells me “Im sorry, that’s not a valid extension”.

Any thoughts?

Thanks
Simon

Think I got it fixed. It was doing this:

neil*CLI> core verbose 99 Verbosity was 0 and is now 99 -- Accepting UNAUTHENTICATED call from 217.14.138.48: > requested format = alaw, > requested prefs = (ilbc|gsm|ulaw|alaw|g729), > actual format = ilbc, > host prefs = (), > priority = caller -- Executing [0871xxxxxxx@default:1] NoOp("IAX2/217.14.138.48:4569-1", "--- calling on voiptalk (0871xxxxxxx) ---") in new stack -- Executing [0871xxxxxxx@default:2] NoOp("IAX2/217.14.138.48:4569-1", "BEFORE Q ") in new stack -- Executing [0871xxxxxxx@default:3] Dial("IAX2/217.14.138.48:4569-1", "SIP/simon.dean.xlite|10|rt") in new stack -- Called simon.dean.xlite -- SIP/simon.dean.xlite-09e42988 is ringing -- SIP/simon.dean.xlite-09e42988 answered IAX2/217.14.138.48:4569-1 -- Started music on hold, class 'default', on IAX2/217.14.138.48:4569-1 -- Playing 'pbx-transfer' (language 'en') -- Unable to find extension '7' in context '' -- Playing 'pbx-invalid' (language 'en') -- Stopped music on hold on IAX2/217.14.138.48:4569-1 == Spawn extension (default, 0871xxxxxxx, 3) exited non-zero on 'IAX2/217.14.138.48:4569-1' -- Hungup 'IAX2/217.14.138.48:4569-1' -- parse_srv: SRV mapped to host sipgate.co.uk, port 5060 neil*CLI> quit

It didn’t have a context, according to that…

So, a bit of scouting around the internet, and I told it to set a context:

Connected to Asterisk 1.4.0-beta3 currently running on neil (pid = 3059) neil*CLI> core verbose 99 Verbosity was 0 and is now 99 -- Accepting UNAUTHENTICATED call from 217.14.138.48: > requested format = alaw, > requested prefs = (ilbc|gsm|ulaw|alaw|g729), > actual format = ilbc, > host prefs = (), > priority = caller -- Executing [0871xxxxxxx@default:1] Set("IAX2/217.14.138.48:4569-1", "__TRANSFER_CONTEXT=default") in new stack -- Executing [0871xxxxxxx@default:2] NoOp("IAX2/217.14.138.48:4569-1", "BEFORE Q default") in new stack -- Executing [0871xxxxxxx@default:3] Dial("IAX2/217.14.138.48:4569-1", "SIP/simon.dean.xlite|10|rt") in new stack -- Called simon.dean.xlite -- SIP/simon.dean.xlite-08a609c0 is ringing -- SIP/simon.dean.xlite-08a609c0 answered IAX2/217.14.138.48:4569-1 -- Started music on hold, class 'default', on IAX2/217.14.138.48:4569-1 -- Playing 'pbx-transfer' (language 'en') -- Stopped music on hold on IAX2/217.14.138.48:4569-1 -- Started music on hold, class 'default', on IAX2/217.14.138.48:4569-1 == Parked IAX2/217.14.138.48:4569-1 on 701@parkedcalls. Will timeout back to extension [default] 0871xxxxxxx, 3 in 45 seconds -- Added extension '701' priority 1 to parkedcalls -- Playing 'digits/7' (language 'en') -- Playing 'digits/0' (language 'en') -- Playing 'digits/1' (language 'en') == Spawn extension (default, 0871xxxxxxx, 3) exited KEEPALIVE on 'IAX2/217.14.138.48:4569-1' -- Executing [701@default:1] ParkedCall("SIP/simon.dean.grandstream-08a5cf78", "701") in new stack -- Stopped music on hold on IAX2/217.14.138.48:4569-1 -- Channel SIP/simon.dean.grandstream-08a5cf78 connected to parked call 701 -- Hungup 'IAX2/217.14.138.48:4569-1' == Spawn extension (default, 701, 1) exited non-zero on 'SIP/simon.dean.grandstream-08a5cf78' neil*CLI>

Seems to work now.

Thing is, is this normal?

Ta
Simon

I think you got it.

Be sure to take a look at this post:

forums.digium.com/viewtopic.php?t=4208

It gives all sorts of good links to learn this stuff.

It’s bizarre coming online then answering your own question.

That’s the best kind of user eh?

I think the first time user, if they transfer a call, they expect the call to be transferred in the context that the call came in on unless they specify something different. That’s what I expect…

So I was really weirded out by having to assign a Transfer Context before the call comes in…

I really like it though. It seems so flexible and it’s quite enjoyable.

Im just trying to figure out how you can replicate a standard digital phone system incorporating standard features such as Redial, Transfer, Do Not Disturb, Hold etc at the touch of a button… preferably with feature buttons on the phone itself.

ie, in business, I don’t think you want to do #700 to hold a call. The Grandstream BT101 though has a Hold button, and that does indeed play hold music to the user. How does it do that? is there an equivalent ‘#’ code for it? Can I make one?

Im just musing right now, got lots to look at and just thinking my questions out loud - Im not expecting an answer (because I want to go away and research - but if you really want to provide the answer, Im all ears :smiley: )