Hello Team,
Hope you are doing well.
Greeting day to all.
I would like to share one Asterisk Problem which is related to channel consumption.
I’m generating Outgoing Call via Asterisk AMI in which first Call used Local Channel then outgoing call dialled on User Phone, if he picks the call custom Dial plan will run else disconnect the call.
In this Model total Three Channels has been consumed from starting to till then user received call, my point is to Minimize used channels of SIP.
Let me share you AMI code which I used for Outgoing:
fputs($socket, "Action: Login\r\n");
fputs($socket, "UserName: $user\r\n");
fputs($socket, "Secret: $pass\r\n\r\n");
fputs($socket, "Action: Originate\r\n" );
fputs($socket, "Channel: Local/$calling_number@outbound-ami-status/n\r\n" );
fputs($socket, "Exten: $calling_number\r\n" );
fputs($socket, "Context: outbound\r\n" );
fputs($socket, "Priority: 1\r\n" );
fputs($socket, "Callerid: XXXXXX\r\n" );
fputs($socket, "WaitTime: 5\r\n" );
fputs($socket, "Variable: variable_id=$variable_id\r\n");
fputs($socket, "Async: true\r\n" );
fputs($socket, "Action: logoff\r\n\r\n" );
Below is my DialPlan code for Local SIP:
[outbound-ami-status]
exten => _X.,1,NoCDR()
same => n,Dial(SIP/${EXTEN}@outbound,15,m(adg-hold-music))
same => n,Goto(CallStatus-${DIALSTATUS},1)
exten => CallStatus-NOANSWER,1,Verbose(1,Call Status = No Answer)
same => n,Hangup()
exten => CallStatus-BUSY,1,Verbose(1,Call Status = Busy)
same => n,Hangup()
exten => _CallStatus-.,1,Verbose(1,Call Status = Unknown)
same => n,Hangup()
[outbound]
exten => _X.,1,macro(To-Outbound-Call-Flow)
exten => h,1,GoTo(macro-To-OBD-Hangup-Call-Flow,h,1)
[macro-To-Outbound-Call-Flow]
exten => s,1,Set(date_time=${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)})
same => n,Answer()
[macro-To-OBD-Hangup-Call-Flow]
exten => h,1,Verbose(1,In Hangup State)
Please help on to minimize used Channels for each call so that I can generate more number of calls from the Server
Note -> Do you know any process for reusing of channels to other extension or vice versa