X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=lcr.git;a=blobdiff_plain;f=ie.cpp;h=7509440c1fb57fc684440202d8fd013ca1541c97;hp=933287e6559a2c85096269aa0336d5f536f48b63;hb=refs%2Fheads%2Fbackup2;hpb=e9bfe48fc5254e79e59c6ffc1698912175edf4e3 diff --git a/ie.cpp b/ie.cpp index 933287e..7509440 100644 --- a/ie.cpp +++ b/ie.cpp @@ -616,7 +616,7 @@ void Pdss1::enc_ie_cause(struct l3_msg *l3m, int location, int cause) unsigned char p[256]; int l; - if (location<0 || location>7) { + if (location<0 || location>10) { PERROR("location(%d) is out of range.\n", location); return; } @@ -711,13 +711,15 @@ void Pdss1::enc_ie_channel_id(struct l3_msg *l3m, int exclusive, int channel) add_layer3_ie(l3m, p[0], p[1], p+2); } else { /* PRI */ - if (channel == CHANNEL_NO) /* no channel */ - return; /* IE not present */ - if (channel == CHANNEL_ANY) /* any channel */ { + if (channel == CHANNEL_NO || channel == CHANNEL_ANY) { + if (channel == CHANNEL_NO) + channel = 0; + else + channel = 3; l = 1; p[0] = IE_CHANNEL_ID; p[1] = l; - p[2] = 0x80 + 0x20 + 0x03; + p[2] = 0x80 + 0x20 + channel; add_layer3_ie(l3m, p[0], p[1], p+2); return; /* end */ } @@ -1096,7 +1098,7 @@ void Pdss1::dec_ie_redir_nr(struct l3_msg *l3m, int *type, int *plan, int *prese *reason = -1; *number = '\0'; - unsigned char *p = l3m->redirect_nr; + unsigned char *p = l3m->redirecting_nr; if (!p) return; if (p[0] < 1) { @@ -1179,7 +1181,7 @@ void Pdss1::dec_ie_redir_dn(struct l3_msg *l3m, int *type, int *plan, int *prese *present = -1; *number = '\0'; - unsigned char *p = l3m->redirect_dn; + unsigned char *p = l3m->redirection_nr; if (!p) return; if (p[0] < 1) {