Failure email notifations

I have an INTERMITTENT issue with outgoing calls. IF I get a
"Got SIP response 503 “Service Unavailable” back from x.x.x.x:5060" message in my log for a call… is there a way to trigger an email right away so I know exactly when the issue happend? My Telco says that that need to know when this is happening so they can run some diagnostic tests on their SS7 / PRI equipment. I can scan the log every ‘x’ minutes but if there was some sort of immediate trigger that happened… that would be better.

Thanks - jack

If you got a

Got SIP response 503 “Service Unavailable” back from x.x.x.x:5060

and you contact your Telco at x.x.x.x over SIP they will already know it failed, as they replied to your SIP “invite”. If there is an intermediate connection from your box to their SS7/PRI equipment (which is not SIP) then explore that first. But given the timestamp in your /var/log/asterisk/full file (normally and by default) they should be totally able to diagnose the problem if at all competent, (don’t do their work for them, you pay for it :slight_smile: ).

Perhaps if they are incopmpetenet then

grep -B 10 ‘Got SIP response 503 “Service Unavailable” back from x.x.x.x:5060’ /var/log/asterisk/full

will give you a little more substantiation as to what you sent in the invite. ( -B 10 will include the ten lines prior to the match and should include your first attempt to place that call)

I have a FreePBX box. I talk to a ZULTYUS pbx using a SIP trunk.
The ZULTYUS pbx as a PRI card installed and my calls go out over that. The ZULTYUS box reports:

[isdn_usr_fsm] ISDN Outgoing Call failed: Pri Circuit Number = 1 TimeSlot = 1 Reason = No circuit or channel available

my telco says that they don’t see any issues on their end. They would like to be notified when the issue occurs. I would like to be able to send them an automated email and be done with it. Yes… they probably should be able to handle it themselves… but I have spent hours on the phone with them and just want this to end. If sending them emails when it happens helps move this along, then that is what I want to do.

Then you need to check the intermediate carrier, if that is not possible then a second derivative might help, from bash:-

tailf /var/log/asterisk/full |while read LINE;do echo $LINE;if [[ “$LINE” =~ “Service Unavailable” ]];then
echo -e “Please check my circuit right now\nI got another effing\n$LINE”|mail -s “It’s me again, Please help me” [email protected];fi;done ) &

(It’s a one liner and I hope this forum doesn’t mangle it)

I usually get the 503 Service Not Available message when the Asterisk extension I called is “unreachable”. In Asterisk log it says unable to create channel “SIP”, subscriber absent.

(You should probably leave out the echo $LINE bit :slight_smile: )