Avaya 96x1 extended Features

I appoligize for any grammer, spelling or typo issues.

Free PBX and Avaya 9611/9608 with Contact list, speed dial, history, Paging, auto answer.

So I have been working on this off and on for a year and I am starting to run out of freetime
So I am trying to get this out there before my life gets to crazy and I forget what I did.

After a bunch of messing around, coding and research I have been able to get my Avaya 9611 SIP phones to register with my free pbx server with Contact list, speed dial, history, Paging, auto answer.

So what do you need.

  1. Freepbx server –
  2. Web server could be co located on your freepbx server.
  3. Avaya 9611/9608 SIp Phone.
  4. Or avaya SIP emulator. http: //www.devconnectprogram.com/site/global/products_resources/avaya_ip_deskphones/development_tools_configurations/emulators/index.gsp
    Because I had to recompile asterisk with some updates files I build my Free pbx server using the instructions found here http: //wiki.freepbx.org/display/FOP/Installing+FreePBX+13+on+CentOS+7.

Start out by getting the Avaya sip phones to registery with freepBX

  1. Configure Sip extensions in freePBX as SIP and TCP.
  2. Configure Avaya Phone http server address to point to Web server hosting Firmware and 46xxsettings.txt file
  3. Configure Avaya Phone with SIP firmware
  4. Configure avaya phone via craft to connect to SIP Control via TCP not TLS.

To begin you need to understand a couple things about avaya 96xx sip phones. They function in 2 ways. SIPPING-19 or Avaya SIP with advanced features including PPM . So when they boot up they one of the things it does is it needs to determine what Sip Features are going to be supported. This is done by sending out a SIP command and waiting for response. Since asterisk does not recognize this command it does not respond so the avaya phone determines it’s not connecting to an Avaya PBX so it defaults to just supporting the SIPPING-19 Features. So in order to enable Contact list, speed dial, history we need to get the phone to enable more than just SIPPING-19. A good place to understand the boot sequences of the phones Andrew Prokop has some really good blogs that go over this.
The Steps Involved in Booting an Avaya SIP Telephone https:// andrewjprokop.wordpress.com/2014/03/03/the-steps-involved-in-booting-an-avaya-sip-telephone/

1 Like

So our 1st step is we need to modify our asterisk install to recognize and respond back correctly to phone so it enables its advanced features.

  1. Edit ./usr/src/asterisk-13.7.2/channels/sip/include/sip.h
    a. Find this section of code
    /*! \brief Type of subscription, based on the packages we do support, see \ref subscription_types /
    enum subscriptiontype {
    NONE = 0,
    XPIDF_XML,
    DIALOG_INFO_XML,
    CPIM_PIDF_XML,
    PIDF_XML,
    MWI_NOTIFICATION,
    CALL_COMPLETION,
    };
    b. And replace it with
    /
    ! \brief Type of subscription, based on the packages we do support, see \ref subscription_types */
    enum subscriptiontype {
    NONE = 0,
    XPIDF_XML,
    DIALOG_INFO_XML,
    CPIM_PIDF_XML,
    PIDF_XML,
    MWI_NOTIFICATION,
    CALL_COMPLETION,
    AVAYA_PPM,
    };

  2. Edit ./usr/src/asterisk-13.7.2/channels/chan_sip.c
    a. Find this section of code

/* RFC 4235: SIP Dialog event package /
{ DIALOG_INFO_XML, “dialog”, “application/dialog-info+xml”, “dialog-info+xml” },
{ CPIM_PIDF_XML, “presence”, “application/cpim-pidf+xml”, “cpim-pidf+xml” }, /
RFC 3863 /
{ PIDF_XML, “presence”, “application/pidf+xml”, “pidf+xml” }, /
RFC 3863 /
{ XPIDF_XML, “presence”, “application/xpidf+xml”, “xpidf+xml” }, /
Pre-RFC 3863 with MS additions /
{ MWI_NOTIFICATION, “message-summary”, “application/simple-message-summary”, “mwi” }, /
RFC 3842: Mailbox notification */

b. Add to the following line under the MWI_NOTIFICATION, line

{ AVAYA_PPM ,“avaya-cm-feature-status”, “application/avaya-cm-feature-status+xml”, “multipart/mixed” } /* RFC 3842: Mailbox notification *

c. Add the following function header

static int respprep401(struct sip_request *resp, struct sip_pvt *p, const char *msg, const struct sip_request *req);

d. Add the following function

[details=Summary]static int respprep401(struct sip_request *resp, struct sip_pvt *p, const char *msg, const struct sip_request *req)
{
char newto[256];
const char *ot;

init_resp(resp, msg);
copy_via_headers(p, resp, req, “Via”);
if (msg[0] == ‘1’ || msg[0] == ‘2’)
copy_all_header(resp, req, “Record-Route”);
copy_header(resp, req, “From”);
ot = sip_get_header(req, “To”);

if (!strcasestr(ot, “tag=”) && strncmp(msg, “100”, 3)) {
/* Add the proper tag if we don’t have it already. If they have specified
their tag, use it. Otherwise, use our own tag */
ast_log(LOG_WARNING, “tag401 Check point 1 \n”);
if (!ast_strlen_zero(p->theirtag) && ast_test_flag(&p->flags[0], SIP_OUTGOING)){
ast_log(LOG_WARNING, “tag401 Check point 2 \n”);
snprintf(newto, sizeof(newto), “%s;tag=%s”, ot, p->theirtag);}
else if (p->tag && !ast_test_flag(&p->flags[0], SIP_OUTGOING)){
ast_log(LOG_WARNING, “tag401 Check point 3 \n”);
ast_log(LOG_WARNING, “\n \n”);
ast_log(LOG_WARNING,(strstr(sip_get_header(req, “Contact”), “+avaya-cm-line=1”)));
ast_log(LOG_WARNING, “\n \n”);

if (strstr(sip_get_header(req, “Contact”), “+avaya-cm-line=1”) != NULL) {
ast_log(LOG_WARNING,"\n ****************avaya featute\n ");
snprintf(newto, sizeof(newto), “%s”, ot);
//snprintf(newto, sizeof(newto), “%s;tag=%s”, ot, p->theirtag);
ast_log(LOG_WARNING, “tag401 Check point 3.1 \n”);
}
else {
snprintf(newto, sizeof(newto), “%s;tag=%s”, ot, p->tag);
ast_log(LOG_WARNING, “tag Check401 point 3.2 \n”);
}
}
else{
ast_log(LOG_WARNING, “tag401 Check point 4 \n”);
ast_copy_string(newto, ot, sizeof(newto));}
ot = newto;
}
ast_log(LOG_WARNING, “tag401 Check point 5 \n”);
add_header(resp, “To”, ot);
copy_header(resp, req, “Call-ID”);
copy_header(resp, req, “CSeq”);
if (!ast_strlen_zero(global_useragent))
add_header(resp, “Server”, global_useragent);
add_header(resp, “Allow”, ALLOWED_METHODS);
add_supported(p, resp);

/* If this is an invite, add Session-Timers related headers if the feature is active for this session /
if (p->method == SIP_INVITE && p->stimer && p->stimer->st_active == TRUE) {
char se_hdr[256];
snprintf(se_hdr, sizeof(se_hdr), “%d;refresher=%s”, p->stimer->st_interval,
p->stimer->st_ref == SESSION_TIMER_REFRESHER_US ? “uas” : “uac”);
add_header(resp, “Session-Expires”, se_hdr);
/
RFC 2048, Section 9

  • If the refresher parameter in the Session-Expires header field in the
  • 2xx response has a value of ‘uac’, the UAS MUST place a Require
  • header field into the response with the value ‘timer’.
  • If the refresher parameter in
  • the 2xx response has a value of ‘uas’ and the Supported header field
  • in the request contained the value ‘timer’, the UAS SHOULD place a
  • Require header field into the response with the value ‘timer’
    */
    if (p->stimer->st_ref == SESSION_TIMER_REFRESHER_THEM ||
    (p->stimer->st_ref == SESSION_TIMER_REFRESHER_US &&
    p->stimer->st_active_peer_ua == TRUE)) {
    resp->reqsipoptions |= SIP_OPT_TIMER;
    }
    }

if (msg[0] == ‘2’ && (p->method == SIP_SUBSCRIBE || p->method == SIP_REGISTER || p->method == SIP_PUBLISH)) {
/* For registration responses, we also need expiry and
contact info /
add_expires(resp, p->expiry);
if (p->expiry) { /
Only add contact if we have an expiry time */
char contact[SIPBUFSIZE];
const char *contact_uri = p->method == SIP_SUBSCRIBE ? p->our_contact : p->fullcontact;
char brackets = strchr(contact_uri, ‘<’);
snprintf(contact, sizeof(contact), “%s%s%s;expires=%d”, brackets ? “” : “<”, contact_uri, brackets ? “” : “>”, p->expiry);
add_header(resp, “Contact”, contact); /
Not when we unregister */
}
if (p->method == SIP_REGISTER && ast_test_flag(&p->flags[0], SIP_USEPATH)) {
copy_header(resp, req, “Path”);
}
} else if (!ast_strlen_zero(p->our_contact) && resp_needs_contact(msg, p->method)) {
add_header(resp, “Contact”, p->our_contact);
}

if (!ast_strlen_zero(p->url)) {
add_header(resp, “Access-URL”, p->url);
ast_string_field_set(p, url, NULL);
}

