[asterisk-users] [extensions.conf] Any idea why not working as it should?

Vincent vincent.delporte at bigfoot.com
Tue Jun 23 09:49:55 CDT 2009


Hello

I noticed a small bug in the way my extensions.conf work:

Users can choose extensions 1-4 or 9 to tell why they're calling, and
I'll send an e-mail to the person(s) to whom is involved. Extension 4
is actually for personal messages for User1, and extension 9 is for
everyone (User1, User2, and User3).

=> For some reason, when the caller chooses extension 4, both User1
and User2 get the e-mail, while I expect only User1 to get one:

===== /usr/local/etc/asterisk/extensions.conf
//Caller can choose extensions 1, 2, 3, 4 or 9

//Look up software name from extension
exten => _[1-49],1,AGI(convert_app.phpcli|${EXTEN})
exten => _[1-49],n,Set(APPLICATION_NUM="${EXTEN}")

//Send e-mail to who is in charge of the application
exten =>
_[1-49],n,AGI(send_call_notification.phpcli|${CALLERID(name)}|${CALLERID(num)}|${APPLICATION_NUM})

exten => _[1-49],n,Hangup()

===== /usr/local/share/asterisk/agi-bin/send_call_notification.phpcli
switch($argv[3]) {
	//Softare 1
	case 1:
	        $mail->AddAddress(User1);
	        break;
	//Softwares 2,3
	case 2:
	case 3:
	        $mail->AddAddress(User2);
	        $mail->AddAddress(User1);
	        break;
	//Personal msg
	//BUG: Why does User2 also receive this e-mail?
	case 4:
	        $mail->AddAddress(User1);
	        break;
	//Any other subject
	case 9:
	        $mail->AddAddress(User3);
	        $mail->AddAddress(User2);
	        $mail->AddAddress(User1);
	        break;
}
===== Even when user selects extension 4, e-mail is sent to User1 and
User2!        
To: user2 at acme.com, user1 at acme.com
Subject: [Personal msg for User1] Call from John Doe (555-1234)
===========================================

Any idea why this is?

Thanks for any hint.




More information about the asterisk-users mailing list