Implement ticket #336: custom presence status in NOTIFY/PUBLISH, supporting subset of RPID elements

git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@1424 74dad513-b988-da41-8d7b-12977e46ad98
diff --git a/build.symbian/bld.inf b/build.symbian/bld.inf
index 76ef118..9514688 100644
--- a/build.symbian/bld.inf
+++ b/build.symbian/bld.inf
@@ -1,11 +1,11 @@
 prj_platforms
 winscw
 //armv5
-//gcce
+gcce
 
 prj_mmpfiles
 pjlib.mmp
-pjlib_test.mmp
+//pjlib_test.mmp
 pjlib_util.mmp
 pjnath.mmp
 pjsdp.mmp
diff --git a/build.symbian/pjsip_simple.mmp b/build.symbian/pjsip_simple.mmp
index fafbf85..86822c6 100644
--- a/build.symbian/pjsip_simple.mmp
+++ b/build.symbian/pjsip_simple.mmp
@@ -41,6 +41,7 @@
 SOURCE	presence.c
 SOURCE	presence_body.c
 SOURCE	publishc.c
+SOURCE	rpid.c
 SOURCE	xpidf.c
 
 SYSTEMINCLUDE	..\pjlib\include 
diff --git a/build.symbian/pjsip_simpleU.def b/build.symbian/pjsip_simpleU.def
index c3548cf..7e41793 100644
--- a/build.symbian/pjsip_simpleU.def
+++ b/build.symbian/pjsip_simpleU.def
@@ -28,66 +28,69 @@
 	pjpidf_tuple_set_id                      @ 27 NONAME
 	pjpidf_tuple_set_timestamp               @ 28 NONAME
 	pjpidf_tuple_set_timestamp_np            @ 29 NONAME
-	pjsip_allow_events_hdr_create            @ 30 NONAME
-	pjsip_event_hdr_create                   @ 31 NONAME
-	pjsip_evsub_accept                       @ 32 NONAME
-	pjsip_evsub_create_uac                   @ 33 NONAME
-	pjsip_evsub_create_uas                   @ 34 NONAME
-	pjsip_evsub_current_notify               @ 35 NONAME
-	pjsip_evsub_get_allow_events_hdr         @ 36 NONAME
-	pjsip_evsub_get_mod_data                 @ 37 NONAME
-	pjsip_evsub_get_state                    @ 38 NONAME
-	pjsip_evsub_get_state_name               @ 39 NONAME
-	pjsip_evsub_init_module                  @ 40 NONAME
-	pjsip_evsub_init_parser                  @ 41 NONAME
-	pjsip_evsub_initiate                     @ 42 NONAME
-	pjsip_evsub_instance                     @ 43 NONAME
-	pjsip_evsub_notify                       @ 44 NONAME
-	pjsip_evsub_register_pkg                 @ 45 NONAME
-	pjsip_evsub_send_request                 @ 46 NONAME
-	pjsip_evsub_set_mod_data                 @ 47 NONAME
-	pjsip_evsub_terminate                    @ 48 NONAME
-	pjsip_get_notify_method                  @ 49 NONAME
-	pjsip_get_subscribe_method               @ 50 NONAME
-	pjsip_iscomposing_create_body            @ 51 NONAME
-	pjsip_iscomposing_create_xml             @ 52 NONAME
-	pjsip_iscomposing_parse                  @ 53 NONAME
-	pjsip_notify_method                      @ 54 NONAME
-	pjsip_pres_accept                        @ 55 NONAME
-	pjsip_pres_create_pidf                   @ 56 NONAME
-	pjsip_pres_create_uac                    @ 57 NONAME
-	pjsip_pres_create_uas                    @ 58 NONAME
-	pjsip_pres_create_xpidf                  @ 59 NONAME
-	pjsip_pres_current_notify                @ 60 NONAME
-	pjsip_pres_get_status                    @ 61 NONAME
-	pjsip_pres_init_module                   @ 62 NONAME
-	pjsip_pres_initiate                      @ 63 NONAME
-	pjsip_pres_instance                      @ 64 NONAME
-	pjsip_pres_notify                        @ 65 NONAME
-	pjsip_pres_parse_pidf                    @ 66 NONAME
-	pjsip_pres_parse_xpidf                   @ 67 NONAME
-	pjsip_pres_send_request                  @ 68 NONAME
-	pjsip_pres_set_status                    @ 69 NONAME
-	pjsip_pres_terminate                     @ 70 NONAME
-	pjsip_publishc_create                    @ 71 NONAME
-	pjsip_publishc_destroy                   @ 72 NONAME
-	pjsip_publishc_get_pool                  @ 73 NONAME
-	pjsip_publishc_init                      @ 74 NONAME
-	pjsip_publishc_init_module               @ 75 NONAME
-	pjsip_publishc_publish                   @ 76 NONAME
-	pjsip_publishc_send                      @ 77 NONAME
-	pjsip_publishc_set_credentials           @ 78 NONAME
-	pjsip_publishc_set_route_set             @ 79 NONAME
-	pjsip_publishc_unpublish                 @ 80 NONAME
-	pjsip_publishc_update_expires            @ 81 NONAME
-	pjsip_sub_state_hdr_create               @ 82 NONAME
-	pjsip_subscribe_method                   @ 83 NONAME
-	pjsip_tsx_get_evsub                      @ 84 NONAME
-	pjsipsimple_strerror                     @ 85 NONAME
-	pjxpidf_create                           @ 86 NONAME
-	pjxpidf_get_status                       @ 87 NONAME
-	pjxpidf_get_uri                          @ 88 NONAME
-	pjxpidf_parse                            @ 89 NONAME
-	pjxpidf_print                            @ 90 NONAME
-	pjxpidf_set_status                       @ 91 NONAME
-	pjxpidf_set_uri                          @ 92 NONAME
+	pjrpid_add_element                       @ 30 NONAME
+	pjrpid_element_dup                       @ 31 NONAME
+	pjrpid_get_element                       @ 32 NONAME
+	pjsip_allow_events_hdr_create            @ 33 NONAME
+	pjsip_event_hdr_create                   @ 34 NONAME
+	pjsip_evsub_accept                       @ 35 NONAME
+	pjsip_evsub_create_uac                   @ 36 NONAME
+	pjsip_evsub_create_uas                   @ 37 NONAME
+	pjsip_evsub_current_notify               @ 38 NONAME
+	pjsip_evsub_get_allow_events_hdr         @ 39 NONAME
+	pjsip_evsub_get_mod_data                 @ 40 NONAME
+	pjsip_evsub_get_state                    @ 41 NONAME
+	pjsip_evsub_get_state_name               @ 42 NONAME
+	pjsip_evsub_init_module                  @ 43 NONAME
+	pjsip_evsub_init_parser                  @ 44 NONAME
+	pjsip_evsub_initiate                     @ 45 NONAME
+	pjsip_evsub_instance                     @ 46 NONAME
+	pjsip_evsub_notify                       @ 47 NONAME
+	pjsip_evsub_register_pkg                 @ 48 NONAME
+	pjsip_evsub_send_request                 @ 49 NONAME
+	pjsip_evsub_set_mod_data                 @ 50 NONAME
+	pjsip_evsub_terminate                    @ 51 NONAME
+	pjsip_get_notify_method                  @ 52 NONAME
+	pjsip_get_subscribe_method               @ 53 NONAME
+	pjsip_iscomposing_create_body            @ 54 NONAME
+	pjsip_iscomposing_create_xml             @ 55 NONAME
+	pjsip_iscomposing_parse                  @ 56 NONAME
+	pjsip_notify_method                      @ 57 NONAME
+	pjsip_pres_accept                        @ 58 NONAME
+	pjsip_pres_create_pidf                   @ 59 NONAME
+	pjsip_pres_create_uac                    @ 60 NONAME
+	pjsip_pres_create_uas                    @ 61 NONAME
+	pjsip_pres_create_xpidf                  @ 62 NONAME
+	pjsip_pres_current_notify                @ 63 NONAME
+	pjsip_pres_get_status                    @ 64 NONAME
+	pjsip_pres_init_module                   @ 65 NONAME
+	pjsip_pres_initiate                      @ 66 NONAME
+	pjsip_pres_instance                      @ 67 NONAME
+	pjsip_pres_notify                        @ 68 NONAME
+	pjsip_pres_parse_pidf                    @ 69 NONAME
+	pjsip_pres_parse_xpidf                   @ 70 NONAME
+	pjsip_pres_send_request                  @ 71 NONAME
+	pjsip_pres_set_status                    @ 72 NONAME
+	pjsip_pres_terminate                     @ 73 NONAME
+	pjsip_publishc_create                    @ 74 NONAME
+	pjsip_publishc_destroy                   @ 75 NONAME
+	pjsip_publishc_get_pool                  @ 76 NONAME
+	pjsip_publishc_init                      @ 77 NONAME
+	pjsip_publishc_init_module               @ 78 NONAME
+	pjsip_publishc_publish                   @ 79 NONAME
+	pjsip_publishc_send                      @ 80 NONAME
+	pjsip_publishc_set_credentials           @ 81 NONAME
+	pjsip_publishc_set_route_set             @ 82 NONAME
+	pjsip_publishc_unpublish                 @ 83 NONAME
+	pjsip_publishc_update_expires            @ 84 NONAME
+	pjsip_sub_state_hdr_create               @ 85 NONAME
+	pjsip_subscribe_method                   @ 86 NONAME
+	pjsip_tsx_get_evsub                      @ 87 NONAME
+	pjsipsimple_strerror                     @ 88 NONAME
+	pjxpidf_create                           @ 89 NONAME
+	pjxpidf_get_status                       @ 90 NONAME
+	pjxpidf_get_uri                          @ 91 NONAME
+	pjxpidf_parse                            @ 92 NONAME
+	pjxpidf_print                            @ 93 NONAME
+	pjxpidf_set_status                       @ 94 NONAME
+	pjxpidf_set_uri                          @ 95 NONAME
diff --git a/build.symbian/pjsua_libU.def b/build.symbian/pjsua_libU.def
index be8569d..2769d65 100644
--- a/build.symbian/pjsua_libU.def
+++ b/build.symbian/pjsua_libU.def
@@ -17,98 +17,99 @@
 	pjsua_acc_modify                         @ 16 NONAME
 	pjsua_acc_set_default                    @ 17 NONAME
 	pjsua_acc_set_online_status              @ 18 NONAME
-	pjsua_acc_set_registration               @ 19 NONAME
-	pjsua_acc_set_transport                  @ 20 NONAME
-	pjsua_buddy_add                          @ 21 NONAME
-	pjsua_buddy_config_default               @ 22 NONAME
-	pjsua_buddy_del                          @ 23 NONAME
-	pjsua_buddy_get_info                     @ 24 NONAME
-	pjsua_buddy_is_valid                     @ 25 NONAME
-	pjsua_buddy_subscribe_pres               @ 26 NONAME
-	pjsua_call_answer                        @ 27 NONAME
-	pjsua_call_dial_dtmf                     @ 28 NONAME
-	pjsua_call_dump                          @ 29 NONAME
-	pjsua_call_get_conf_port                 @ 30 NONAME
-	pjsua_call_get_count                     @ 31 NONAME
-	pjsua_call_get_info                      @ 32 NONAME
-	pjsua_call_get_max_count                 @ 33 NONAME
-	pjsua_call_get_user_data                 @ 34 NONAME
-	pjsua_call_hangup                        @ 35 NONAME
-	pjsua_call_hangup_all                    @ 36 NONAME
-	pjsua_call_has_media                     @ 37 NONAME
-	pjsua_call_is_active                     @ 38 NONAME
-	pjsua_call_make_call                     @ 39 NONAME
-	pjsua_call_reinvite                      @ 40 NONAME
-	pjsua_call_send_im                       @ 41 NONAME
-	pjsua_call_send_typing_ind               @ 42 NONAME
-	pjsua_call_set_hold                      @ 43 NONAME
-	pjsua_call_set_user_data                 @ 44 NONAME
-	pjsua_call_xfer                          @ 45 NONAME
-	pjsua_call_xfer_replaces                 @ 46 NONAME
-	pjsua_codec_get_param                    @ 47 NONAME
-	pjsua_codec_set_param                    @ 48 NONAME
-	pjsua_codec_set_priority                 @ 49 NONAME
-	pjsua_conf_add_port                      @ 50 NONAME
-	pjsua_conf_adjust_rx_level               @ 51 NONAME
-	pjsua_conf_adjust_tx_level               @ 52 NONAME
-	pjsua_conf_connect                       @ 53 NONAME
-	pjsua_conf_disconnect                    @ 54 NONAME
-	pjsua_conf_get_active_ports              @ 55 NONAME
-	pjsua_conf_get_max_ports                 @ 56 NONAME
-	pjsua_conf_get_port_info                 @ 57 NONAME
-	pjsua_conf_get_signal_level              @ 58 NONAME
-	pjsua_conf_remove_port                   @ 59 NONAME
-	pjsua_config_default                     @ 60 NONAME
-	pjsua_config_dup                         @ 61 NONAME
-	pjsua_create                             @ 62 NONAME
-	pjsua_destroy                            @ 63 NONAME
-	pjsua_dump                               @ 64 NONAME
-	pjsua_enum_accs                          @ 65 NONAME
-	pjsua_enum_buddies                       @ 66 NONAME
-	pjsua_enum_calls                         @ 67 NONAME
-	pjsua_enum_codecs                        @ 68 NONAME
-	pjsua_enum_conf_ports                    @ 69 NONAME
-	pjsua_enum_snd_devs                      @ 70 NONAME
-	pjsua_enum_transports                    @ 71 NONAME
-	pjsua_get_buddy_count                    @ 72 NONAME
-	pjsua_get_ec_tail                        @ 73 NONAME
-	pjsua_get_pjmedia_endpt                  @ 74 NONAME
-	pjsua_get_pjsip_endpt                    @ 75 NONAME
-	pjsua_get_pool_factory                   @ 76 NONAME
-	pjsua_get_snd_dev                        @ 77 NONAME
-	pjsua_handle_events                      @ 78 NONAME
-	pjsua_im_send                            @ 79 NONAME
-	pjsua_im_typing                          @ 80 NONAME
-	pjsua_init                               @ 81 NONAME
-	pjsua_logging_config_default             @ 82 NONAME
-	pjsua_logging_config_dup                 @ 83 NONAME
-	pjsua_media_config_default               @ 84 NONAME
-	pjsua_media_transports_create            @ 85 NONAME
-	pjsua_msg_data_init                      @ 86 NONAME
-	pjsua_perror                             @ 87 NONAME
-	pjsua_player_create                      @ 88 NONAME
-	pjsua_player_destroy                     @ 89 NONAME
-	pjsua_player_get_conf_port               @ 90 NONAME
-	pjsua_player_get_port                    @ 91 NONAME
-	pjsua_player_set_pos                     @ 92 NONAME
-	pjsua_playlist_create                    @ 93 NONAME
-	pjsua_pool_create                        @ 94 NONAME
-	pjsua_pres_dump                          @ 95 NONAME
-	pjsua_reconfigure_logging                @ 96 NONAME
-	pjsua_recorder_create                    @ 97 NONAME
-	pjsua_recorder_destroy                   @ 98 NONAME
-	pjsua_recorder_get_conf_port             @ 99 NONAME
-	pjsua_recorder_get_port                  @ 100 NONAME
-	pjsua_set_ec                             @ 101 NONAME
-	pjsua_set_no_snd_dev                     @ 102 NONAME
-	pjsua_set_null_snd_dev                   @ 103 NONAME
-	pjsua_set_snd_dev                        @ 104 NONAME
-	pjsua_start                              @ 105 NONAME
-	pjsua_transport_close                    @ 106 NONAME
-	pjsua_transport_config_default           @ 107 NONAME
-	pjsua_transport_config_dup               @ 108 NONAME
-	pjsua_transport_create                   @ 109 NONAME
-	pjsua_transport_get_info                 @ 110 NONAME
-	pjsua_transport_register                 @ 111 NONAME
-	pjsua_transport_set_enable               @ 112 NONAME
-	pjsua_verify_sip_url                     @ 113 NONAME
+	pjsua_acc_set_online_status2             @ 19 NONAME
+	pjsua_acc_set_registration               @ 20 NONAME
+	pjsua_acc_set_transport                  @ 21 NONAME
+	pjsua_buddy_add                          @ 22 NONAME
+	pjsua_buddy_config_default               @ 23 NONAME
+	pjsua_buddy_del                          @ 24 NONAME
+	pjsua_buddy_get_info                     @ 25 NONAME
+	pjsua_buddy_is_valid                     @ 26 NONAME
+	pjsua_buddy_subscribe_pres               @ 27 NONAME
+	pjsua_call_answer                        @ 28 NONAME
+	pjsua_call_dial_dtmf                     @ 29 NONAME
+	pjsua_call_dump                          @ 30 NONAME
+	pjsua_call_get_conf_port                 @ 31 NONAME
+	pjsua_call_get_count                     @ 32 NONAME
+	pjsua_call_get_info                      @ 33 NONAME
+	pjsua_call_get_max_count                 @ 34 NONAME
+	pjsua_call_get_user_data                 @ 35 NONAME
+	pjsua_call_hangup                        @ 36 NONAME
+	pjsua_call_hangup_all                    @ 37 NONAME
+	pjsua_call_has_media                     @ 38 NONAME
+	pjsua_call_is_active                     @ 39 NONAME
+	pjsua_call_make_call                     @ 40 NONAME
+	pjsua_call_reinvite                      @ 41 NONAME
+	pjsua_call_send_im                       @ 42 NONAME
+	pjsua_call_send_typing_ind               @ 43 NONAME
+	pjsua_call_set_hold                      @ 44 NONAME
+	pjsua_call_set_user_data                 @ 45 NONAME
+	pjsua_call_xfer                          @ 46 NONAME
+	pjsua_call_xfer_replaces                 @ 47 NONAME
+	pjsua_codec_get_param                    @ 48 NONAME
+	pjsua_codec_set_param                    @ 49 NONAME
+	pjsua_codec_set_priority                 @ 50 NONAME
+	pjsua_conf_add_port                      @ 51 NONAME
+	pjsua_conf_adjust_rx_level               @ 52 NONAME
+	pjsua_conf_adjust_tx_level               @ 53 NONAME
+	pjsua_conf_connect                       @ 54 NONAME
+	pjsua_conf_disconnect                    @ 55 NONAME
+	pjsua_conf_get_active_ports              @ 56 NONAME
+	pjsua_conf_get_max_ports                 @ 57 NONAME
+	pjsua_conf_get_port_info                 @ 58 NONAME
+	pjsua_conf_get_signal_level              @ 59 NONAME
+	pjsua_conf_remove_port                   @ 60 NONAME
+	pjsua_config_default                     @ 61 NONAME
+	pjsua_config_dup                         @ 62 NONAME
+	pjsua_create                             @ 63 NONAME
+	pjsua_destroy                            @ 64 NONAME
+	pjsua_dump                               @ 65 NONAME
+	pjsua_enum_accs                          @ 66 NONAME
+	pjsua_enum_buddies                       @ 67 NONAME
+	pjsua_enum_calls                         @ 68 NONAME
+	pjsua_enum_codecs                        @ 69 NONAME
+	pjsua_enum_conf_ports                    @ 70 NONAME
+	pjsua_enum_snd_devs                      @ 71 NONAME
+	pjsua_enum_transports                    @ 72 NONAME
+	pjsua_get_buddy_count                    @ 73 NONAME
+	pjsua_get_ec_tail                        @ 74 NONAME
+	pjsua_get_pjmedia_endpt                  @ 75 NONAME
+	pjsua_get_pjsip_endpt                    @ 76 NONAME
+	pjsua_get_pool_factory                   @ 77 NONAME
+	pjsua_get_snd_dev                        @ 78 NONAME
+	pjsua_handle_events                      @ 79 NONAME
+	pjsua_im_send                            @ 80 NONAME
+	pjsua_im_typing                          @ 81 NONAME
+	pjsua_init                               @ 82 NONAME
+	pjsua_logging_config_default             @ 83 NONAME
+	pjsua_logging_config_dup                 @ 84 NONAME
+	pjsua_media_config_default               @ 85 NONAME
+	pjsua_media_transports_create            @ 86 NONAME
+	pjsua_msg_data_init                      @ 87 NONAME
+	pjsua_perror                             @ 88 NONAME
+	pjsua_player_create                      @ 89 NONAME
+	pjsua_player_destroy                     @ 90 NONAME
+	pjsua_player_get_conf_port               @ 91 NONAME
+	pjsua_player_get_port                    @ 92 NONAME
+	pjsua_player_set_pos                     @ 93 NONAME
+	pjsua_playlist_create                    @ 94 NONAME
+	pjsua_pool_create                        @ 95 NONAME
+	pjsua_pres_dump                          @ 96 NONAME
+	pjsua_reconfigure_logging                @ 97 NONAME
+	pjsua_recorder_create                    @ 98 NONAME
+	pjsua_recorder_destroy                   @ 99 NONAME
+	pjsua_recorder_get_conf_port             @ 100 NONAME
+	pjsua_recorder_get_port                  @ 101 NONAME
+	pjsua_set_ec                             @ 102 NONAME
+	pjsua_set_no_snd_dev                     @ 103 NONAME
+	pjsua_set_null_snd_dev                   @ 104 NONAME
+	pjsua_set_snd_dev                        @ 105 NONAME
+	pjsua_start                              @ 106 NONAME
+	pjsua_transport_close                    @ 107 NONAME
+	pjsua_transport_config_default           @ 108 NONAME
+	pjsua_transport_config_dup               @ 109 NONAME
+	pjsua_transport_create                   @ 110 NONAME
+	pjsua_transport_get_info                 @ 111 NONAME
+	pjsua_transport_register                 @ 112 NONAME
+	pjsua_transport_set_enable               @ 113 NONAME
+	pjsua_verify_sip_url                     @ 114 NONAME
diff --git a/pjsip-apps/src/pjsua/pjsua_app.c b/pjsip-apps/src/pjsua/pjsua_app.c
index 9947e1a..c338159 100644
--- a/pjsip-apps/src/pjsua/pjsua_app.c
+++ b/pjsip-apps/src/pjsua/pjsua_app.c
@@ -1820,8 +1820,10 @@
 	    if (pjsua_buddy_get_info(ids[i], &info) != PJ_SUCCESS)
 		continue;
 
