Problem with Local Channel

Hello All,

I am trying to find the status of the called number using Dial status. I am creating a “call file” where I am defining the channel as local channel. you can see the code below for the call file. Then, I have written the context and extensions which has a “dial plan”. You can see the code below for the extensions.conf. Now, when i placed the call file in /var/spool/outgoing I am unable to view the dial status and I am facing some errors. Can any one please help me on this issue.

Here is the detailed explanation of my problem.

My call file is:

Channel: LOCAL/123@newamar/n
CallerID: 456456
MaxRetries: 0
RetryTime: 9
WaitTime: 12
Context: newamar
Extension: 124
Priority: 1
Setvar: SOUND=/var/www/push/sound/CallMeBackUS
Setvar: DESTINATION=7865210317
Setvar: OPERATOR=vitel-outbound

my extensions.conf file is:

[newamar]
exten => 123,1,Dial(SIP/${DESTINATION}@${OPERATOR})
exten => 123,n,Goto(s-${DIALSTATUS},1)
exten => s-NOANSWER,1,NoOp(no answer)
exten => s-CONGESTION,1,NoOp(congestion)
exten => s-CANCEL,1,NoOp(cancel)
exten => s-BUSY,1,NoOp(Busy)
exten => s-ANSWER,1,Playback(${SOUND})
exten => s-ANSWER,n,Hangup
exten => 123,1,NoOp(${DIALSTATUS})
exten => 123,n,Hangup

When I placed my call file in /var/spool/outgoing i am getting the following description in my console:

– Attempting call on LOCAL/123@newamar/n for 124@newamar:1 (Retry 1)
– Executing [123@newamar:1] Dial(“Local/123@newamar-8e8f,2”, “SIP/7865210317@vitel-outbound”) in new stack
– Called 7865210317@vitel-outbound
– SIP/vitel-outbound-006648b0 is ringing
– SIP/vitel-outbound-006648b0 is making progress passing it to Local/123@newamar-8e8f,2
– SIP/vitel-outbound-006648b0 answered Local/123@newamar-8e8f,2

Channel Local/123@newamar-8e8f,1 was answered.
== Starting Local/123@newamar-8e8f,1 at newamar,124,1 failed so falling back to exten ‘s’
== Starting Local/123@newamar-8e8f,1 at newamar,s,1 still failed so falling back to context ‘default’
[Dec 30 14:19:39] WARNING[2899]: pbx.c:2470 __ast_pbx_run: Channel ‘Local/123@newamar-8e8f,1’ sent into invalid extension ‘s’ in context ‘default’, but no invalid handler
[Dec 30 14:19:39] NOTICE[2899]: pbx_spool.c:365 attempt_thread: Call completed to LOCAL/123@newamar/n
== Spawn extension (newamar, 123, 1) exited non-zero on ‘Local/123@newamar-8e8f,2’

Here I am unable to resolve the problem. Can you please have a look into it.

I think you want something like this:

[code][newamar]
exten => 123,1,Dial(SIP/${DESTINATION}@${OPERATOR})
exten => 123,n,Goto(s-${DIALSTATUS},1)
exten => s-NOANSWER,1,NoOp(no answer)
exten => s-CONGESTION,1,NoOp(congestion)
exten => s-CANCEL,1,NoOp(cancel)
exten => s-BUSY,1,NoOp(Busy)

exten => 124,1,Playback(${SOUND})
exten => 124,n,Hangup[/code]

You had 2 #1 priorities on the 123 extension, and when the Dial is answered it connects to the extension defined in the call file, which is 124.

Thank you very much for replying. I want actually the status of the called number. But, when I am trying to use NoOp(${DIALSTATUS}) a null value is being returned.

I will briefly describe you my problem:
I am creating a call file to call a number.
Now, once the call file is placed in the var/asterisk/spool/outgoing
the number is getting the call.
now, while the number is getting is called we can have different option like, it being answered, busy, not answered and various others.
I am trying to get the status of the called number.

Can you please inform me if you have any idea to solve this. I thought using DIALSTATUS I could solve that, but I am facing the probelms.

Thanks,
amaresh

