Extend a call feature functionality version upgrade from asterisk v13 to v20

Hi everybody, I hope Christmas was good for you all!

I want to post a topic to get help from other community engineers about the Asterisk extend a call feature.

This is our ‘Extend a Call’ feature description with 1 minute remaining.

In the call the client will here a 1 minute waring and can hit 1 to extend or 2 to finish the call. if 2 then he finished out the 1 minute. If 1 then the time is paused and he has a choice to extend 10, 15 or 20 minutes. He makes his selection and then is asked to verify his zip again (since we kept the card number we will bill him for whatever he chooses). The agent is on hold and hears a recording what the client is picking while he makes his selection and once done they are connected again.

this is current asterisk v13’s codebaase,

[macro-extendcall]
exten => s,1,NoOp(Extending call for ${CHANNEL}, ${UNIQUEID}, ${MYVPC_ORDERID}, ${END_TIME}, ${EPOCH})
same => n,EndTime(END_TIME)
same => n,NoOp(end time ${END_TIME}, epoch ${EPOCH}, delta $[${END_TIME} - ${EPOCH}])
same => n,GotoIf($[(${END_TIME} - ${EPOCH}) > 120] ?endextend)
exten => s,n,Macro(finditems,${EXTENDCALL_GROUP},${CONTEXT},extendcall)
exten => s,n,GotoIf($[${LEN(${ITEMS_FOUND})} = 0] ?notavail,1)

exten => s,n,Macro(selectfromlist,${URIENCODE(${ITEMS_FOUND})},${MYVPC_COMMON_SOUND}/item,${MYVPC_COMMON_SOUND}/extendcallmenu)
exten => s,n,GotoIf($[${LEN(${CHOICE})} = 0] ?endextend)

exten => s,n,Set(OLDORDERID=${MYVPC_ORDERID})
exten => s,n,Macro(processpayment,${EXTENDCALL_OPTS},${CHOICE})
exten => s,n,GotoIf($[“${PAYMENT_STATUS}” != “APPROVED”] ?endextend)
same => n,Extend($[${MYVPC_DURATION} * 60000]:60000)

exten => s,n(endextend),NoOp

exten => notavail,1,Playback(myvpc/feature-not-avail)

I am getting an issue on “EndTime”,“endextend” in above [macro-extendcall]
Please check my post and give me your feedback.

Thank you, Alex

“EndTime” is not something included in Asterisk as shipped by the project, or “Extend” so unless you’ve patched your Asterisk 20 to include them from some source, they wouldn’t exist.

Hi @jcolp thanks so much for your response.

I am now curious how I can exactly update the codebase to do same functionality in asterisk v20?
Could you kindly let me know any references what I can refer to do it?

Thank you,

Alex

I can’t really answer. You’re talking about functionality that doesn’t exist in Asterisk and I’ve never seen, so no idea how it is written, implemented, or works.

Thanks for your quick response.

I also think it is custom function in asterisk v13. In that case, could you tell me where I can filter or find these functions codebase?

I tried to check out the modules directory.. but I could not find out any valuable module…

Where we store dialplan applications in the source code is in the “apps” directory. Your custom stuff could be there, or elsewhere.

Binary built and installed modules go into the “modules” directory.

Could you kindly share with me the potential directory paths?

No… it’s arbitrary where it could be. I’ve helped as much as I can.

Got it,

Thank you very much @jcolp

Happy New Year @jcolp
Hope you had a great holidays so far.

Could you kindly give me some advice to make a call with 10 mins limit and 1min remaining warning and extend a call duration at 9:00.

I do not believe there is any “extend” functionality built in, so I don’t have anything to offer.

Yes, alright
There is no Extend() application in asterisk.
So I am now trying with Set(TIMEOUT(absolute))

-Create a call
same => n,Set(TIMEOUT(absolute)=180)

same => n,Dial(PJSIP/+1978XXXXXXXX@inteliquent-test,30,gm)

-Extend a call
n,Set(TIMEOUT(absolute)=${MATH(${TIMEOUT(absolute)} + 600,int)})

Above approache allow me to extend a call but there was no beep 1min remaining warning..
Could you tell me how did you handle this kind of cases?

That is an absolute timeout with no beep or notice. The only timeout mechanism that gives notice is the L Dial option[1] which once set when Dial is invoked can’t be altered.

[1] Dial - Asterisk Documentation