-	    printf(" [%2d] <%7s>  %.*s\n", 
-		    ids[i]+1, info.status_text.ptr, 
+	    printf(" [%2d] <%.*s>  %.*s\n", 
+		    ids[i]+1, 
+		    (int)info.status_text.slen,
+		    info.status_text.ptr, 
 		    (int)info.uri.slen,
 		    info.uri.ptr);
 	}
@@ -1857,8 +1859,9 @@
 
     printf(" %c[%2d] %.*s: %s\n", (acc_id==current_acc?'*':' '),
 	   acc_id,  (int)info.acc_uri.slen, info.acc_uri.ptr, buf);
-    printf("       Online status: %s\n", 
-	   (info.online_status ? "Online" : "Invisible"));
+    printf("       Online status: %.*s\n", 
+	(int)info.online_status_text.slen,
+	info.online_status_text.ptr);
 }
 
 
@@ -1887,11 +1890,11 @@
     puts("|                              |                          |                   |");
     puts("|  m  Make new call            | +b  Add new buddy       .| +a  Add new accnt |");
     puts("|  M  Make multiple calls      | -b  Delete buddy         | -a  Delete accnt. |");
-    puts("|  a  Answer call              | !b  Modify buddy         | !a  Modify accnt. |");
-    puts("|  h  Hangup call  (ha=all)    |  i  Send IM              | rr  (Re-)register |");
-    puts("|  H  Hold call                |  s  Subscribe presence   | ru  Unregister    |");
-    puts("|  v  re-inVite (release hold) |  u  Unsubscribe presence |  >  Cycle next ac.|");
-    puts("|  ]  Select next dialog       |  t  ToGgle Online status |  <  Cycle prev ac.|");
+    puts("|  a  Answer call              |  i  Send IM              | !a  Modify accnt. |");
+    puts("|  h  Hangup call  (ha=all)    |  s  Subscribe presence   | rr  (Re-)register |");
+    puts("|  H  Hold call                |  u  Unsubscribe presence | ru  Unregister    |");
+    puts("|  v  re-inVite (release hold) |  t  ToGgle Online status |  >  Cycle next ac.|");
+    puts("|  ]  Select next dialog       |  T  Set online status    |  <  Cycle prev ac.|");
     puts("|  [  Select previous dialog   +--------------------------+-------------------+");
     puts("|  x  Xfer call                |      Media Commands:     |  Status & Config: |");
     puts("|  X  Xfer with Replaces       |                          |                   |");
@@ -2092,6 +2095,85 @@
 
 
 /*
+ * Change extended online status.
+ */
+static void change_online_status(void)
+{
+    char menuin[32];
+    pj_bool_t online_status;
+    pjrpid_element elem;
+    int i, choice;
+
+    enum {
+	AVAILABLE, BUSY, OTP, IDLE, AWAY, BRB, OFFLINE, OPT_MAX
+    };
+
+    struct opt {
+	int id;
+	char *name;
+    } opts[] = {
+	{ AVAILABLE, "Available" },
+	{ BUSY, "Busy"},
+	{ OTP, "On the phone"},
+	{ IDLE, "Idle"},
+	{ AWAY, "Away"},
+	{ BRB, "Be right back"},
+	{ OFFLINE, "Offline"}
+    };
+
+    printf("\n"
+	   "Choices:\n");
+    for (i=0; i<PJ_ARRAY_SIZE(opts); ++i) {
+	printf("  %d  %s\n", opts[i].id+1, opts[i].name);
+    }
+
+    if (!simple_input("Select status", menuin, sizeof(menuin)))
+	return;
+
+    choice = atoi(menuin) - 1;
+    if (choice < 0 || choice >= OPT_MAX) {
+	puts("Invalid selection");
+	return;
+    }
+
+    pj_bzero(&elem, sizeof(elem));
+    elem.type = PJRPID_ELEMENT_TYPE_PERSON;
+
+    online_status = PJ_TRUE;
+
+    switch (choice) {
+    case AVAILABLE:
+	break;
+    case BUSY:
+	elem.activity = PJRPID_ACTIVITY_BUSY;
+	elem.note = pj_str("Busy");
+	break;
+    case OTP:
+	elem.activity = PJRPID_ACTIVITY_BUSY;
+	elem.note = pj_str("On the phone");
+	break;
+    case IDLE:
+	elem.activity = PJRPID_ACTIVITY_UNKNOWN;
+	elem.note = pj_str("Idle");
+	break;
+    case AWAY:
+	elem.activity = PJRPID_ACTIVITY_AWAY;
+	elem.note = pj_str("Away");
+	break;
+    case BRB:
+	elem.activity = PJRPID_ACTIVITY_UNKNOWN;
+	elem.note = pj_str("Be right back");
+	break;
+    case OFFLINE:
+	online_status = PJ_FALSE;
+	break;
+    }
+
+    pjsua_acc_set_online_status2(current_acc, online_status, &elem);
+}
+
+
+/*
  * Main "user interface" loop.
  */
 void console_app_main(const pj_str_t *uri_to_call)
@@ -2802,6 +2884,10 @@
 		   (acc_info.online_status?"online":"offline"));
 	    break;
 
