Client's SIP packet when server WaitExten()

david_x
Joined: Sat 18 of Oct, 2008

Client's SIP packet when server WaitExten()

Posted:Sat 18 of Oct, 2008 (07:09 UTC)
Hi, all. I'm a newbie in asterisk.

I wrote simple AEL script like following. It's for connecting both parties after dialing A and B.
But it doesn't work for me at all. And I don't know what I must do on the client. Only registering and inviting are OK.
When asterisk do WaitExten(), clicking any key occurs error.


globals {
	SYSTEMSTATUS = 0;
	partya = 0;
	partyb = 0;
}

context default {
	999 => {
		Playback(please enter phone number to dial A);
		jump s@callcenter;
	}
}

context callcenter {
	s => {
		WaitExten();
	}
	_X! => {
		switch (${SYSTEMSTATUS}) {
			case 0: // initial status
				partya = ${EXTEN};
				SYSTEMSTATUS = 1;
				Playback(please enter phone number to dial B);
				WaitExten();
				break;
			case 1:
				partyb = ${EXTEN};
				// dail A
				Dial(Phone/${partya}, 15);
				if (${DIALSTATUS}=ANSWER) {
					Dial(Phone/${partyb}, 15);
					if (${DIALSTATUS}=ANSWER) {
						Playback(tt-ok);
					} else {
						Playback(can not dial B);
						Hangup();
					}
				} else {
					Playback(can not dial A);
					Hangup();
				}
		}
	}
}


Thanks for any reply.

David.