SIP Response for call files call

Hi All,

I am having an asterisk server installed with Version 16, And also have a SIP Trunk from Telecom operator.

I am using call files to make outgoing calls. But presently when am making the call using call file am not getting SIP response or hangup cause. But the same SIP response is getting from the operator.

Below is my call file:

Channel: SIP/out/1234567899
Context: testV
Extension: s
Priority: 1

Below us my dialplan :

[testV]

exten => 1,n,NoOp({UNIQUEID}) exten => s,n,NoOp({starttime})
exten => s,n,Set(hangup=FALSE)
exten => s,n,Hangup(16)

exten => h,1,Set(CDR(userfield)=Hangupcause:{HANGUPCAUSE}) exten => h,n,NoOp({starttime} , {CDR(start)},{CDR(end)})

exten => failed,1,Set(failed=1)
exten => failed,n,NoOp({HASH(SIP_CAUSE,{CDR(channel)})})
exten => failed,n,NoOp(HANGUPCAUSE is ${HANGUPCAUSE})

Can anyone help to get the SIP Response like if busy 486 SIP response need to capture at DialPlan.

You need to edit your dial-plan first!

[testV]
exten => 1,n,NoOp({UNIQUEID}) exten => s,n,NoOp({starttime})
exten => s,n,Set(hangup=FALSE)
exten => s,n,Hangup(16)

[testV]
exten => s,1,NoOp({UNIQUEID}) exten => s,n,NoOp({starttime})
exten => s,n,Set(hangup=FALSE)
exten => s,n,Hangup(16)

But how can we get the failed call SIP Response ?

at CLI, “sip set debug on”
you can see a SIP Packets.

Am getting the SIP Response from the Telecom operator in the SIP set debug. But i need that SIP response like 486,200,603 in asterisk variable for the failed calls.

Use local channel to dial out using SIP trunk and collect SIP response code there

Hai Satish, if i use local then again i need to add an dialplan for the same again based on the operator. Is there any other option .

When my call fails, the call result is stored in ${REASON} variable. I am using this in “failed” extension to get the reason of failure. I am getting the following results:
0 - Failed (not busy or congested)
1 - Hung up
3 - Ring timeout
5 - Busy
8 - Congestion

The above results are not sufficient for analysis. I want the detailed release cause of the call like ISDN cause or something with more details of why the call failed.

When I am using ${HANGUPCAUSE} I am always getting the result as “0”.

Can anyone help me with the same?

Yes you’ll have to add some dialplan and if you are using different providers, pass the provider name in a variable and use it to dialout.
AFAIK, I won’t have much control over call if you don’t use local channel here

But this will increase the server load. like example if am making 1000 calls, in asterisk it will create extra 1000 more channel, which will increase the server load.

By default the local channel tries to optimize itself out of the callpath so I don’t see that will increase server load significantly.
However I suggest to test it on your server for 1000 calls and see how much it affects the server load.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.