+	case 'T':
+	    change_online_status();
+	    break;
+
 	case 'c':
 	    switch (menuin[1]) {
 	    case 'l':
diff --git a/pjsip/build/Makefile b/pjsip/build/Makefile
index a9b242c..849b2c3 100644
--- a/pjsip/build/Makefile
+++ b/pjsip/build/Makefile
@@ -62,7 +62,7 @@
 export PJSIP_SIMPLE_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \
 			errno.o evsub.o evsub_msg.o iscomposing.o \
 			pidf.o presence.o presence_body.o publishc.o \
-			xpidf.o
+			rpid.o xpidf.o
 export PJSIP_SIMPLE_CFLAGS += $(_CFLAGS)
 
 
diff --git a/pjsip/build/pjsip_simple.dsp b/pjsip/build/pjsip_simple.dsp
index 64cb98a..82554d7 100644
--- a/pjsip/build/pjsip_simple.dsp
+++ b/pjsip/build/pjsip_simple.dsp
@@ -40,6 +40,7 @@
 # PROP Output_Dir "./output/pjsip-simple-i386-win32-vc6-release"

 # PROP Intermediate_Dir "./output/pjsip-simple-i386-win32-vc6-release"

 # PROP Target_Dir ""

+F90=df.exe

 # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c

 # ADD CPP /nologo /MD /W4 /GX /Zi /O2 /I "../include" /I "../../pjlib-util/include" /I "../../pjlib/include" /D "NDEBUG" /D PJ_WIN32=1 /D PJ_M_I386=1 /D "WIN32" /D "_MBCS" /D "_LIB" /YX /FD /c

 # ADD BASE RSC /l 0x409 /d "NDEBUG"

@@ -63,6 +64,7 @@
 # PROP Output_Dir "./output/pjsip-simple-i386-win32-vc6-debug"

 # PROP Intermediate_Dir "./output/pjsip-simple-i386-win32-vc6-debug"

 # PROP Target_Dir ""

+F90=df.exe

 # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c

 # ADD CPP /nologo /MTd /W4 /Gm /GX /ZI /Od /I "../include" /I "../../pjlib-util/include" /I "../../pjlib/include" /D "_DEBUG" /D PJ_WIN32=1 /D PJ_M_I386=1 /D "WIN32" /D "_MBCS" /D "_LIB" /FR /YX /FD /GZ /c

 # ADD BASE RSC /l 0x409 /d "_DEBUG"

@@ -117,6 +119,10 @@
 # End Source File

 # Begin Source File

 

+SOURCE="..\src\pjsip-simple\rpid.c"

+# End Source File

+# Begin Source File

+

 SOURCE="..\src\pjsip-simple\xpidf.c"

 # End Source File

 # End Group

@@ -157,6 +163,10 @@
 # End Source File

 # Begin Source File

 

+SOURCE="..\include\pjsip-simple\rpid.h"

+# End Source File

+# Begin Source File

+

 SOURCE="..\include\pjsip-simple\types.h"

 # End Source File

 # Begin Source File

diff --git a/pjsip/build/pjsip_simple.vcproj b/pjsip/build/pjsip_simple.vcproj
index 3beea61..4ea6328 100644
--- a/pjsip/build/pjsip_simple.vcproj
+++ b/pjsip/build/pjsip_simple.vcproj
@@ -350,6 +350,10 @@
 				</FileConfiguration>

 			</File>

 			<File

+				RelativePath="..\src\pjsip-simple\rpid.c"

+				>

+			</File>

+			<File

 				RelativePath="..\src\pjsip-simple\xpidf.c"

 				>

 				<FileConfiguration

@@ -409,6 +413,10 @@
 				>

 			</File>

 			<File

+				RelativePath="..\include\pjsip-simple\rpid.h"

+				>

+			</File>

+			<File

 				RelativePath="..\include\pjsip-simple\types.h"

 				>

 			</File>

diff --git a/pjsip/build/wince-evc4/pjsip_simple_wince.vcp b/pjsip/build/wince-evc4/pjsip_simple_wince.vcp
index b093383..1e37e1c 100644
--- a/pjsip/build/wince-evc4/pjsip_simple_wince.vcp
+++ b/pjsip/build/wince-evc4/pjsip_simple_wince.vcp
@@ -365,8 +365,12 @@
 	"..\..\..\pjlib\include\pj\array.h"\
 	"..\..\..\pjlib\include\pj\assert.h"\
 	"..\..\..\pjlib\include\pj\compat\assert.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_armcc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_codew.h"\
 	"..\..\..\pjlib\include\pj\compat\cc_gcc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_gcce.h"\
 	"..\..\..\pjlib\include\pj\compat\cc_msvc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\
 	"..\..\..\pjlib\include\pj\compat\ctype.h"\
 	"..\..\..\pjlib\include\pj\compat\errno.h"\
 	"..\..\..\pjlib\include\pj\compat\high_precision.h"\
@@ -378,10 +382,12 @@
 	"..\..\..\pjlib\include\pj\compat\os_palmos.h"\
 	"..\..\..\pjlib\include\pj\compat\os_rtems.h"\
 	"..\..\..\pjlib\include\pj\compat\os_sunos.h"\
+	"..\..\..\pjlib\include\pj\compat\os_symbian.h"\
 	"..\..\..\pjlib\include\pj\compat\os_win32.h"\
 	"..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\
 	"..\..\..\pjlib\include\pj\compat\setjmp.h"\
 	"..\..\..\pjlib\include\pj\compat\size_t.h"\
+	"..\..\..\pjlib\include\pj\compat\stdarg.h"\
 	"..\..\..\pjlib\include\pj\compat\string.h"\
 	"..\..\..\pjlib\include\pj\config.h"\
 	"..\..\..\pjlib\include\pj\config_site.h"\
@@ -395,6 +401,7 @@
 	"..\..\..\pjlib\include\pj\guid.h"\
 	"..\..\..\pjlib\include\pj\hash.h"\
 	"..\..\..\pjlib\include\pj\ioqueue.h"\
+	"..\..\..\pjlib\include\pj\ip_helper.h"\
 	"..\..\..\pjlib\include\pj\list.h"\
 	"..\..\..\pjlib\include\pj\list_i.h"\
 	"..\..\..\pjlib\include\pj\lock.h"\
@@ -402,6 +409,7 @@
 	"..\..\..\pjlib\include\pj\os.h"\
 	"..\..\..\pjlib\include\pj\pool.h"\
 	"..\..\..\pjlib\include\pj\pool_alt.h"\
+	"..\..\..\pjlib\include\pj\pool_buf.h"\
 	"..\..\..\pjlib\include\pj\pool_i.h"\
 	"..\..\..\pjlib\include\pj\rand.h"\
 	"..\..\..\pjlib\include\pj\rbtree.h"\
@@ -819,15 +827,23 @@
 !ELSEIF  "$(CFG)" == "pjsip_simple_wince - Win32 (WCE emulator) Debug"
 
 DEP_CPP_EVSUB=\
+	"..\..\..\pjlib-util\include\pjlib-util\config.h"\
+	"..\..\..\pjlib-util\include\pjlib-util\dns.h"\
+	"..\..\..\pjlib-util\include\pjlib-util\resolver.h"\
 	"..\..\..\pjlib-util\include\pjlib-util\scanner.h"\
 	"..\..\..\pjlib-util\include\pjlib-util\scanner_cis_bitwise.h"\
 	"..\..\..\pjlib-util\include\pjlib-util\scanner_cis_uint.h"\
+	"..\..\..\pjlib-util\include\pjlib-util\types.h"\
 	"..\..\..\pjlib\include\pj\addr_resolv.h"\
 	"..\..\..\pjlib\include\pj\array.h"\
 	"..\..\..\pjlib\include\pj\assert.h"\
 	"..\..\..\pjlib\include\pj\compat\assert.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_armcc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_codew.h"\
 	"..\..\..\pjlib\include\pj\compat\cc_gcc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_gcce.h"\
 	"..\..\..\pjlib\include\pj\compat\cc_msvc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\
 	"..\..\..\pjlib\include\pj\compat\ctype.h"\
 	"..\..\..\pjlib\include\pj\compat\errno.h"\
 	"..\..\..\pjlib\include\pj\compat\high_precision.h"\
@@ -839,10 +855,12 @@
 	"..\..\..\pjlib\include\pj\compat\os_palmos.h"\
 	"..\..\..\pjlib\include\pj\compat\os_rtems.h"\
 	"..\..\..\pjlib\include\pj\compat\os_sunos.h"\
+	"..\..\..\pjlib\include\pj\compat\os_symbian.h"\
 	"..\..\..\pjlib\include\pj\compat\os_win32.h"\
 	"..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\
 	"..\..\..\pjlib\include\pj\compat\setjmp.h"\
 	"..\..\..\pjlib\include\pj\compat\size_t.h"\
+	"..\..\..\pjlib\include\pj\compat\stdarg.h"\
 	"..\..\..\pjlib\include\pj\compat\string.h"\
 	"..\..\..\pjlib\include\pj\config.h"\
 	"..\..\..\pjlib\include\pj\config_site.h"\
@@ -856,6 +874,7 @@
 	"..\..\..\pjlib\include\pj\guid.h"\
 	"..\..\..\pjlib\include\pj\hash.h"\
 	"..\..\..\pjlib\include\pj\ioqueue.h"\
+	"..\..\..\pjlib\include\pj\ip_helper.h"\
 	"..\..\..\pjlib\include\pj\list.h"\
 	"..\..\..\pjlib\include\pj\list_i.h"\
 	"..\..\..\pjlib\include\pj\lock.h"\
@@ -863,6 +882,7 @@
 	"..\..\..\pjlib\include\pj\os.h"\
 	"..\..\..\pjlib\include\pj\pool.h"\
 	"..\..\..\pjlib\include\pj\pool_alt.h"\
+	"..\..\..\pjlib\include\pj\pool_buf.h"\
 	"..\..\..\pjlib\include\pj\pool_i.h"\
 	"..\..\..\pjlib\include\pj\rand.h"\
 	"..\..\..\pjlib\include\pj\rbtree.h"\
@@ -880,6 +900,7 @@
 	"..\..\include\pjsip-simple\types.h"\
 	"..\..\include\pjsip\sip_auth.h"\
 	"..\..\include\pjsip\sip_auth_msg.h"\
+	"..\..\include\pjsip\sip_autoconf.h"\
 	"..\..\include\pjsip\sip_config.h"\
 	"..\..\include\pjsip\sip_dialog.h"\
 	"..\..\include\pjsip\sip_endpoint.h"\
@@ -1501,15 +1522,21 @@
 !ELSEIF  "$(CFG)" == "pjsip_simple_wince - Win32 (WCE emulator) Debug"
 
 DEP_CPP_EVSUB_=\
+	"..\..\..\pjlib-util\include\pjlib-util\config.h"\
 	"..\..\..\pjlib-util\include\pjlib-util\scanner.h"\
 	"..\..\..\pjlib-util\include\pjlib-util\scanner_cis_bitwise.h"\
 	"..\..\..\pjlib-util\include\pjlib-util\scanner_cis_uint.h"\
+	"..\..\..\pjlib-util\include\pjlib-util\types.h"\
 	"..\..\..\pjlib\include\pj\addr_resolv.h"\
 	"..\..\..\pjlib\include\pj\array.h"\
 	"..\..\..\pjlib\include\pj\assert.h"\
 	"..\..\..\pjlib\include\pj\compat\assert.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_armcc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_codew.h"\
 	"..\..\..\pjlib\include\pj\compat\cc_gcc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_gcce.h"\
 	"..\..\..\pjlib\include\pj\compat\cc_msvc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\
 	"..\..\..\pjlib\include\pj\compat\ctype.h"\
 	"..\..\..\pjlib\include\pj\compat\errno.h"\
 	"..\..\..\pjlib\include\pj\compat\high_precision.h"\
@@ -1521,10 +1548,12 @@
 	"..\..\..\pjlib\include\pj\compat\os_palmos.h"\
 	"..\..\..\pjlib\include\pj\compat\os_rtems.h"\
 	"..\..\..\pjlib\include\pj\compat\os_sunos.h"\
+	"..\..\..\pjlib\include\pj\compat\os_symbian.h"\
 	"..\..\..\pjlib\include\pj\compat\os_win32.h"\
 	"..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\
 	"..\..\..\pjlib\include\pj\compat\setjmp.h"\
 	"..\..\..\pjlib\include\pj\compat\size_t.h"\
+	"..\..\..\pjlib\include\pj\compat\stdarg.h"\
 	"..\..\..\pjlib\include\pj\compat\string.h"\
 	"..\..\..\pjlib\include\pj\config.h"\
 	"..\..\..\pjlib\include\pj\config_site.h"\
@@ -1538,6 +1567,7 @@
 	"..\..\..\pjlib\include\pj\guid.h"\
 	"..\..\..\pjlib\include\pj\hash.h"\
 	"..\..\..\pjlib\include\pj\ioqueue.h"\
+	"..\..\..\pjlib\include\pj\ip_helper.h"\
 	"..\..\..\pjlib\include\pj\list.h"\
 	"..\..\..\pjlib\include\pj\list_i.h"\
 	"..\..\..\pjlib\include\pj\lock.h"\
@@ -1545,6 +1575,7 @@
 	"..\..\..\pjlib\include\pj\os.h"\
 	"..\..\..\pjlib\include\pj\pool.h"\
 	"..\..\..\pjlib\include\pj\pool_alt.h"\
+	"..\..\..\pjlib\include\pj\pool_buf.h"\
 	"..\..\..\pjlib\include\pj\pool_i.h"\
 	"..\..\..\pjlib\include\pj\rand.h"\
 	"..\..\..\pjlib\include\pj\rbtree.h"\
@@ -1558,6 +1589,7 @@
 	"..\..\..\pjlib\include\pjlib.h"\
 	"..\..\include\pjsip-simple\evsub_msg.h"\
 	"..\..\include\pjsip\print_util.h"\
+	"..\..\include\pjsip\sip_autoconf.h"\
 	"..\..\include\pjsip\sip_config.h"\
 	"..\..\include\pjsip\sip_msg.h"\
 	"..\..\include\pjsip\sip_parser.h"\
@@ -2013,17 +2045,23 @@
 !ELSEIF  "$(CFG)" == "pjsip_simple_wince - Win32 (WCE emulator) Debug"
 
 DEP_CPP_ISCOM=\
+	"..\..\..\pjlib-util\include\pjlib-util\config.h"\
 	"..\..\..\pjlib-util\include\pjlib-util\errno.h"\
 	"..\..\..\pjlib-util\include\pjlib-util\scanner.h"\
 	"..\..\..\pjlib-util\include\pjlib-util\scanner_cis_bitwise.h"\
 	"..\..\..\pjlib-util\include\pjlib-util\scanner_cis_uint.h"\
+	"..\..\..\pjlib-util\include\pjlib-util\types.h"\
 	"..\..\..\pjlib-util\include\pjlib-util\xml.h"\
 	"..\..\..\pjlib\include\pj\addr_resolv.h"\
 	"..\..\..\pjlib\include\pj\array.h"\
 	"..\..\..\pjlib\include\pj\assert.h"\
 	"..\..\..\pjlib\include\pj\compat\assert.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_armcc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_codew.h"\
 	"..\..\..\pjlib\include\pj\compat\cc_gcc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_gcce.h"\
 	"..\..\..\pjlib\include\pj\compat\cc_msvc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\
 	"..\..\..\pjlib\include\pj\compat\ctype.h"\
 	"..\..\..\pjlib\include\pj\compat\errno.h"\
 	"..\..\..\pjlib\include\pj\compat\high_precision.h"\
@@ -2035,10 +2073,12 @@
 	"..\..\..\pjlib\include\pj\compat\os_palmos.h"\
 	"..\..\..\pjlib\include\pj\compat\os_rtems.h"\
 	"..\..\..\pjlib\include\pj\compat\os_sunos.h"\
+	"..\..\..\pjlib\include\pj\compat\os_symbian.h"\
 	"..\..\..\pjlib\include\pj\compat\os_win32.h"\
 	"..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\
 	"..\..\..\pjlib\include\pj\compat\setjmp.h"\
 	"..\..\..\pjlib\include\pj\compat\size_t.h"\
+	"..\..\..\pjlib\include\pj\compat\stdarg.h"\
 	"..\..\..\pjlib\include\pj\compat\string.h"\
 	"..\..\..\pjlib\include\pj\config.h"\
 	"..\..\..\pjlib\include\pj\config_site.h"\
@@ -2052,6 +2092,7 @@
 	"..\..\..\pjlib\include\pj\guid.h"\
 	"..\..\..\pjlib\include\pj\hash.h"\
 	"..\..\..\pjlib\include\pj\ioqueue.h"\
+	"..\..\..\pjlib\include\pj\ip_helper.h"\
 	"..\..\..\pjlib\include\pj\list.h"\
 	"..\..\..\pjlib\include\pj\list_i.h"\
 	"..\..\..\pjlib\include\pj\lock.h"\
@@ -2059,6 +2100,7 @@
 	"..\..\..\pjlib\include\pj\os.h"\
 	"..\..\..\pjlib\include\pj\pool.h"\
 	"..\..\..\pjlib\include\pj\pool_alt.h"\
+	"..\..\..\pjlib\include\pj\pool_buf.h"\
 	"..\..\..\pjlib\include\pj\pool_i.h"\
 	"..\..\..\pjlib\include\pj\rand.h"\
 	"..\..\..\pjlib\include\pj\rbtree.h"\
@@ -2073,6 +2115,7 @@
 	"..\..\include\pjsip-simple\errno.h"\
 	"..\..\include\pjsip-simple\iscomposing.h"\
 	"..\..\include\pjsip-simple\types.h"\
+	"..\..\include\pjsip\sip_autoconf.h"\
 	"..\..\include\pjsip\sip_config.h"\
 	"..\..\include\pjsip\sip_errno.h"\
 	"..\..\include\pjsip\sip_msg.h"\
@@ -2549,8 +2592,12 @@
 	"..\..\..\pjlib\include\pj\array.h"\
 	"..\..\..\pjlib\include\pj\assert.h"\
 	"..\..\..\pjlib\include\pj\compat\assert.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_armcc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_codew.h"\
 	"..\..\..\pjlib\include\pj\compat\cc_gcc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_gcce.h"\
 	"..\..\..\pjlib\include\pj\compat\cc_msvc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\
 	"..\..\..\pjlib\include\pj\compat\ctype.h"\
 	"..\..\..\pjlib\include\pj\compat\errno.h"\
 	"..\..\..\pjlib\include\pj\compat\high_precision.h"\
@@ -2562,10 +2609,12 @@
 	"..\..\..\pjlib\include\pj\compat\os_palmos.h"\
 	"..\..\..\pjlib\include\pj\compat\os_rtems.h"\
 	"..\..\..\pjlib\include\pj\compat\os_sunos.h"\
+	"..\..\..\pjlib\include\pj\compat\os_symbian.h"\
 	"..\..\..\pjlib\include\pj\compat\os_win32.h"\
 	"..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\
 	"..\..\..\pjlib\include\pj\compat\setjmp.h"\
 	"..\..\..\pjlib\include\pj\compat\size_t.h"\
+	"..\..\..\pjlib\include\pj\compat\stdarg.h"\
 	"..\..\..\pjlib\include\pj\compat\string.h"\
 	"..\..\..\pjlib\include\pj\config.h"\
 	"..\..\..\pjlib\include\pj\config_site.h"\
@@ -2579,6 +2628,7 @@
 	"..\..\..\pjlib\include\pj\guid.h"\
 	"..\..\..\pjlib\include\pj\hash.h"\
 	"..\..\..\pjlib\include\pj\ioqueue.h"\
+	"..\..\..\pjlib\include\pj\ip_helper.h"\
 	"..\..\..\pjlib\include\pj\list.h"\
 	"..\..\..\pjlib\include\pj\list_i.h"\
 	"..\..\..\pjlib\include\pj\lock.h"\
@@ -2586,6 +2636,7 @@
 	"..\..\..\pjlib\include\pj\os.h"\
 	"..\..\..\pjlib\include\pj\pool.h"\
 	"..\..\..\pjlib\include\pj\pool_alt.h"\
+	"..\..\..\pjlib\include\pj\pool_buf.h"\
 	"..\..\..\pjlib\include\pj\pool_i.h"\
 	"..\..\..\pjlib\include\pj\rand.h"\
 	"..\..\..\pjlib\include\pj\rbtree.h"\
@@ -2599,6 +2650,7 @@
 	"..\..\..\pjlib\include\pjlib.h"\
 	"..\..\include\pjsip-simple\pidf.h"\
 	"..\..\include\pjsip-simple\types.h"\
+	"..\..\include\pjsip\sip_autoconf.h"\
 	"..\..\include\pjsip\sip_config.h"\
 	"..\..\include\pjsip\sip_types.h"\
 	
@@ -3030,16 +3082,24 @@
 !ELSEIF  "$(CFG)" == "pjsip_simple_wince - Win32 (WCE emulator) Debug"
 
 DEP_CPP_PRESE=\
+	"..\..\..\pjlib-util\include\pjlib-util\config.h"\
+	"..\..\..\pjlib-util\include\pjlib-util\dns.h"\
+	"..\..\..\pjlib-util\include\pjlib-util\resolver.h"\
 	"..\..\..\pjlib-util\include\pjlib-util\scanner.h"\
 	"..\..\..\pjlib-util\include\pjlib-util\scanner_cis_bitwise.h"\
 	"..\..\..\pjlib-util\include\pjlib-util\scanner_cis_uint.h"\
+	"..\..\..\pjlib-util\include\pjlib-util\types.h"\
 	"..\..\..\pjlib-util\include\pjlib-util\xml.h"\
 	"..\..\..\pjlib\include\pj\addr_resolv.h"\
 	"..\..\..\pjlib\include\pj\array.h"\
 	"..\..\..\pjlib\include\pj\assert.h"\
 	"..\..\..\pjlib\include\pj\compat\assert.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_armcc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_codew.h"\
 	"..\..\..\pjlib\include\pj\compat\cc_gcc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_gcce.h"\
 	"..\..\..\pjlib\include\pj\compat\cc_msvc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\
 	"..\..\..\pjlib\include\pj\compat\ctype.h"\
 	"..\..\..\pjlib\include\pj\compat\errno.h"\
 	"..\..\..\pjlib\include\pj\compat\high_precision.h"\
@@ -3051,10 +3111,12 @@
 	"..\..\..\pjlib\include\pj\compat\os_palmos.h"\
 	"..\..\..\pjlib\include\pj\compat\os_rtems.h"\
 	"..\..\..\pjlib\include\pj\compat\os_sunos.h"\
+	"..\..\..\pjlib\include\pj\compat\os_symbian.h"\
 	"..\..\..\pjlib\include\pj\compat\os_win32.h"\
 	"..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\
 	"..\..\..\pjlib\include\pj\compat\setjmp.h"\
 	"..\..\..\pjlib\include\pj\compat\size_t.h"\
+	"..\..\..\pjlib\include\pj\compat\stdarg.h"\
 	"..\..\..\pjlib\include\pj\compat\string.h"\
 	"..\..\..\pjlib\include\pj\config.h"\
 	"..\..\..\pjlib\include\pj\config_site.h"\
@@ -3068,6 +3130,7 @@
 	"..\..\..\pjlib\include\pj\guid.h"\
 	"..\..\..\pjlib\include\pj\hash.h"\
 	"..\..\..\pjlib\include\pj\ioqueue.h"\
+	"..\..\..\pjlib\include\pj\ip_helper.h"\
 	"..\..\..\pjlib\include\pj\list.h"\
 	"..\..\..\pjlib\include\pj\list_i.h"\
 	"..\..\..\pjlib\include\pj\lock.h"\
@@ -3075,6 +3138,7 @@
 	"..\..\..\pjlib\include\pj\os.h"\
 	"..\..\..\pjlib\include\pj\pool.h"\
 	"..\..\..\pjlib\include\pj\pool_alt.h"\
+	"..\..\..\pjlib\include\pj\pool_buf.h"\
 	"..\..\..\pjlib\include\pj\pool_i.h"\
 	"..\..\..\pjlib\include\pj\rand.h"\
 	"..\..\..\pjlib\include\pj\rbtree.h"\
@@ -3091,10 +3155,12 @@
 	"..\..\include\pjsip-simple\evsub_msg.h"\
 	"..\..\include\pjsip-simple\pidf.h"\
 	"..\..\include\pjsip-simple\presence.h"\
+	"..\..\include\pjsip-simple\rpid.h"\
 	"..\..\include\pjsip-simple\types.h"\
 	"..\..\include\pjsip-simple\xpidf.h"\
 	"..\..\include\pjsip\sip_auth.h"\
 	"..\..\include\pjsip\sip_auth_msg.h"\
+	"..\..\include\pjsip\sip_autoconf.h"\
 	"..\..\include\pjsip\sip_config.h"\
 	"..\..\include\pjsip\sip_dialog.h"\
 	"..\..\include\pjsip\sip_endpoint.h"\
@@ -3749,16 +3815,22 @@
 !ELSEIF  "$(CFG)" == "pjsip_simple_wince - Win32 (WCE emulator) Debug"
 
 DEP_CPP_PRESEN=\
+	"..\..\..\pjlib-util\include\pjlib-util\config.h"\
 	"..\..\..\pjlib-util\include\pjlib-util\scanner.h"\
 	"..\..\..\pjlib-util\include\pjlib-util\scanner_cis_bitwise.h"\
 	"..\..\..\pjlib-util\include\pjlib-util\scanner_cis_uint.h"\
+	"..\..\..\pjlib-util\include\pjlib-util\types.h"\
 	"..\..\..\pjlib-util\include\pjlib-util\xml.h"\
 	"..\..\..\pjlib\include\pj\addr_resolv.h"\
 	"..\..\..\pjlib\include\pj\array.h"\
 	"..\..\..\pjlib\include\pj\assert.h"\
 	"..\..\..\pjlib\include\pj\compat\assert.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_armcc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_codew.h"\
 	"..\..\..\pjlib\include\pj\compat\cc_gcc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_gcce.h"\
 	"..\..\..\pjlib\include\pj\compat\cc_msvc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\
 	"..\..\..\pjlib\include\pj\compat\ctype.h"\
 	"..\..\..\pjlib\include\pj\compat\errno.h"\
 	"..\..\..\pjlib\include\pj\compat\high_precision.h"\
@@ -3770,10 +3842,12 @@
 	"..\..\..\pjlib\include\pj\compat\os_palmos.h"\
 	"..\..\..\pjlib\include\pj\compat\os_rtems.h"\
 	"..\..\..\pjlib\include\pj\compat\os_sunos.h"\
+	"..\..\..\pjlib\include\pj\compat\os_symbian.h"\
 	"..\..\..\pjlib\include\pj\compat\os_win32.h"\
 	"..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\
 	"..\..\..\pjlib\include\pj\compat\setjmp.h"\
 	"..\..\..\pjlib\include\pj\compat\size_t.h"\
+	"..\..\..\pjlib\include\pj\compat\stdarg.h"\
 	"..\..\..\pjlib\include\pj\compat\string.h"\
 	"..\..\..\pjlib\include\pj\config.h"\
 	"..\..\..\pjlib\include\pj\config_site.h"\
@@ -3787,6 +3861,7 @@
 	"..\..\..\pjlib\include\pj\guid.h"\
 	"..\..\..\pjlib\include\pj\hash.h"\
 	"..\..\..\pjlib\include\pj\ioqueue.h"\
+	"..\..\..\pjlib\include\pj\ip_helper.h"\
 	"..\..\..\pjlib\include\pj\list.h"\
 	"..\..\..\pjlib\include\pj\list_i.h"\
 	"..\..\..\pjlib\include\pj\lock.h"\
@@ -3794,6 +3869,7 @@
 	"..\..\..\pjlib\include\pj\os.h"\
 	"..\..\..\pjlib\include\pj\pool.h"\
 	"..\..\..\pjlib\include\pj\pool_alt.h"\
+	"..\..\..\pjlib\include\pj\pool_buf.h"\
 	"..\..\..\pjlib\include\pj\pool_i.h"\
 	"..\..\..\pjlib\include\pj\rand.h"\
 	"..\..\..\pjlib\include\pj\rbtree.h"\
@@ -3809,8 +3885,10 @@
 	"..\..\include\pjsip-simple\evsub.h"\
 	"..\..\include\pjsip-simple\pidf.h"\
 	"..\..\include\pjsip-simple\presence.h"\
+	"..\..\include\pjsip-simple\rpid.h"\
 	"..\..\include\pjsip-simple\types.h"\
 	"..\..\include\pjsip-simple\xpidf.h"\
+	"..\..\include\pjsip\sip_autoconf.h"\
 	"..\..\include\pjsip\sip_config.h"\
 	"..\..\include\pjsip\sip_errno.h"\
 	"..\..\include\pjsip\sip_msg.h"\
@@ -4497,15 +4575,23 @@
 !ELSEIF  "$(CFG)" == "pjsip_simple_wince - Win32 (WCE emulator) Debug"
 
 DEP_CPP_PUBLI=\
+	"..\..\..\pjlib-util\include\pjlib-util\config.h"\
+	"..\..\..\pjlib-util\include\pjlib-util\dns.h"\
+	"..\..\..\pjlib-util\include\pjlib-util\resolver.h"\
 	"..\..\..\pjlib-util\include\pjlib-util\scanner.h"\
 	"..\..\..\pjlib-util\include\pjlib-util\scanner_cis_bitwise.h"\
 	"..\..\..\pjlib-util\include\pjlib-util\scanner_cis_uint.h"\
+	"..\..\..\pjlib-util\include\pjlib-util\types.h"\
 	"..\..\..\pjlib\include\pj\addr_resolv.h"\
 	"..\..\..\pjlib\include\pj\array.h"\
 	"..\..\..\pjlib\include\pj\assert.h"\
 	"..\..\..\pjlib\include\pj\compat\assert.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_armcc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_codew.h"\
 	"..\..\..\pjlib\include\pj\compat\cc_gcc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_gcce.h"\
 	"..\..\..\pjlib\include\pj\compat\cc_msvc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\
 	"..\..\..\pjlib\include\pj\compat\ctype.h"\
 	"..\..\..\pjlib\include\pj\compat\errno.h"\
 	"..\..\..\pjlib\include\pj\compat\high_precision.h"\
@@ -4517,10 +4603,12 @@
 	"..\..\..\pjlib\include\pj\compat\os_palmos.h"\
 	"..\..\..\pjlib\include\pj\compat\os_rtems.h"\
 	"..\..\..\pjlib\include\pj\compat\os_sunos.h"\
+	"..\..\..\pjlib\include\pj\compat\os_symbian.h"\
 	"..\..\..\pjlib\include\pj\compat\os_win32.h"\
 	"..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\
 	"..\..\..\pjlib\include\pj\compat\setjmp.h"\
 	"..\..\..\pjlib\include\pj\compat\size_t.h"\
+	"..\..\..\pjlib\include\pj\compat\stdarg.h"\
 	"..\..\..\pjlib\include\pj\compat\string.h"\
 	"..\..\..\pjlib\include\pj\config.h"\
 	"..\..\..\pjlib\include\pj\config_site.h"\
@@ -4534,6 +4622,7 @@
 	"..\..\..\pjlib\include\pj\guid.h"\
 	"..\..\..\pjlib\include\pj\hash.h"\
 	"..\..\..\pjlib\include\pj\ioqueue.h"\
+	"..\..\..\pjlib\include\pj\ip_helper.h"\
 	"..\..\..\pjlib\include\pj\list.h"\
 	"..\..\..\pjlib\include\pj\list_i.h"\
 	"..\..\..\pjlib\include\pj\lock.h"\
@@ -4541,6 +4630,7 @@
 	"..\..\..\pjlib\include\pj\os.h"\
 	"..\..\..\pjlib\include\pj\pool.h"\
 	"..\..\..\pjlib\include\pj\pool_alt.h"\
+	"..\..\..\pjlib\include\pj\pool_buf.h"\
 	"..\..\..\pjlib\include\pj\pool_i.h"\
 	"..\..\..\pjlib\include\pj\rand.h"\
 	"..\..\..\pjlib\include\pj\rbtree.h"\
@@ -4555,6 +4645,7 @@
 	"..\..\include\pjsip-simple\publish.h"\
 	"..\..\include\pjsip\sip_auth.h"\
 	"..\..\include\pjsip\sip_auth_msg.h"\
+	"..\..\include\pjsip\sip_autoconf.h"\
 	"..\..\include\pjsip\sip_config.h"\
 	"..\..\include\pjsip\sip_endpoint.h"\
 	"..\..\include\pjsip\sip_errno.h"\
@@ -5174,6 +5265,753 @@
 # End Source File
 # Begin Source File
 
+SOURCE="..\..\src\pjsip-simple\rpid.c"
+
+!IF  "$(CFG)" == "pjsip_simple_wince - Win32 (WCE emulator) Release"
+
+DEP_CPP_RPID_=\
+	"..\..\..\pjlib-util\include\pjlib-util\xml.h"\
+	"..\..\..\pjlib\include\pj\addr_resolv.h"\
+	"..\..\..\pjlib\include\pj\array.h"\
+	"..\..\..\pjlib\include\pj\assert.h"\
+	"..\..\..\pjlib\include\pj\compat\assert.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_armcc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_codew.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_gcc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_gcce.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_msvc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\
+	"..\..\..\pjlib\include\pj\compat\ctype.h"\
+	"..\..\..\pjlib\include\pj\compat\errno.h"\
+	"..\..\..\pjlib\include\pj\compat\high_precision.h"\
+	"..\..\..\pjlib\include\pj\compat\m_auto.h"\
+	"..\..\..\pjlib\include\pj\compat\os_auto.h"\
+	"..\..\..\pjlib\include\pj\compat\os_darwinos.h"\
+	"..\..\..\pjlib\include\pj\compat\os_linux.h"\
+	"..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\
+	"..\..\..\pjlib\include\pj\compat\os_palmos.h"\
+	"..\..\..\pjlib\include\pj\compat\os_rtems.h"\
+	"..\..\..\pjlib\include\pj\compat\os_sunos.h"\
+	"..\..\..\pjlib\include\pj\compat\os_symbian.h"\
+	"..\..\..\pjlib\include\pj\compat\os_win32.h"\
+	"..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\
+	"..\..\..\pjlib\include\pj\compat\setjmp.h"\
+	"..\..\..\pjlib\include\pj\compat\size_t.h"\
+	"..\..\..\pjlib\include\pj\compat\stdarg.h"\
+	"..\..\..\pjlib\include\pj\compat\string.h"\
+	"..\..\..\pjlib\include\pj\config.h"\
+	"..\..\..\pjlib\include\pj\config_site.h"\
+	"..\..\..\pjlib\include\pj\config_site_sample.h"\
+	"..\..\..\pjlib\include\pj\ctype.h"\
+	"..\..\..\pjlib\include\pj\errno.h"\
+	"..\..\..\pjlib\include\pj\except.h"\
+	"..\..\..\pjlib\include\pj\fifobuf.h"\
+	"..\..\..\pjlib\include\pj\file_access.h"\
+	"..\..\..\pjlib\include\pj\file_io.h"\
+	"..\..\..\pjlib\include\pj\guid.h"\
+	"..\..\..\pjlib\include\pj\hash.h"\
+	"..\..\..\pjlib\include\pj\ioqueue.h"\
+	"..\..\..\pjlib\include\pj\ip_helper.h"\
+	"..\..\..\pjlib\include\pj\list.h"\
+	"..\..\..\pjlib\include\pj\list_i.h"\
+	"..\..\..\pjlib\include\pj\lock.h"\
+	"..\..\..\pjlib\include\pj\log.h"\
+	"..\..\..\pjlib\include\pj\os.h"\
+	"..\..\..\pjlib\include\pj\pool.h"\
+	"..\..\..\pjlib\include\pj\pool_alt.h"\
+	"..\..\..\pjlib\include\pj\pool_buf.h"\
+	"..\..\..\pjlib\include\pj\pool_i.h"\
+	"..\..\..\pjlib\include\pj\rand.h"\
+	"..\..\..\pjlib\include\pj\rbtree.h"\
+	"..\..\..\pjlib\include\pj\sock.h"\
+	"..\..\..\pjlib\include\pj\sock_select.h"\
+	"..\..\..\pjlib\include\pj\string.h"\
+	"..\..\..\pjlib\include\pj\string_i.h"\
+	"..\..\..\pjlib\include\pj\timer.h"\
+	"..\..\..\pjlib\include\pj\types.h"\
+	"..\..\..\pjlib\include\pj\unicode.h"\
+	"..\..\..\pjlib\include\pjlib.h"\
+	"..\..\include\pjsip-simple\errno.h"\
+	"..\..\include\pjsip-simple\pidf.h"\
+	"..\..\include\pjsip-simple\rpid.h"\
+	"..\..\include\pjsip-simple\types.h"\
+	"..\..\include\pjsip\sip_autoconf.h"\
+	"..\..\include\pjsip\sip_config.h"\
+	"..\..\include\pjsip\sip_errno.h"\
+	"..\..\include\pjsip\sip_types.h"\
+	
+
+!ELSEIF  "$(CFG)" == "pjsip_simple_wince - Win32 (WCE emulator) Debug"
+
+DEP_CPP_RPID_=\
+	"..\..\..\pjlib-util\include\pjlib-util\xml.h"\
+	"..\..\..\pjlib\include\pj\addr_resolv.h"\
+	"..\..\..\pjlib\include\pj\array.h"\
+	"..\..\..\pjlib\include\pj\assert.h"\
+	"..\..\..\pjlib\include\pj\compat\assert.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_armcc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_codew.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_gcc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_gcce.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_msvc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\
+	"..\..\..\pjlib\include\pj\compat\ctype.h"\
+	"..\..\..\pjlib\include\pj\compat\errno.h"\
+	"..\..\..\pjlib\include\pj\compat\high_precision.h"\
+	"..\..\..\pjlib\include\pj\compat\m_auto.h"\
+	"..\..\..\pjlib\include\pj\compat\os_auto.h"\
+	"..\..\..\pjlib\include\pj\compat\os_darwinos.h"\
+	"..\..\..\pjlib\include\pj\compat\os_linux.h"\
+	"..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\
+	"..\..\..\pjlib\include\pj\compat\os_palmos.h"\
+	"..\..\..\pjlib\include\pj\compat\os_rtems.h"\
+	"..\..\..\pjlib\include\pj\compat\os_sunos.h"\
+	"..\..\..\pjlib\include\pj\compat\os_symbian.h"\
+	"..\..\..\pjlib\include\pj\compat\os_win32.h"\
+	"..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\
+	"..\..\..\pjlib\include\pj\compat\setjmp.h"\
+	"..\..\..\pjlib\include\pj\compat\size_t.h"\
+	"..\..\..\pjlib\include\pj\compat\stdarg.h"\
+	"..\..\..\pjlib\include\pj\compat\string.h"\
+	"..\..\..\pjlib\include\pj\config.h"\
+	"..\..\..\pjlib\include\pj\config_site.h"\
+	"..\..\..\pjlib\include\pj\config_site_sample.h"\
+	"..\..\..\pjlib\include\pj\ctype.h"\
+	"..\..\..\pjlib\include\pj\errno.h"\
+	"..\..\..\pjlib\include\pj\except.h"\
+	"..\..\..\pjlib\include\pj\fifobuf.h"\
+	"..\..\..\pjlib\include\pj\file_access.h"\
+	"..\..\..\pjlib\include\pj\file_io.h"\
+	"..\..\..\pjlib\include\pj\guid.h"\
+	"..\..\..\pjlib\include\pj\hash.h"\
+	"..\..\..\pjlib\include\pj\ioqueue.h"\
+	"..\..\..\pjlib\include\pj\ip_helper.h"\
+	"..\..\..\pjlib\include\pj\list.h"\
+	"..\..\..\pjlib\include\pj\list_i.h"\
+	"..\..\..\pjlib\include\pj\lock.h"\
+	"..\..\..\pjlib\include\pj\log.h"\
+	"..\..\..\pjlib\include\pj\os.h"\
+	"..\..\..\pjlib\include\pj\pool.h"\
+	"..\..\..\pjlib\include\pj\pool_alt.h"\
+	"..\..\..\pjlib\include\pj\pool_buf.h"\
+	"..\..\..\pjlib\include\pj\pool_i.h"\
+	"..\..\..\pjlib\include\pj\rand.h"\
+	"..\..\..\pjlib\include\pj\rbtree.h"\
+	"..\..\..\pjlib\include\pj\sock.h"\
+	"..\..\..\pjlib\include\pj\sock_select.h"\
+	"..\..\..\pjlib\include\pj\string.h"\
+	"..\..\..\pjlib\include\pj\string_i.h"\
+	"..\..\..\pjlib\include\pj\timer.h"\
+	"..\..\..\pjlib\include\pj\types.h"\
+	"..\..\..\pjlib\include\pj\unicode.h"\
+	"..\..\..\pjlib\include\pjlib.h"\
+	"..\..\include\pjsip-simple\errno.h"\
+	"..\..\include\pjsip-simple\pidf.h"\
+	"..\..\include\pjsip-simple\rpid.h"\
+	"..\..\include\pjsip-simple\types.h"\
+	"..\..\include\pjsip\sip_autoconf.h"\
+	"..\..\include\pjsip\sip_config.h"\
+	"..\..\include\pjsip\sip_errno.h"\
+	"..\..\include\pjsip\sip_types.h"\
+	
+
+!ELSEIF  "$(CFG)" == "pjsip_simple_wince - Win32 (WCE ARMV4I) Release"
+
+DEP_CPP_RPID_=\
+	"..\..\..\pjlib-util\include\pjlib-util\xml.h"\
+	"..\..\..\pjlib\include\pj\addr_resolv.h"\
+	"..\..\..\pjlib\include\pj\array.h"\
+	"..\..\..\pjlib\include\pj\assert.h"\
+	"..\..\..\pjlib\include\pj\compat\assert.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_armcc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_codew.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_gcc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_gcce.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_msvc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\
+	"..\..\..\pjlib\include\pj\compat\ctype.h"\
+	"..\..\..\pjlib\include\pj\compat\errno.h"\
+	"..\..\..\pjlib\include\pj\compat\high_precision.h"\
+	"..\..\..\pjlib\include\pj\compat\m_auto.h"\
+	"..\..\..\pjlib\include\pj\compat\os_auto.h"\
+	"..\..\..\pjlib\include\pj\compat\os_darwinos.h"\
+	"..\..\..\pjlib\include\pj\compat\os_linux.h"\
+	"..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\
+	"..\..\..\pjlib\include\pj\compat\os_palmos.h"\
+	"..\..\..\pjlib\include\pj\compat\os_rtems.h"\
+	"..\..\..\pjlib\include\pj\compat\os_sunos.h"\
+	"..\..\..\pjlib\include\pj\compat\os_symbian.h"\
+	"..\..\..\pjlib\include\pj\compat\os_win32.h"\
+	"..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\
+	"..\..\..\pjlib\include\pj\compat\setjmp.h"\
+	"..\..\..\pjlib\include\pj\compat\size_t.h"\
+	"..\..\..\pjlib\include\pj\compat\stdarg.h"\
+	"..\..\..\pjlib\include\pj\compat\string.h"\
+	"..\..\..\pjlib\include\pj\config.h"\
+	"..\..\..\pjlib\include\pj\config_site.h"\
+	"..\..\..\pjlib\include\pj\config_site_sample.h"\
+	"..\..\..\pjlib\include\pj\ctype.h"\
+	"..\..\..\pjlib\include\pj\errno.h"\
+	"..\..\..\pjlib\include\pj\except.h"\
+	"..\..\..\pjlib\include\pj\fifobuf.h"\
+	"..\..\..\pjlib\include\pj\file_access.h"\
+	"..\..\..\pjlib\include\pj\file_io.h"\
+	"..\..\..\pjlib\include\pj\guid.h"\
+	"..\..\..\pjlib\include\pj\hash.h"\
+	"..\..\..\pjlib\include\pj\ioqueue.h"\
+	"..\..\..\pjlib\include\pj\ip_helper.h"\
+	"..\..\..\pjlib\include\pj\list.h"\
+	"..\..\..\pjlib\include\pj\list_i.h"\
+	"..\..\..\pjlib\include\pj\lock.h"\
+	"..\..\..\pjlib\include\pj\log.h"\
+	"..\..\..\pjlib\include\pj\os.h"\
+	"..\..\..\pjlib\include\pj\pool.h"\
+	"..\..\..\pjlib\include\pj\pool_alt.h"\
+	"..\..\..\pjlib\include\pj\pool_buf.h"\
+	"..\..\..\pjlib\include\pj\pool_i.h"\
+	"..\..\..\pjlib\include\pj\rand.h"\
+	"..\..\..\pjlib\include\pj\rbtree.h"\
+	"..\..\..\pjlib\include\pj\sock.h"\
+	"..\..\..\pjlib\include\pj\sock_select.h"\
+	"..\..\..\pjlib\include\pj\string.h"\
+	"..\..\..\pjlib\include\pj\string_i.h"\
+	"..\..\..\pjlib\include\pj\timer.h"\
+	"..\..\..\pjlib\include\pj\types.h"\
+	"..\..\..\pjlib\include\pj\unicode.h"\
+	"..\..\..\pjlib\include\pjlib.h"\
+	"..\..\include\pjsip-simple\errno.h"\
+	"..\..\include\pjsip-simple\pidf.h"\
+	"..\..\include\pjsip-simple\rpid.h"\
+	"..\..\include\pjsip-simple\types.h"\
+	"..\..\include\pjsip\sip_autoconf.h"\
+	"..\..\include\pjsip\sip_config.h"\
+	"..\..\include\pjsip\sip_errno.h"\
+	"..\..\include\pjsip\sip_types.h"\
+	
+
+!ELSEIF  "$(CFG)" == "pjsip_simple_wince - Win32 (WCE ARMV4I) Debug"
+
+DEP_CPP_RPID_=\
+	"..\..\..\pjlib-util\include\pjlib-util\xml.h"\
+	"..\..\..\pjlib\include\pj\addr_resolv.h"\
+	"..\..\..\pjlib\include\pj\array.h"\
+	"..\..\..\pjlib\include\pj\assert.h"\
+	"..\..\..\pjlib\include\pj\compat\assert.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_armcc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_codew.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_gcc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_gcce.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_msvc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\
+	"..\..\..\pjlib\include\pj\compat\ctype.h"\
+	"..\..\..\pjlib\include\pj\compat\errno.h"\
+	"..\..\..\pjlib\include\pj\compat\high_precision.h"\
+	"..\..\..\pjlib\include\pj\compat\m_auto.h"\
+	"..\..\..\pjlib\include\pj\compat\os_auto.h"\
+	"..\..\..\pjlib\include\pj\compat\os_darwinos.h"\
+	"..\..\..\pjlib\include\pj\compat\os_linux.h"\
+	"..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\
+	"..\..\..\pjlib\include\pj\compat\os_palmos.h"\
+	"..\..\..\pjlib\include\pj\compat\os_rtems.h"\
+	"..\..\..\pjlib\include\pj\compat\os_sunos.h"\
+	"..\..\..\pjlib\include\pj\compat\os_symbian.h"\
+	"..\..\..\pjlib\include\pj\compat\os_win32.h"\
+	"..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\
+	"..\..\..\pjlib\include\pj\compat\setjmp.h"\
+	"..\..\..\pjlib\include\pj\compat\size_t.h"\
+	"..\..\..\pjlib\include\pj\compat\stdarg.h"\
+	"..\..\..\pjlib\include\pj\compat\string.h"\
+	"..\..\..\pjlib\include\pj\config.h"\
+	"..\..\..\pjlib\include\pj\config_site.h"\
+	"..\..\..\pjlib\include\pj\config_site_sample.h"\
+	"..\..\..\pjlib\include\pj\ctype.h"\
+	"..\..\..\pjlib\include\pj\errno.h"\
+	"..\..\..\pjlib\include\pj\except.h"\
+	"..\..\..\pjlib\include\pj\fifobuf.h"\
+	"..\..\..\pjlib\include\pj\file_access.h"\
+	"..\..\..\pjlib\include\pj\file_io.h"\
+	"..\..\..\pjlib\include\pj\guid.h"\
+	"..\..\..\pjlib\include\pj\hash.h"\
+	"..\..\..\pjlib\include\pj\ioqueue.h"\
+	"..\..\..\pjlib\include\pj\ip_helper.h"\
+	"..\..\..\pjlib\include\pj\list.h"\
+	"..\..\..\pjlib\include\pj\list_i.h"\
+	"..\..\..\pjlib\include\pj\lock.h"\
+	"..\..\..\pjlib\include\pj\log.h"\
+	"..\..\..\pjlib\include\pj\os.h"\
+	"..\..\..\pjlib\include\pj\pool.h"\
+	"..\..\..\pjlib\include\pj\pool_alt.h"\
+	"..\..\..\pjlib\include\pj\pool_buf.h"\
+	"..\..\..\pjlib\include\pj\pool_i.h"\
+	"..\..\..\pjlib\include\pj\rand.h"\
+	"..\..\..\pjlib\include\pj\rbtree.h"\
+	"..\..\..\pjlib\include\pj\sock.h"\
+	"..\..\..\pjlib\include\pj\sock_select.h"\
+	"..\..\..\pjlib\include\pj\string.h"\
+	"..\..\..\pjlib\include\pj\string_i.h"\
+	"..\..\..\pjlib\include\pj\timer.h"\
+	"..\..\..\pjlib\include\pj\types.h"\
+	"..\..\..\pjlib\include\pj\unicode.h"\
+	"..\..\..\pjlib\include\pjlib.h"\
+	"..\..\include\pjsip-simple\errno.h"\
+	"..\..\include\pjsip-simple\pidf.h"\
+	"..\..\include\pjsip-simple\rpid.h"\
+	"..\..\include\pjsip-simple\types.h"\
+	"..\..\include\pjsip\sip_autoconf.h"\
+	"..\..\include\pjsip\sip_config.h"\
+	"..\..\include\pjsip\sip_errno.h"\
+	"..\..\include\pjsip\sip_types.h"\
+	
+
+!ELSEIF  "$(CFG)" == "pjsip_simple_wince - Win32 (WCE ARMV4) Release"
+
+DEP_CPP_RPID_=\
+	"..\..\..\pjlib-util\include\pjlib-util\xml.h"\
+	"..\..\..\pjlib\include\pj\addr_resolv.h"\
+	"..\..\..\pjlib\include\pj\array.h"\
+	"..\..\..\pjlib\include\pj\assert.h"\
+	"..\..\..\pjlib\include\pj\compat\assert.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_armcc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_codew.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_gcc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_gcce.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_msvc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\
+	"..\..\..\pjlib\include\pj\compat\ctype.h"\
+	"..\..\..\pjlib\include\pj\compat\errno.h"\
+	"..\..\..\pjlib\include\pj\compat\high_precision.h"\
+	"..\..\..\pjlib\include\pj\compat\m_auto.h"\
+	"..\..\..\pjlib\include\pj\compat\os_auto.h"\
+	"..\..\..\pjlib\include\pj\compat\os_darwinos.h"\
+	"..\..\..\pjlib\include\pj\compat\os_linux.h"\
+	"..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\
+	"..\..\..\pjlib\include\pj\compat\os_palmos.h"\
+	"..\..\..\pjlib\include\pj\compat\os_rtems.h"\
+	"..\..\..\pjlib\include\pj\compat\os_sunos.h"\
+	"..\..\..\pjlib\include\pj\compat\os_symbian.h"\
+	"..\..\..\pjlib\include\pj\compat\os_win32.h"\
+	"..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\
+	"..\..\..\pjlib\include\pj\compat\setjmp.h"\
+	"..\..\..\pjlib\include\pj\compat\size_t.h"\
+	"..\..\..\pjlib\include\pj\compat\stdarg.h"\
+	"..\..\..\pjlib\include\pj\compat\string.h"\
+	"..\..\..\pjlib\include\pj\config.h"\
+	"..\..\..\pjlib\include\pj\config_site.h"\
+	"..\..\..\pjlib\include\pj\config_site_sample.h"\
+	"..\..\..\pjlib\include\pj\ctype.h"\
+	"..\..\..\pjlib\include\pj\errno.h"\
+	"..\..\..\pjlib\include\pj\except.h"\
+	"..\..\..\pjlib\include\pj\fifobuf.h"\
+	"..\..\..\pjlib\include\pj\file_access.h"\
+	"..\..\..\pjlib\include\pj\file_io.h"\
+	"..\..\..\pjlib\include\pj\guid.h"\
+	"..\..\..\pjlib\include\pj\hash.h"\
+	"..\..\..\pjlib\include\pj\ioqueue.h"\
+	"..\..\..\pjlib\include\pj\ip_helper.h"\
+	"..\..\..\pjlib\include\pj\list.h"\
+	"..\..\..\pjlib\include\pj\list_i.h"\
+	"..\..\..\pjlib\include\pj\lock.h"\
+	"..\..\..\pjlib\include\pj\log.h"\
+	"..\..\..\pjlib\include\pj\os.h"\
+	"..\..\..\pjlib\include\pj\pool.h"\
+	"..\..\..\pjlib\include\pj\pool_alt.h"\
+	"..\..\..\pjlib\include\pj\pool_buf.h"\
+	"..\..\..\pjlib\include\pj\pool_i.h"\
+	"..\..\..\pjlib\include\pj\rand.h"\
+	"..\..\..\pjlib\include\pj\rbtree.h"\
+	"..\..\..\pjlib\include\pj\sock.h"\
+	"..\..\..\pjlib\include\pj\sock_select.h"\
+	"..\..\..\pjlib\include\pj\string.h"\
+	"..\..\..\pjlib\include\pj\string_i.h"\
+	"..\..\..\pjlib\include\pj\timer.h"\
+	"..\..\..\pjlib\include\pj\types.h"\
+	"..\..\..\pjlib\include\pj\unicode.h"\
+	"..\..\..\pjlib\include\pjlib.h"\
+	"..\..\include\pjsip-simple\errno.h"\
+	"..\..\include\pjsip-simple\pidf.h"\
+	"..\..\include\pjsip-simple\rpid.h"\
+	"..\..\include\pjsip-simple\types.h"\
+	"..\..\include\pjsip\sip_autoconf.h"\
+	"..\..\include\pjsip\sip_config.h"\
+	"..\..\include\pjsip\sip_errno.h"\
+	"..\..\include\pjsip\sip_types.h"\
+	
+
+!ELSEIF  "$(CFG)" == "pjsip_simple_wince - Win32 (WCE ARMV4) Debug"
+
+DEP_CPP_RPID_=\
+	"..\..\..\pjlib-util\include\pjlib-util\xml.h"\
+	"..\..\..\pjlib\include\pj\addr_resolv.h"\
+	"..\..\..\pjlib\include\pj\array.h"\
+	"..\..\..\pjlib\include\pj\assert.h"\
+	"..\..\..\pjlib\include\pj\compat\assert.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_armcc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_codew.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_gcc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_gcce.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_msvc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\
+	"..\..\..\pjlib\include\pj\compat\ctype.h"\
+	"..\..\..\pjlib\include\pj\compat\errno.h"\
+	"..\..\..\pjlib\include\pj\compat\high_precision.h"\
+	"..\..\..\pjlib\include\pj\compat\m_auto.h"\
+	"..\..\..\pjlib\include\pj\compat\os_auto.h"\
+	"..\..\..\pjlib\include\pj\compat\os_darwinos.h"\
+	"..\..\..\pjlib\include\pj\compat\os_linux.h"\
+	"..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\
+	"..\..\..\pjlib\include\pj\compat\os_palmos.h"\
+	"..\..\..\pjlib\include\pj\compat\os_rtems.h"\
+	"..\..\..\pjlib\include\pj\compat\os_sunos.h"\
+	"..\..\..\pjlib\include\pj\compat\os_symbian.h"\
+	"..\..\..\pjlib\include\pj\compat\os_win32.h"\
+	"..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\
+	"..\..\..\pjlib\include\pj\compat\setjmp.h"\
+	"..\..\..\pjlib\include\pj\compat\size_t.h"\
+	"..\..\..\pjlib\include\pj\compat\stdarg.h"\
+	"..\..\..\pjlib\include\pj\compat\string.h"\
+	"..\..\..\pjlib\include\pj\config.h"\
+	"..\..\..\pjlib\include\pj\config_site.h"\
+	"..\..\..\pjlib\include\pj\config_site_sample.h"\
+	"..\..\..\pjlib\include\pj\ctype.h"\
+	"..\..\..\pjlib\include\pj\errno.h"\
+	"..\..\..\pjlib\include\pj\except.h"\
+	"..\..\..\pjlib\include\pj\fifobuf.h"\
+	"..\..\..\pjlib\include\pj\file_access.h"\
+	"..\..\..\pjlib\include\pj\file_io.h"\
+	"..\..\..\pjlib\include\pj\guid.h"\
+	"..\..\..\pjlib\include\pj\hash.h"\
+	"..\..\..\pjlib\include\pj\ioqueue.h"\
+	"..\..\..\pjlib\include\pj\ip_helper.h"\
+	"..\..\..\pjlib\include\pj\list.h"\
+	"..\..\..\pjlib\include\pj\list_i.h"\
+	"..\..\..\pjlib\include\pj\lock.h"\
+	"..\..\..\pjlib\include\pj\log.h"\
+	"..\..\..\pjlib\include\pj\os.h"\
+	"..\..\..\pjlib\include\pj\pool.h"\
+	"..\..\..\pjlib\include\pj\pool_alt.h"\
+	"..\..\..\pjlib\include\pj\pool_buf.h"\
+	"..\..\..\pjlib\include\pj\pool_i.h"\
+	"..\..\..\pjlib\include\pj\rand.h"\
+	"..\..\..\pjlib\include\pj\rbtree.h"\
+	"..\..\..\pjlib\include\pj\sock.h"\
+	"..\..\..\pjlib\include\pj\sock_select.h"\
+	"..\..\..\pjlib\include\pj\string.h"\
+	"..\..\..\pjlib\include\pj\string_i.h"\
+	"..\..\..\pjlib\include\pj\timer.h"\
+	"..\..\..\pjlib\include\pj\types.h"\
+	"..\..\..\pjlib\include\pj\unicode.h"\
+	"..\..\..\pjlib\include\pjlib.h"\
+	"..\..\include\pjsip-simple\errno.h"\
+	"..\..\include\pjsip-simple\pidf.h"\
+	"..\..\include\pjsip-simple\rpid.h"\
+	"..\..\include\pjsip-simple\types.h"\
+	"..\..\include\pjsip\sip_autoconf.h"\
+	"..\..\include\pjsip\sip_config.h"\
+	"..\..\include\pjsip\sip_errno.h"\
+	"..\..\include\pjsip\sip_types.h"\
+	
+
+!ELSEIF  "$(CFG)" == "pjsip_simple_wince - Win32 (WCE ARMV4T) Release"
+
+DEP_CPP_RPID_=\
+	"..\..\..\pjlib-util\include\pjlib-util\xml.h"\
+	"..\..\..\pjlib\include\pj\addr_resolv.h"\
+	"..\..\..\pjlib\include\pj\array.h"\
+	"..\..\..\pjlib\include\pj\assert.h"\
+	"..\..\..\pjlib\include\pj\compat\assert.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_armcc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_codew.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_gcc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_gcce.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_msvc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\
+	"..\..\..\pjlib\include\pj\compat\ctype.h"\
+	"..\..\..\pjlib\include\pj\compat\errno.h"\
+	"..\..\..\pjlib\include\pj\compat\high_precision.h"\
+	"..\..\..\pjlib\include\pj\compat\m_auto.h"\
+	"..\..\..\pjlib\include\pj\compat\os_auto.h"\
+	"..\..\..\pjlib\include\pj\compat\os_darwinos.h"\
+	"..\..\..\pjlib\include\pj\compat\os_linux.h"\
+	"..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\
+	"..\..\..\pjlib\include\pj\compat\os_palmos.h"\
+	"..\..\..\pjlib\include\pj\compat\os_rtems.h"\
+	"..\..\..\pjlib\include\pj\compat\os_sunos.h"\
+	"..\..\..\pjlib\include\pj\compat\os_symbian.h"\
+	"..\..\..\pjlib\include\pj\compat\os_win32.h"\
+	"..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\
+	"..\..\..\pjlib\include\pj\compat\setjmp.h"\
+	"..\..\..\pjlib\include\pj\compat\size_t.h"\
+	"..\..\..\pjlib\include\pj\compat\stdarg.h"\
+	"..\..\..\pjlib\include\pj\compat\string.h"\
+	"..\..\..\pjlib\include\pj\config.h"\
+	"..\..\..\pjlib\include\pj\config_site.h"\
+	"..\..\..\pjlib\include\pj\config_site_sample.h"\
+	"..\..\..\pjlib\include\pj\ctype.h"\
+	"..\..\..\pjlib\include\pj\errno.h"\
+	"..\..\..\pjlib\include\pj\except.h"\
+	"..\..\..\pjlib\include\pj\fifobuf.h"\
+	"..\..\..\pjlib\include\pj\file_access.h"\
+	"..\..\..\pjlib\include\pj\file_io.h"\
+	"..\..\..\pjlib\include\pj\guid.h"\
+	"..\..\..\pjlib\include\pj\hash.h"\
+	"..\..\..\pjlib\include\pj\ioqueue.h"\
+	"..\..\..\pjlib\include\pj\ip_helper.h"\
+	"..\..\..\pjlib\include\pj\list.h"\
+	"..\..\..\pjlib\include\pj\list_i.h"\
+	"..\..\..\pjlib\include\pj\lock.h"\
+	"..\..\..\pjlib\include\pj\log.h"\
+	"..\..\..\pjlib\include\pj\os.h"\
+	"..\..\..\pjlib\include\pj\pool.h"\
+	"..\..\..\pjlib\include\pj\pool_alt.h"\
+	"..\..\..\pjlib\include\pj\pool_buf.h"\
+	"..\..\..\pjlib\include\pj\pool_i.h"\
+	"..\..\..\pjlib\include\pj\rand.h"\
+	"..\..\..\pjlib\include\pj\rbtree.h"\
+	"..\..\..\pjlib\include\pj\sock.h"\
+	"..\..\..\pjlib\include\pj\sock_select.h"\
+	"..\..\..\pjlib\include\pj\string.h"\
+	"..\..\..\pjlib\include\pj\string_i.h"\
+	"..\..\..\pjlib\include\pj\timer.h"\
+	"..\..\..\pjlib\include\pj\types.h"\
+	"..\..\..\pjlib\include\pj\unicode.h"\
+	"..\..\..\pjlib\include\pjlib.h"\
+	"..\..\include\pjsip-simple\errno.h"\
+	"..\..\include\pjsip-simple\pidf.h"\
+	"..\..\include\pjsip-simple\rpid.h"\
+	"..\..\include\pjsip-simple\types.h"\
+	"..\..\include\pjsip\sip_autoconf.h"\
+	"..\..\include\pjsip\sip_config.h"\
+	"..\..\include\pjsip\sip_errno.h"\
+	"..\..\include\pjsip\sip_types.h"\
+	
+
+!ELSEIF  "$(CFG)" == "pjsip_simple_wince - Win32 (WCE ARMV4T) Debug"
+
+DEP_CPP_RPID_=\
+	"..\..\..\pjlib-util\include\pjlib-util\xml.h"\
+	"..\..\..\pjlib\include\pj\addr_resolv.h"\
+	"..\..\..\pjlib\include\pj\array.h"\
+	"..\..\..\pjlib\include\pj\assert.h"\
+	"..\..\..\pjlib\include\pj\compat\assert.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_armcc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_codew.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_gcc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_gcce.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_msvc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\
+	"..\..\..\pjlib\include\pj\compat\ctype.h"\
+	"..\..\..\pjlib\include\pj\compat\errno.h"\
+	"..\..\..\pjlib\include\pj\compat\high_precision.h"\
+	"..\..\..\pjlib\include\pj\compat\m_auto.h"\
+	"..\..\..\pjlib\include\pj\compat\os_auto.h"\
+	"..\..\..\pjlib\include\pj\compat\os_darwinos.h"\
+	"..\..\..\pjlib\include\pj\compat\os_linux.h"\
+	"..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\
+	"..\..\..\pjlib\include\pj\compat\os_palmos.h"\
+	"..\..\..\pjlib\include\pj\compat\os_rtems.h"\
+	"..\..\..\pjlib\include\pj\compat\os_sunos.h"\
+	"..\..\..\pjlib\include\pj\compat\os_symbian.h"\
+	"..\..\..\pjlib\include\pj\compat\os_win32.h"\
+	"..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\
+	"..\..\..\pjlib\include\pj\compat\setjmp.h"\
+	"..\..\..\pjlib\include\pj\compat\size_t.h"\
+	"..\..\..\pjlib\include\pj\compat\stdarg.h"\
+	"..\..\..\pjlib\include\pj\compat\string.h"\
+	"..\..\..\pjlib\include\pj\config.h"\
+	"..\..\..\pjlib\include\pj\config_site.h"\
+	"..\..\..\pjlib\include\pj\config_site_sample.h"\
+	"..\..\..\pjlib\include\pj\ctype.h"\
+	"..\..\..\pjlib\include\pj\errno.h"\
+	"..\..\..\pjlib\include\pj\except.h"\
+	"..\..\..\pjlib\include\pj\fifobuf.h"\
+	"..\..\..\pjlib\include\pj\file_access.h"\
+	"..\..\..\pjlib\include\pj\file_io.h"\
+	"..\..\..\pjlib\include\pj\guid.h"\
+	"..\..\..\pjlib\include\pj\hash.h"\
+	"..\..\..\pjlib\include\pj\ioqueue.h"\
+	"..\..\..\pjlib\include\pj\ip_helper.h"\
+	"..\..\..\pjlib\include\pj\list.h"\
+	"..\..\..\pjlib\include\pj\list_i.h"\
+	"..\..\..\pjlib\include\pj\lock.h"\
+	"..\..\..\pjlib\include\pj\log.h"\
+	"..\..\..\pjlib\include\pj\os.h"\
+	"..\..\..\pjlib\include\pj\pool.h"\
+	"..\..\..\pjlib\include\pj\pool_alt.h"\
+	"..\..\..\pjlib\include\pj\pool_buf.h"\
+	"..\..\..\pjlib\include\pj\pool_i.h"\
+	"..\..\..\pjlib\include\pj\rand.h"\
+	"..\..\..\pjlib\include\pj\rbtree.h"\
+	"..\..\..\pjlib\include\pj\sock.h"\
+	"..\..\..\pjlib\include\pj\sock_select.h"\
+	"..\..\..\pjlib\include\pj\string.h"\
+	"..\..\..\pjlib\include\pj\string_i.h"\
+	"..\..\..\pjlib\include\pj\timer.h"\
+	"..\..\..\pjlib\include\pj\types.h"\
+	"..\..\..\pjlib\include\pj\unicode.h"\
+	"..\..\..\pjlib\include\pjlib.h"\
+	"..\..\include\pjsip-simple\errno.h"\
+	"..\..\include\pjsip-simple\pidf.h"\
+	"..\..\include\pjsip-simple\rpid.h"\
+	"..\..\include\pjsip-simple\types.h"\
+	"..\..\include\pjsip\sip_autoconf.h"\
+	"..\..\include\pjsip\sip_config.h"\
+	"..\..\include\pjsip\sip_errno.h"\
+	"..\..\include\pjsip\sip_types.h"\
+	
+
+!ELSEIF  "$(CFG)" == "pjsip_simple_wince - Win32 (WCE x86) Release"
+
+DEP_CPP_RPID_=\
+	"..\..\..\pjlib-util\include\pjlib-util\xml.h"\
+	"..\..\..\pjlib\include\pj\addr_resolv.h"\
+	"..\..\..\pjlib\include\pj\array.h"\
+	"..\..\..\pjlib\include\pj\assert.h"\
+	"..\..\..\pjlib\include\pj\compat\assert.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_armcc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_codew.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_gcc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_gcce.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_msvc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\
+	"..\..\..\pjlib\include\pj\compat\ctype.h"\
+	"..\..\..\pjlib\include\pj\compat\errno.h"\
+	"..\..\..\pjlib\include\pj\compat\high_precision.h"\
+	"..\..\..\pjlib\include\pj\compat\m_auto.h"\
+	"..\..\..\pjlib\include\pj\compat\os_auto.h"\
+	"..\..\..\pjlib\include\pj\compat\os_darwinos.h"\
+	"..\..\..\pjlib\include\pj\compat\os_linux.h"\
+	"..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\
+	"..\..\..\pjlib\include\pj\compat\os_palmos.h"\
+	"..\..\..\pjlib\include\pj\compat\os_rtems.h"\
+	"..\..\..\pjlib\include\pj\compat\os_sunos.h"\
+	"..\..\..\pjlib\include\pj\compat\os_symbian.h"\
+	"..\..\..\pjlib\include\pj\compat\os_win32.h"\
+	"..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\
+	"..\..\..\pjlib\include\pj\compat\setjmp.h"\
+	"..\..\..\pjlib\include\pj\compat\size_t.h"\
+	"..\..\..\pjlib\include\pj\compat\stdarg.h"\
+	"..\..\..\pjlib\include\pj\compat\string.h"\
+	"..\..\..\pjlib\include\pj\config.h"\
+	"..\..\..\pjlib\include\pj\config_site.h"\
+	"..\..\..\pjlib\include\pj\config_site_sample.h"\
+	"..\..\..\pjlib\include\pj\ctype.h"\
+	"..\..\..\pjlib\include\pj\errno.h"\
+	"..\..\..\pjlib\include\pj\except.h"\
+	"..\..\..\pjlib\include\pj\fifobuf.h"\
+	"..\..\..\pjlib\include\pj\file_access.h"\
+	"..\..\..\pjlib\include\pj\file_io.h"\
+	"..\..\..\pjlib\include\pj\guid.h"\
+	"..\..\..\pjlib\include\pj\hash.h"\
+	"..\..\..\pjlib\include\pj\ioqueue.h"\
+	"..\..\..\pjlib\include\pj\ip_helper.h"\
+	"..\..\..\pjlib\include\pj\list.h"\
+	"..\..\..\pjlib\include\pj\list_i.h"\
+	"..\..\..\pjlib\include\pj\lock.h"\
+	"..\..\..\pjlib\include\pj\log.h"\
+	"..\..\..\pjlib\include\pj\os.h"\
+	"..\..\..\pjlib\include\pj\pool.h"\
+	"..\..\..\pjlib\include\pj\pool_alt.h"\
+	"..\..\..\pjlib\include\pj\pool_buf.h"\
+	"..\..\..\pjlib\include\pj\pool_i.h"\
+	"..\..\..\pjlib\include\pj\rand.h"\
+	"..\..\..\pjlib\include\pj\rbtree.h"\
+	"..\..\..\pjlib\include\pj\sock.h"\
+	"..\..\..\pjlib\include\pj\sock_select.h"\
+	"..\..\..\pjlib\include\pj\string.h"\
+	"..\..\..\pjlib\include\pj\string_i.h"\
+	"..\..\..\pjlib\include\pj\timer.h"\
+	"..\..\..\pjlib\include\pj\types.h"\
+	"..\..\..\pjlib\include\pj\unicode.h"\
+	"..\..\..\pjlib\include\pjlib.h"\
+	"..\..\include\pjsip-simple\errno.h"\
+	"..\..\include\pjsip-simple\pidf.h"\
+	"..\..\include\pjsip-simple\rpid.h"\
+	"..\..\include\pjsip-simple\types.h"\
+	"..\..\include\pjsip\sip_autoconf.h"\
+	"..\..\include\pjsip\sip_config.h"\
+	"..\..\include\pjsip\sip_errno.h"\
+	"..\..\include\pjsip\sip_types.h"\
+	
+
+!ELSEIF  "$(CFG)" == "pjsip_simple_wince - Win32 (WCE x86) Debug"
+
+DEP_CPP_RPID_=\
+	"..\..\..\pjlib-util\include\pjlib-util\xml.h"\
+	"..\..\..\pjlib\include\pj\addr_resolv.h"\
+	"..\..\..\pjlib\include\pj\array.h"\
+	"..\..\..\pjlib\include\pj\assert.h"\
+	"..\..\..\pjlib\include\pj\compat\assert.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_armcc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_codew.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_gcc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_gcce.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_msvc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\
+	"..\..\..\pjlib\include\pj\compat\ctype.h"\
+	"..\..\..\pjlib\include\pj\compat\errno.h"\
+	"..\..\..\pjlib\include\pj\compat\high_precision.h"\
+	"..\..\..\pjlib\include\pj\compat\m_auto.h"\
+	"..\..\..\pjlib\include\pj\compat\os_auto.h"\
+	"..\..\..\pjlib\include\pj\compat\os_darwinos.h"\
+	"..\..\..\pjlib\include\pj\compat\os_linux.h"\
+	"..\..\..\pjlib\include\pj\compat\os_linux_kernel.h"\
+	"..\..\..\pjlib\include\pj\compat\os_palmos.h"\
+	"..\..\..\pjlib\include\pj\compat\os_rtems.h"\
+	"..\..\..\pjlib\include\pj\compat\os_sunos.h"\
+	"..\..\..\pjlib\include\pj\compat\os_symbian.h"\
+	"..\..\..\pjlib\include\pj\compat\os_win32.h"\
+	"..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\
+	"..\..\..\pjlib\include\pj\compat\setjmp.h"\
+	"..\..\..\pjlib\include\pj\compat\size_t.h"\
+	"..\..\..\pjlib\include\pj\compat\stdarg.h"\
+	"..\..\..\pjlib\include\pj\compat\string.h"\
+	"..\..\..\pjlib\include\pj\config.h"\
+	"..\..\..\pjlib\include\pj\config_site.h"\
+	"..\..\..\pjlib\include\pj\config_site_sample.h"\
+	"..\..\..\pjlib\include\pj\ctype.h"\
+	"..\..\..\pjlib\include\pj\errno.h"\
+	"..\..\..\pjlib\include\pj\except.h"\
+	"..\..\..\pjlib\include\pj\fifobuf.h"\
+	"..\..\..\pjlib\include\pj\file_access.h"\
+	"..\..\..\pjlib\include\pj\file_io.h"\
+	"..\..\..\pjlib\include\pj\guid.h"\
+	"..\..\..\pjlib\include\pj\hash.h"\
+	"..\..\..\pjlib\include\pj\ioqueue.h"\
+	"..\..\..\pjlib\include\pj\ip_helper.h"\
+	"..\..\..\pjlib\include\pj\list.h"\
+	"..\..\..\pjlib\include\pj\list_i.h"\
+	"..\..\..\pjlib\include\pj\lock.h"\
+	"..\..\..\pjlib\include\pj\log.h"\
+	"..\..\..\pjlib\include\pj\os.h"\
+	"..\..\..\pjlib\include\pj\pool.h"\
+	"..\..\..\pjlib\include\pj\pool_alt.h"\
+	"..\..\..\pjlib\include\pj\pool_buf.h"\
+	"..\..\..\pjlib\include\pj\pool_i.h"\
+	"..\..\..\pjlib\include\pj\rand.h"\
+	"..\..\..\pjlib\include\pj\rbtree.h"\
+	"..\..\..\pjlib\include\pj\sock.h"\
+	"..\..\..\pjlib\include\pj\sock_select.h"\
+	"..\..\..\pjlib\include\pj\string.h"\
+	"..\..\..\pjlib\include\pj\string_i.h"\
+	"..\..\..\pjlib\include\pj\timer.h"\
+	"..\..\..\pjlib\include\pj\types.h"\
+	"..\..\..\pjlib\include\pj\unicode.h"\
+	"..\..\..\pjlib\include\pjlib.h"\
+	"..\..\include\pjsip-simple\errno.h"\
+	"..\..\include\pjsip-simple\pidf.h"\
+	"..\..\include\pjsip-simple\rpid.h"\
+	"..\..\include\pjsip-simple\types.h"\
+	"..\..\include\pjsip\sip_autoconf.h"\
+	"..\..\include\pjsip\sip_config.h"\
+	"..\..\include\pjsip\sip_errno.h"\
+	"..\..\include\pjsip\sip_types.h"\
+	
+
+!ENDIF 
+
+# End Source File
+# Begin Source File
+
 SOURCE="..\..\src\pjsip-simple\xpidf.c"
 
 !IF  "$(CFG)" == "pjsip_simple_wince - Win32 (WCE emulator) Release"
@@ -5226,8 +6064,12 @@
 	"..\..\..\pjlib\include\pj\array.h"\
 	"..\..\..\pjlib\include\pj\assert.h"\
 	"..\..\..\pjlib\include\pj\compat\assert.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_armcc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_codew.h"\
 	"..\..\..\pjlib\include\pj\compat\cc_gcc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_gcce.h"\
 	"..\..\..\pjlib\include\pj\compat\cc_msvc.h"\
+	"..\..\..\pjlib\include\pj\compat\cc_mwcc.h"\
 	"..\..\..\pjlib\include\pj\compat\ctype.h"\
 	"..\..\..\pjlib\include\pj\compat\errno.h"\
 	"..\..\..\pjlib\include\pj\compat\high_precision.h"\
@@ -5239,10 +6081,12 @@
 	"..\..\..\pjlib\include\pj\compat\os_palmos.h"\
 	"..\..\..\pjlib\include\pj\compat\os_rtems.h"\
 	"..\..\..\pjlib\include\pj\compat\os_sunos.h"\
+	"..\..\..\pjlib\include\pj\compat\os_symbian.h"\
 	"..\..\..\pjlib\include\pj\compat\os_win32.h"\
 	"..\..\..\pjlib\include\pj\compat\os_win32_wince.h"\
 	"..\..\..\pjlib\include\pj\compat\setjmp.h"\
 	"..\..\..\pjlib\include\pj\compat\size_t.h"\
+	"..\..\..\pjlib\include\pj\compat\stdarg.h"\
 	"..\..\..\pjlib\include\pj\compat\string.h"\
 	"..\..\..\pjlib\include\pj\config.h"\
 	"..\..\..\pjlib\include\pj\config_site.h"\
@@ -5256,6 +6100,7 @@
 	"..\..\..\pjlib\include\pj\guid.h"\
 	"..\..\..\pjlib\include\pj\hash.h"\
 	"..\..\..\pjlib\include\pj\ioqueue.h"\
+	"..\..\..\pjlib\include\pj\ip_helper.h"\
 	"..\..\..\pjlib\include\pj\list.h"\
 	"..\..\..\pjlib\include\pj\list_i.h"\
 	"..\..\..\pjlib\include\pj\lock.h"\
@@ -5263,6 +6108,7 @@
 	"..\..\..\pjlib\include\pj\os.h"\
 	"..\..\..\pjlib\include\pj\pool.h"\
 	"..\..\..\pjlib\include\pj\pool_alt.h"\
+	"..\..\..\pjlib\include\pj\pool_buf.h"\
 	"..\..\..\pjlib\include\pj\pool_i.h"\
 	"..\..\..\pjlib\include\pj\rand.h"\
 	"..\..\..\pjlib\include\pj\rbtree.h"\
@@ -5276,6 +6122,7 @@
 	"..\..\..\pjlib\include\pjlib.h"\
 	"..\..\include\pjsip-simple\types.h"\
 	"..\..\include\pjsip-simple\xpidf.h"\
+	"..\..\include\pjsip\sip_autoconf.h"\
 	"..\..\include\pjsip\sip_config.h"\
 	"..\..\include\pjsip\sip_types.h"\
 	
@@ -5673,6 +6520,10 @@
 # End Source File
 # Begin Source File
 
+SOURCE="..\..\include\pjsip-simple\rpid.h"
+# End Source File
+# Begin Source File
+
 SOURCE="..\..\include\pjsip-simple\types.h"
 # End Source File
 # Begin Source File
diff --git a/pjsip/include/pjsip-simple/errno.h b/pjsip/include/pjsip-simple/errno.h
index ab3d4ec..7097bc6 100644
--- a/pjsip/include/pjsip-simple/errno.h
+++ b/pjsip/include/pjsip-simple/errno.h
@@ -77,6 +77,11 @@
  * Bad XPIDF Message
  */
 #define PJSIP_SIMPLE_EBADXPIDF	    (PJSIP_SIMPLE_ERRNO_START+25)   /*270025*/
+/**
+ * @hideinitializer
+ * Bad RPID Message
+ */
+#define PJSIP_SIMPLE_EBADRPID	    (PJSIP_SIMPLE_ERRNO_START+26)   /*270026*/
 
 
 /************************************************************
diff --git a/pjsip/include/pjsip-simple/presence.h b/pjsip/include/pjsip-simple/presence.h
index fb505fe..e52ec9c 100644
--- a/pjsip/include/pjsip-simple/presence.h
+++ b/pjsip/include/pjsip-simple/presence.h
@@ -26,6 +26,7 @@
 #include <pjsip-simple/evsub.h>
 #include <pjsip-simple/pidf.h>
 #include <pjsip-simple/xpidf.h>
+#include <pjsip-simple/rpid.h>
 
 
 PJ_BEGIN_DECL
@@ -73,6 +74,7 @@
  */
 #define PJSIP_PRES_STATUS_MAX_INFO  8
 
+
 /**
  * This structure describes presence status of a presentity.
  */
@@ -82,6 +84,8 @@
     struct {
 
 	pj_bool_t	basic_open;	/**< Basic status/availability.	    */
+	pjrpid_element	rpid;		/**< Optional RPID info.	    */
+
 	pj_str_t	id;		/**< Tuple id.			    */
 	pj_str_t	contact;	/**< Optional contact address.	    */
 
diff --git a/pjsip/include/pjsip-simple/rpid.h b/pjsip/include/pjsip-simple/rpid.h
new file mode 100644
index 0000000..2f090a9
--- /dev/null
+++ b/pjsip/include/pjsip-simple/rpid.h
@@ -0,0 +1,148 @@
+/* $Id$ */
+/* 
+ * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
+ */
+#ifndef __PJSIP_SIMPLE_RPID_H__
+#define __PJSIP_SIMPLE_RPID_H__
+
+/**
+ * @file rpid.h
+ * @brief RPID: Rich Presence Extensions to the PIDF (RFC 4480)
+ */
+#include <pjsip-simple/types.h>
+#include <pjsip-simple/pidf.h>
+
+PJ_BEGIN_DECL
+
+
+/**
+ * @defgroup PJSIP_SIMPLE_RPID RPID/Rich Presence Extensions to PIDF (RFC 4480)
+ * @ingroup PJSIP_SIMPLE
+ * @brief RPID/Rich Presence Extensions to PIDF (RFC 4480)
+ * @{
+ *
+ * This file provides tools for managing subset of RPID elements into
+ * PIDF document.
+ */
+
+/**
+ * This enumeration describes subset of standard activities as 
+ * described by RFC 4880, RPID: Rich Presence Extensions to the 
+ * Presence Information Data Format (PIDF). 
+ */
+typedef enum pjrpid_activity
+{
+    /** Activity is unknown. The activity would then be conceived
+     *  in the "note" field.
+     */
+    PJRPID_ACTIVITY_UNKNOWN,
+
+    /** The person is away */
+    PJRPID_ACTIVITY_AWAY,
+
+    /** The person is busy */
+    PJRPID_ACTIVITY_BUSY
+
+} pjrpid_activity;
+
+
+/**
+ * This enumeration describes types of RPID element.
+ */
+typedef enum pjrpid_element_type
+{
+    /** RPID <person> element */
+    PJRPID_ELEMENT_TYPE_PERSON
+
+} pjrpid_element_type;
+
+
+/**
+ * This structure describes person information in RPID document.
+ */
+typedef struct pjrpid_element
+{
+    /** Element type. */
+    pjrpid_element_type	    type;
+
+    /** Optional id to set on the element. */
+    pj_str_t		    id;
+
+    /** Activity type. */
+    pjrpid_activity	    activity;
+
+    /** Optional text describing the person/element. */
+    pj_str_t		    note;
+
+} pjrpid_element;
+
+
+/**
+ * Duplicate RPID element.
+ *
+ * @param pool	    Pool.
+ * @param dst	    Destination structure.
+ * @param src	    Source structure.
+ */
+PJ_DECL(void) pjrpid_element_dup(pj_pool_t *pool, pjrpid_element *dst,
+				 const pjrpid_element *src);
+
+
+/**
+ * Add RPID element information into existing PIDF document. This will also
+ * add the appropriate XML namespace attributes into the presence's XML
+ * node, if the attributes are not already present, and also a <note> element
+ * to the first <tuple> element of the PIDF document.
+ *
+ * @param pres	    The PIDF presence document.
+ * @param pool	    Pool.
+ * @param options   Currently unused, and must be zero.
+ * @param elem	    RPID element information to be added into the PIDF
+ *		    document.
+ *
+ * @return PJ_SUCCESS on success.
+ */
+PJ_DECL(pj_status_t) pjrpid_add_element(pjpidf_pres *pres,
+				        pj_pool_t *pool,
+					unsigned options,
+				        const pjrpid_element *elem);
+
+/**
+ * Get RPID element information from PIDF document, if any.
+ *
+ * @param pres	    The PIDF document containing RPID elements.
+ * @param pool	    Pool to duplicate the information.
+ * @param elem	    Structure to receive the element information.
+ *
+ * @return PJ_SUCCESS	if the document does contain RPID element
+ *			and the information has been parsed successfully.
+ */
+PJ_DECL(pj_status_t) pjrpid_get_element(const pjpidf_pres *pres,
+				        pj_pool_t *pool,
+				        pjrpid_element *elem);
+
+
+/**
+ * @}
+ */
+
+
+PJ_END_DECL
+
+
+#endif	/* __PJSIP_SIMPLE_RPID_H__ */
+
diff --git a/pjsip/include/pjsua-lib/pjsua.h b/pjsip/include/pjsua-lib/pjsua.h
index d6af018..ad89a03 100644
--- a/pjsip/include/pjsua-lib/pjsua.h
+++ b/pjsip/include/pjsua-lib/pjsua.h
@@ -1918,6 +1918,16 @@
     pj_bool_t		online_status;
 
     /**
+     * Presence online status text.
+     */
+    pj_str_t		online_status_text;
+
+    /**
+     * Extended RPID online status information.
+     */
+    pjrpid_element	rpid;
+
+    /**
      * Buffer that is used internally to store the status text.
      */
     char		buf_[PJ_ERR_MSG_SIZE];
@@ -2080,7 +2090,10 @@
 /**
  * Modify account's presence status to be advertised to remote/presence
  * subscribers. This would trigger the sending of outgoing NOTIFY request
- * if there are server side presence subscription for this account.
+ * if there are server side presence subscription for this account, and/or
+ * outgoing PUBLISH if presence publication is enabled for this account.
+ *
+ * @see pjsua_acc_set_online_status2()
  *
  * @param acc_id	The account ID.
  * @param is_online	True of false.
@@ -2095,6 +2108,24 @@
 PJ_DECL(pj_status_t) pjsua_acc_set_online_status(pjsua_acc_id acc_id,
 						 pj_bool_t is_online);
 
+/**
+ * Modify account's presence status to be advertised to remote/presence
+ * subscribers. This would trigger the sending of outgoing NOTIFY request
+ * if there are server side presence subscription for this account, and/or
+ * outgoing PUBLISH if presence publication is enabled for this account.
+ *
+ * @see pjsua_acc_set_online_status()
+ *
+ * @param acc_id	The account ID.
+ * @param is_online	True of false.
+ * @param pr		Extended information in subset of RPID format
+ *			which allows setting custom presence text.
+ *
+ * @return		PJ_SUCCESS on success, or the appropriate error code.
+ */
+PJ_DECL(pj_status_t) pjsua_acc_set_online_status2(pjsua_acc_id acc_id,
+						  pj_bool_t is_online,
+						  const pjrpid_element *pr);
 
 /**
  * Update registration or perform unregistration. If registration is
@@ -2988,9 +3019,14 @@
     pj_bool_t		monitor_pres;
 
     /**
+     * Extended RPID information about the person.
+     */
+    pjrpid_element	rpid;
+
+    /**
      * Internal buffer.
      */
-    char		buf_[256];
+    char		buf_[512];
 
 } pjsua_buddy_info;
 
diff --git a/pjsip/include/pjsua-lib/pjsua_internal.h b/pjsip/include/pjsua-lib/pjsua_internal.h
index ca9ea65..de6be5d 100644
--- a/pjsip/include/pjsua-lib/pjsua_internal.h
+++ b/pjsip/include/pjsua-lib/pjsua_internal.h
@@ -95,6 +95,7 @@
     pjsip_cred_info  cred[PJSUA_ACC_MAX_PROXIES]; /**< Complete creds.	*/
 
     pj_bool_t	     online_status; /**< Our online status.		*/
+    pjrpid_element   rpid;	    /**< RPID element information.	*/
     pjsua_srv_pres   pres_srv_list; /**< Server subscription list.	*/
     pjsip_publishc  *publish_sess;  /**< Client publication session.	*/
     pj_bool_t	     publish_state; /**< Last published online status	*/
@@ -320,6 +321,11 @@
 void pjsua_pres_refresh(void);
 
 /*
+ * Update server subscription (e.g. when our online status has changed)
+ */
+void pjsua_pres_update_acc(int acc_id, pj_bool_t force);
+
+/*
  * Shutdown presence.
  */
 void pjsua_pres_shutdown(void);
diff --git a/pjsip/src/pjsip-simple/errno.c b/pjsip/src/pjsip-simple/errno.c
index c224b0d..4248fda 100644
--- a/pjsip/src/pjsip-simple/errno.c
+++ b/pjsip/src/pjsip-simple/errno.c
@@ -43,6 +43,7 @@
     { PJSIP_SIMPLE_EBADCONTENT,	    "Bad Content-Type for presence" },
     { PJSIP_SIMPLE_EBADPIDF,	    "Bad PIDF content for presence" },
     { PJSIP_SIMPLE_EBADXPIDF,	    "Bad XPIDF content for presence" },
+    { PJSIP_SIMPLE_EBADRPID,	    "Invalid or bad RPID document"},
 
     /* isComposing errors. */
     { PJSIP_SIMPLE_EBADISCOMPOSE,   "Bad isComposing indication/XML message" },
diff --git a/pjsip/src/pjsip-simple/presence.c b/pjsip/src/pjsip-simple/presence.c
index 88aa8d6..bb5dcd5 100644
--- a/pjsip/src/pjsip-simple/presence.c
+++ b/pjsip/src/pjsip-simple/presence.c
@@ -390,6 +390,17 @@
 	pj_strdup(pres->dlg->pool, 
 		  &pres->status.info[i].contact,
 		  &status->info[i].contact);
+
+	/* Duplicate <person> */
+	pres->status.info[i].rpid.activity = 
+	    status->info[i].rpid.activity;
+	pj_strdup(pres->dlg->pool, 
+		  &pres->status.info[i].rpid.id,
+		  &status->info[i].rpid.id);
+	pj_strdup(pres->dlg->pool,
+		  &pres->status.info[i].rpid.note,
+		  &status->info[i].rpid.note);
+
     }
 
     pres->status.info_cnt = status->info_cnt;
