H Extension Variables

Any help would be appreciated, I’m really not quite sure why this is happening.

I have an asterisk 1.6 installation that I am trying to receive a fax from a SIP provider. After I get the fax, I just want to send it out. The problem is that I put my AGI script in the h extension and pass the file name of the fax I just got in. Sometimes all the variables are populated correctly, sometimes they are not. I’m not sure why that isn’t happening correctly. All the examples of fax to email I’ve found seem to do this in a similar way. Below is the relevant code from my dialplan. The faxes come in fine by the way, if I open the files themselves they are fine.


exten => 2999,1,NoOp(Fax Testing Beginning)
exten => 2999,n,Set(thisDID=${EXTEN})
exten => 2999,n,Set(emailAddress=tmarricco@mydomainhere.com)
exten => 2999,n,Set(fromNumber=${CALLERID(num)})
exten => 2999,n,ReceiveFAX(/root/faxtemp/${EXTEN}-${fromNumber}-${emailAddress}.tiff)



include => faxnumbers

Sometimes the h extension isn’t reached, other times its reached by the script is run:

Executing [h@incoming:1] AGI(“SIP/”, “sendFax.php,”)

Other times the script is run with all the variables populated and the email goes off fine. Does anybody have any idea?