- pbxdude
- Friday, November 23rd, 2007 at 1:42:51am MST
This post has 1 comment thread shown at the end of this page.
- #!/usr/bin/perl -w
- # usage:
- # cat /path/to/asterisk_source/include/asterisk/causes.h \
- # | this_perl_script \
- # > /path/to/extensions-include-foo.conf
- #
- # extensions.conf: (example)
- # ...
- # #include "/path/to/extensions-include-foo.conf"
- # [macro-dial_something]
- # ...
- # exten => h,1,GoSub(ast_hangup_causes,hc-${HANGUPCAUSE},1)
- # exten => h,n,NoOp(Hangup cause was ${HANGUPREASON})
- # ...
- use strict;
- print <<_EOM ;
- [ast_hangup_causes]
- ;
- ; Sets the variable HANGUPREASON
- _EOM
- while(<>) {
- next unless (/^#define\s+AST_CAUSE/o && /\d+$/o);
- $reason =~ s/^AST_CAUSE_//;
- print <<_EOM ;
- ;
- exten => hc-$code,1,Set(HANGUPREASON=$reason)
- exten => hc-$code,n,Return()
- _EOM
- }
- print <<_EOM ;
- ;
- exten => hc-.,1,Set(HANGUPREASON=REASON_\${EXTEN:3}_NOTINLIST)
- exten => hc-.,n,Return()
- _EOM
- exit $?
advertising
Update the Post
Either update this post and resubmit it with changes, or make a new post.
You may also comment on this post.
Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.
comments on this paste
pbxdude (#794600) need help on hangup cause
Posted By: abdullah (+92-346-5765641)
Posted: January 24th, 2012 at 9:02am MST
can anyone help me to find hangup cause from asterisk . ISDN Channal . i need full script as this one is not understandable.
http://pastebin.ca/794600
i really appricate for your forward response.