diff --git a/pjsip/src/pjsip-simple/presence_body.c b/pjsip/src/pjsip-simple/presence_body.c
index c57e427..9f085d5 100644
--- a/pjsip/src/pjsip-simple/presence_body.c
+++ b/pjsip/src/pjsip-simple/presence_body.c
@@ -101,6 +101,11 @@
 				     status->info[i].basic_open);
     }
 
+    /* Create <person> (RPID) */
+    if (status->info_cnt) {
+	pjrpid_add_element(pidf, pool, 0, &status->info[0].rpid);
+    }
+
     body = PJ_POOL_ZALLOC_T(pool, pjsip_msg_body);
     body->data = pidf;
     body->content_type.type = STR_APPLICATION;
@@ -196,6 +201,9 @@
 	pres_status->info_cnt++;
     }
 
+    /* Parse <person> (RPID) */
+    pjrpid_get_element(pidf, pool, &pres_status->info[0].rpid);
+
     return PJ_SUCCESS;
 }
 
diff --git a/pjsip/src/pjsip-simple/rpid.c b/pjsip/src/pjsip-simple/rpid.c
new file mode 100644
index 0000000..fde939b
--- /dev/null
+++ b/pjsip/src/pjsip-simple/rpid.c
@@ -0,0 +1,268 @@
+/* $Id$ */
+/* 
+ * Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
+ */
+#include <pjsip-simple/rpid.h>
+#include <pjsip-simple/errno.h>
+#include <pj/assert.h>
+#include <pj/guid.h>
+#include <pj/string.h>
+
+
+static const pj_str_t DM_NAME = {"xmlns:dm", 8};
+static const pj_str_t DM_VAL = {"urn:ietf:params:xml:ns:pidf:data-model", 38};
+static const pj_str_t RPID_NAME = {"xmlns:rpid", 10};
+static const pj_str_t RPID_VAL = {"urn:ietf:params:xml:ns:pidf:rpid", 32};
+
+static const pj_str_t DM_NOTE = {"dm:note", 7};
+static const pj_str_t DM_PERSON = {"dm:person", 9};
+static const pj_str_t ID = {"id", 2};
+static const pj_str_t NOTE = {"note", 4};
+static const pj_str_t RPID_ACTIVITIES = {"rpid:activities", 15};
+static const pj_str_t RPID_AWAY = {"rpid:away", 9};
+static const pj_str_t RPID_BUSY = {"rpid:busy", 9};
+static const pj_str_t RPID_UNKNOWN = {"rpid:unknown", 12};
+
+
+/* Duplicate RPID element */
+PJ_DEF(void) pjrpid_element_dup(pj_pool_t *pool, pjrpid_element *dst,
+				const pjrpid_element *src)
+{
+    pj_memcpy(dst, src, sizeof(pjrpid_element));
+    pj_strdup(pool, &dst->id, &src->id);
+    pj_strdup(pool, &dst->note, &src->note);
+}
+
+
+/* Update RPID namespaces. */
+static void update_namespaces(pjpidf_pres *pres,
+			      pj_pool_t *pool)
+{
+    /* Check if namespace is already present. */
+    if (pj_xml_find_attr(pres, &DM_NAME, NULL) != NULL)
+	return;
+
+    pj_xml_add_attr(pres, pj_xml_attr_new(pool, &DM_NAME, &DM_VAL));
+    pj_xml_add_attr(pres, pj_xml_attr_new(pool, &RPID_NAME, &RPID_VAL));
+}
+
+
+/* Comparison function to find node name substring */
+static pj_bool_t substring_match(const pj_xml_node *node, 
+				 const char *part_name,
+				 int part_len)
+{
+    pj_str_t end_name;
+
+    if (part_len < 1)
+	part_len = pj_ansi_strlen(part_name);
+
+    if (node->name.slen < part_len)
+	return PJ_FALSE;
+
+    end_name.ptr = node->name.ptr + (node->name.slen - part_len);
+    end_name.slen = part_len;
+
+    return pj_strnicmp2(&end_name, part_name, part_len)==0;
+}
+
+/* Util to find child node with the specified substring */
+static pj_xml_node *find_node(const pj_xml_node *parent, 
+			      const char *part_name)
+{
+    const pj_xml_node *node = parent->node_head.next, 
+		      *head = (pj_xml_node*) &parent->node_head;
+    int part_len = pj_ansi_strlen(part_name);
+
+    while (node != head) {
+	if (substring_match(node, part_name, part_len))
+	    return (pj_xml_node*) node;
+
+	node = node->next;
+    }
+
+    return NULL;
+}
+
+/*
+ * Add RPID element into existing PIDF document.
+ */
+PJ_DEF(pj_status_t) pjrpid_add_element(pjpidf_pres *pres, 
+				       pj_pool_t *pool,
+				       unsigned options,
+				       const pjrpid_element *elem)
+{
+    pj_xml_node *nd_person, *nd_activities, *nd_activity, *nd_note;
+    pj_xml_attr *attr;
+
+    PJ_ASSERT_RETURN(pres && pool && options==0 && elem, PJ_EINVAL);
+
+    PJ_UNUSED_ARG(options);
+
+    /* Check if we need to add RPID information into the PIDF document. */
+    if (elem->id.slen==0 && 
+	elem->activity==PJRPID_ACTIVITY_UNKNOWN &&
+	elem->note.slen==0)
+    {
+	/* No RPID information to be added. */
+	return PJ_SUCCESS;
+    }
+
+    /* Add <note> to <tuple> */
+    if (elem->note.slen != 0) {
+	pj_xml_node *nd_tuple;
+
+	nd_tuple = find_node(pres, "tuple");
+
+	if (nd_tuple) {
+	    nd_note = pj_xml_node_new(pool, &NOTE);
+	    pj_strdup(pool, &nd_note->content, &elem->note);
+	    pj_xml_add_node(nd_tuple, nd_note);
+	    nd_note = NULL;
+	}
+    }
+
+    /* Update namespace */
+    update_namespaces(pres, pool);
+
+    /* Add <person> */
+    nd_person = pj_xml_node_new(pool, &DM_PERSON);
+    if (elem->id.slen != 0) {
+	attr = pj_xml_attr_new(pool, &ID, &elem->id);
+    } else {
+	pj_str_t person_id;
+	pj_create_unique_string(pool, &person_id);
+	attr = pj_xml_attr_new(pool, &ID, &person_id);
+    }
+    pj_xml_add_attr(nd_person, attr);
+    pj_xml_add_node(pres, nd_person);
+
+    /* Add <activities> */
+    nd_activities = pj_xml_node_new(pool, &RPID_ACTIVITIES);
+    pj_xml_add_node(nd_person, nd_activities);
+
+    /* Add the activity */
+    switch (elem->activity) {
+    case PJRPID_ACTIVITY_AWAY:
+	nd_activity = pj_xml_node_new(pool, &RPID_AWAY);
+	break;
+    case PJRPID_ACTIVITY_BUSY:
+	nd_activity = pj_xml_node_new(pool, &RPID_BUSY);
+	break;
+    case PJRPID_ACTIVITY_UNKNOWN:
+    default:
+	nd_activity = pj_xml_node_new(pool, &RPID_UNKNOWN);
+	break;
+    }
+    pj_xml_add_node(nd_activities, nd_activity);
+
+    /* Add custom text if required. */
+    if (elem->note.slen != 0) {
+	nd_note = pj_xml_node_new(pool, &DM_NOTE);
+	pj_strdup(pool, &nd_note->content, &elem->note);
+	pj_xml_add_node(nd_person, nd_note);
+    }
+
+    /* Done */
+    return PJ_SUCCESS;
+}
+
+
+/* Get <note> element from PIDF <tuple> element */
+static pj_status_t get_tuple_note(const pjpidf_pres *pres,
+				  pj_pool_t *pool,
+				  pjrpid_element *elem)
+{
+    const pj_xml_node *nd_tuple, *nd_note;
+
+    nd_tuple = find_node(pres, "tuple");
+    if (!nd_tuple)
+	return PJSIP_SIMPLE_EBADRPID;
+
+    nd_note = find_node(pres, "note");
+    if (nd_note) {
+	pj_strdup(pool, &elem->note, &nd_note->content);
+	return PJ_SUCCESS;
+    }
+
+    return PJSIP_SIMPLE_EBADRPID;
+}
+
+/*
+ * Get RPID element from PIDF document, if any.
+ */
+PJ_DEF(pj_status_t) pjrpid_get_element(const pjpidf_pres *pres,
+				       pj_pool_t *pool,
+				       pjrpid_element *elem)
+{
+    const pj_xml_node *nd_person, *nd_activities, *nd_note = NULL;
+    const pj_xml_attr *attr;
+
+    /* Reset */
+    pj_bzero(elem, sizeof(*elem));
+    elem->activity = PJRPID_ACTIVITY_UNKNOWN;
+
+    /* Find <person> */
+    nd_person = find_node(pres, "person");
+    if (!nd_person) {
+	/* <person> not found, try to get <note> from <tuple> */
+	return get_tuple_note(pres, pool, elem);
+    }
+
+    /* Get element id attribute */
+    attr = pj_xml_find_attr((pj_xml_node*)nd_person, &ID, NULL);
+    if (attr)
+	pj_strdup(pool, &elem->id, &attr->value);
+
+    /* Get <activities> */
+    nd_activities = find_node(nd_person, "activities");
+    if (nd_activities) {
+	const pj_xml_node *nd_activity;
+
+	/* Try to get <note> from <activities> */
+	nd_note = find_node(nd_activities, "note");
+
+	/* Get the activity */
+	nd_activity = nd_activities->node_head.next;
+	if (nd_activity == nd_note)
+	    nd_activity = nd_activity->next;
+
+	if (nd_activity != (pj_xml_node*) &nd_activities->node_head) {
+	    if (substring_match(nd_activity, "busy", -1))
+		elem->activity = PJRPID_ACTIVITY_BUSY;
+	    else if (substring_match(nd_activity, "away", -1))
+		elem->activity = PJRPID_ACTIVITY_AWAY;
+	    else
+		elem->activity = PJRPID_ACTIVITY_UNKNOWN;
+
+	}
+    }
+
+    /* If <note> is not found, get <note> from <person> */
+    if (nd_note == NULL)
+	nd_note = find_node(nd_person, "note");
+
+    if (nd_note) {
+	pj_strdup(pool, &elem->note, &nd_note->content);
+    } else {
+	get_tuple_note(pres, pool, elem);
+    }
+
+    return PJ_SUCCESS;
+}
+
+
diff --git a/pjsip/src/pjsua-lib/pjsua_acc.c b/pjsip/src/pjsua-lib/pjsua_acc.c
index b92e3e5..854f8cb 100644
--- a/pjsip/src/pjsua-lib/pjsua_acc.c
+++ b/pjsip/src/pjsua-lib/pjsua_acc.c
@@ -430,7 +430,26 @@
     PJ_ASSERT_RETURN(pjsua_var.acc[acc_id].valid, PJ_EINVALIDOP);
 
     pjsua_var.acc[acc_id].online_status = is_online;
