i am using A2Billing which uses Asterisk 13 (I know its EOL)
Is there an easy OOB method to parse back the SIP cause code the carrier is sending us when Asterisk is acting as a B2BUA.
Example, if the carrier legB sends back 604, asterisk sends 404 to the client
If the carrier LebB sends back a 487, asterisk sends a 603 to the client
I just want to parse back the exact same cause code and cause text to the UAC
same => n,Noop(${DIALSTATUS})
same => n,GotoIf($["${DIALSTATUS}" = "CONGESTION"]?anotherattempt)
same => n,GotoIf($["${DIALSTATUS}" = "CHANUNAVAIL"]?anotherattempt)
same => n,GotoIf($["${DIALSTATUS}" = "BUSY"]?totalhangup)
same => n,GotoIf($["${DIALSTATUS}" = "NOANSWER"]?totalhangup)
same => n(totalhangup),Hangup()
same => n(hangupbaduser),Hangup(57)
same => n(hangupnoratecard),Hangup(38)
same => n(hangupratecardnodest),Hangup(52)
same => n(hangupnotrunk),Hangup(44)
;Hangup the call
exten => h,1,GotoIf($[${strusername}=${CDR(accountcode)}]?h,oktolog:kickoff) ; 2 for OK 31 for Kick off
same => n(oktolog),Set(StrSessiontime=${CDR(billsec)})
same => n,Set(StrCalledstation=${dst})
same => n,Set(StrDialstatus=${DIALSTATUS})
same => n,Set(StrDialstatus_value=9)
same => n,Set(sellcost=0)
same => n,Set(buycost=0)
same => n,Set(StrChannel=${CDR(channel)})
same => n,GotoIf($["${StrSessiontime}" = "0"]?h,setsellcost:calcsellcost)
same => n(calcsellcost),ExecIf($[${StrSessiontime}>${str__initblock}]?set(sellcost=$[CEIL(${StrSessiontime}/${str__billingblock})*${str__billingblock}/60*${str__rateinitial}]))
same => n,ExecIf($[${StrSessiontime}<=${str__initblock}]?set(sellcost=$[${str__initblock}/60*${str__rateinitial}]))
same => n(setsellcost),set(sellcost_all=${sellcost})
same => n,GotoIf($["${StrSessiontime}" = "0"]?h,setbuycost:calcbuycost)
same => n(calcbuycost),ExecIf($[${StrSessiontime}>${str__buyrateinitblock}]?set(buycost=$[CEIL(${StrSessiontime}/${str__buyrateincrement})*${str__buyrateincrement}/60*${str__buyrate}]))
same => n,ExecIf($[${StrSessiontime}<=${str__buyrateinitblock}] ?set(buycost=$[${str__buyrateinitblock}/60*${str__buyrate}]))
same => n(setbuycost),set(buycost_all=${buycost})
same => n,ExecIf($[ "${StrDialstatus}" = "CHANUNAVAIL" ]?Set(StrDialstatus_value=6))
same => n,ExecIf($[ "${StrDialstatus}" = "CANCEL" ]?Set(StrDialstatus_value=4))
same => n,ExecIf($[ "${StrDialstatus}" = "BUSY" ]?Set(StrDialstatus_value=2))
same => n,ExecIf($[ "${StrDialstatus}" = "CONGESTION" ]?Set(StrDialstatus_value=5))
same => n,ExecIf($[ "${StrDialstatus}" = "ANSWER" ]?Set(StrDialstatus_value=1))
same => n,ExecIf($[ "${StrDialstatus}" = "NOANSWER" ]?Set(StrDialstatus_value=3))
same => n,ExecIf($[ "${StrDialstatus}" = "" ]?Set(StrDialstatus_value=6))
same => n,Set(BILLING_CDRUPDATE()=${CDR(uniqueid)},${CDR(channel)},${strid},${StrSessiontime},${StrCalledstation},${StrDialstatus_value},${sellcost_all},${str_tariffgroup_id},${str_idtariffplan},${str_ratecard_id},${trunk_id_trunk},${CALLERID(num)},${buycost_all},${CDR(dnid)},${str_dialprefix})
same => n,NOOP(sellcost=${sellcost},buycost=${buycost})
same => n,NOOP(finished)
same => n(kickoff),NoOp(Kick Off)