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

Ishfaq Malik ish at pack-net.co.uk
Wed Jun 24 07:21:11 CDT 2009


It is a php problem

you need to put a break in your case 2

	case 2:break;
	case 3:
	        $mail->AddAddress(User2);
	        $mail->AddAddress(User1);
	        break;

Ish


Danny Nicholas wrote:
> First of all, this is a PHP problem, not an asterisk one.  That being said,
> could the empty case 2: be causing the problem?  Have you run the php from a
> command line to see what happens (php send_call_notification.phpcli 3)?
>
> -----Original Message-----
> From: asterisk-users-bounces at lists.digium.com
> [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Vincent
> Sent: Tuesday, June 23, 2009 9:50 AM
> To: asterisk-users at lists.digium.com
> Subject: [asterisk-users] [extensions.conf] Any idea why not working as
> itshould?
>
> 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.
>
>
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users
>
>
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users
>
>   

-- 
Ishfaq Malik
Software Developer
PackNet Ltd

Office:   0161 660 3062



More information about the asterisk-users mailing list