-    pjsua_pres_refresh();
+    pj_bzero(&pjsua_var.acc[acc_id].rpid, sizeof(pjrpid_element));
+    pjsua_pres_update_acc(acc_id, PJ_FALSE);
+    return PJ_SUCCESS;
+}
+
+
+/* 
+ * Set online status with extended information 
+ */
+PJ_DEF(pj_status_t) pjsua_acc_set_online_status2( pjsua_acc_id acc_id,
+						  pj_bool_t is_online,
+						  const pjrpid_element *pr)
+{
+    PJ_ASSERT_RETURN(acc_id>=0 && acc_id<(int)PJ_ARRAY_SIZE(pjsua_var.acc),
+		     PJ_EINVAL);
+    PJ_ASSERT_RETURN(pjsua_var.acc[acc_id].valid, PJ_EINVALIDOP);
+
+    pjsua_var.acc[acc_id].online_status = is_online;
+    pjrpid_element_dup(pjsua_var.pool, &pjsua_var.acc[acc_id].rpid, pr);
+    pjsua_pres_update_acc(acc_id, PJ_TRUE);
     return PJ_SUCCESS;
 }
 
@@ -689,7 +708,14 @@
     info->acc_uri = acc_cfg->id;
     info->has_registration = (acc->cfg.reg_uri.slen > 0);
     info->online_status = acc->online_status;