If you want the dialstatus of ANSWERED, then create a h extension and noop it there.

Hello,

Thanks for replying me back. What I want exactly is the status of the called number. the number could not be in the status ANSWERED, but it can also be in BUSY, NO ANSWER, some times the number could be UNAVAILABLE and I need to know this status of the called number.
I hope you this is clear to explain the problem.
I want dial plan to achieve this.

Thanks,
Amaresh

Hello All,

I will like to bring back my probelm again…

Following is my call file:

[b]Channel: LOCAL/amar@newamar/n
CallerID: 3054963480
MaxRetries: 0
RetryTime: 9
WaitTime: 12
Context: newamar
Extension: amar
Priority: 1
Setvar: SOUND=/var/www/push/sound/CallMeBackUS
Setvar: DESTINATION=7865210317
Setvar: OPERATOR=vitel-outbound

[/b]and my extension.conf file is

exten => amar,1,Dial(SIP/${DESTINATION}@${OPERATOR}/${EXTEN})
exten => amar,n,NoOp(${EXTEN}:DIALSTATUS=${DIALSTATUS};HANGUPCAUSE=${HANGUPCAUSE})

So, When callfile gets copied, call is established to the destination number, Now I have two cases:

Case I: When the callee answers the call one more call is established to the same destination number and if I lift the call again, one more call iis getting established (like an infinite loop)
Case II: When I cut the call, I am getting nothing in the console.

Can anyone suggest me what could be the problem.

Looking forward to hear from you.

Thanks,
Amaresh Manthena.

Lets look at what you have in the amar extension

Now if you replace that with the parameters you get:

Ok that is the 1st leg of the call as you have defined… Now, if that call answers you are sending it into

Context: newamar Extension: amar Priority: 1
Which will call that same extension again…

Thank you for the reply… but even if the code is :

exten => amar,1,Dial(SIP/7865210317@vitel-outbound)

The same thing is happening…

[quote]Channel: LOCAL/amar@newamar/n<<<<<<<<<<<<<<<<<<
CallerID: 3054963480
MaxRetries: 0
RetryTime: 9
WaitTime: 12
Context: newamar<<<<<<<<<<<<<<<<<<<<<<<
Extension: amar <<<<<<<<<<<<<<<<<<<<<<<
Priority: 1
Setvar: SOUND=/var/www/push/sound/CallMeBackUS
Setvar: DESTINATION=7865210317
Setvar: OPERATOR=vitel-outbound [/quote]

your channel and destination are the same, May work but its a realy bad idea.

try something like

[quote]Channel: LOCAL/amarC@newamar/n
CallerID: 3054963480
MaxRetries: 0
RetryTime: 9
WaitTime: 12
Context: newamar
Extension: amarE
Priority: 1
Setvar: SOUND=/var/www/push/sound/CallMeBackUS
Setvar: DESTINATION=7865210317
Setvar: OPERATOR=vitel-outbound [/quote]

Why are you sending the call to its self ???

Hello ianplain,

CAN YOU PLEASE EXPLAIN ME WHAT EXACTLY HAPPENS WHEN THE ASTERISK SEES THE CALL FILE AS GIVEN BELOW.

LOOKING FORWARD TO HEAR FROM YOU.

THANKS,
AMARESH

You have programmed a loop into the dialplan. How many more times can it be explained to you.

The “context”, “extension”, and “priority” properties in the .call file tell asterisk where to send the call upon ANSWER. You are setting those three values to the same values that dial the initial call. You need to differentiate them, otherwise you will just keep doing the same thing over and over.

LOCAL/amar@newamar (implicit priority 1) will jump the Local channel to:

[newamar]
exten => amar,1,Dial(SIP/${DESTINATION}@${OPERATOR}/${EXTEN})

On top of that, you specify upon ANSWER, the new SIP channel should return to amar@newamar - priority 1… meaning your new channel will try to do native bridging with itself.

You MUST have a different context, extension or priority specified in the .call example which will be used to handle the call upon answer. If the call fails for any reason NOANSWER, BUSY, CONGESTION, etc the flow will simply fall through to the next priority in the same context/extension.