/* default to routing the response to the address where the request

  • came from. Since we don’t have a transport layer, we do this here.
  • The process_via() function will update the port to either the port
  • specified in the via header or the default port later on (per RFC
  • 3261 section 18.2.2).
    */
    p->sa = p->recv;

if (process_via(p, req)) {
ast_log(LOG_WARNING, “error processing via header, will send response to originating address\n”);
}

return 0;
}
[/details]

e. In the function in transmit_response_with_auth find respprep(&resp, p, msg, req); and replace it with respprep401(&resp, p, msg, req);

f. in the function static void state_notify_build_xml switch (subscribed) find the case statement switch (subscribed) and add the following code right above the Case none:

[details=Summary] case AVAYA_PPM: /* SNOM subscribes in this format /
ast_str_append(tmp, 0, “<?xml version=\"1.0\"?>\n”);
ast_str_append(tmp, 0, “<dialog-info xmlns=“urn:ietf:params:xml:ns:dialog-info” version=”%u" state="%s" entity="%s">\n", p->dialogver, full ? “full” : “partial”, mto);
if (data->state > 0 && (data->state & AST_EXTENSION_RINGING) && sip_cfg.notifyringing) {
/
Twice the extension length should be enough for XML encoding */
char local_display[AST_MAX_EXTENSION * 2];
char remote_display[AST_MAX_EXTENSION * 2];
char local_target = ast_strdupa(mto);
/
It may seem odd to base the remote_target on the To header here,

  • but testing by reporters on issue ASTERISK-16735 found that basing
  • on the From header would cause ringing state hints to not work
  • properly on certain SNOM devices. If you are using notifycid properly
  • (i.e. in the same extension and context as the dialed call) then this
  • should not be an issue since the data will be overwritten shortly
  • with channel caller ID
    */
    char *remote_target = ast_strdupa(mto);

ast_xml_escape(exten, local_display, sizeof(local_display));
ast_xml_escape(exten, remote_display, sizeof(remote_display));

/* There are some limitations to how this works. The primary one is that the
callee must be dialing the same extension that is being monitored. Simply dialing
the hint’d device is not sufficient. */
if (sip_cfg.notifycid) {
struct ast_channel *callee;

  callee = find_ringing_channel(data->device_state_info, p);
  if (callee) {
    static char *anonymous = "anonymous";
    static char *invalid = "anonymous.invalid";
    char *cid_num;
    char *connected_num;
    int need;
    int cid_num_restricted, connected_num_restricted;

    ast_channel_lock(callee);

    cid_num_restricted = (ast_channel_caller(callee)->id.number.presentation &
   AST_PRES_RESTRICTION) == AST_PRES_RESTRICTED;
    cid_num = S_COR(ast_channel_caller(callee)->id.number.valid,

S_COR(cid_num_restricted, anonymous,
ast_channel_caller(callee)->id.number.str), “”);

    need = strlen(cid_num) + (cid_num_restricted ? strlen(invalid) :
  strlen(p->fromdomain)) + sizeof("sip:@");
    local_target = ast_alloca(need);

    snprintf(local_target, need, "sip:%s@%s", cid_num,

cid_num_restricted ? invalid : p->fromdomain);

    ast_xml_escape(S_COR(ast_channel_caller(callee)->id.name.valid,
S_COR((ast_channel_caller(callee)->id.name.presentation &
    AST_PRES_RESTRICTION) == AST_PRES_RESTRICTED, anonymous,
   ast_channel_caller(callee)->id.name.str), ""),
 local_display, sizeof(local_display));

    connected_num_restricted = (ast_channel_connected(callee)->id.number.presentation &
    AST_PRES_RESTRICTION) == AST_PRES_RESTRICTED;
    connected_num = S_COR(ast_channel_connected(callee)->id.number.valid,
  S_COR(connected_num_restricted, anonymous,
    ast_channel_connected(callee)->id.number.str), "");

    need = strlen(connected_num) + (connected_num_restricted ? strlen(invalid) :
    strlen(p->fromdomain)) + sizeof("sip:@");
    remote_target = ast_alloca(need);

    snprintf(remote_target, need, "sip:%s@%s", connected_num,

connected_num_restricted ? invalid : p->fromdomain);

    ast_xml_escape(S_COR(ast_channel_connected(callee)->id.name.valid,
S_COR((ast_channel_connected(callee)->id.name.presentation &
    AST_PRES_RESTRICTION) == AST_PRES_RESTRICTED, anonymous,
    ast_channel_connected(callee)->id.name.str), ""),
 remote_display, sizeof(remote_display));

    ast_channel_unlock(callee);
    callee = ast_channel_unref(callee);
  }

  /* We create a fake call-id which the phone will send back in an INVITE
     Replaces header which we can grab and do some magic with. */
  if (sip_cfg.pedanticsipchecking) {
    ast_str_append(tmp, 0, "<dialog id=\"%s\" call-id=\"pickup-%s\" local-tag=\"%s\" remote-tag=\"%s\" direction=\"recipient\">\n",

exten, p->callid, p->theirtag, p->tag);
} else {
ast_str_append(tmp, 0, “<dialog id=”%s" call-id=“pickup-%s” direction=“recipient”>\n",
exten, p->callid);
}
ast_str_append(tmp, 0,
"\n"
/* See the limitations of this above. Luckily the phone seems to still be
happy when these values are not correct. */
"<identity display="%s">%s\n"
"<target uri="%s"/>\n"
"\n"
"\n"
"<identity display="%s">%s\n"
"<target uri="%s"/>\n"
"\n",
remote_display, remote_target, remote_target, local_display, local_target, local_target);
} else {
ast_str_append(tmp, 0, “<dialog id=”%s" direction=“recipient”>\n", exten);
}

} else {
ast_str_append(tmp, 0, “<dialog id=”%s">\n", exten);
}
ast_str_append(tmp, 0, “%s\n”, statestring);
if (data->state == AST_EXTENSION_ONHOLD) {
ast_str_append(tmp, 0, “\n<target uri=”%s">\n"
"<param pname="+sip.rendering" pvalue=“no”/>\n"
"\n\n", mto);
}
ast_str_append(tmp, 0, “\n\n”);
break;
[/details]

g. in the function sip_get_dest_result get_destination add the following code under If (!oreq)

[details=Summary] if(strstr(sip_get_header(req, “To”), “avaya-cm-fnu=off-hook”) != NULL) {
ast_log(LOG_WARNING, “get_destination Check point 33.1 \n”);
if ((strstr(sip_get_header(req, “Contact”), “uri-user=”) != NULL)) {

const char *contact = sip_get_header(req, “Contact”);
char *URIUSER = strstr(contact, “uri-user=”);
char *URIdomian = strstr(contact, “uri-domain=”);
URIUSER+= 9;
URIUSER[strlen(URIUSER) - strlen(URIdomian)-1] = 0;

uri=URIUSER;
ast_log(LOG_WARNING, " ‘%s’\n", URIUSER);
ast_log(LOG_WARNING, “get_destination Check point 33.2 \n”);
}

}

[/details]

