ASR_BASE

Change-Id: Icf3719cc0afe3eeb3edc7fa80a2eb5199ca9dda1
diff --git a/target/linux/mmp/base-files/sbin/run_ims.sh b/target/linux/mmp/base-files/sbin/run_ims.sh
new file mode 100755
index 0000000..95288f7
--- /dev/null
+++ b/target/linux/mmp/base-files/sbin/run_ims.sh
@@ -0,0 +1,40 @@
+#!/bin/sh
+#
+# run IMS on spesific APN
+# CID7 must be free for MO PDP used by IMS
+# If IMS use MT PDP on ccinet4 instead wsetup script must be called before
+#
+
+APN=$1
+CID=7
+
+## check AT channel
+status=`serial_atcmd "AT" | grep OK`
+if [ -z "$status" ]; then
+		echo "AT CHANNEL ERROR"
+		exit 1
+fi
+
+status=`serial_atcmd "AT+CGPIAF=0,0,0,0" | grep OK`
+if [ -z "$status" ]; then
+		echo "AT CHANNEL ERROR"
+		exit 1
+fi
+
+if [ -n "$APN" ]; then
+	## configure IMS APN
+	status=`serial_atcmd "AT*IMSCFG=KEY_IMS_PDP_APN,$APN" | grep OK`
+	if [ -z "$status" ]; then
+			echo "AT CHANNEL ERROR"
+			exit 1
+	fi
+fi
+
+ifup wan6$CID
+
+## enable IMS
+status=`serial_atcmd "AT*IMSCFG=KEY_IMS_SUPPORT,true" | grep OK`
+if [ -z "$status" ]; then
+		echo "AT CHANNEL ERROR"
+		exit 1
+fi