-    
+    pj_memcpy(&info->rpid, &acc->rpid, sizeof(pjrpid_element));
+    if (info->rpid.note.slen)
+	info->online_status_text = info->rpid.note;
+    else if (info->online_status)
+	info->online_status_text = pj_str("Online");
+    else
+	info->online_status_text = pj_str("Offline");
+
     if (acc->reg_last_err) {
 	info->status = (pjsip_status_code) acc->reg_last_err;
 	pj_strerror(acc->reg_last_err, info->buf_, sizeof(info->buf_));
diff --git a/pjsip/src/pjsua-lib/pjsua_pres.c b/pjsip/src/pjsua-lib/pjsua_pres.c
index d531695..b544af6 100644
--- a/pjsip/src/pjsua-lib/pjsua_pres.c
+++ b/pjsip/src/pjsua-lib/pjsua_pres.c
@@ -113,7 +113,15 @@
 	info->status_text = pj_str("?");
     } else if (pjsua_var.buddy[buddy_id].status.info[0].basic_open) {
 	info->status = PJSUA_BUDDY_STATUS_ONLINE;
-	info->status_text = pj_str("Online");
+
+	/* copy RPID information */
+	info->rpid = buddy->status.info[0].rpid;
+
+	if (info->rpid.note.slen)
+	    info->status_text = info->rpid.note;
+	else
+	    info->status_text = pj_str("Online");
+
     } else {
 	info->status = PJSUA_BUDDY_STATUS_OFFLINE;
 	info->status_text = pj_str("Offline");
@@ -652,6 +660,9 @@
 	pres_status.info_cnt = 1;
 	pres_status.info[0].basic_open = acc->online_status;
 	pres_status.info[0].id = acc->cfg.pidf_tuple_id;
+	/* .. including RPID information */
+	pj_memcpy(&pres_status.info[0].rpid, &acc->rpid, 
+		  sizeof(pjrpid_element));
 
 	/* Be careful not to send PIDF with presence entity ID containing
 	 * "<" character.
@@ -821,8 +832,8 @@
 }
 
 
-/* Refresh subscription (e.g. when our online status has changed) */
-static void refresh_server_subscription(int acc_id)
+/* Update server subscription (e.g. when our online status has changed) */
+void pjsua_pres_update_acc(int acc_id, pj_bool_t force)
 {
     pjsua_acc *acc = &pjsua_var.acc[acc_id];
     pjsua_acc_config *acc_cfg = &pjsua_var.acc[acc_id].cfg;
@@ -836,8 +847,12 @@
 	pjsip_tx_data *tdata;
 
 	pjsip_pres_get_status(uapres->sub, &pres_status);
-	if (pres_status.info[0].basic_open != acc->online_status) {
+	if (force || pres_status.info[0].basic_open != acc->online_status) {
+
 	    pres_status.info[0].basic_open = acc->online_status;
+	    pj_memcpy(&pres_status.info[0].rpid, &acc->rpid, 
+		      sizeof(pjrpid_element));
+
 	    pjsip_pres_set_status(uapres->sub, &pres_status);
 
 	    if (pjsip_pres_current_notify(uapres->sub, &tdata)==PJ_SUCCESS) {
@@ -855,7 +870,7 @@
      * send the first PUBLISH. 
      */
     if (acc_cfg->publish_enabled && acc->publish_sess) {
-	if (acc->publish_state != acc->online_status) {
+	if (force || acc->publish_state != acc->online_status) {
 	    send_publish(acc_id, PJ_TRUE);
 	}
     }
@@ -1251,7 +1266,7 @@
 
     for (i=0; i<PJ_ARRAY_SIZE(pjsua_var.acc); ++i) {
 	if (pjsua_var.acc[i].valid)
-	    refresh_server_subscription(i);
+	    pjsua_pres_update_acc(i, PJ_FALSE);
     }
 }