Extension "h" feature

Hi All,

Can we make Asterisk to execute extension “h” when a call is rejected (ie ending the call without receiving it) and when a call is placed to a non-existing number??? Please do suggest. Thank you in advance.

Regards,

Kurian.

I would just a “catch all” extension for that. Maybe something like

Exten => _X.,1,Do Something
Exten => _X.,2,Congestion

Hi,

Thank you for the reply. I need to execute an AGI script when a call is rejected (when the call is ended without receiving it) or when the call is made to non-existing number. I tried using the option,

I need to update the DB when a call is rejected or when a call is placed to a non-existing number. And the server is making automatic calls by generating .call files in /var/spool/asterisk/outgoing. How can I accomplish this? The extension “h” is not getting executed when the above call operation is performed. Do suggest some tips. How can I accomplish this with your logic? Please advice. Thank you in advance.

Regards,

Kurian.

Did you try:

Exten => _X.,1,DeadAGI(arservice_call_log.agi,${EXTEN})
Exten => _X.,2,Hangup

Hi,

Thank you for the reply. Here is the context I use in /etc/asterisk/extensions.conf. We use extension “s” and “h” returned to update the Database in the backend.

[quote][outboundmsg2]
exten=>h,1,DeadAGI(arservice_call_log.agi,${EXTEN})
exten=>h,2,DeadAGI(arservice_call_log.agi,PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME})
exten=>s,1,AGI(arservice_call_log.agi,${EXTEN})
exten=>s,2,WaitForSilence(500,2)
exten=>s,3,AGI(arservice-play.agi)
exten=>s,4,Hangup[/quote]

Do suggest some tips. Thank you.

Regards,

Kurian.

What is the point of exten=>s,1,AGI(arservice_call_log.agi,${EXTEN}) ?
${EXTEN} will bring back s every time because that is the extension that you are using. How do you see if an extension is valid or not ?

Hi,
Thank you for the reply. After creating the .call file in outgoing folder, and when the call is placed to a valid phone number, and when other person picks up the phone, extension s will be executed. And since AGI(arservice_call_log) is executed then, an entry corresponding to this number is made in the DB at the backend. And when the call hangsup, the arservice_call_log.agi checks if its “h” and some other entry in the DB is made. The .call file is automatically generated using one perl script in the backend. This .call file carries some variables like “unique_id”, timestamp etc which will help to update the fields in the DB.

Regards,

Kurian.