h. add to the following handle_request_invite before if (p->relatedpeer) {

[details=Summary] if(strstr(sip_get_header(req, “To”), “avaya-cm-fnu=off-hook”) != NULL) {
ast_log(LOG_WARNING,"\n ****************avaya featute\n ");
ast_log(LOG_WARNING, “handle_request_invite Check point 2.1 \n”);
check_via(p, req);
copy_request(&p->initreq, req);
pvt_set_needdestroy(p, “forcing expiration”);
transmit_response(p, “183 Session Progress”, req);
goto request_invite_cleanup;
}
[/details]

i. in handle_request_subscribe replace this line
if (!strcmp(event, “presence”) || !strcmp(event, “dialog”)) { /* Presence, RFC 3842 /
with
if (!strcmp(event, “presence”) || !strcmp(event, “dialog”)|| !strcmp(event, “avaya-cm-feature-status”)) { /
Presence, RFC 3842 */

j. in handle_request_subscribe under

} else if (strstr(accept, “application/xpidf+xml”)) { subscribed = XPIDF_XML; /* Early pre-RFC 3863 format with MSN additions (Microsoft Messenger) */

add

} else if (strstr(accept, “application/avaya-cm-feature-status+xml”)) {
_ subscribed = AVAYA_PPM;_

  1. Recompile Asterisk
    a. cd /usr/src
    b. cd asterisk-*
    c. make
    d. make install
    e. make config
2 Likes

At this point assuming you did everything correctly when your phone reboots it should start request PPM data. However, Unless your sniffing traffic you may not notice anything.

To configure AutoAnser(paging/intercom)
Make the following changes to extensions_override_freepbx.conf

[details=Summary][autoanswer]
exten => s,1,gotoIf($["${ARG1}" = “Auto”]?avaya:notavaya
exten => s,n(avaya),GosubIf($["${ARG1}" != “”]?addheader,1(Answer-Mode,${ARG1}))
exten => s,n,GosubIf($["${ARG2}" != “”]?addheader,1(Call-Info,${ARG2}))
exten => s,n,Return()

exten => s,n(notavaya),GosubIf($["${ARG1}" != “”]?addheader,1(Alert-Info,${ARG1}))
exten => s,n,GosubIf($["${ARG2}" != “”]?addheader,1(Call-Info,${ARG2}))
exten => s,n,Return()
exten => addheader,1,SIPAddHeader(${ARG1}: ${ARG2})
exten => addheader,n,Set(PJSIP_HEADER(add,${ARG1})=${ARG2})
exten => addheader,n,Return()
;–== end of [autoanswer] ==–;
[/details]

Then run the following commands from your ssh terminal

[details=Summary]amportal a m
INSERT INTO paging_autoanswer (useragent, var, setting) VALUES (‘avaya’, ‘ALERTINFO’, ‘Auto’);
[/details]

If the above does not work just update the extensions_override_freepbx.conf file with this.

[details=Summary][autoanswer]
exten => s,1,GosubIf($["${ARG1}" != “”]?addheader,1(Answer-Mode,Auto))
exten => s,n,GosubIf($["${ARG2}" != “”]?addheader,1(Call-Info,${ARG2}))
exten => s,n,Return()
exten => addheader,1,SIPAddHeader(${ARG1}: ${ARG2})
exten => addheader,n,Set(PJSIP_HEADER(add,${ARG1})=${ARG2})
exten => addheader,n,Return()
;–== end of [autoanswer] ==–;
[/details]

2 Likes

We now need to configure a PPM server.

  1. Make sure your web server is configured to support PHP
  2. On you Web server create the following dir. \axis\services
  3. Create a file named PPM and copy the below code in
<?php $handle=""; $domain=""; $extenion=""; function SendgetInitialEndpointConfiguration() { echo "<?xml Version=\"1.0\" ?>";

echo “soapenv:Envelope”;

echo “soapenv:Body”;

echo "<ns1:getInitialEndpointConfigurationResponse xmlns:ns1=“http://xml.avaya.com/service/ProfileManagement/112004” xmlns:SOAPENV=“http://schemas.xmlsoap.org/soap/envelope/” SOAPENV:encodingStyle=“http://schemas.xmlsoap.org/soap/encoding/">";
echo " “;
echo " “;
echo " 3”;
echo " < EmergencyNumberList xmlns:soapenc=“http://schemas.xmlsoap.org/soap/encoding/””;
echo “xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance””;
echo “soapenc:arrayType=“ns1:EmergencyNumberData[3]” xsi:type=“soapenc:Array”>”;
echo " “;
echo " Police”;
echo " 911”;
echo " “;
echo " “;
echo " Ambulance”;
echo " 911”;
echo " “;
echo " “;
echo " Fire”;
echo " 911”;
echo " “;
echo " </ EmergencyNumberList>”;
echo " ";
echo " ";
echo “</ns1:getInitialEndpointConfigurationResponse>”;

echo “</soapenv:Body>”;
echo “</soapenv:Envelope>”;

exit();

}

function SendgetHomeServer() {
global $domain;
echo “<?xml Version=\"1.0\" ?>”;

echo “soapenv:Envelope”;

echo “soapenv:Body”;

echo “<ns1:getHomeServerResponse xmlns:ns1=“http://xml.avaya.com/service/ProfileManagement/112004” xmlns:SOAPENV=“http://schemas.xmlsoap.org/soap/envelope/” SOAPENV:encodingStyle=“http://schemas.xmlsoap.org/soap/encoding/">";
echo " “;
echo " http: //192.168.1.12/axis/services/ppm”;
echo " $domain”;
echo " $domain”;
echo " “;
echo " 2”;
echo " <TransportList xmlns:soapenc=“http://schemas.xmlsoap.org/soap/encoding/”";
echo “xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance””;
echo “soapenc:arrayType=“ns1:TransportData[2]” xsi:type=“soapenc:Array”>”;
echo " “;
echo " TCP”;
echo " 5060";
echo " ";
echo " ";
echo " ";
echo " ";
echo “</ns1:getHomeServerResponse>”;

echo “</soapenv:Body>”;
echo “</soapenv:Envelope>”;

exit();

}

function SendgetHomeCapabilities() {
global $domain;
echo “<?xml Version=\"1.0\" ?>”;

echo “soapenv:Envelope”;

echo “soapenv:Body”;

echo " <ns1:getHomeCapabilitiesResponse xmlns:ns1=“http://xml.avaya.com/service/ProfileManagement/112004” xmlns:SOAPENV=“http://schemas.xmlsoap.org/soap/envelope/” SOAPENV:encodingStyle=“http://schemas.xmlsoap.org/soap/encoding/">";
echo " “;
echo " <ServicesList xmlns:soapenc=“http://schemas.xmlsoap.org/soap/encoding/””;
echo " xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance””;
echo " soapenc:arrayType=“ns1:ServiceData[3]” xsi:type=“soapenc:Array”>";
echo " “;
echo " endpoint-reflection”;
echo " $domain";
echo " 0";
echo " 1";
echo " <ServiceFeatures soapenc:arrayType=“ns1:FeatureData[0]” xsi:type=“soapenc:Array” />";
echo " 0";
echo " “;
echo " “;
echo " ppm-features”;
echo " “;
echo " 0”;
echo " 1”;
echo " <ServiceFeatures soapenc:arrayType=“ns1:FeatureData[3]” xsi:type=“soapenc:Array”>";
echo " “;
echo " FS-DeviceData”;
echo " 2";
echo " FS-Available";
echo " “;
echo " “;
echo " setVolumeSettings”;
echo " 1”;
echo " Method-Available";
echo " “;
echo " “;
echo " getAllEndpointConfiguration”;
echo " 1”;
echo " Method-Available";
echo " “;
echo " “;
echo " getCallHistory”;
echo " 1”;
echo " Method-Available";
echo " “;
echo " “;
echo " deleteCallHistory”;
echo " 1”;
echo " Method-Available";
echo " “;
echo " “;
echo " 3”;
echo " “;
echo " “;
echo " proxy-server”;
echo " $domain”;
echo " CoreSM”;
echo " <ServiceTransport soapenc:arrayType=“ns1:TransportData[2]” xsi:type=“soapenc:Array”>";
echo " “;
echo " TCP”;
echo " 5060";
echo " “;
echo " “;
echo " 2”;
echo " asm6.3.4.0.594”;
echo " <ServiceFeatures soapenc:arrayType=“ns1:FeatureData[4]” xsi:type=“soapenc:Array”>";
echo " “;
echo " mustDualRegister”;
echo " 0";
echo " true";
echo " “;
echo " “;
echo " FS-AST”;
echo " 0”;
echo " FS-Available";
echo " “;
echo " “;
echo " FS-PPM”;
echo " 0”;
echo " FS-Available";
echo " “;
echo " “;
echo " servicePriority”;
echo " 0”;
echo " 1";
echo " “;
echo " “;
echo " 4”;
echo " “;
echo " “;
echo " proxy-server”;
echo " $domain”;
echo " CoreSM”;
echo " <ServiceTransport soapenc:arrayType=“ns1:TransportData[3]” xsi:type=“soapenc:Array”>";
echo " “;
echo " TCP”;
echo " 5060";
echo " “;
echo " “;
echo " UDP”;
echo " 5050”;
echo " “;
echo " “;
echo " 3”;
echo " asmSwVersionUnknown”;
echo " <ServiceFeatures soapenc:arrayType=“ns1:FeatureData[4]” xsi:type=“soapenc:Array”>";
echo " “;
echo " mustDualRegister”;
echo " 0";
echo " true";
echo " “;
echo " “;
echo " FS-AST”;
echo " 0”;
echo " FS-Available";
echo " “;
echo " “;
echo " FS-PPM”;
echo " 0”;
echo " FS-Available";
echo " “;
echo " “;
echo " servicePriority”;
echo " 0”;
echo " 2";
echo " “;
echo " “;
echo " 4”;
echo " “;
echo " “;
echo " proxy-server”;
echo " $domain”;
echo " BranchSM”;
echo " <ServiceTransport soapenc:arrayType=“ns1:TransportData[2]” xsi:type=“soapenc:Array”>";
echo " “;
echo " TCP”;
echo " 5060";
echo " “;
echo " “;
echo " 2”;
echo " asmSwVersionUnknown”;
echo " <ServiceFeatures soapenc:arrayType=“ns1:FeatureData[4]” xsi:type=“soapenc:Array”>";
echo " “;
echo " mustDualRegister”;
echo " 0";
echo " true";
echo " “;
echo " “;
echo " FS-AST”;
echo " 0”;
echo " FS-Available";
echo " “;
echo " “;
echo " FS-PPM”;
echo " 0”;
echo " FS-Available";
echo " “;
echo " “;
echo " servicePriority”;
echo " 0”;
echo " 3";
echo " “;
echo " “;
echo " 4”;
echo " “;
echo " “;
echo " presence-services”;
echo " $domain”;
echo " PS”;
echo " <ServiceTransport soapenc:arrayType=“ns1:TransportData[1]” xsi:type=“soapenc:Array”>";
echo " “;
echo " TLS”;
echo " 5222";
echo " “;
echo " “;
echo " 1”;
echo " swVersionUnknown”;
echo " <ServiceFeatures soapenc:arrayType=“ns1:FeatureData[2]” xsi:type=“soapenc:Array”>";
echo " “;
echo " XMPP_IM”;
echo " 0";
echo " FS-Available";
echo " “;
echo " “;
echo " servicePriority”;
echo " 0”;
echo " 1";
echo " “;
echo " “;
echo " 2”;
echo " “;
echo " “;
echo " 4”;
echo " <FNUList xmlns:soapenc=“http://schemas.xmlsoap.org/soap/encoding/””;
echo " xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance””;
echo " soapenc:arrayType=“ns1:FNUFeature[2]” xsi:type=“soapenc:Array”>";
echo " “;
echo " avaya-cm-fnu=off-hook”;
echo " true";
echo " false";
echo " R013x.00.0.300";
echo " 0";
echo " “;
echo " “;
echo " avaya-cm-fnu=transfer-to-voicemail”;
echo " false”;
echo " false";
echo " R013x.00.0.300";
echo " 0";
echo " ";
echo " “;
echo " 2”;
echo " “;
echo " </ns1:getHomeCapabilitiesResponse>”;

echo “</soapenv:Body>”;
echo “</soapenv:Envelope>”;

exit();

}

function SendgetAllEndpointConfiguration() {

global $handle;
global $domain;
global $extenion;

echo “<?xml Version=\"1.0\" ?>”;

echo “soapenv:Envelope”;

echo “soapenv:Body”;

echo " <ns1:getAllEndpointConfigurationResponse xmlns:ns1=“http://xml.avaya.com/service/ProfileManagement/112004” xmlns:SOAPENV=“http://schemas.xmlsoap.org/soap/envelope/” SOAPENV:encodingStyle=“http://schemas.xmlsoap.org/soap/encoding/”> ";
echo " ";
echo " ";
echo “5 5 5 3”;
echo " ";
echo " ";
echo " 0 ";
echo " <RingerOnOffDataList xmlns:soapenc=“http://schemas.xmlsoap.org/soap/encoding/” ";
echo " xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” ";
echo " soapenc:arrayType=“ns1:RingerOnOffData[1]” xsi:type=“soapenc:Array”> ";
echo " 62004 delayed2 9single half-ring 6200 10 on ";
echo " ";
echo " ";
echo " ";
echo " 0 ";
echo " <TimerList xmlns:soapenc=“http://schemas.xmlsoap.org/soap/encoding/” ";
echo " xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” soapenc:arrayType=“ns1:Timer[4]” ";
echo " xsi:type=“soapenc:Array”> ";
echo " ";
echo " ";
echo " ";
echo " n ";
echo " n ";
echo " ";
echo " $extenion ";
echo " All ";

$filename = $handle."\OneTouchDial";

echo " ";

if (file_exists($filename)) {
$post = file_get_contents($filename);
$post= str_replace(array("\n", “\r”, “\r\n”), ‘&’,$post);
$post= str_replace(’><’, ‘>&<’,$post);
$data = array();
parse_str($post, $data);
echo " “.sizeof($data).” ";
echo " <OneTouchDialList xmlns:soapenc=“http://schemas.xmlsoap.org/soap/encoding/” ";
echo " xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” ";
echo " soapenc:arrayType=“ns1:OneTouchButton[1]” xsi:type=“soapenc:Array”> ";

            foreach ($data as $key => $val) {
                                            $parm=$key;
                                            $pieces = explode(",", $parm);
                                            echo '    <item> ';
                                            echo "   <ButtonLocation>$pieces[0]</ButtonLocation> ";
                                            echo "   <Address>$pieces[1]</Address>            ";
                                            echo "<Label>$pieces[3]</Label>";
                                            echo "<ReadOnly>$pieces[2]</ReadOnly>";
                                            echo '    </item>';
                                            echo '    <item> ';
                                            echo '    </item>';
                            }

} else {
echo " 0 ";
echo " <OneTouchDialList xmlns:soapenc=“http://schemas.xmlsoap.org/soap/encoding/” ";
echo " xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” ";
echo " soapenc:arrayType=“ns1:OneTouchButton[1]” xsi:type=“soapenc:Array”> ";
}

echo " ";
echo " ";

$filename2 = $handle."\ButtonAssignments";

echo " $filename ";
echo " ";

if (file_exists($filename2)) {
$post = file_get_contents($filename2);
$post= str_replace(array("\n", “\r”, “\r\n”), ‘&’,$post);
$post= str_replace(’&&’, ‘&’,$post);
$data = array();
//parse_str($post, $data);
$data=explode(’&’,$post);

echo " “.sizeof($data).” ";
echo " <ButtonAssignment xmlns:soapenc=“http://schemas.xmlsoap.org/soap/encoding/” ";
echo " xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” ";
echo " soapenc:arrayType=“ns1:ButtonData[8]” xsi:type=“soapenc:Array”> ";

            foreach ($data as $key) {
                                            $parm=$key;
                                            $pieces = explode(",", $parm);  

echo " $parm ";

}

} else {
echo " 0 ";
echo " <ButtonAssignment xmlns:soapenc=“http://schemas.xmlsoap.org/soap/encoding/” ";
echo " xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” ";
echo " soapenc:arrayType=“ns1:ButtonData[8]” xsi:type=“soapenc:Array”> ";
}

echo " ";
echo " ";

echo " ";
echo " $domain ";
echo " 0 ";
echo " <DialPlan xmlns:soapenc=“http://schemas.xmlsoap.org/soap/encoding/” ";
echo " xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” soapenc:arrayType=“xsd:string[10]” ";
echo " xsi:type=“soapenc:Array”> ";

echo " 5xx";
echo " 6xxx";
echo " 1xxxxxxxxxx";

echo " ";
echo " ";
echo " ";
echo " ";
echo " “;
echo " false false”;
echo " ";
echo " ";
echo " 0 ";
echo " <MaintenanceDataList xmlns:soapenc=“http://schemas.xmlsoap.org/soap/encoding/” ";
echo " xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” ";
echo " soapenc:arrayType=“ns1:MaintenanceData[5]” xsi:type=“soapenc:Array”> ";
echo " ";
echo " ";
echo " ";
echo " 0 ";
echo " <NumberFormatList xmlns:soapenc=“http://schemas.xmlsoap.org/soap/encoding/” ";
echo " xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” ";
echo " soapenc:arrayType=“ns1:NumberFormatRule[2]” xsi:type=“soapenc:Array”> ";
echo " ";
echo " ";
echo " ";
echo " 0 ";
echo " <IdentityList xmlns:soapenc=“http://schemas.xmlsoap.org/soap/encoding/” ";
echo " xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” soapenc:arrayType=“ns1:Identity[5]” ";
echo " xsi:type=“soapenc:Array”> ";
echo " ";
echo " ";
echo " ";
echo " 0 ";
echo " <ConfigDataPacketVersionsList ";
echo " xmlns:soapenc=“http://schemas.xmlsoap.org/soap/encoding/” ";
echo " xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” ";
echo " soapenc:arrayType=“ns1:ConfigDataPacketVersions[1]” xsi:type=“soapenc:Array”> ";
echo " ";
echo " ";
echo " ";
echo " ";
echo " 1 ";
echo " <EmergencyNumberList xmlns:soapenc=“http://schemas.xmlsoap.org/soap/encoding/” ";
echo " xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” ";
echo " soapenc:arrayType=“ns1:EmergencyNumberData[1]” xsi:type=“soapenc:Array”> ";
echo " </ EmergencyNumberList> ";
echo " ";
echo " n ";
echo " ";
echo " 0 ";
echo " <CmSystemParameters xmlns:soapenc=“http://schemas.xmlsoap.org/soap/encoding/” ";
echo " xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” ";
echo " soapenc:arrayType=“ns1:CmSystemParameter[2]” xsi:type=“soapenc:Array”> ";
echo " ";
echo " ";
echo " ";
echo " </ns1:getAllEndpointConfigurationResponse> ";

echo “</soapenv:Body>”;
echo “</soapenv:Envelope>”;

exit();

}

function SendgetContactList() {

/*
echo “<?xml Version=\"1.0\" ?>”;
echo " <soapenv:Envelope xmlns:soapenv=“http://schemas.xmlsoap.org/soap/envelope/” ";
echo " xmlns:xsd=“http://www.w3.org/2001/XMLSchema” xmlns:xsi="http://www.w3.org/2001/ “;
echo " XMLSchema-instance”> ";
echo " soapenv:Body ";
echo " <ns1:getContactListResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/ “;
echo " soap/encoding/” xmlns:ns1="http://xml.avaya.com/service/ProfileManagement/ “;
echo " 112004”> ";
echo " ";
echo " 1 ";
echo " <ContactInfo soapenc:arrayType=“ns1:ContactData[1]” xmlns:soapenc="http:// “;
echo " schemas.xmlsoap.org/soap/encoding/”> ";
echo " ";
echo " [email protected] ";
echo " Test ";
echo " Test ";
echo " top ";
echo " <ParentGroup xsi:nil=“true”/> ";
echo " ";
echo " ";
echo " Testing ";
echo " true ";
echo " <ContactPhones xsi:nil=“true”/> ";
echo " ";
echo " ";
echo " ";
echo " </ns1:getContactListResponse> ";
echo " </soapenv:Body> ";
echo " </soapenv:Envelope> ";
*/

global $handle;

$filename = $handle."\Contacts";

echo “<?xml Version=\"1.0\" ?>”;
echo " <soapenv:Envelope xmlns:soapenv=“http://schemas.xmlsoap.org/soap/envelope/” ";
echo " xmlns:xsd=“http://www.w3.org/2001/XMLSchema” xmlns:xsi="http://www.w3.org/2001/ “;
echo " XMLSchema-instance”> ";
echo " soapenv:Body ";
echo " <ns1:getContactListResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/ “;
echo " soap/encoding/” xmlns:ns1="http://xml.avaya.com/service/ProfileManagement/ “;
echo " 112004”> ";
echo " ";

if (file_exists($filename)) {
$post = file_get_contents($filename);

$post= str_replace(array("\n", “\r”, “\r\n”), ‘&’,$post);
$post= str_replace(’><’, ‘>&<’,$post);
$data = array();
parse_str($post, $data);

echo " “.sizeof($data).” ";
echo " <ContactInfo soapenc:arrayType=“ns1:ContactData[1]” xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">";

foreach ($data as $key => $val) {
$parm=$key;
$pieces = explode(",", $parm);

echo " ";
echo " $pieces[2] ";
echo “$pieces[1],$pieces[0]”;
echo " $pieces[1],$pieces[0] ";
echo " top ";
echo " <ParentGroup xsi:nil=“true”/> ";
echo " ";
echo " ";
echo " Testing ";
echo " true ";
echo “$pieces[3]”;
if (sizeof($pieces)>4){
echo $pieces[4];
}
echo " <ContactPhones xsi:nil=“true”/> ";

echo " ";
}

//$pieces = explode(";", $Contact);
//fwrite($myfile,"$Contact".PHP_EOL);

} else {
echo " 0 ";
echo " <ContactInfo soapenc:arrayType=“ns1:ContactData[1]” xmlns:soapenc="http:// ";
echo " schemas.xmlsoap.org/soap/encoding/">";
}

echo " ";
echo " ";
echo " </ns1:getContactListResponse> ";
echo " </soapenv:Body> ";
echo " </soapenv:Envelope> ";

exit();

}

Function Sendaddcontact () {
global $handle;
$post = file_get_contents(‘php://input’);

$ftname="";
$LastName="";
$SpeedDialEnable="";
$PhoneNumber="";

$i=0;

$data = array();

$post= str_replace(array("\n", “\r”, “\r\n”), ‘&’,$post);
$post= str_replace(’><’, ‘>&<’,$post);

parse_str($post, $data);

foreach ($data as $key => $val) {
$parm=$key;
switch ($parm) {

                            case strpos($parm,'FirstName')==True:{
                                            $ftname=str_replace('<FirstName>','',$parm);
                                            $ftname=str_replace('</FirstName>','',$ftname);
                                            break;}
                                                            
                            case strchr($parm, 'LastName')==True:{
                                            $LastName=str_replace('<LastName>','',$parm);
                                            $LastName=str_replace('</LastName>','',$LastName);  
                                            break;}
                                                                            
                            case strchr($parm, 'PhoneNumber')==True:{
                                            $PhoneNumber=str_replace('<PhoneNumber>','',$parm);
                                            $PhoneNumber=str_replace('</PhoneNumber>','',$PhoneNumber);
                                            break;}
                                            
                            case strchr($parm, 'SpeedDialEnable')==True:{
                                            $SpeedDialEnable=str_replace('<SpeedDialEnable>','',$parm);
                                            $SpeedDialEnable=str_replace('</SpeedDialEnable>','',$SpeedDialEnable);
                                            break;}
                            } 

}

$Contact=$ftname.",".$LastName.",".$PhoneNumber.",".$SpeedDialEnable;

$filename = $handle."\Contacts";

if (file_exists($filename)) {
$myfile = fopen($filename, “a”);
} else {
$myfile = fopen($filename, “w”);
}

$pieces = explode(";", $Contact);
fwrite($myfile,"$Contact".PHP_EOL);

echo “<?xml Version=\"1.0\" ?>”;
echo " <soapenv:Envelope xmlns:soapenv=“http://schemas.xmlsoap.org/soap/envelope/” ";
echo " xmlns:xsd=“http://www.w3.org/2001/XMLSchema” xmlns:xsi="http://www.w3.org/2001/ “;
echo " XMLSchema-instance”> ";
echo " soapenv:Body ";
echo '<ns1:addContactResponse xmlns:ns1=“http://xml.avaya.com/service/ProfileManagement/112004” xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/” SOAP-ENV:encodingStyle=“http://schemas.xmlsoap.org/soap/encoding/”> ';
echo ‘PPM_Success’;
echo ‘</ns1:addContactResponse>’;
echo " </soapenv:Body> ";
echo " </soapenv:Envelope> ";

exit();

}

function sendgetCallHistory(){
global $handle;

$filename = $handle."\History";

echo “<?xml Version=\"1.0\" ?>”;
echo " <soapenv:Envelope xmlns:soapenv=“http://schemas.xmlsoap.org/soap/envelope/” ";
echo " xmlns:xsd=“http://www.w3.org/2001/XMLSchema” xmlns:xsi="http://www.w3.org/2001/ “;
echo " XMLSchema-instance”> ";
echo " soapenv:Body ";
echo ’ <ns1:getCallHistoryResponse xmlns:ns1=“http://xml.avaya.com/service/ProfileManagement/112004” xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/” SOAP-ENV:encodingStyle=“http://schemas.xmlsoap.org/soap/encoding/”>’;
echo " ";

if (file_exists($filename)) {
$post = file_get_contents($filename);

$post= str_replace(array("\n", “\r”, “\r\n”), ‘&’,$post);
$post= str_replace(’><’, ‘>&<’,$post);
$data = array();
parse_str($post, $data);

echo " “.sizeof($data).” ";
echo ‘’ ;

foreach ($data as $key => $val) {
$parm=$key;
$pieces = explode(",", $parm);

echo " ";
echo "$pieces[0] “;
echo “$pieces[1]”;
echo " $pieces[2] “;
echo " $pieces[3]”;
echo " $pieces[4] “;
echo " $pieces[5]”;
echo " $pieces[6]”;

echo " ";
}
echo " ";
echo " ";

//$pieces = explode(";", $Contact);
//fwrite($myfile,"$Contact".PHP_EOL);

} else {
echo " 0 ";
echo ‘<ns1:getCallHistoryResponse xmlns:ns1=“http://xml.avaya.com/service/ProfileManagement/112004” xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/” SOAP-ENV:encodingStyle=“http://schemas.xmlsoap.org/soap/encoding/”>’ ;

}

echo " </ns1:getCallHIstoryResponse> ";
echo " </soapenv:Body> ";
echo " </soapenv:Envelope> ";

exit();
}

Function sendsetDeviceData(){

echo “<?xml Version=\"1.0\" ?>”;
echo " <soapenv:Envelope xmlns:soapenv=“http://schemas.xmlsoap.org/soap/envelope/” ";
echo " xmlns:xsd=“http://www.w3.org/2001/XMLSchema” xmlns:xsi="http://www.w3.org/2001/ “;
echo " XMLSchema-instance”> ";
echo " soapenv:Body ";
echo ‘<ns1:setDeviceDataResponse xmlns:ns1=“http://xml.avaya.com/service/ProfileManagement/112004” xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/” SOAP-ENV:encodingStyle=“http://schemas.xmlsoap.org/soap/encoding/”>’;
echo ’ PPM_Success’;
echo ‘</ns1:setDeviceDataResponse>’;

echo " </soapenv:Body> ";
echo " </soapenv:Envelope> ";

exit();

}

Function sendgetDeviceData(){

echo “<?xml Version=\"1.0\" ?>”;
echo " <soapenv:Envelope xmlns:soapenv=“http://schemas.xmlsoap.org/soap/envelope/” ";
echo " xmlns:xsd=“http://www.w3.org/2001/XMLSchema” xmlns:xsi="http://www.w3.org/2001/ “;
echo " XMLSchema-instance”> ";
echo " soapenv:Body ";

echo ‘<ns1:getDeviceDataResponse xmlns:ns1=“http://xml.avaya.com/service/ProfileManagement/112004” xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/” SOAP-ENV:encodingStyle=“http://schemas.xmlsoap.org/soap/encoding/”> 1 one-X Communicator Avaya EMUL 1 Config XML <ConfigData xmlns=“http://xml.avaya.com/endpointAPI”><version>1455151791</version><parameter><name>DefaultAudioPath</name><alias/><value>1</value><category>Config</category></parameter><parameter><name>ButtonClicksEnabled</name><alias/><value>0</value><category>Config</category></parameter><parameter><name>ContinuousScrollingEnabled</name><alias/><value>0</value><category>Config</category></parameter><parameter><name>PersonalRingToneWave</name><alias/><value>3</value><category>Config</category></parameter><parameter><name>CallPickupRingType</name><alias/><value>1</value><category>Config</category></parameter><parameter><name>CallPickupIndication</name><alias/><value>3</value><category>Config</category></parameter><parameter><name>CallPickupRingTypeUserSelection</name><alias/><value>-1</value><category>Config</category></parameter><parameter><name>TeamButtonRingTypePerButton</name><alias/><value/><category>Config</category></parameter><parameter><name>BCAButtonRingTypePerButton</name><alias/><value/><category>Config</category></parameter><parameter><name>CallForwardRing</name><alias/><value>0</value><category>Config</category></parameter><parameter><name>ReturnToHomeScreen</name><alias/><value>1</value><category>Config</category></parameter><parameter><name>LargeFont</name><alias/><value>0</value><category>Config</category></parameter><parameter><name>ShowPhoneScreenOnCall</name><alias/><value>1</value><category>Config</category></parameter><parameter><name>ShowPhoneScreenOnAlert</name><alias/><value>1</value><category>Config</category></parameter><parameter><name>DisplayCallTimers</name><alias/><value>1</value><category>Config</category></parameter><parameter><name>UseVisualAlerting</name><alias/><value>1</value><category>Config</category></parameter><parameter><name>EffectOfRedialButton</name><alias/><value>1</value><category>Config</category></parameter><parameter><name>ErrortoneEnabled</name><alias/><value>1</value><category>Config</category></parameter><parameter><name>PhoneScreenWidth</name><alias/><value>0</value><category>Config</category></parameter><parameter><name>ShowQuickTouchPanel</name><alias/><value>1</value><category>Config</category></parameter><parameter><name>PhoneEditedDialing</name><alias/><value>0</value><category>Config</category></parameter><parameter><name>UseKeyRepeatDelay</name><alias/><value>0</value><category>Config</category></parameter><parameter><name>ToggleNameNumber</name><alias/><value>1</value><category>Config</category></parameter><parameter><name>AgcForHandset</name><alias/><value>1</value><category>Config</category></parameter><parameter><name>AgcForHeadset</name><alias/><value>1</value><category>Config</category></parameter><parameter><name>AgcForSpeaker</name><alias/><value>1</value><category>Config</category></parameter><parameter><name>HeadsetProfile</name><alias/><value>0</value><category>Config</category></parameter><parameter><name>HeadsetSignaling</name><alias/><value>0</value><category>Config</category></parameter><parameter><name>SipUserDisplayname</name><alias/><value/><category>Config</category></parameter><parameter><name>’;

echo ‘Favorites</name><alias/><value>’;
global $handle;
$filename = $handle."\Favorites";

if (file_exists($filename)) {
$post = file_get_contents($filename);
$post= str_replace(array("\n", “\r”, “\r\n”), ‘&’,$post);
$post= str_replace(’=’, ‘-’,$post);
$data = array();
parse_str($post, $data);
foreach ($data as $key => $val)
{
$parm= str_replace(’-’, ‘=’,$key);

                              echo "$parm";
                                            if (sizeof($data)>1){
                                                            echo ",";
                                            }
                            }

}
echo ‘</value>’;

echo ‘<category>Config</category></parameter><parameter><name>PersonalLabels</name><alias/><value/><category>Config</category></parameter><parameter><name>CurrentSkin</name><alias/><value>file://skins/9611/9611_pof.xml</value><category>Config</category></parameter><parameter><name>UserDisplayName</name><alias/><value/><category>Config</category></parameter><parameter><name>CurrentLogo</name><alias/><value/><category>Config</category></parameter><parameter><name>LanguageFileInUse</name><alias/><value>Mlf_English.xml</value><category>Config</category></parameter><parameter><name>UserPreferredLanguage</name><alias/><value>English</value><category>Config</category></parameter><parameter><name>LanguageInUse</name><alias/><value>English</value><category>Config</category></parameter><parameter><name>TimeFormat</name><alias/><value>0</value><category>Config</category></parameter><parameter><name>CallHistoryActivated</name><alias/><value>1</value><category>Config</category></parameter><parameter><name>CallHistoryLoggingBridgedCalls</name><alias/><value>1</value><category>Config</category></parameter><parameter><name>EnableAutomaticIdlePresence</name><alias/><value>0</value><category>Config</category></parameter><parameter><name>DNDSACLinkManual</name><alias/><value>0</value><category>Config</category></parameter><parameter><name>AwayTimer</name><alias/><value>1</value><category>Config</category></parameter><parameter><name>AwayTimerValue</name><alias/><value>60</value><category>Config</category></parameter><parameter><name>UseExchangeContacts</name><alias/><value>0</value><category>Config</category></parameter><parameter><name>UseExchangeCalendar</name><alias/><value>0</value><category>Config</category></parameter><parameter><name>ExchangeUserAccount</name><alias/><value/><category>Config</category></parameter><parameter><name>ExchangeUserPassword</name><alias/><value/><category>Config</category></parameter><parameter><name>EnableExchangeReminder</name><alias/><value>0</value><category>Config</category></parameter><parameter><name>ExchangeReminderTime</name><alias/><value>5</value><category>Config</category></parameter><parameter><name>ExchangeSnoozeTime</name><alias/><value>5</value><category>Config</category></parameter><parameter><name>ExchangeReminderTone</name><alias/><value>1</value><category>Config</category></parameter><parameter><name>AlwaysPromptForUsernameAndPassword</name><alias/><value>0</value><category>Config</category></parameter><parameter><name>UserEnableVideo</name><alias/><value>1</value><category>Config</category></parameter><parameter><name>IMAlertTone</name><alias/><value>1</value><category>Config</category></parameter><parameter><name>HtmlBrowserExceptionDomains</name><alias/><value/><category>Config</category></parameter><parameter><name>HtmlBrowserProxy</name><alias/><value/><category>Config</category></parameter><parameter><name>HtmlBookmarksList</name><alias/><value/><category>Config</category></parameter><parameter><name>UseMuteAlerting</name><alias/><value>0</value><category>Config</category></parameter><parameter><name>OutsideCallRingType</name><alias/><value>1</value><category>Config</category></parameter><parameter><name>PriorityCallRingType</name><alias/><value>1</value><category>Config</category></parameter><parameter><name>IntercomRingType</name><alias/><value>1</value><category>Config</category></parameter><parameter><name>ForwardedCallRingType</name><alias/><value>1</value><category>Config</category></parameter><parameter><name>BridgedCallRingType</name><alias/><value>1</value><category>Config</category></parameter><parameter><name>AnswerMode</name><alias/><value>AUDIO</value><category>Config</category></parameter><parameter><name>DateFormatOptions</name><alias/><value>1</value><category>Config</category></parameter><parameter><name>SshRootAllowed</name><alias/><value>1</value><category>Config</category></parameter><parameter><name>ContactNameDisplay</name><alias/><value>1</value><category>Config</category></parameter><parameter><name>EnableOnlineSearch</name><alias/><value>0</value><category>Config</category></parameter><parameter><name>DefaultSearchDirectory</name><alias/><value>2</value><category>Config</category></parameter><parameter><name>DefaultContactsStore</name><alias/><value>1</value><category>Config</category></parameter><parameter><name>EnableContactsAutodial</name><alias/><value>1</value><category>Config</category></parameter></ConfigData> </ns1:getDeviceDataResponse>’;

echo " </soapenv:Body> ";
echo " </soapenv:Envelope> ";

exit();

}

$post = file_get_contents(‘php://input’);

$post= str_replace(array("\n", “\r”, “\r\n”), ‘&’,$post);
$post= str_replace(’><’, ‘>&<’,$post);

$data = array();
parse_str($post, $data);

foreach ($data as $key => $val) {
$parm=$key;

                            switch ($parm) {
                            
                           case strchr($parm, '<Handle')==TRUE:

                                            $handle=str_replace('<Handle>','',$parm);
                                            $handle=str_replace('</Handle>','',$handle);
                                            break;

                            }

}

$extenion=substr($handle,0,strrpos($handle, ‘@’));
$domain=substr($handle,strrpos($handle, ‘@’)+1,strlen($handle));

$domain=str_replace(’_’,’.’,$domain);

foreach ($data as $key => $val) {
$parm=$key;

                            switch ($parm) {

                            case strchr($parm, 'getInitialEndpointConfiguration')==TRUE:
                                            SendgetInitialEndpointConfiguration();
                                            break;
                            case strchr($parm, 'getHomeServer')==TRUE:
                                            SendgetHomeServer();
                                            break;                                                   
                            case strchr($parm, 'getHomeCapabilities')==TRUE:
                                            SendgetHomeCapabilities();
                                            break;   
                            case strchr($parm, 'getAllEndpointConfiguration')==TRUE:
                                            SendgetAllEndpointConfiguration();
                                            break;
                            case strchr($parm, 'getContactList')==TRUE:
                                            SendgetContactList();
                                            break;
                            case strchr($parm, '<ns1:addContact')==TRUE:
                                            Sendaddcontact();
                                            break;   
                            case strchr($parm, '<ns1:getCallHistory')==TRUE:
                                            sendgetCallHistory();
                                            break;
                            case strchr($parm, 'ns1:setDeviceData')==TRUE:
                                            sendsetDeviceData();
                                            break;
                            case strchr($parm, 'ns1:getDeviceData')==TRUE:
                                            sendgetDeviceData();
                                            break;
                            }

}

/*

echo “<?xml Version=\"1.0\" ?>”;

echo “soapenv:Envelope”;

echo "soapenv:Body;

echo “</soapenv:Body>”;
echo “</soapenv:Envelope>”;

*/
exit();

?>

you will need to make your your http server is configured to process php files with out an extension.

  1. Update you 46xxsettings.txt file with
    a. SET CONFIG_SERVER IPADDRESSOFWEBSERVER
    b. SET CONFIG_SERVER_SECURE_MODE 0
    c. SET ENABLE_AVAYA_ENVIRONMENT 0
    d. SET SIPDOMAIN IPADDRESSOFPBX
    e. SET GMTOFFSET GMToffset
  2. In the PPM file located and replace with you own dial plan
    echo " 5xx";
    echo " 6xxx";
    echo " 1xxxxxxxxxx";

Know that that the PPM server is configured we need to set up extension profiles.

For each extension create a folder under axis\services with the format of extenstion@pbxaddress
example
6100@192_168_1_94
Under each folder create the following files.

  1. ButtonAssignments
  2. Contacts
  3. Favorites
  4. History
  5. OneTouchDial

In the ButtonAssignments file place the following lines making sure your change 6300 to whatever the extension

1 call-appr 6300 1 false false

2 call-appr 6300 2 false false

3 call-appr 6300 3 false false

In the contacts file create a line in the following format for each contact you want to add

firstname,lastname,Phonenumber,false
ex.
Main,Floor,6100,false
Basement,6200,false
Garage,6300,false
Office,6400,false
Master,Bedroom,6500,false
Computer,Closet,6600,false

In the Favorites file create the following, create a line for each number you want to display as a onetouchdial on the phone.
systemnumber_13=autodial
systemnumber_14=autodial
systemnumber_15=autodial
systemnumber_16=autodial
systemnumber_17=autodial

In the OneTouchDial file create a line in the following format for each contact you want to add to the default screen as a one touch dial. Start the 1st number with 13 and then for each number you add incease that number by one

13, Phonenumber,TRUE,Name

Ex.
13,600,TRUE,House
14,601,TRUE,Basement
15,602,TRUE,Office
16,603,TRUE,Garage

Assuming I wrote everything down correctly you should now have contacts, history, onetouch dialing. At this point any changes on the phone will not be saved back to the PPM server, so all updates must be made in the config files.

1 Like

Hi Shawn, i’m trying to implement the PPM web service as per your comments above, any chance you have the PHP code posted elsewhere? Github? Or may I ask you if there is a WSDL of the PPM web service anywhere on the web? Cause it seems the forum has removed some or all of XML tags from your response and it’s hard to figure out the names of all the missing XML tags…
Thanks a lot.

Sorry about the forum post…
i will try and pm you a link in abit

Hi Shawn,

I’m also trying to get this going - I’m having an issue with the additions to chan_sip because of the breaks in the code in different sections of the post. Do you still happen to have a link to the config files as downloads? I’m very curious to try getting Asterisk working more fully with my couple of Avaya phones.

Thanks!

I will shoot you a link tomorrow

Hi, slockner.

You can publish the link to download the files, I have the same problem, in this publication the code is break, thank you very much.

I have 15 Avaya phones working fine with elastix, but the advanced features does not work.

1 Like

Is it possible you could post the code somewhere, I tried implementing it, but I am definitely missing something.

Thank you!

–John

1 Like

here is the full code for the ppm
https://www.slockner.com/RDWeb/Pages/ppm.txt

here is the version of chan_sip.c and sip.h that already has the updated code.

https://www.slockner.com/RDWeb/Pages/chan_sip.c
https://www.slockner.com/RDWeb/Pages/sip.h

1 Like

i have been working on some updates to enable a few more features but i have ran in to some issues tracing some of the Sip authentication with subscribe request. send calls buttons and forwarding.

in avaya once a Subscribe message is sent and authorized all other subscribe messages do not need to be re-authorized however in freepbx an authorized request is sent and the phones dont know how to handle that… at least my best guess.

unfortunately life and the wife have Pulled me away for a while

1 Like

Thanks for doing this, a lot of people over here appreciate your work!

Shawn, can you describe what the phone needs to see to start contacting the PPM server for more than just ‘getInitialEndpointConfiguration’? I’m trying to implement correct replies for my SIP proxy but I’m having trouble following your Asterisk patch to make sense of it all.

I see the phone sends SUBSCRIBE with Event: avaya-cm-feature-status but I don’t really know what to do from here. I can send 202 Accepted but then do I need to send NOTIFY? What headers/info do I need to send in NOTIFY? Do you happen to have traces you can upload of what the SIP dialogue should look like to enable each feature?

OK here is a trace of my phone logging in. After the notify there is some more subscribe attempts but those don’t havine anything to do with the ppm… and are part of my work in progress.

Client->Server
REGISTER sip:192.168.100.100 SIP/2.0
From: <sip:[email protected]>;tag=7b98b24f-7c663c374f566wr393w3968e4i654w_F6519
To: <sip:[email protected]>
Call-ID: 1_7b98b24f630caba130464630f101i2c132als_R6519
CSeq: 1 REGISTER
Max-Forwards: 70
Via: SIP/2.0/TCP 192.168.3.36:1026;branch=z9hG4bK1_7b98b24f5a225a615w5t5c2o4e1iw18526p44r_R6519
Supported: eventlist,feature-ref,replaces,sdp-anat,tdialog
Allow: INVITE,ACK,BYE,CANCEL,SUBSCRIBE,NOTIFY,MESSAGE,REFER,INFO,PUBLISH,UPDATE
User-Agent: Avaya one-X Deskphone 7.1.0.0.57 (3)
Contact: <sip:[email protected]:1026;transport=tcp;avaya-sc-enabled>;q=1;expires=900;avaya-actions="presence.initiate-pubsub,presence.redirect";+avaya.gmtoffset="-6:00";+avaya.js-ver="1.0";+avaya.model="9611";+avaya.sn="n/a";+avaya.firmware="S96x1_SALBR7_0_1_4r6_V4r83.tar";+sip.instance="<urn:uuid:00000000-0000-1000-8000-00155d01520e>";reg-id=1
Content-Length:     0
Server->Client
SIP/2.0 401 Unauthorized
Via: SIP/2.0/TCP 192.168.3.36:1026;branch=z9hG4bK1_7b98b24f5a225a615w5t5c2o4e1iw18526p44r_R6519;received=192.168.3.36
From: <sip:[email protected]>;tag=7b98b24f-7c663c374f566wr393w3968e4i654w_F6519
To: <sip:[email protected]>;tag=as00f4f2d6
Call-ID: 1_7b98b24f630caba130464630f101i2c132als_R6519
CSeq: 1 REGISTER
Server: FPBX-14.0.1.24(14.5.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="77593df5"
Content-Length: 0
Client->Server
REGISTER sip:192.168.100.100 SIP/2.0
From: <sip:[email protected]>;tag=7b98b24f-7c663c374f566wr393w3968e4i654w_F6519
To: <sip:[email protected]>
Call-ID: 1_7b98b24f630caba130464630f101i2c132als_R6519
CSeq: 2 REGISTER
Max-Forwards: 70
Via: SIP/2.0/TCP 192.168.3.36:1026;branch=z9hG4bK2_7b98b25f-200319d737232f2n5l3z24r3tw4nz_R6519
Supported: eventlist,feature-ref,replaces,sdp-anat,tdialog
Allow: INVITE,ACK,BYE,CANCEL,SUBSCRIBE,NOTIFY,MESSAGE,REFER,INFO,PUBLISH,UPDATE
User-Agent: Avaya one-X Deskphone 7.1.0.0.57 (3)
Contact: <sip:[email protected]:1026;transport=tcp;avaya-sc-enabled>;q=1;expires=900;avaya-actions="presence.initiate-pubsub,presence.redirect";+avaya.gmtoffset="-6:00";+avaya.js-ver="1.0";+avaya.model="9611";+avaya.sn="n/a";+avaya.firmware="S96x1_SALBR7_0_1_4r6_V4r83.tar";+sip.instance="<urn:uuid:00000000-0000-1000-8000-00155d01520e>";reg-id=1
Authorization: Digest realm="asterisk",nonce="77593df5",uri="sip:192.168.100.100",response="e8ab5a363a32fa6228f062b58f08b5c1",username="6519"
Content-Length:     0
Server->Client
OPTIONS sip:[email protected]:1026;transport=tcp;avaya-sc-enabled SIP/2.0
Via: SIP/2.0/TCP 192.168.100.100:5060;branch=z9hG4bK5c8f9a99
Max-Forwards: 70
From: "Unknown" <sip:[email protected]>;tag=as032a6494
To: <sip:[email protected]:1026;transport=tcp;avaya-sc-enabled>
Contact: <sip:[email protected]:5060;transport=tcp>
Call-ID: [email protected]:5060
CSeq: 102 OPTIONS
User-Agent: FPBX-14.0.1.24(14.5.0)
Date: Thu, 17 May 2018 17:42:57 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0
Client->Server
SIP/2.0 200 OK
From: "Unknown" <sip:[email protected]>;tag=as032a6494
To: <sip:[email protected]:1026;transport=tcp;avaya-sc-enabled>
Call-ID: [email protected]:5060
CSeq: 102 OPTIONS
Via: SIP/2.0/TCP 192.168.100.100:5060;branch=z9hG4bK5c8f9a99
Supported: 100rel,eventlist,feature-ref,replaces,sdp-anat,tdialog
Allow: INVITE,ACK,BYE,CANCEL,SUBSCRIBE,NOTIFY,MESSAGE,REFER,INFO,PRACK,PUBLISH,UPDATE
User-Agent: Avaya one-X Deskphone 7.1.0.0.57 (3)
Contact: <sip:[email protected]:1026;transport=tcp>;+avaya.gmtoffset="-6:00";+avaya.js-ver="1.0";+avaya.model="9611";+avaya.sn="n/a";+avaya.firmware="S96x1_SALBR7_0_1_4r6_V4r83.tar"
Accept: text/plain;q=-1
Accept-Encoding: identity
Accept-Language: en
Reason: sip;cause=1;text="Line Appearance In Use"
Content-Length:     0
Server->Client
SIP/2.0 200 OK
Via: SIP/2.0/TCP 192.168.3.36:1026;branch=z9hG4bK2_7b98b25f-200319d737232f2n5l3z24r3tw4nz_R6519;received=192.168.3.36
From: <sip:[email protected]>;tag=7b98b24f-7c663c374f566wr393w3968e4i654w_F6519
To: <sip:[email protected]>;tag=as00f4f2d6
Call-ID: 1_7b98b24f630caba130464630f101i2c132als_R6519
CSeq: 2 REGISTER
Server: FPBX-14.0.1.24(14.5.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Expires: 900
Contact: <sip:[email protected]:1026;transport=tcp;avaya-sc-enabled>;expires=900
Date: Thu, 17 May 2018 17:42:57 GMT
Content-Length: 0
Client->Server
SUBSCRIBE sip:[email protected] SIP/2.0
From: <sip:[email protected]>;tag=7b98b26e-db64d75v2b6t3r4k2k2y6t2h5rs6l_F6519
To: <sip:[email protected]>
Call-ID: 1_7b98b26e4ba27c9v5966k5a452e1v6mtnt_S6519
CSeq: 1 SUBSCRIBE
Max-Forwards: 70
Via: SIP/2.0/TCP 192.168.3.36:1026;branch=z9hG4bK1_7b98b26e-7e559daf12c1k1d2o1u17j4t4of1a_S6519
Supported: 100rel,eventlist,feature-ref,replaces,sdp-anat,tdialog
User-Agent: Avaya one-X Deskphone 7.1.0.0.57 (3)
Contact: <sip:[email protected]:1026;transport=tcp>;+sip.instance="<urn:uuid:00000000-0000-1000-8000-00155d01520e>"
Accept-Encoding: gzip
Event: avaya-cm-feature-status
Expires: 86400
Accept: application/avaya-cm-feature-status+xml, multipart/mixed
Content-Length:     0
Server->Client
SIP/2.0 401 Unauthorized
Via: SIP/2.0/TCP 192.168.3.36:1026;branch=z9hG4bK1_7b98b26e-7e559daf12c1k1d2o1u17j4t4of1a_S6519;received=192.168.3.36
From: <sip:[email protected]>;tag=7b98b26e-db64d75v2b6t3r4k2k2y6t2h5rs6l_F6519
To: <sip:[email protected]>;tag=as04cd2f7e
Call-ID: 1_7b98b26e4ba27c9v5966k5a452e1v6mtnt_S6519
CSeq: 1 SUBSCRIBE
Server: FPBX-14.0.1.24(14.5.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="2b84df02"
Content-Length: 0
Client->Server
SUBSCRIBE sip:[email protected] SIP/2.0
From: <sip:[email protected]>;tag=7b98b26e-db64d75v2b6t3r4k2k2y6t2h5rs6l_F6519
To: <sip:[email protected]>
Call-ID: 1_7b98b26e4ba27c9v5966k5a452e1v6mtnt_S6519
CSeq: 2 SUBSCRIBE
Max-Forwards: 70
Via: SIP/2.0/TCP 192.168.3.36:1026;branch=z9hG4bK2_7b98b26e7405e949332b14706a1n1lq2g2r4jj_S6519
Supported: 100rel,eventlist,feature-ref,replaces,sdp-anat,tdialog
User-Agent: Avaya one-X Deskphone 7.1.0.0.57 (3)
Contact: <sip:[email protected]:1026;transport=tcp>;+sip.instance="<urn:uuid:00000000-0000-1000-8000-00155d01520e>"
Accept-Encoding: gzip
Authorization: Digest realm="asterisk",nonce="2b84df02",uri="sip:[email protected]",response="9fb163325319fc757b582c9682244cf4",username="6519"
Event: avaya-cm-feature-status
Expires: 86400
Accept: application/avaya-cm-feature-status+xml, multipart/mixed
Content-Length:     0
Server->Client
SIP/2.0 200 OK
Via: SIP/2.0/TCP 192.168.3.36:1026;branch=z9hG4bK2_7b98b26e7405e949332b14706a1n1lq2g2r4jj_S6519;received=192.168.3.36
From: <sip:[email protected]>;tag=7b98b26e-db64d75v2b6t3r4k2k2y6t2h5rs6l_F6519
To: <sip:[email protected]>;tag=as04cd2f7e
Call-ID: 1_7b98b26e4ba27c9v5966k5a452e1v6mtnt_S6519
CSeq: 2 SUBSCRIBE
Server: FPBX-14.0.1.24(14.5.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Expires: 3600
Contact: <sip:[email protected]:5060;transport=tcp>;expires=3600
Content-Length: 0
Server->Client
NOTIFY sip:[email protected]:1026;transport=tcp SIP/2.0
Via: SIP/2.0/TCP 192.168.100.100:5060;branch=z9hG4bK086c51ea
Max-Forwards: 70
From: <sip:[email protected]>;tag=as04cd2f7e
To: <sip:[email protected]>;tag=7b98b26e-db64d75v2b6t3r4k2k2y6t2h5rs6l_F6519
Contact: <sip:192.168.100.100:5060;transport=tcp>;+g.avaya.aura.subs-reuse="avaya-cm-feature-status,dialog,message-summary,reg,avaya-ccs-profile,avaya-cm-cc-info"
Call-ID: 1_7b98b26e4ba27c9v5966k5a452e1v6mtnt_S6519
CSeq: 102 NOTIFY
User-Agent: FPBX-14.0.1.24(14.5.0)
Subscription-State: active
Event: avaya-cm-feature-status
Content-Type: application/avaya-cm-feature-status+xml
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Content-Length: 1502

<?xml version="1.0"?>
<feature-status entity="sip:[email protected]" version="0" state="full" avext="6519">
<feature name="call-forwarding-all" status="on"><param pname="avaya-cm-destination" pval="+40205" avext="40205"></param>
<feature name="call-forwarding-busy-no-answer" status="off"></feature>
<feature name="associated-eas-agent" status="off"></feature>
<feature name="service-observing" status="off"></feature>
<feature name="sac" status="off"></feature>
<feature name="off-pbx" status="on"></feature>
<feature name="call-park" status="off"></feature>
<feature name="enhanced-call-forwarding" status="off">
<param pname="target" pval="+6519"></param>
<param pname="avaya-cm-cfall-internal-dest" pval=""></param>
<param pname="avaya-cm-cfall-internal-action" pval="off"></param>
<param pname="avaya-cm-cfall-external-dest" pval=""></param>
<param pname="avaya-cm-cfall-external-action" pval="off"></param>
<param pname="avaya-cm-cfbusy-internal-dest" pval=""></param>
<param pname="avaya-cm-cfbusy-internal-action" pval="off"></param>
<param pname="avaya-cm-cfbusy-external-dest" pval=""></param>
<param pname="avaya-cm-cfbusy-external-action" pval="off"></param>
<param pname="avaya-cm-cfnr-internal-dest" pval=""></param>
<param pname="avaya-cm-cfnr-internal-action" pval="off"></param>
<param pname="avaya-cm-cfnr-external-dest" pval=""></param>
<param pname="avaya-cm-cfnr-external-action" pval="off"></param>
</feature>
<feature name="limit-call" status="off"></feature>
</feature-status>

Thanks, that was helpful in getting to the next steps. Do you see erratic behavior when it comes to the phones calling the SOAP actions? I’m testing with both the 96x1 emulator and a 9611G phone and I see ‘getInitialEndpointConfiguration’ called consistently every single time on bootup. But, sometimes the phone never calls ‘getHomeServer’ or it calls it some arbitrary amount of time later.

I haven’t implemented all of the SOAP responses on my http server but I’ve never gotten my 9611G to request ‘getHomeServerCapabilities’ and I’ve only gotten it to request ‘getHomeServer’ once. With the emulator, I have gotten it to request all the SOAP actions I’ve implemented so far but again, it’s seemingly random when the phone decides to do it.

My 46xxsettings.txt looks like this:

SET SIP_CONTROLLER_LIST 192.168.1.20:5060;transport=tcp
SET CONFIG_SERVER 192.168.1.20
SET CONFIG_SERVER_SECURE_MODE 0
SET ENABLE_AVAYA_ENVIRONMENT 0
SET DISCOVER_AVAYA_ENVIRONMENT 1

And my SIP proxy (Kamailio) is configured to send “200 OK” to all subscribe messages and send NOTIFY for event avaya-cm-feature-status exactly like your trace does 1 second after the SUBSCRIBE message is received. I’ve traced the SIP and HTTP exchanges and everything appears to be in order.

Any idea what’s going on here?

I am glad someone else is make some progress.

what version of the emulator are you using?

I did some tracing this morning and I get one getHomeServerCapabilitie at login but never seen a getHomeServer… I actually think I read some place that one of them has been depreciated.

let me know if you need any more traces. I have a few tricks to get access to an actual Avaya SIP phone to do some traces.

it would be nice to trick freepbx in to sening 200 and notify to all sub…

I believe I solved my problem. Kamailio doesn’t append a contact header on replies by default. When I was answering SUBSCRIBE with 200 OK, the phone wasn’t happy about the contact header missing. Now, both my phone and emulator hit all the SOAP actions immediately. Now I just need to finish implementing responses.

My overall goal is to allow Avaya 96x1 phones to have several additional features when working with a 3CX PBX. I’m using Kamailio as an in between to generate the NOTIFY messages. I also intend to use it to append the P-Asserted-Identity header that these phones seem to need to display the caller name. Have you found that to be true also?